【新增】模型模块接口

This commit is contained in:
MichaelWin
2025-12-22 18:35:58 +08:00
parent e96c54c328
commit 77c1155b38
53 changed files with 1426 additions and 58 deletions

View File

@@ -36,8 +36,15 @@ mybatis-plus.mapper-locations=classpath*:/mapper/**/*.xml
mybatis-plus.type-aliases-package=com.corewing.app.entity
mybatis-plus.configuration.map-underscore-to-camel-case=true
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
mybatis-plus.global-config.db-config.id-type=AUTO
mybatis-plus.global-config.db-config.id-type=ASSIGN_ID
mybatis-plus.global-config.db-config.table-prefix=
# ========== 逻辑删除核心配置 ==========
# 1. 自定义逻辑删除字段名(替换为你的字段,如 is_delete、del_flag 等)
mybatis-plus.global-config.db-config.logic-delete-field=del_flag
# 2. 逻辑未删除值(替换为你的业务未删除值,如 0、false、N 等)
mybatis-plus.global-config.db-config.logic-not-delete-value=NOT_DELETE
# 3. 逻辑已删除值(替换为你的业务已删除值,如 1、true、Y 等)
mybatis-plus.global-config.db-config.logic-delete-value=DELETE
# Redis 配置
spring.redis.host=localhost
@@ -95,3 +102,41 @@ spring.mail.properties.mail.smtp.socketFactory.fallback=false
dingtalk.webhook=https://oapi.dingtalk.com/robot/send?access_token=7eed4b3483303c9ec71ef37a08c347bb597fd4c64211a96a8f55f72405ff6444
# 如果使用加签安全设置请填写密钥secret
dingtalk.secret=SEC0f2b835f28139905e3c0b5be979b215df1735f1154f36514aafbae8708014148
# ===================== Knife4j 核心增强配置 =====================
# 启用Knife4j增强模式
knife4j.enable=true
knife4j.setting.language=zh_cn
knife4j.basic.enable=true
knife4j.basic.username=corewing
knife4j.basic.password=Aaa123..
# ===================== Knife4j OpenAPI 全局文档配置 =====================
# 文档标题
knife4j.openapi.title=CoreWing APP API
# 文档描述支持Markdown换行用\n特殊符号保留
knife4j.openapi.description=
# 作者邮箱
knife4j.openapi.email=
# 联系人
knife4j.openapi.concat=
# 文档官网地址
knife4j.openapi.url=
# 文档版本
knife4j.openapi.version=v1.0
# 许可证
knife4j.openapi.license=
# ===================== Knife4j 分组配置 =====================
# 分组名称
knife4j.openapi.group.test1.group-name=APP接口
# 接口扫描规则package按包扫描、path按路径匹配、api按注解匹配
knife4j.openapi.group.test1.api-rule=package
# 按包扫描的资源(数组,用[索引]标识多个包)
knife4j.openapi.group.test1.api-rule-resources[0]=com.corewing.app.modules.app
# 若有多个包,继续添加索引
# knife4j.openapi.group.test1.api-rule-resources[1]=com.knife4j.demo.new4

View File

