2024-03-06 20:56:22 +08:00
|
|
|
package com.ai.da.service;
|
|
|
|
|
|
2024-03-15 15:38:56 +08:00
|
|
|
|
2024-03-26 14:58:43 +08:00
|
|
|
import com.ai.da.common.enums.CreditsEventsEnum;
|
2024-03-15 15:38:56 +08:00
|
|
|
import com.ai.da.common.response.PageBaseResponse;
|
|
|
|
|
import com.ai.da.mapper.primary.entity.CreditsDetail;
|
|
|
|
|
import com.ai.da.model.dto.QueryIncomeOrExpenditureDTO;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.IService;
|
|
|
|
|
|
|
|
|
|
public interface CreditsService extends IService<CreditsDetail> {
|
2024-03-06 20:56:22 +08:00
|
|
|
|
|
|
|
|
void initCredits();
|
|
|
|
|
|
|
|
|
|
Boolean buyCredits(Long accountId, Integer quantity);
|
|
|
|
|
|
|
|
|
|
void creditsIncrease(Long accountId, String event);
|
|
|
|
|
|
|
|
|
|
void creditsDecrease(Long accountId, String event);
|
|
|
|
|
|
2024-03-26 14:58:43 +08:00
|
|
|
String getCredits(Long accountId);
|
2024-03-06 20:56:22 +08:00
|
|
|
|
|
|
|
|
void creditsRefund(Long accountId, Integer quantity);
|
2024-03-15 15:38:56 +08:00
|
|
|
|
|
|
|
|
void insertToCreditsDetail(Long accountId, String changeEvent, String credits, String changeType);
|
|
|
|
|
|
|
|
|
|
PageBaseResponse<CreditsDetail> queryCreditsDetailsPage(QueryIncomeOrExpenditureDTO queryPageByTimeDTO);
|
2024-03-26 14:58:43 +08:00
|
|
|
|
|
|
|
|
Boolean checkCredits(Long accountId, CreditsEventsEnum event, Integer num);
|
2024-03-28 14:43:36 +08:00
|
|
|
|
|
|
|
|
Boolean creditsPreDeduction(CreditsEventsEnum event, Integer num);
|
|
|
|
|
|
|
|
|
|
void taskCreditsDeduction(Long accountId, String taskId);
|
2024-03-06 20:56:22 +08:00
|
|
|
}
|