mirror of
https://gitcode.com/ageerle/ruoyi-ai.git
synced 2026-03-22 00:53:44 +08:00
Merge pull request #118 from MuSan-Li/feature_20250610_add_prompt_template
Feature 20250610 add prompt template
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
package org.ruoyi.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.ruoyi.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 提示词模板对象 prompt_template
|
||||
*
|
||||
* @author evo
|
||||
* @date 2025-06-12
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("prompt_template")
|
||||
public class PromptTemplate extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 提示词模板名称
|
||||
*/
|
||||
private String templateName;
|
||||
|
||||
/**
|
||||
* 提示词模板内容
|
||||
*/
|
||||
private String templateContent;
|
||||
|
||||
/**
|
||||
* 提示词分类,knowledge 知识库类型,chat 对话类型,draw绘画类型 ...
|
||||
*/
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package org.ruoyi.domain.bo;
|
||||
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.ruoyi.common.core.validate.AddGroup;
|
||||
import org.ruoyi.common.core.validate.EditGroup;
|
||||
import org.ruoyi.core.domain.BaseEntity;
|
||||
import org.ruoyi.domain.PromptTemplate;
|
||||
|
||||
/**
|
||||
* 提示词模板业务对象 prompt_template
|
||||
*
|
||||
* @author evo
|
||||
* @date 2025-06-12
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = PromptTemplate.class, reverseConvertGenerate = false)
|
||||
public class PromptTemplateBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "主键不能为空", groups = {EditGroup.class})
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 提示词模板名称
|
||||
*/
|
||||
@NotBlank(message = "提示词模板名称不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String templateName;
|
||||
|
||||
/**
|
||||
* 提示词模板内容
|
||||
*/
|
||||
@NotBlank(message = "提示词模板内容不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String templateContent;
|
||||
|
||||
/**
|
||||
* 提示词分类,knowledge 知识库类型,chat 对话类型,draw绘画类型 ...
|
||||
*/
|
||||
@NotBlank(message = "提示词分类", groups = {AddGroup.class, EditGroup.class})
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@NotBlank(message = "备注不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package org.ruoyi.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.ruoyi.domain.PromptTemplate;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* 提示词模板视图对象 prompt_template
|
||||
*
|
||||
* @author evo
|
||||
* @date 2025-06-12
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = PromptTemplate.class)
|
||||
public class PromptTemplateVo implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ExcelProperty(value = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 提示词模板名称
|
||||
*/
|
||||
@ExcelProperty(value = "提示词模板名称")
|
||||
private String templateName;
|
||||
|
||||
/**
|
||||
* 提示词模板内容
|
||||
*/
|
||||
@ExcelProperty(value = "提示词模板内容")
|
||||
private String templateContent;
|
||||
|
||||
/**
|
||||
* 提示词分类,knowledge 知识库类型,chat 对话类型,draw绘画类型 ...
|
||||
*/
|
||||
@ExcelProperty(value = "提示词分类")
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.ruoyi.mapper;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.ruoyi.core.mapper.BaseMapperPlus;
|
||||
import org.ruoyi.domain.PromptTemplate;
|
||||
import org.ruoyi.domain.vo.PromptTemplateVo;
|
||||
|
||||
/**
|
||||
* 提示词模板Mapper接口
|
||||
*
|
||||
* @author evo
|
||||
* @date 2025-06-12
|
||||
*/
|
||||
public interface PromptTemplateMapper extends BaseMapperPlus<PromptTemplate, PromptTemplateVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package org.ruoyi.service;
|
||||
|
||||
|
||||
import org.ruoyi.core.page.PageQuery;
|
||||
import org.ruoyi.core.page.TableDataInfo;
|
||||
import org.ruoyi.domain.bo.PromptTemplateBo;
|
||||
import org.ruoyi.domain.vo.PromptTemplateVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 提示词模板Service接口
|
||||
*
|
||||
* @author evo
|
||||
* @date 2025-06-12
|
||||
*/
|
||||
public interface IPromptTemplateService {
|
||||
|
||||
/**
|
||||
* 查询提示词模板
|
||||
*/
|
||||
PromptTemplateVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询提示词模板列表
|
||||
*/
|
||||
TableDataInfo<PromptTemplateVo> queryPageList(PromptTemplateBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询提示词模板列表
|
||||
*/
|
||||
List<PromptTemplateVo> queryList(PromptTemplateBo bo);
|
||||
|
||||
/**
|
||||
* 新增提示词模板
|
||||
*/
|
||||
Boolean insertByBo(PromptTemplateBo bo);
|
||||
|
||||
/**
|
||||
* 修改提示词模板
|
||||
*/
|
||||
Boolean updateByBo(PromptTemplateBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除提示词模板信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package org.ruoyi.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.ruoyi.common.core.utils.MapstructUtils;
|
||||
import org.ruoyi.common.core.utils.StringUtils;
|
||||
import org.ruoyi.core.page.PageQuery;
|
||||
import org.ruoyi.core.page.TableDataInfo;
|
||||
import org.ruoyi.domain.PromptTemplate;
|
||||
import org.ruoyi.domain.bo.PromptTemplateBo;
|
||||
import org.ruoyi.domain.vo.PromptTemplateVo;
|
||||
import org.ruoyi.mapper.PromptTemplateMapper;
|
||||
import org.ruoyi.service.IPromptTemplateService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 提示词模板Service业务层处理
|
||||
*
|
||||
* @author evo
|
||||
* @date 2025-06-12
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class PromptTemplateServiceImpl implements IPromptTemplateService {
|
||||
|
||||
private final PromptTemplateMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询提示词模板
|
||||
*/
|
||||
@Override
|
||||
public PromptTemplateVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询提示词模板列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<PromptTemplateVo> queryPageList(PromptTemplateBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<PromptTemplate> lqw = buildQueryWrapper(bo);
|
||||
Page<PromptTemplateVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询提示词模板列表
|
||||
*/
|
||||
@Override
|
||||
public List<PromptTemplateVo> queryList(PromptTemplateBo bo) {
|
||||
LambdaQueryWrapper<PromptTemplate> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<PromptTemplate> buildQueryWrapper(PromptTemplateBo bo) {
|
||||
LambdaQueryWrapper<PromptTemplate> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getTemplateName()),
|
||||
PromptTemplate::getTemplateName, bo.getTemplateName());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getTemplateContent()),
|
||||
PromptTemplate::getTemplateContent, bo.getTemplateContent());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCategory()),
|
||||
PromptTemplate::getCategory, bo.getCategory());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增提示词模板
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(PromptTemplateBo bo) {
|
||||
PromptTemplate add = MapstructUtils.convert(bo, PromptTemplate.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改提示词模板
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(PromptTemplateBo bo) {
|
||||
PromptTemplate update = MapstructUtils.convert(bo, PromptTemplate.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(PromptTemplate entity) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除提示词模板
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.ruoyi.mapper.PromptTemplateMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,111 @@
|
||||
package org.ruoyi.chat.controller.chat;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.ruoyi.common.core.domain.R;
|
||||
import org.ruoyi.common.core.validate.AddGroup;
|
||||
import org.ruoyi.common.core.validate.EditGroup;
|
||||
import org.ruoyi.common.excel.utils.ExcelUtil;
|
||||
import org.ruoyi.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.ruoyi.common.log.annotation.Log;
|
||||
import org.ruoyi.common.log.enums.BusinessType;
|
||||
import org.ruoyi.common.web.core.BaseController;
|
||||
import org.ruoyi.core.page.PageQuery;
|
||||
import org.ruoyi.core.page.TableDataInfo;
|
||||
import org.ruoyi.domain.bo.PromptTemplateBo;
|
||||
import org.ruoyi.domain.vo.PromptTemplateVo;
|
||||
import org.ruoyi.service.IPromptTemplateService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 提示词模板
|
||||
*
|
||||
* @author evo
|
||||
* @date 2025-06-12
|
||||
*/
|
||||
@Validated
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/system/promptTemplate")
|
||||
public class PromptTemplateController extends BaseController {
|
||||
|
||||
private final IPromptTemplateService promptTemplateService;
|
||||
|
||||
/**
|
||||
* 查询提示词模板列表
|
||||
*/
|
||||
@SaCheckPermission("system:promptTemplate:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<PromptTemplateVo> list(PromptTemplateBo bo, PageQuery pageQuery) {
|
||||
return promptTemplateService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出提示词模板列表
|
||||
*/
|
||||
@SaCheckPermission("system:promptTemplate:export")
|
||||
@Log(title = "提示词模板", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(PromptTemplateBo bo, HttpServletResponse response) {
|
||||
List<PromptTemplateVo> list = promptTemplateService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "提示词模板", PromptTemplateVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取提示词模板详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("system:promptTemplate:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<PromptTemplateVo> getInfo(@NotNull(message = "主键不能为空") @PathVariable Long id) {
|
||||
return R.ok(promptTemplateService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增提示词模板
|
||||
*/
|
||||
@SaCheckPermission("system:promptTemplate:add")
|
||||
@Log(title = "提示词模板", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody PromptTemplateBo bo) {
|
||||
return toAjax(promptTemplateService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改提示词模板
|
||||
*/
|
||||
@SaCheckPermission("system:promptTemplate:edit")
|
||||
@Log(title = "提示词模板", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody PromptTemplateBo bo) {
|
||||
return toAjax(promptTemplateService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除提示词模板
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("system:promptTemplate:remove")
|
||||
@Log(title = "提示词模板", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空") @PathVariable Long[] ids) {
|
||||
return toAjax(promptTemplateService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
@@ -492,6 +492,7 @@ INSERT INTO `sys_dict_data` VALUES (1776109770934677506, '000000', 0, 'token计
|
||||
INSERT INTO `sys_dict_data` VALUES (1776109853377916929, '000000', 0, '次数计费', '2', 'sys_model_billing', '', 'success', 'N', '0', 103, 1, '2024-04-05 12:49:22', 1, '2024-04-05 12:49:22', '');
|
||||
INSERT INTO `sys_dict_data` VALUES (1780264338471858177, '000000', 0, '未支付', '1', 'pay_state', '', 'info', 'N', '0', 103, 1, '2024-04-16 23:57:49', 1, '2024-04-16 23:58:29', '');
|
||||
INSERT INTO `sys_dict_data` VALUES (1780264431589601282, '000000', 2, '已支付', '2', 'pay_state', '', 'success', 'N', '0', 103, 1, '2024-04-16 23:58:11', 1, '2024-04-16 23:58:21', '');
|
||||
INSERT INTO `sys_dict_data` VALUES (1933094189606670338, '000000', 0, '知识库', 'vector', 'prompt_template_type', null, '', 'N', '0', 103, 1, '2025-06-12 17:29:05', 1, '2025-06-12 17:29:05', null);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for sys_dict_type
|
||||
@@ -536,6 +537,8 @@ INSERT INTO `sys_dict_type` VALUES (1775756736895438849, '000000', '用户等级
|
||||
INSERT INTO `sys_dict_type` VALUES (1776109665045278721, '000000', '模型计费方式', 'sys_model_billing', '0', 103, 1, '2024-04-05 12:48:37', 1, '2024-04-08 11:22:18', '模型计费方式');
|
||||
INSERT INTO `sys_dict_type` VALUES (1780263881368219649, '000000', '支付状态', 'pay_state', '0', 103, 1, '2024-04-16 23:56:00', 1, '2025-03-29 15:21:57', '支付状态');
|
||||
INSERT INTO `sys_dict_type` VALUES (1904565568803217409, '000000', '状态类型', 'status_type', '0', 103, 1, '2025-03-26 00:06:31', 1, '2025-03-26 00:06:31', NULL);
|
||||
INSERT INTO `sys_dict_type` VALUES (1933093946274123777, '000000', '提示词模板分类', 'prompt_template_type', '0', 103, 1, '2025-06-12 17:28:07', 1, '2025-06-12 17:28:07', null);
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for sys_file_info
|
||||
@@ -713,6 +716,12 @@ INSERT INTO `sys_menu` VALUES (1906674838461321219, '配置信息新增', 190667
|
||||
INSERT INTO `sys_menu` VALUES (1906674838461321220, '配置信息修改', 1906674838461321217, 3, '#', '', NULL, 1, 0, 'F', '0', '0', 'system:config:edit', '#', 103, 1, '2025-03-31 19:48:48', NULL, NULL, '');
|
||||
INSERT INTO `sys_menu` VALUES (1906674838461321221, '配置信息删除', 1906674838461321217, 4, '#', '', NULL, 1, 0, 'F', '0', '0', 'system:config:remove', '#', 103, 1, '2025-03-31 19:48:48', NULL, NULL, '');
|
||||
INSERT INTO `sys_menu` VALUES (1906674838461321222, '配置信息导出', 1906674838461321217, 5, '#', '', NULL, 1, 0, 'F', '0', '0', 'system:config:export', '#', 103, 1, '2025-03-31 19:48:48', NULL, NULL, '');
|
||||
INSERT INTO `sys_menu` VALUES (1929170702299045890, '提示词模板', 1775500307898949634, '1', 'promptTemplate', 'system/promptTemplate/index', '', 1, 0, 'C', '0', '0', 'system:promptTemplate:list', 'fluent:prompt-16-filled', 103, 1, sysdate(), null, null, '提示词模板菜单');
|
||||
INSERT INTO `sys_menu` VALUES (1929170702299045891, '提示词模板查询', 1929170702299045890, '1', '#', '', NULL, 1, 0, 'F', '0', '0', 'system:promptTemplate:query', '#', 103, 1, sysdate(), null, null, '');
|
||||
INSERT INTO `sys_menu` VALUES (1929170702299045892, '提示词模板新增', 1929170702299045890, '2', '#', '', NULL, 1, 0, 'F', '0', '0', 'system:promptTemplate:add', '#', 103, 1, sysdate(), null, null, '');
|
||||
INSERT INTO `sys_menu` VALUES (1929170702299045893, '提示词模板修改', 1929170702299045890, '3', '#', '', NULL, 1, 0, 'F', '0', '0', 'system:promptTemplate:edit', '#', 103, 1, sysdate(), null, null, '');
|
||||
INSERT INTO `sys_menu` VALUES (1929170702299045894, '提示词模板删除', 1929170702299045890, '4', '#', '', NULL, 1, 0, 'F', '0', '0', 'system:promptTemplate:remove', '#', 103, 1, sysdate(), null, null, '');
|
||||
INSERT INTO `sys_menu` VALUES (1929170702299045895, '提示词模板导出', 1929170702299045890, '5', '#', '', NULL, 1, 0, 'F', '0', '0', 'system:promptTemplate:export', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for sys_notice
|
||||
@@ -2510,4 +2519,24 @@ INSERT INTO `sys_user_role` VALUES (1871910972567822337, 1);
|
||||
INSERT INTO `sys_user_role` VALUES (1897620177094057985, 1);
|
||||
INSERT INTO `sys_user_role` VALUES (1925795787894333441, 1729685491108446210);
|
||||
|
||||
# 提示词模板表
|
||||
DROP TABLE IF EXISTS `prompt_template`;
|
||||
CREATE TABLE prompt_template
|
||||
(
|
||||
id bigint auto_increment comment '主键'
|
||||
primary key,
|
||||
template_name varchar(128) null comment '提示词模板名称',
|
||||
template_content text null comment '提示词模板内容',
|
||||
category varchar(16) NULL COMMENT '提示词分类,knowledge 知识库类型,chat 对话类型,draw绘画类型 ...',
|
||||
create_dept bigint null comment '创建部门',
|
||||
create_by bigint null comment '创建者',
|
||||
create_time datetime null comment '创建时间',
|
||||
update_by bigint null comment '更新者',
|
||||
update_time datetime null comment '更新时间',
|
||||
remark varchar(256) null comment '备注'
|
||||
) ENGINE = InnoDB
|
||||
CHARACTER SET = utf8mb4
|
||||
COLLATE = utf8mb4_general_ci COMMENT = '提示词模板表'
|
||||
ROW_FORMAT = Dynamic;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
||||
Reference in New Issue
Block a user