@@ -0,0 +1,31 @@
<?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.corewing.app.mapper.AppModelCategoryMapper">
<!-- 基础查询SQL片段 -->
<sql id="selectVOSql">
select mc.*
from app_model_category mc
</sql>
<!-- 分页查询 -->
<select id="page" resultType="com.corewing.app.entity.AppModelCategory">
<include refid="selectVOSql"/>
<where>
<if test="modelCategoryPageRequest.searchKey != null and modelCategoryPageRequest.searchKey != ''">
AND mc.name like CONCAT('%', #{modelCategoryPageRequest.searchKey}, '%')
</if>
</where>
</select>
<select id="list" resultType="com.corewing.app.entity.AppModelCategory">
<include refid="selectVOSql"/>
<where>
<if test="modelCategoryListRequest.searchKey != null and modelCategoryListRequest.searchKey != ''">
AND mc.name like CONCAT('%', #{modelCategoryListRequest.searchKey}, '%')
</if>
</where>
</select>
</mapper>

View File

@@ -0,0 +1,107 @@
<?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.corewing.app.mapper.AppModelMapper">
<!-- 基础查询SQL片段 -->
<sql id="selectVOSql">
select m.*,mc.name as categoryTitle
from app_model m
left join app_model_category mc on m.category_id = mc.id
</sql>
<!-- 分页查询 -->
<select id="page" resultType="com.corewing.app.entity.AppModel">
<include refid="selectVOSql"/>
<where>
<if test="modelPageRequest.userId != null and modelPageRequest.userId != ''">
AND m.user_id = #{modelPageRequest.userId}
</if>
<if test="modelPageRequest.status != null and modelPageRequest.status != ''">
AND m.status = #{modelPageRequest.status}
</if>
<if test="modelPageRequest.isPublic != null and modelPageRequest.isPublic != ''">
AND m.is_public = #{modelPageRequest.isPublic}
</if>
<if test="modelPageRequest.searchKey != null and modelPageRequest.searchKey != ''">
AND m.title like CONCAT('%', #{modelPageRequest.searchKey}, '%')
</if>
<if test="modelPageRequest.categoryId != null and modelPageRequest.categoryId != ''">
AND m.category_id = #{modelPageRequest.categoryId}
</if>
</where>
</select>
<select id="list" resultType="com.corewing.app.entity.AppModel">
<include refid="selectVOSql"/>
<where>
<if test="modelListRequest.userId != null and modelListRequest.userId != ''">
AND m.user_id = #{modelListRequest.userId}
</if>
<if test="modelListRequest.status != null and modelListRequest.status != ''">
AND m.status = #{modelListRequest.status}
</if>
<if test="modelListRequest.isPublic != null and modelListRequest.isPublic != ''">
AND m.is_public = #{modelListRequest.isPublic}
</if>
<if test="modelListRequest.searchKey != null and modelListRequest.searchKey != ''">
AND m.title like CONCAT('%', #{modelListRequest.searchKey}, '%')
</if>
<if test="modelListRequest.categoryId != null and modelListRequest.categoryId != ''">
AND m.category_id = #{modelListRequest.categoryId}
</if>
</where>
</select>
<select id="getModelById" resultType="com.corewing.app.entity.AppModel">
<include refid="selectVOSql"/>
<where>
and m.id = #{modelId}
</where>
</select>
<select id="favoriteList" resultType="com.corewing.app.entity.AppModel">
<include refid="selectVOSql"/>
left join app_model_favorite mf on mf.model_id = m.id
<where>
AND mf.user_id = #{userId}
<if test="modelFavoriteListRequest.searchKey != null and modelFavoriteListRequest.searchKey != ''">
AND m.title like CONCAT('%', #{modelFavoriteListRequest.searchKey}, '%')
</if>
</where>
</select>
<select id="favoritePage" resultType="com.corewing.app.entity.AppModel">
<include refid="selectVOSql"/>
left join app_model_favorite mf on mf.model_id = m.id
<where>
AND mf.user_id = #{userId}
<if test="modelFavoritePageRequest.searchKey != null and modelFavoritePageRequest.searchKey != ''">
AND m.title like CONCAT('%', #{modelFavoritePageRequest.searchKey}, '%')
</if>
</where>
</select>
<select id="downloadLogList" resultType="com.corewing.app.entity.AppModel">
<include refid="selectVOSql"/>
left join app_model_download_log mol on mol.model_id = m.id
<where>
AND mf.user_id = #{userId}
<if test="modelDownloadLogListRequest.searchKey != null and modelDownloadLogListRequest.searchKey != ''">
AND m.title like CONCAT('%', #{modelDownloadLogListRequest.searchKey}, '%')
</if>
</where>
</select>
<select id="downloadLogPage" resultType="com.corewing.app.entity.AppModel">
<include refid="selectVOSql"/>
left join app_model_download_log mol on mol.model_id = m.id
<where>
AND mf.user_id = #{userId}
<if test="modelDownloadLogPageRequest.searchKey != null and modelDownloadLogPageRequest.searchKey != ''">
AND m.title like CONCAT('%', #{modelDownloadLogPageRequest.searchKey}, '%')
</if>
</where>
</select>
</mapper>

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB