mirror of
https://gitcode.com/ageerle/ruoyi-ai.git
synced 2026-04-08 01:07:31 +00:00
用户发送消息 → 预检查余额 → 保存用户消息 → 发布计费事件 → 异步扣费 → 保存账单记录
添加了billingType计费类型字段消息保存的时候写入进去
This commit is contained in:
@@ -69,5 +69,10 @@ public class ChatMessage extends BaseEntity {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 计费类型(1-token计费,2-次数计费,null-普通消息)
|
||||
*/
|
||||
private String billingType;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user