Feat: all - support multiple platforms

This commit is contained in:
2024-03-18 17:26:08 +08:00
parent 9fe6333aeb
commit cc4e6bd960
39 changed files with 415 additions and 78 deletions

View File

@@ -62,5 +62,8 @@ logging:
# max-file-size: 10MB # Maximum log file size
# max-history: 7 # Maximum number of archive log files to keep
mybatis-plus:
type-aliases-package: top.fatweb.oxygen.api.entity
knife4j:
production: true # Production environment mode will block doc

View File

@@ -6,6 +6,7 @@ create table if not exists t_b_tool_main
name varchar(50) not null comment '工具名',
tool_id varchar(50) not null comment '工具 ID',
icon text not null comment '图标',
platform varchar(20) not null comment '平台',
description varchar(500) null comment '简介',
base_id bigint not null comment '基板 ID',
author_id bigint not null comment '作者 ID',
@@ -20,6 +21,6 @@ create table if not exists t_b_tool_main
update_time datetime not null default (utc_timestamp()) comment '修改时间',
deleted bigint not null default 0,
version int not null default 0,
constraint t_b_tool_main_unique_tool_id_ver unique (tool_id, author_id, ver, deleted),
constraint t_b_tool_main_unique_tool_id_publish unique (tool_id, author_id, publish, deleted)
constraint t_b_tool_main_unique_tool_id_platform_author_ver unique (tool_id, platform, author_id, ver, deleted),
constraint t_b_tool_main_unique_tool_id_platform_author_publish unique (tool_id, platform, author_id, publish, deleted)
) comment '工具-主表';

View File

@@ -6,11 +6,12 @@ create table if not exists t_b_tool_template
name varchar(40) not null comment '模板名',
base_id bigint not null comment '基板 ID',
source_id bigint not null comment '源码 ID',
platform varchar(20) not null comment '平台',
entry_point varchar(64) not null default 'main.tsx' comment '入口文件',
enable int not null default 1 comment '启用',
create_time datetime not null default (utc_timestamp()) comment '创建时间',
update_time datetime not null default (utc_timestamp()) comment '修改时间',
deleted bigint not null default 0,
version int not null default 0,
constraint t_b_tool_template_unique_name unique (name, deleted)
constraint t_b_tool_template_unique_name_platform unique (name, platform, deleted)
) comment '工具-模板表'

View File

@@ -6,10 +6,11 @@ create table if not exists t_b_tool_base
name varchar(20) not null comment '基板名',
source_id bigint not null comment '源码 ID',
dist_id bigint not null comment '产物 ID',
platform varchar(20) not null comment '平台',
compiled int not null default 0 comment '已编译',
create_time datetime not null default (utc_timestamp()) comment '创建时间',
update_time datetime not null default (utc_timestamp()) comment '修改时间',
deleted bigint not null default 0,
version int not null default 0,
constraint t_b_tool_base_unique_name unique (name, deleted)
constraint t_b_tool_base_unique_name_platform unique (name, platform, deleted)
)

View File

@@ -6,6 +6,7 @@
t_b_tool_template.name as tool_template_name,
t_b_tool_template.base_id as tool_template_base_id,
t_b_tool_template.source_id as tool_template_source_id,
t_b_tool_template.platform as tool_template_platform,
t_b_tool_template.entry_point as tool_template_entry_point,
t_b_tool_template.enable as tool_template_enable,
t_b_tool_template.create_time as tool_template_create_time,
@@ -35,6 +36,7 @@
t_b_tool_main.name as tool_name,
t_b_tool_main.tool_id as tool_tool_id,
t_b_tool_main.icon as tool_icon,
t_b_tool_main.platform as tool_platform,
t_b_tool_main.description as tool_description,
t_b_tool_main.base_id as tool_base_id,
t_b_tool_main.author_id as tool_author_id,
@@ -97,6 +99,7 @@
t_b_tool_main.name as tool_name,
t_b_tool_main.tool_id as tool_tool_id,
t_b_tool_main.icon as tool_icon,
t_b_tool_main.platform as tool_platform,
t_b_tool_main.description as tool_description,
t_b_tool_main.base_id as tool_base_id,
t_b_tool_main.author_id as tool_author_id,
@@ -133,6 +136,7 @@
t_b_tool_main.name as tool_name,
t_b_tool_main.tool_id as tool_tool_id,
t_b_tool_main.icon as tool_icon,
t_b_tool_main.platform as tool_platform,
t_b_tool_main.description as tool_description,
t_b_tool_main.base_id as tool_base_id,
t_b_tool_main.author_id as tool_author_id,
@@ -187,6 +191,7 @@
<where>
and t_b_tool_main.deleted = 0
and t_b_tool_main.tool_id = #{toolId}
and t_b_tool_main.platform = #{platform}
<choose>
<when test="operator == null">
and tsu.username = #{username}

View File

@@ -6,6 +6,7 @@
t_b_tool_main.name as tool_name,
t_b_tool_main.tool_id as tool_tool_id,
t_b_tool_main.icon as tool_icon,
t_b_tool_main.platform as tool_platform,
t_b_tool_main.description as tool_description,
t_b_tool_main.base_id as tool_base_id,
t_b_tool_main.author_id as tool_author_id,
@@ -74,6 +75,11 @@
close=")" nullable="true">
#{item}
</foreach>
<foreach collection="platform" item="item" index="index" open="and t_b_tool_main.platform in ("
separator=","
close=")" nullable="true">
#{item}
</foreach>
<if test="searchValue != null">
<choose>
<when test="searchType == 'NAME'">
@@ -155,6 +161,7 @@
t_b_tool_main.name as tool_name,
t_b_tool_main.tool_id as tool_tool_id,
t_b_tool_main.icon as tool_icon,
t_b_tool_main.platform as tool_platform,
t_b_tool_main.description as tool_description,
t_b_tool_main.base_id as tool_base_id,
t_b_tool_main.author_id as tool_author_id,
@@ -216,6 +223,7 @@
<result property="name" column="tool_name"/>
<result property="toolId" column="tool_tool_id"/>
<result property="icon" column="tool_icon"/>
<result property="platform" column="tool_platform"/>
<result property="description" column="tool_description"/>
<result property="baseId" column="tool_base_id"/>
<result property="authorId" column="tool_author_id"/>

View File

@@ -60,6 +60,7 @@
t_b_tool_main.name as tool_name,
t_b_tool_main.tool_id as tool_tool_id,
t_b_tool_main.icon as tool_icon,
t_b_tool_main.platform as tool_platform,
t_b_tool_main.description as tool_description,
t_b_tool_main.base_id as tool_base_id,
t_b_tool_main.author_id as tool_author_id,

View File

@@ -6,6 +6,7 @@
t_b_tool_base.name as tool_base_name,
t_b_tool_base.source_id as tool_base_source_id,
t_b_tool_base.dist_id as tool_base_dist_id,
t_b_tool_base.platform as tool_base_platform,
t_b_tool_base.compiled as tool_base_compiled,
t_b_tool_base.create_time as tool_base_create_time,
t_b_tool_base.update_time as tool_base_update_time,
@@ -34,6 +35,7 @@
<result property="name" column="tool_base_name"/>
<result property="sourceId" column="tool_base_source_id"/>
<result property="distId" column="tool_base_dist_id"/>
<result property="platform" column="tool_base_platform"/>
<result property="compiled" column="tool_base_compiled"/>
<result property="createTime" column="tool_base_create_time"/>
<result property="updateTime" column="tool_base_update_time"/>

View File

@@ -6,6 +6,7 @@
t_b_tool_template.name as tool_template_name,
t_b_tool_template.base_id as tool_template_base_id,
t_b_tool_template.source_id as tool_template_source_id,
t_b_tool_template.platform as tool_template_platform,
t_b_tool_template.entry_point as tool_template_entry_point,
t_b_tool_template.enable as tool_template_enable,
t_b_tool_template.create_time as tool_template_create_time,
@@ -27,22 +28,29 @@
and t_b_tool_template.id = #{id}
</select>
<select id="selectList" resultMap="toolTemplateMap">
select t_b_tool_template.id as tool_template_id,
t_b_tool_template.name as tool_template_name,
t_b_tool_template.base_id as tool_template_base_id,
t_b_tool_template.source_id as tool_template_source_id,
t_b_tool_template.entry_point as tool_template_entry_point,
t_b_tool_template.enable as tool_template_enable,
t_b_tool_template.create_time as tool_template_create_time,
t_b_tool_template.update_time as tool_template_update_time,
t_b_tool_template.deleted as tool_template_deleted,
t_b_tool_template.version as tool_template_version,
tbtb.name as tool_template_base_name
<select id="selectListWithBaseName" resultMap="toolTemplateMap">
select t_b_tool_template.id as tool_template_id,
t_b_tool_template.name as tool_template_name,
t_b_tool_template.base_id as tool_template_base_id,
t_b_tool_template.source_id as tool_template_source_id,
t_b_tool_template.platform as tool_template_platform,
t_b_tool_template.entry_point as tool_template_entry_point,
t_b_tool_template.enable as tool_template_enable,
t_b_tool_template.create_time as tool_template_create_time,
t_b_tool_template.update_time as tool_template_update_time,
t_b_tool_template.deleted as tool_template_deleted,
t_b_tool_template.version as tool_template_version,
tbtb.name as tool_template_base_name
from t_b_tool_template
left join (select * from t_b_tool_base where deleted = 0) as tbtb
on tbtb.id = t_b_tool_template.base_id
where t_b_tool_template.deleted = 0
left join (select * from t_b_tool_base where deleted = 0) as tbtb
on tbtb.id = t_b_tool_template.base_id
<where>
and t_b_tool_template.deleted = 0
<foreach collection="platform" item="item" index="index" open="and t_b_tool_template.platform in ("
separator="," close=")" nullable="true">
#{item}
</foreach>
</where>
</select>
<resultMap id="toolTemplateMap" type="toolTemplate">
@@ -50,6 +58,7 @@
<result property="name" column="tool_template_name"/>
<result property="baseId" column="tool_template_base_id"/>
<result property="sourceId" column="tool_template_source_id"/>
<result property="platform" column="tool_template_platform"/>
<result property="entryPoint" column="tool_template_entry_point"/>
<result property="enable" column="tool_template_enable"/>
<result property="createTime" column="tool_template_create_time"/>