Merge remote-tracking branch 'origin/main'

# Conflicts:
#	bonus-modules/bonus-ai/src/main/java/com/bonus/ai/domain/dataset/AnnotationTaskEntity.java
This commit is contained in:
weiweiw 2024-12-12 18:09:25 +08:00
commit b24b53ec3e
24 changed files with 1106 additions and 14 deletions

View File

@ -0,0 +1,83 @@
package com.bonus.ai.controller;
import com.bonus.ai.domain.MirrorManagerEntity;
import com.bonus.ai.service.MirrorManagerService;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.core.web.page.TableDataInfo;
import com.bonus.common.log.annotation.SysLog;
import com.bonus.common.log.enums.OperaType;
import com.bonus.common.security.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
* 镜像管理Controller
*
* @author bonus
* @date 2024-12-11
*/
@RestController
@RequestMapping("/mirror")
public class MirrorManagerController extends BaseController {
@Resource
private MirrorManagerService aiMirrorManagerService;
/**
* 查询镜像管理列表
*/
@RequiresPermissions("mirror:manager:list")
@GetMapping("/list")
public TableDataInfo list(MirrorManagerEntity aiMirrorManager) {
try {
startPage();
List<MirrorManagerEntity> list = aiMirrorManagerService.selectAiMirrorManagerList(aiMirrorManager);
return getDataTable(list);
} catch (Exception e) {
return getDataTable(new ArrayList<>());
}
}
/**
* 获取镜像管理详细信息
*/
@RequiresPermissions("mirror:manager:query")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return aiMirrorManagerService.selectAiMirrorManagerById(id);
}
/**
* 新增镜像管理
*/
@RequiresPermissions("mirror:manager:add")
@PostMapping("/add")
@SysLog(title = "镜像管理", businessType = OperaType.INSERT, logType = 0, module = "镜像管理", details = "导出镜像管理列表")
public AjaxResult add(@RequestBody MirrorManagerEntity aiMirrorManager) {
return aiMirrorManagerService.insertAiMirrorManager(aiMirrorManager);
}
/**
* 修改镜像管理
*/
@RequiresPermissions("mirror:manager:edit")
@PutMapping("/edit")
@SysLog(title = "镜像管理", businessType = OperaType.UPDATE, logType = 0, module = "镜像管理", details = "导出镜像管理列表")
public AjaxResult edit(@RequestBody MirrorManagerEntity aiMirrorManager) {
return aiMirrorManagerService.updateAiMirrorManager(aiMirrorManager);
}
/**
* 删除镜像管理
*/
@RequiresPermissions("mirror:manager:remove")
@PostMapping("/delete/{ids}")
@SysLog(title = "镜像管理", businessType = OperaType.DELETE, logType = 0, module = "镜像管理", details = "导出镜像管理列表")
public AjaxResult remove(@PathVariable Long[] ids) {
return aiMirrorManagerService.deleteAiMirrorManagerByIds(ids);
}
}

View File

@ -0,0 +1,99 @@
package com.bonus.ai.controller;
import com.bonus.ai.domain.ModelManagerEntity;
import com.bonus.ai.service.ModelManagerService;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.core.web.page.TableDataInfo;
import com.bonus.common.log.annotation.SysLog;
import com.bonus.common.log.enums.OperaType;
import com.bonus.common.security.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
* 模型管理Controller
*
* @author bonus
* @date 2024-12-10
*/
@RestController
@RequestMapping("/model")
public class ModelManagerController extends BaseController {
@Resource
private ModelManagerService aiModelManagerService;
/**
* 查询模型管理列表
*/
@RequiresPermissions("model:manager:list")
@GetMapping("/list")
public TableDataInfo list(ModelManagerEntity aiModelManager) {
try {
startPage();
List<ModelManagerEntity> list = aiModelManagerService.selectAiModelManagerList(aiModelManager);
return getDataTable(list);
} catch (Exception e) {
return getDataTable(new ArrayList<>());
}
}
/**
* 获取模型管理详细信息
*/
@RequiresPermissions("model:manager:query")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return aiModelManagerService.selectAiModelManagerById(id);
}
/**
* 新增模型管理
*/
@RequiresPermissions("model:manager:add")
@PostMapping("/add")
@SysLog(title = "模型管理", businessType = OperaType.INSERT, logType = 0, module = "模型管理", details = "导出模型管理列表")
public AjaxResult add(@RequestBody ModelManagerEntity aiModelManager) {
return aiModelManagerService.insertAiModelManager(aiModelManager);
}
/**
* 修改模型管理
*/
@RequiresPermissions("model:manager:edit")
@PostMapping("/edit")
@SysLog(title = "模型管理", businessType = OperaType.UPDATE, logType = 0, module = "模型管理", details = "导出模型管理列表")
public AjaxResult edit(@RequestBody ModelManagerEntity aiModelManager) {
return aiModelManagerService.updateAiModelManager(aiModelManager);
}
/**
* 删除模型管理
*/
@RequiresPermissions("model:manager:remove")
@PostMapping("/delete/{ids}")
@SysLog(title = "模型管理", businessType = OperaType.DELETE, logType = 0, module = "模型管理", details = "导出模型管理列表")
public AjaxResult remove(@PathVariable Long[] ids) {
return aiModelManagerService.deleteAiModelManagerByIds(ids);
}
/**
* 文件上传
*/
@RequiresPermissions("model:manager:uploadFile")
@PostMapping("/uploadFile")
@SysLog(title = "模型管理", businessType = OperaType.DELETE, logType = 0, module = "模型管理", details = "导出模型管理列表")
public AjaxResult uploadFile(@RequestParam("file") MultipartFile file,
@RequestParam("chunk") int chunk,
@RequestParam("totalChunks") int totalChunks,
@RequestParam("fileName") String fileName) {
return aiModelManagerService.uploadFile(file, chunk, totalChunks,fileName);
}
}

View File

@ -69,7 +69,7 @@ public class DataSetBasicFileEntity extends BaseEntity {
private Date uploadTime;
private Long dataSetId;
private String auditFailedReason;
/**查询目的,表示文件在当前任务下的标注状态*/
String fileAnnotationStatus;
String annotationResult;

View File

@ -0,0 +1,66 @@
package com.bonus.ai.domain;
import com.bonus.common.core.annotation.Excel;
import com.bonus.common.core.web.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 镜像管理对象 ai_mirror_manager
*
* @author bonus
* @date 2024-12-11
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class MirrorManagerEntity extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 构建方式 */
private String conManner;
/** 接口文档 */
private String interfaceDocument;
/** 文档上传path */
private String documentPath;
/** 镜像名称 */
private String mirrorName;
/** 镜像版本 */
private String mirrorVersion;
/** 所属模型 */
private String ownModel;
/** 运行环境 */
private String runEnvironment;
/** 模型框架 */
private String modelFrame;
/** 语言 */
private String language;
/** 镜像文件path */
private String mirrorPath;
/** 是否删除 */
private String isActive;
/** 数据集id */
private String datasetId;
/** 模型文件名 */
private String modelFileName;
/** 使用手册文件名 */
private String manualFileName;
}

View File

@ -0,0 +1,72 @@
package com.bonus.ai.domain;
import com.bonus.common.core.annotation.Excel;
import com.bonus.common.core.web.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 模型管理对象 ai_model_manager
*
* @author bonus
* @date 2024-12-10
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class ModelManagerEntity extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* $column.columnComment
*/
private Long id;
/**
* 模型名称
*/
private String modelName;
/**
* 版本号
*/
private String modelVersion;
/**
* 模型类型
*/
private String modelType;
/**
* 模型框架
*/
private String modelFrame;
/**
* 模型文件名
*/
private String modelFileName;
/**
* 模型上传path
*/
private String modelPath;
/**
* 使用手册文件名
*/
private String manualFileName;
/**
* 使用手册path
*/
private String modelManual;
/**
* 是否删除
*/
private String isActive;
/**
* 数据集id
*/
private Long datasetId;
/**
* 数据集名称
*/
private String datasetName;
}

View File

