feat(video): 新增模型管理与MinIO对象存储功能
- 新增算法模型实体类VModel及对应CRUD接口和实现 - 新增MinIO对象记录实体类VMinioObject及对应CRUD接口和实现 - 实现模型下载重定向功能 - 扩展MinioService支持指定文件名上传和删除对象 - 在CommonController中增加上传后持久化MinIO对象记录逻辑 - 新增ModelController用于模型管理RESTful接口- 新增VMinioObjectController用于MinIO对象记录管理接口 - 添加相关Mapper XML配置和DAO接口 - 更新pom.xml引入必要依赖
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
<?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.ruoyi.video.mapper.VMinioObjectMapper">
|
||||
|
||||
<resultMap id="VMinioObjectResult" type="com.ruoyi.video.domain.VMinioObject">
|
||||
<id property="objectId" column="object_id" />
|
||||
<result property="objectName" column="object_name" />
|
||||
<result property="url" column="url" />
|
||||
<result property="originalName" column="original_name" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<insert id="insertVMinioObject" parameterType="com.ruoyi.video.domain.VMinioObject" useGeneratedKeys="true" keyProperty="objectId">
|
||||
INSERT INTO v_minio_object (
|
||||
object_name,
|
||||
url,
|
||||
original_name,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
remark,
|
||||
del_flag
|
||||
) VALUES (
|
||||
#{objectName},
|
||||
#{url},
|
||||
#{originalName},
|
||||
#{createBy},
|
||||
NOW(),
|
||||
#{updateBy},
|
||||
NOW(),
|
||||
#{remark},
|
||||
#{delFlag}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="selectVMinioObjectById" parameterType="long" resultMap="VMinioObjectResult">
|
||||
SELECT * FROM v_minio_object WHERE object_id = #{id}
|
||||
</select>
|
||||
|
||||
<delete id="deleteVMinioObjectById" parameterType="long">
|
||||
DELETE FROM v_minio_object WHERE object_id = #{id}
|
||||
</delete>
|
||||
|
||||
<select id="selectVMinioObjectByObjectName" parameterType="string" resultMap="VMinioObjectResult">
|
||||
SELECT * FROM v_minio_object WHERE object_name = #{objectName}
|
||||
</select>
|
||||
|
||||
<delete id="deleteVMinioObjectByObjectName" parameterType="string">
|
||||
DELETE FROM v_minio_object WHERE object_name = #{objectName}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
67
ruoyi-video/src/main/resources/mapper/video/VModelMapper.xml
Normal file
67
ruoyi-video/src/main/resources/mapper/video/VModelMapper.xml
Normal file
@@ -0,0 +1,67 @@
|
||||
<?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.ruoyi.video.mapper.VModelMapper">
|
||||
|
||||
<resultMap id="VModelResult" type="com.ruoyi.video.domain.VModel">
|
||||
<id property="modelId" column="model_id" />
|
||||
<result property="modelName" column="model_name" />
|
||||
<result property="version" column="version" />
|
||||
<result property="framework" column="framework" />
|
||||
<result property="url" column="url" />
|
||||
<result property="fileSize" column="file_size" />
|
||||
<result property="checksum" column="checksum" />
|
||||
<result property="enabled" column="enabled" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<insert id="insertModel" parameterType="com.ruoyi.video.domain.VModel" useGeneratedKeys="true" keyProperty="modelId">
|
||||
INSERT INTO v_model (
|
||||
model_name, version, framework, url, file_size, checksum, enabled,
|
||||
create_by, create_time, update_by, update_time, remark, del_flag
|
||||
) VALUES (
|
||||
#{modelName}, #{version}, #{framework}, #{url}, #{fileSize}, #{checksum}, #{enabled},
|
||||
#{createBy}, NOW(), #{updateBy}, NOW(), #{remark}, #{delFlag}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="selectModelById" parameterType="long" resultMap="VModelResult">
|
||||
SELECT * FROM v_model WHERE model_id = #{id}
|
||||
</select>
|
||||
|
||||
<delete id="deleteModelById" parameterType="long">
|
||||
DELETE FROM v_model WHERE model_id = #{id}
|
||||
</delete>
|
||||
|
||||
<update id="updateEnabled">
|
||||
UPDATE v_model SET enabled = #{enabled}, update_time = NOW() WHERE model_id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="selectModelList" parameterType="map" resultMap="VModelResult">
|
||||
SELECT * FROM v_model
|
||||
<where>
|
||||
<if test="modelName != null and modelName != ''">
|
||||
AND model_name LIKE CONCAT('%', #{modelName}, '%')
|
||||
</if>
|
||||
<if test="framework != null and framework != ''">
|
||||
AND framework = #{framework}
|
||||
</if>
|
||||
<if test="enabled != null">
|
||||
AND enabled = #{enabled}
|
||||
</if>
|
||||
<if test="keyword != null and keyword != ''">
|
||||
AND (
|
||||
model_name LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR version LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR url LIKE CONCAT('%', #{keyword}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user