44 lines
1.6 KiB
Java
44 lines
1.6 KiB
Java
package com.ai.da.service;
|
|
|
|
|
|
import com.ai.da.common.enums.CreditsEventsEnum;
|
|
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> {
|
|
|
|
Boolean buyCredits(Long accountId, Float quantity);
|
|
|
|
void creditsIncrease(Long accountId, String event);
|
|
|
|
void creditsDecrease(Long accountId, String event);
|
|
|
|
String getCredits(Long accountId);
|
|
|
|
void creditsRefund(Long accountId, Integer quantity, String orderNo);
|
|
|
|
void insertToCreditsDetail(Long accountId, String changeEvent, String credits, String changeType, String orderNo);
|
|
|
|
PageBaseResponse<CreditsDetail> queryCreditsDetailsPage(QueryIncomeOrExpenditureDTO queryPageByTimeDTO);
|
|
|
|
Boolean checkCredits(Long accountId, CreditsEventsEnum event, Integer num);
|
|
|
|
Boolean creditsPreDeduction(CreditsEventsEnum event, Integer num);
|
|
|
|
Boolean creditsPreDeduction(Integer credits);
|
|
|
|
void addRecordToCreditsDeduction(Long accountId, String taskId, CreditsEventsEnum creditsEventsEnum);
|
|
|
|
Boolean taskCreditsDeduction(Long accountId, String taskId);
|
|
|
|
CreditsDetail getByAccountIdAndChangeEvent(Long accountId, String changeEvent, String changedCredits);
|
|
|
|
void preInsert(Long accountId, String changeEventName, String taskId, Boolean isPreInsert, String changedCredits);
|
|
|
|
void updateChangedCredits(String accountId, String taskId);
|
|
|
|
CreditsDetail queryDetailByTaskId(String taskId);
|
|
}
|