Compare commits
2 Commits
e4b0ed3d74
...
038f205413
| Author | SHA1 | Date | |
|---|---|---|---|
| 038f205413 | |||
| 8f8b0a03e4 |
@@ -1,6 +1,7 @@
|
||||
<script setup>
|
||||
import { ref, computed, watch } from 'vue'
|
||||
import { toast } from 'vue-sonner'
|
||||
import dayjs from 'dayjs'
|
||||
import { Icon } from '@iconify/vue'
|
||||
import { UserPromptApi } from '@/api/userPrompt'
|
||||
|
||||
@@ -62,7 +63,7 @@ async function loadList() {
|
||||
name: item.name,
|
||||
content: item.content,
|
||||
category: item.category,
|
||||
useCount: item.useCount || 0
|
||||
createTime: item.createTime
|
||||
}))
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -172,7 +173,7 @@ function handleUse(item) {
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<span class="text-xs text-muted-foreground">使用 {{ item.useCount || 0 }} 次</span>
|
||||
<span class="text-xs text-muted-foreground" v-if="item.createTime">{{ dayjs(item.createTime).format('YYYY-MM-DD HH:mm') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -243,7 +244,7 @@ function handleUse(item) {
|
||||
|
||||
.card-footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-top: 8px;
|
||||
padding-top: 8px;
|
||||
|
||||
@@ -35,6 +35,8 @@ public class AiAgentServiceImpl implements AiAgentService {
|
||||
public Long createAiAgent(AiAgentSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
AiAgentDO aiAgent = BeanUtils.toBean(createReqVO, AiAgentDO.class);
|
||||
aiAgent.setOperatorId(SecurityFrameworkUtils.getLoginUserId());
|
||||
aiAgent.setOperatorName(String.valueOf(SecurityFrameworkUtils.getLoginUserNickname()));
|
||||
aiAgentMapper.insert(aiAgent);
|
||||
|
||||
// 返回
|
||||
@@ -47,6 +49,8 @@ public class AiAgentServiceImpl implements AiAgentService {
|
||||
validateAiAgentExists(updateReqVO.getId());
|
||||
// 更新
|
||||
AiAgentDO updateObj = BeanUtils.toBean(updateReqVO, AiAgentDO.class);
|
||||
updateObj.setOperatorId(SecurityFrameworkUtils.getLoginUserId());
|
||||
updateObj.setOperatorName(String.valueOf(SecurityFrameworkUtils.getLoginUserNickname()));
|
||||
aiAgentMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,20 +19,17 @@ public class AiAgentSaveReqVO {
|
||||
@NotEmpty(message = "智能体名称不能为空")
|
||||
private String agentName;
|
||||
|
||||
@Schema(description = "图标URL", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "图标URL不能为空")
|
||||
@Schema(description = "图标URL", example = "https://example.com/icon.png")
|
||||
private String icon;
|
||||
|
||||
@Schema(description = "状态(0-禁用 1-启用)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "状态(0-禁用 1-启用)不能为空")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "设定描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对")
|
||||
@NotEmpty(message = "设定描述不能为空")
|
||||
@Schema(description = "设定描述", example = "你说的对")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "预置提示词", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "预置提示词不能为空")
|
||||
@Schema(description = "预置提示词")
|
||||
private String systemPrompt;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
@@ -41,12 +38,10 @@ public class AiAgentSaveReqVO {
|
||||
@Schema(description = "分类名称(中文)", example = "文案创作")
|
||||
private String categoryName;
|
||||
|
||||
@Schema(description = "操作人用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "6593")
|
||||
@NotNull(message = "操作人用户编号不能为空")
|
||||
@Schema(description = "操作人用户编号", example = "6593")
|
||||
private Long operatorId;
|
||||
|
||||
@Schema(description = "操作人账号", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||
@NotEmpty(message = "操作人账号不能为空")
|
||||
@Schema(description = "操作人账号", example = "赵六")
|
||||
private String operatorName;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user