用户发送消息 → 预检查余额 → 保存用户消息 → 发布计费事件 → 异步扣费 → 保存账单记录

添加了billingType计费类型字段消息保存的时候写入进去
This commit is contained in:
Administrator
2025-08-27 15:30:59 +08:00
parent 1c721981db
commit 9f7f00e50c
6 changed files with 83 additions and 25 deletions

View File

@@ -69,5 +69,10 @@ public class ChatMessage extends BaseEntity {
*/
private String remark;
/**
* 计费类型1-token计费2-次数计费null-普通消息)
*/
private String billingType;
}

View File

@@ -75,5 +75,10 @@ public class ChatMessageBo extends BaseEntity {
@NotBlank(message = "备注不能为空", groups = { AddGroup.class, EditGroup.class })
private String remark;
/**
* 计费类型1-token计费2-次数计费null-普通消息)
*/
private String billingType;
}

View File

@@ -4,6 +4,8 @@ import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import org.ruoyi.common.excel.annotation.ExcelDictFormat;
import org.ruoyi.common.excel.convert.ExcelDictConvert;
import org.ruoyi.domain.ChatMessage;
import java.io.Serial;
@@ -73,6 +75,13 @@ public class ChatMessageVo implements Serializable {
@ExcelProperty(value = "模型名称")
private String modelName;
/**
* 计费类型1-token计费2-次数计费)
*/
@ExcelProperty(value = "计费类型", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "sys_model_billing")
private String billingType;
/**
* 备注
*/
@@ -87,4 +96,5 @@ public class ChatMessageVo implements Serializable {
private Date createTime;
}