@ -0,0 +1,54 @@
package com.bonus.ai.mapper;
import com.bonus.ai.domain.MirrorManagerEntity;
import java.util.List;
/**
* 镜像管理Mapper接口
*
* @author bonus
* @date 2024-12-11
*/
public interface MirrorManagerMapper {
/**
* 查询镜像管理
*
* @param id 镜像管理主键
* @return 镜像管理
*/
public MirrorManagerEntity selectAiMirrorManagerById(Long id);
/**
* 查询镜像管理列表
*
* @param aiMirrorManager 镜像管理
* @return 镜像管理集合
*/
public List<MirrorManagerEntity> selectAiMirrorManagerList(MirrorManagerEntity aiMirrorManager);
/**
* 新增镜像管理
*
* @param aiMirrorManager 镜像管理
* @return 结果
*/
public int insertAiMirrorManager(MirrorManagerEntity aiMirrorManager);
/**
* 修改镜像管理
*
* @param aiMirrorManager 镜像管理
* @return 结果
*/
public int updateAiMirrorManager(MirrorManagerEntity aiMirrorManager);
/**
* 批量删除镜像管理
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteAiMirrorManagerByIds(Long[] ids);
}

View File

@ -0,0 +1,54 @@
package com.bonus.ai.mapper;
import com.bonus.ai.domain.ModelManagerEntity;
import java.util.List;
/**
* 模型管理Mapper接口
*
* @author bonus
* @date 2024-12-10
*/
public interface ModelManagerMapper {
/**
* 查询模型管理
*
* @param id 模型管理主键
* @return 模型管理
*/
public ModelManagerEntity selectAiModelManagerById(Long id);
/**
* 查询模型管理列表
*
* @param aiModelManager 模型管理
* @return 模型管理集合
*/
public List<ModelManagerEntity> selectAiModelManagerList(ModelManagerEntity aiModelManager);
/**
* 新增模型管理
*
* @param aiModelManager 模型管理
* @return 结果
*/
public int insertAiModelManager(ModelManagerEntity aiModelManager);
/**
* 修改模型管理
*
* @param aiModelManager 模型管理
* @return 结果
*/
public int updateAiModelManager(ModelManagerEntity aiModelManager);
/**
* 批量删除模型管理
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteAiModelManagerByIds(Long[] ids);
}

View File

@ -0,0 +1,106 @@
package com.bonus.ai.service.Impl;
import com.bonus.ai.domain.MirrorManagerEntity;
import com.bonus.ai.mapper.MirrorManagerMapper;
import com.bonus.ai.service.MirrorManagerService;
import com.bonus.common.core.utils.DateUtils;
import com.bonus.common.core.web.domain.AjaxResult;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* 镜像管理Service业务层处理
*
* @author bonus
* @date 2024-12-11
*/
@Service
public class MirrorManagerServiceImpl implements MirrorManagerService {
@Resource
private MirrorManagerMapper aiMirrorManagerMapper;
/**
* 查询镜像管理
*
* @param id 镜像管理主键
* @return 镜像管理
*/
@Override
public AjaxResult selectAiMirrorManagerById(Long id) {
try {
MirrorManagerEntity aiMirrorManager = aiMirrorManagerMapper.selectAiMirrorManagerById(id);
if (ObjectUtils.isEmpty(aiMirrorManager)) {
return AjaxResult.error();
} else {
return AjaxResult.success(aiMirrorManager);
}
} catch (Exception e) {
return AjaxResult.error();
}
}
/**
* 查询镜像管理列表
*
* @param aiMirrorManager 镜像管理
* @return 镜像管理
*/
@Override
public List<MirrorManagerEntity> selectAiMirrorManagerList(MirrorManagerEntity aiMirrorManager) {
return aiMirrorManagerMapper.selectAiMirrorManagerList(aiMirrorManager);
}
/**
* 新增镜像管理
*
* @param aiMirrorManager 镜像管理
* @return 结果
*/
@Override
public AjaxResult insertAiMirrorManager(MirrorManagerEntity aiMirrorManager) {
aiMirrorManager.setCreateTime(DateUtils.getNowDate());
try {
int rows = aiMirrorManagerMapper.insertAiMirrorManager(aiMirrorManager);
return rows > 0 ? AjaxResult.success() : AjaxResult.error();
} catch (Exception e) {
return AjaxResult.error();
}
}
/**
* 修改镜像管理
*
* @param aiMirrorManager 镜像管理
* @return 结果
*/
@Override
public AjaxResult updateAiMirrorManager(MirrorManagerEntity aiMirrorManager) {
aiMirrorManager.setUpdateTime(DateUtils.getNowDate());
try {
int rows = aiMirrorManagerMapper.updateAiMirrorManager(aiMirrorManager);
return rows > 0 ? AjaxResult.success() : AjaxResult.error();
} catch (Exception e) {
return AjaxResult.error();
}
}
/**
* 批量删除镜像管理
*
* @param ids 需要删除的镜像管理主键
* @return 结果
*/
@Override
public AjaxResult deleteAiMirrorManagerByIds(Long[] ids) {
try {
int rows = aiMirrorManagerMapper.deleteAiMirrorManagerByIds(ids);
return rows > 0 ? AjaxResult.success() : AjaxResult.error();
} catch (Exception e) {
return AjaxResult.error();
}
}
}

View File

@ -0,0 +1,140 @@
package com.bonus.ai.service.Impl;
import java.util.List;
import com.bonus.ai.domain.DataSetBasicFileEntity;
import com.bonus.ai.domain.ModelManagerEntity;
import com.bonus.ai.mapper.ModelManagerMapper;
import com.bonus.ai.service.ModelManagerService;
import com.bonus.ai.utils.MinioUtil;
import com.bonus.common.core.utils.DateUtils;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.security.utils.SecurityUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
/**
* 模型管理Service业务层处理
*
* @author bonus
* @date 2024-12-10
*/
@Service
public class ModelManagerServiceImpl implements ModelManagerService {
@Resource
private ModelManagerMapper aiModelManagerMapper;
@Resource
private MinioUtil minioUtil;
/**
* 查询模型管理
*
* @param id 模型管理主键
* @return 模型管理
*/
@Override
public AjaxResult selectAiModelManagerById(Long id) {
try {
ModelManagerEntity aiModelManager = aiModelManagerMapper.selectAiModelManagerById(id);
if (ObjectUtils.isEmpty(aiModelManager)) {
return AjaxResult.error();
} else {
return AjaxResult.success(aiModelManager);
}
} catch (Exception e) {
return AjaxResult.error();
}
}
/**
* 查询模型管理列表
*
* @param aiModelManager 模型管理
* @return 模型管理
*/
@Override
public List<ModelManagerEntity> selectAiModelManagerList(ModelManagerEntity aiModelManager) {
return aiModelManagerMapper.selectAiModelManagerList(aiModelManager);
}
/**
* 新增模型管理
*
* @param aiModelManager 模型管理
* @return 结果
*/
@Override
public AjaxResult insertAiModelManager(ModelManagerEntity aiModelManager) {
aiModelManager.setCreateTime(DateUtils.getNowDate());
aiModelManager.setCreateBy(SecurityUtils.getUserId().toString());
try {
int rows = aiModelManagerMapper.insertAiModelManager(aiModelManager);
return rows > 0 ? AjaxResult.success() : AjaxResult.error();
} catch (Exception e) {
return AjaxResult.error();
}
}
/**
* 修改模型管理
*
* @param aiModelManager 模型管理
* @return 结果
*/
@Override
public AjaxResult updateAiModelManager(ModelManagerEntity aiModelManager) {
aiModelManager.setUpdateTime(DateUtils.getNowDate());
try {
int rows = aiModelManagerMapper.updateAiModelManager(aiModelManager);
return rows > 0 ? AjaxResult.success() : AjaxResult.error();
} catch (Exception e) {
return AjaxResult.error();
}
}
/**
* 批量删除模型管理
*
* @param ids 需要删除的模型管理主键
* @return 结果
*/
@Override
public AjaxResult deleteAiModelManagerByIds(Long[] ids) {
try {
int rows = aiModelManagerMapper.deleteAiModelManagerByIds(ids);
return rows > 0 ? AjaxResult.success() : AjaxResult.error();
} catch (Exception e) {
return AjaxResult.error();
}
}
/**
* 文件上传
*
* @param file 文件流
* @param chunk 当前分片
* @param totalChunks 总分片
*/
@Override
public AjaxResult uploadFile(MultipartFile file, int chunk, int totalChunks, String fileName) {
try {
// 使用唯一路径保存分片到 MinIO
String objectName = SecurityUtils.getUserId().toString() + "/temp/" + fileName + "/chunk_" + chunk;
minioUtil.uploadFile(file, objectName);
// 检查是否是最后一个分片若是则合并
if (chunk == totalChunks) {
DataSetBasicFileEntity entity = minioUtil.mergeChunksWithMultithreading(fileName, totalChunks, minioUtil.joinPath(SecurityUtils.getUserId().toString(), "model/"));
return AjaxResult.success(entity);
}
return AjaxResult.success();
} catch (Exception e) {
return AjaxResult.error();
}
}
}

View File

@ -0,0 +1,56 @@
package com.bonus.ai.service;
import com.bonus.ai.domain.MirrorManagerEntity;
import com.bonus.common.core.web.domain.AjaxResult;
import java.util.List;
/**
* 镜像管理Service接口
*
* @author bonus
* @date 2024-12-11
*/
public interface MirrorManagerService
{
/**
* 查询镜像管理
*
* @param id 镜像管理主键
* @return 镜像管理
*/
public AjaxResult selectAiMirrorManagerById(Long id);
/**
* 查询镜像管理列表
*
* @param aiMirrorManager 镜像管理
* @return 镜像管理集合
*/
public List<MirrorManagerEntity> selectAiMirrorManagerList(MirrorManagerEntity aiMirrorManager);
/**
* 新增镜像管理
*
* @param aiMirrorManager 镜像管理
* @return 结果
*/
public AjaxResult insertAiMirrorManager(MirrorManagerEntity aiMirrorManager);
/**
* 修改镜像管理
*
* @param aiMirrorManager 镜像管理
* @return 结果
*/
public AjaxResult updateAiMirrorManager(MirrorManagerEntity aiMirrorManager);
/**
* 批量删除镜像管理
*
* @param ids 需要删除的镜像管理主键集合
* @return 结果
*/
public AjaxResult deleteAiMirrorManagerByIds(Long[] ids);
}

View File

@ -0,0 +1,64 @@
package com.bonus.ai.service;
import com.bonus.ai.domain.ModelManagerEntity;
import com.bonus.common.core.web.domain.AjaxResult;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
/**
* 模型管理Service接口
*
* @author bonus
* @date 2024-12-10
*/
public interface ModelManagerService {
/**
* 查询模型管理
*
* @param id 模型管理主键
* @return 模型管理
*/
public AjaxResult selectAiModelManagerById(Long id);
/**
* 查询模型管理列表
*
* @param aiModelManager 模型管理
* @return 模型管理集合
*/
public List<ModelManagerEntity> selectAiModelManagerList(ModelManagerEntity aiModelManager);
/**
* 新增模型管理
*
* @param aiModelManager 模型管理
* @return 结果
*/
public AjaxResult insertAiModelManager(ModelManagerEntity aiModelManager);
/**
* 修改模型管理
*
* @param aiModelManager 模型管理
* @return 结果
*/
public AjaxResult updateAiModelManager(ModelManagerEntity aiModelManager);
/**
* 批量删除模型管理
*
* @param ids 需要删除的模型管理主键集合
* @return 结果
*/
public AjaxResult deleteAiModelManagerByIds(Long[] ids);
/**
* 文件上传
*
* @param file 文件流
* @param chunk 当前分片
* @param totalChunks 总分片
*/
AjaxResult uploadFile(MultipartFile file, int chunk, int totalChunks,String fileName);
}

View File

@ -21,12 +21,14 @@ spring:
password: nacos
discovery:
# 服务注册地址
server-addr: 192.168.0.14:8848
namespace: f648524d-0a7b-449e-8f92-64e05236fd51
server-addr: 127.0.0.1:8848
namespace: db93cb6f-e0b3-4f24-a5fc-72f5562f5676
config:
# 配置中心地址
server-addr: 192.168.0.14:8848
namespace: f648524d-0a7b-449e-8f92-64e05236fd51
server-addr: 127.0.0.1:8848
namespace: db93cb6f-e0b3-4f24-a5fc-72f5562f5676
# 配置文件格式
file-extension: yml
# 共享配置

View File

@ -240,6 +240,7 @@
adfm.create_time AS createTime,
atap.annotation_status AS fileAnnotationStatus,
atap.annotation_result AS annotationResult,
atap.audit_failed_reason AS auditFailedReason,
aat.task_id
FROM ai_basic_file abf
LEFT JOIN ai_dataset_file_map adfm ON abf.file_id = adfm.file_id

View File

@ -48,7 +48,8 @@
WHERE adfm.dataset_id = ad.dataset_id) AS annotatedCount,
(SELECT COUNT(*)
FROM ai_dataset_file_map adfm
WHERE adfm.dataset_id = ad.dataset_id AND adfm.is_annotated = '0') AS notAnnotatedCount
WHERE adfm.dataset_id = ad.dataset_id AND adfm.is_annotated = '0') AS notAnnotatedCount,
( SELECT adv.version_name FROM ai_dataset_version adv WHERE adv.dataset_id = ad.dataset_id ORDER BY adv.create_time DESC LIMIT 1 ) AS latestVersionName
FROM
ai_dataset ad
</sql>

View File

@ -0,0 +1,162 @@
<?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="com.bonus.ai.mapper.MirrorManagerMapper">
<resultMap type="com.bonus.ai.domain.MirrorManagerEntity" id="AiMirrorManagerResult">
<result property="id" column="id"/>
<result property="createBy" column="create_by"/>
<result property="conManner" column="con_manner"/>
<result property="interfaceDocument" column="interface_document"/>
<result property="documentPath" column="document_path"/>
<result property="mirrorName" column="mirror_name"/>
<result property="mirrorVersion" column="mirror_version"/>
<result property="ownModel" column="own_model"/>
<result property="runEnvironment" column="run_environment"/>
<result property="modelFrame" column="model_frame"/>
<result property="language" column="language"/>
<result property="mirrorPath" column="mirror_path"/>
<result property="remark" column="remark"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
<result property="isActive" column="is_active"/>
<result property="datasetId" column="datasetId"/>
<result property="modelFileName" column="modelFileName"/>
<result property="manualFileName" column="manualFileName"/>
</resultMap>
<sql id="selectAiMirrorManagerVo">
select id,
create_by,
con_manner,
interface_document,
document_path,
mirror_name,
mirror_version,
own_model,
run_environment,
model_frame,
language,
mirror_path,
remark,
create_time,
update_time,
is_active,
datasetId,
modelFileName,
manualFileName
from ai_mirror_manager
</sql>
<select id="selectAiMirrorManagerList" parameterType="com.bonus.ai.domain.MirrorManagerEntity"
resultMap="AiMirrorManagerResult">
<include refid="selectAiMirrorManagerVo"/>
<where>
<if test="conManner != null and conManner != ''">and con_manner = #{conManner}</if>
<if test="interfaceDocument != null and interfaceDocument != ''">and interface_document =
#{interfaceDocument}
</if>
<if test="documentPath != null and documentPath != ''">and document_path = #{documentPath}</if>
<if test="mirrorName != null and mirrorName != ''">and mirror_name like concat('%', #{mirrorName}, '%')
</if>
<if test="mirrorVersion != null and mirrorVersion != ''">and mirror_version = #{mirrorVersion}</if>
<if test="ownModel != null and ownModel != ''">and own_model = #{ownModel}</if>
<if test="runEnvironment != null and runEnvironment != ''">and run_environment = #{runEnvironment}</if>
<if test="modelFrame != null and modelFrame != ''">and model_frame = #{modelFrame}</if>
<if test="language != null and language != ''">and language = #{language}</if>
<if test="mirrorPath != null and mirrorPath != ''">and mirror_path = #{mirrorPath}</if>
<if test="isActive != null and isActive != ''">and is_active = #{isActive}</if>
<if test="datasetId != null and datasetId != ''">and datasetId = #{datasetId}</if>
<if test="modelFileName != null and modelFileName != ''">and modelFileName like concat('%',
#{modelFileName}, '%')
</if>
<if test="manualFileName != null and manualFileName != ''">and manualFileName like concat('%',
#{manualFileName}, '%')
</if>
</where>
</select>
<select id="selectAiMirrorManagerById" parameterType="Long" resultMap="AiMirrorManagerResult">
<include refid="selectAiMirrorManagerVo"/>
where id = #{id}
</select>
<insert id="insertAiMirrorManager" parameterType="com.bonus.ai.domain.MirrorManagerEntity">
insert into ai_mirror_manager
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="conManner != null">con_manner,</if>
<if test="interfaceDocument != null">interface_document,</if>
<if test="documentPath != null">document_path,</if>
<if test="mirrorName != null">mirror_name,</if>
<if test="mirrorVersion != null">mirror_version,</if>
<if test="ownModel != null">own_model,</if>
<if test="runEnvironment != null">run_environment,</if>
<if test="modelFrame != null">model_frame,</if>
<if test="language != null">language,</if>
<if test="mirrorPath != null">mirror_path,</if>
<if test="remark != null">remark,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="isActive != null">is_active,</if>
<if test="datasetId != null">datasetId,</if>
<if test="modelFileName != null">modelFileName,</if>
<if test="manualFileName != null">manualFileName,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="conManner != null">#{conManner},</if>
<if test="interfaceDocument != null">#{interfaceDocument},</if>
<if test="documentPath != null">#{documentPath},</if>
<if test="mirrorName != null">#{mirrorName},</if>
<if test="mirrorVersion != null">#{mirrorVersion},</if>
<if test="ownModel != null">#{ownModel},</if>
<if test="runEnvironment != null">#{runEnvironment},</if>
<if test="modelFrame != null">#{modelFrame},</if>
<if test="language != null">#{language},</if>
<if test="mirrorPath != null">#{mirrorPath},</if>
<if test="remark != null">#{remark},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="isActive != null">#{isActive},</if>
<if test="datasetId != null">#{datasetId},</if>
<if test="modelFileName != null">#{modelFileName},</if>
<if test="manualFileName != null">#{manualFileName},</if>
</trim>
</insert>
<update id="updateAiMirrorManager" parameterType="com.bonus.ai.domain.MirrorManagerEntity">
update ai_mirror_manager
<trim prefix="SET" suffixOverrides=",">
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="conManner != null">con_manner = #{conManner},</if>
<if test="interfaceDocument != null">interface_document = #{interfaceDocument},</if>
<if test="documentPath != null">document_path = #{documentPath},</if>
<if test="mirrorName != null">mirror_name = #{mirrorName},</if>
<if test="mirrorVersion != null">mirror_version = #{mirrorVersion},</if>
<if test="ownModel != null">own_model = #{ownModel},</if>
<if test="runEnvironment != null">run_environment = #{runEnvironment},</if>
<if test="modelFrame != null">model_frame = #{modelFrame},</if>
<if test="language != null">language = #{language},</if>
<if test="mirrorPath != null">mirror_path = #{mirrorPath},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="isActive != null">is_active = #{isActive},</if>
<if test="datasetId != null">datasetId = #{datasetId},</if>
<if test="modelFileName != null">modelFileName = #{modelFileName},</if>
<if test="manualFileName != null">manualFileName = #{manualFileName},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteAiMirrorManagerByIds" parameterType="String">
delete from ai_mirror_manager where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,132 @@
<?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="com.bonus.ai.mapper.ModelManagerMapper">
<resultMap type="com.bonus.ai.domain.ModelManagerEntity" id="AiModelManagerResult">
<result property="id" column="id"/>
<result property="createBy" column="create_by"/>
<result property="modelName" column="model_name"/>
<result property="modelVersion" column="model_version"/>
<result property="modelType" column="model_type"/>
<result property="modelFrame" column="model_frame"/>
<result property="modelPath" column="model_path"/>
<result property="modelManual" column="model_manual"/>
<result property="remark" column="remark"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
<result property="isActive" column="is_active"/>
<result property="manualFileName" column="manual_file_name"/>
<result property="datasetId" column="dataset_id"/>
<result property="modelFileName" column="model_file_name"/>
<result property="datasetName" column="dataset_name"/>
</resultMap>
<sql id="selectAiModelManagerVo">
select amm.id,
su.user_name AS create_by,
amm.model_name,
amm.model_version,
amm.model_type,
amm.model_frame,
amm.model_path,
amm.model_manual,
amm.remark,
amm.create_time,
amm.update_time,
amm.is_active,
amm.dataset_id,
ad.dataset_name,
amm.manual_file_name,
amm.model_file_name
from ai_model_manager amm
LEFT JOIN sys_user su ON amm.create_by = su.user_id
LEFT JOIN ai_dataset ad ON amm.dataset_id = ad.dataset_id
</sql>
<select id="selectAiModelManagerList" parameterType="com.bonus.ai.domain.ModelManagerEntity"
resultMap="AiModelManagerResult">
<include refid="selectAiModelManagerVo"/>
<where>
<if test="modelName != null and modelName != ''">and amm.model_name like concat('%', #{modelName}, '%')
</if>
<if test="modelVersion != null and modelVersion != ''">and amm.model_version = #{modelVersion}</if>
<if test="modelType != null and modelType != ''">and amm.model_type = #{modelType}</if>
<if test="modelFrame != null and modelFrame != ''">and amm.model_frame = #{modelFrame}</if>
<if test="modelPath != null and modelPath != ''">and amm.model_path = #{modelPath}</if>
<if test="modelManual != null and modelManual != ''">and amm.model_manual = #{modelManual}</if>
<if test="isActive != null and isActive != ''">and amm.is_active = #{isActive}</if>
</where>
</select>
<select id="selectAiModelManagerById" parameterType="Long" resultMap="AiModelManagerResult">
<include refid="selectAiModelManagerVo"/>
where amm.id = #{id}
</select>
<insert id="insertAiModelManager" parameterType="com.bonus.ai.domain.ModelManagerEntity">
insert into ai_model_manager
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="modelName != null">model_name,</if>
<if test="modelVersion != null">model_version,</if>
<if test="modelType != null">model_type,</if>
<if test="modelFrame != null">model_frame,</if>
<if test="modelPath != null">model_path,</if>
<if test="modelManual != null">model_manual,</if>
<if test="remark != null">remark,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="datasetId != null">dataset_id,</if>
<if test="modelFileName != null">model_file_name,</if>
<if test="manualFileName != null">manual_file_name,</if>
<if test="isActive != null">is_active,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="modelName != null">#{modelName},</if>
<if test="modelVersion != null">#{modelVersion},</if>
<if test="modelType != null">#{modelType},</if>
<if test="modelFrame != null">#{modelFrame},</if>
<if test="modelPath != null">#{modelPath},</if>
<if test="modelManual != null">#{modelManual},</if>
<if test="remark != null">#{remark},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="datasetId != null">#{datasetId},</if>
<if test="modelFileName != null">#{modelFileName},</if>
<if test="manualFileName != null">#{manualFileName},</if>
<if test="isActive != null">#{isActive},</if>
</trim>
</insert>
<update id="updateAiModelManager" parameterType="com.bonus.ai.domain.ModelManagerEntity">
update ai_model_manager
<trim prefix="SET" suffixOverrides=",">
<if test="modelName != null">model_name = #{modelName},</if>
<if test="modelVersion != null">model_version = #{modelVersion},</if>
<if test="modelType != null">model_type = #{modelType},</if>
<if test="modelFrame != null">model_frame = #{modelFrame},</if>
<if test="modelPath != null">model_path = #{modelPath},</if>
<if test="modelManual != null">model_manual = #{modelManual},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="datasetId != null">dataset_Id = #{datasetId},</if>
<if test="modelFileName != null">model_file_name = #{modelFileName},</if>
<if test="manualFileName != null">manual_file_name = #{manualFileName},</if>
<if test="isActive != null">is_active = #{isActive},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteAiModelManagerByIds" parameterType="String">
delete from ai_model_manager where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -1,6 +1,6 @@
# Tomcat
server:
port: 18083
port: 29093
# Spring
spring:
servlet:

View File

@ -1,6 +1,6 @@
# Tomcat
server:
port: 18091
port: 29091
# Spring
spring:

View File

@ -1,6 +1,6 @@
# Tomcat
server:
port: 18093
port: 19093
# Spring
spring:

View File

@ -1,6 +1,6 @@
# Tomcat
server:
port: 18090
port: 29090
servlet:
context-path: zhgd
# Spring

View File

@ -1,6 +1,6 @@
# Tomcat
server:
port: 18094
port: 19094
# Spring
spring:

View File

@ -1,6 +1,6 @@
# Tomcat
server:
port: 18095
port: 19095
# Spring
spring:

View File

@ -1,6 +1,6 @@
# Tomcat
server:
port: 18092
port: 29092
# Spring
spring:

View File

@ -1,6 +1,6 @@
# Tomcat
server:
port: 18096
port: 19096
# Spring
spring: