Add icon and publish time to tool
This commit is contained in:
@@ -25,6 +25,7 @@ object ToolConverter {
|
|||||||
id = tool.id,
|
id = tool.id,
|
||||||
name = tool.name,
|
name = tool.name,
|
||||||
toolId = tool.toolId,
|
toolId = tool.toolId,
|
||||||
|
icon = tool.icon,
|
||||||
description = tool.description,
|
description = tool.description,
|
||||||
baseId = tool.baseId,
|
baseId = tool.baseId,
|
||||||
author = tool.author?.let(UserConverter::userToUserWithInfoVo),
|
author = tool.author?.let(UserConverter::userToUserWithInfoVo),
|
||||||
@@ -37,6 +38,7 @@ object ToolConverter {
|
|||||||
entryPoint = tool.entryPoint,
|
entryPoint = tool.entryPoint,
|
||||||
publish = tool.publish == 1,
|
publish = tool.publish == 1,
|
||||||
review = tool.review,
|
review = tool.review,
|
||||||
|
publishTime = tool.publishTime,
|
||||||
createTime = tool.createTime,
|
createTime = tool.createTime,
|
||||||
updateTime = tool.updateTime
|
updateTime = tool.updateTime
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -51,6 +51,15 @@ class Tool {
|
|||||||
@TableField("tool_id")
|
@TableField("tool_id")
|
||||||
var toolId: String? = null
|
var toolId: String? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Icon
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
@TableField("icon")
|
||||||
|
var icon: String? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description
|
* Description
|
||||||
*
|
*
|
||||||
@@ -146,10 +155,21 @@ class Tool {
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see ReviewType
|
||||||
*/
|
*/
|
||||||
@TableField("review")
|
@TableField("review")
|
||||||
var review: ReviewType? = null
|
var review: ReviewType? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Publish time
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see LocalDateTime
|
||||||
|
*/
|
||||||
|
@TableField("publish_time")
|
||||||
|
var publishTime: LocalDateTime? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create time
|
* Create time
|
||||||
*
|
*
|
||||||
@@ -236,6 +256,6 @@ class Tool {
|
|||||||
var dist: ToolData? = null
|
var dist: ToolData? = null
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return "Tool(id=$id, name=$name, toolId=$toolId, description=$description, baseId=$baseId, authorId=$authorId, ver=$ver, privately=$privately, keywords=$keywords, sourceId=$sourceId, distId=$distId, entryPoint=$entryPoint, publish=$publish, review=$review, createTime=$createTime, updateTime=$updateTime, deleted=$deleted, version=$version, author=$author, categories=$categories, source=$source, dist=$dist)"
|
return "Tool(id=$id, name=$name, toolId=$toolId, icon=$icon, description=$description, baseId=$baseId, authorId=$authorId, ver=$ver, privately=$privately, keywords=$keywords, sourceId=$sourceId, distId=$distId, entryPoint=$entryPoint, publish=$publish, review=$review, publishTime=$publishTime, createTime=$createTime, updateTime=$updateTime, deleted=$deleted, version=$version, author=$author, base=$base, categories=$categories, source=$source, dist=$dist)"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -38,6 +38,16 @@ data class ToolCreateParam(
|
|||||||
)
|
)
|
||||||
val toolId: String?,
|
val toolId: String?,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Icon
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
@Schema(description = "图标", required = true)
|
||||||
|
@field: NotBlank(message = "Icon can not be blank")
|
||||||
|
val icon: String?,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description
|
* Description
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ class EditServiceImpl(
|
|||||||
val tool = Tool().apply {
|
val tool = Tool().apply {
|
||||||
name = toolCreateParam.name!!.trim()
|
name = toolCreateParam.name!!.trim()
|
||||||
toolId = toolCreateParam.toolId
|
toolId = toolCreateParam.toolId
|
||||||
|
icon = toolCreateParam.icon
|
||||||
description = toolCreateParam.description
|
description = toolCreateParam.description
|
||||||
baseId = template.base!!.id
|
baseId = template.base!!.id
|
||||||
authorId = WebUtil.getLoginUserId() ?: throw UserNotFoundException()
|
authorId = WebUtil.getLoginUserId() ?: throw UserNotFoundException()
|
||||||
|
|||||||
@@ -41,6 +41,15 @@ data class ToolVo(
|
|||||||
@Schema(description = "工具 ID")
|
@Schema(description = "工具 ID")
|
||||||
val toolId: String?,
|
val toolId: String?,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Icon
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
@Schema(description = "图标")
|
||||||
|
val icon: String?,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description
|
* Description
|
||||||
*
|
*
|
||||||
@@ -155,6 +164,16 @@ data class ToolVo(
|
|||||||
@Schema(description = "审核")
|
@Schema(description = "审核")
|
||||||
val review: Tool.ReviewType?,
|
val review: Tool.ReviewType?,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Publish time
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see LocalDateTime
|
||||||
|
*/
|
||||||
|
@Schema(description = "发布时间", example = "1900-01-01T00:00:00.000Z")
|
||||||
|
val publishTime: LocalDateTime?,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create time
|
* Create time
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -2,23 +2,25 @@ drop table if exists t_b_tool_main;
|
|||||||
|
|
||||||
create table if not exists t_b_tool_main
|
create table if not exists t_b_tool_main
|
||||||
(
|
(
|
||||||
id bigint not null primary key,
|
id bigint not null primary key,
|
||||||
name varchar(50) not null comment '工具名',
|
name varchar(50) not null comment '工具名',
|
||||||
tool_id varchar(50) not null comment '工具 ID',
|
tool_id varchar(50) not null comment '工具 ID',
|
||||||
description varchar(500) null comment '简介',
|
icon text not null comment '图标',
|
||||||
base_id bigint not null comment '基板 ID',
|
description varchar(500) null comment '简介',
|
||||||
author_id bigint not null comment '作者 ID',
|
base_id bigint not null comment '基板 ID',
|
||||||
ver varchar(20) not null comment '版本',
|
author_id bigint not null comment '作者 ID',
|
||||||
privately int not null default 0 comment '私有',
|
ver varchar(20) not null comment '版本',
|
||||||
keywords varchar(500) not null comment '关键字',
|
privately int not null default 0 comment '私有',
|
||||||
source_id bigint not null comment '源码 ID',
|
keywords varchar(500) not null comment '关键字',
|
||||||
dist_id bigint not null comment '产物 ID',
|
source_id bigint not null comment '源码 ID',
|
||||||
entry_point varchar(64) not null default 'main.tsx' comment '入口文件',
|
dist_id bigint not null comment '产物 ID',
|
||||||
publish int not null default 0 comment '发布',
|
entry_point varchar(64) not null default 'main.tsx' comment '入口文件',
|
||||||
review varchar(10) not null default 'NONE' comment '审核',
|
publish int not null default 0 comment '发布',
|
||||||
create_time datetime not null default (utc_timestamp()) comment '创建时间',
|
review varchar(10) not null default 'NONE' comment '审核',
|
||||||
update_time datetime not null default (utc_timestamp()) comment '修改时间',
|
publish_time datetime null comment '发布时间',
|
||||||
deleted bigint not null default 0,
|
create_time datetime not null default (utc_timestamp()) comment '创建时间',
|
||||||
version int not null default 0,
|
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 unique (tool_id, author_id, ver, deleted)
|
constraint t_b_tool_main_unique_tool_id unique (tool_id, author_id, ver, deleted)
|
||||||
) comment '工具-主表';
|
) comment '工具-主表';
|
||||||
@@ -31,50 +31,52 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectOne" resultMap="toolMap">
|
<select id="selectOne" resultMap="toolMap">
|
||||||
select t_b_tool_main.id as tool_id,
|
select t_b_tool_main.id as tool_id,
|
||||||
t_b_tool_main.name as tool_name,
|
t_b_tool_main.name as tool_name,
|
||||||
t_b_tool_main.tool_id as tool_tool_id,
|
t_b_tool_main.tool_id as tool_tool_id,
|
||||||
t_b_tool_main.description as tool_description,
|
t_b_tool_main.icon as tool_icon,
|
||||||
t_b_tool_main.base_id as tool_base_id,
|
t_b_tool_main.description as tool_description,
|
||||||
t_b_tool_main.author_id as tool_author_id,
|
t_b_tool_main.base_id as tool_base_id,
|
||||||
t_b_tool_main.ver as tool_ver,
|
t_b_tool_main.author_id as tool_author_id,
|
||||||
t_b_tool_main.privately as tool_privately,
|
t_b_tool_main.ver as tool_ver,
|
||||||
t_b_tool_main.keywords as tool_keywords,
|
t_b_tool_main.privately as tool_privately,
|
||||||
t_b_tool_main.source_id as tool_source_id,
|
t_b_tool_main.keywords as tool_keywords,
|
||||||
t_b_tool_main.dist_id as tool_dist_id,
|
t_b_tool_main.source_id as tool_source_id,
|
||||||
t_b_tool_main.entry_point as tool_entry_point,
|
t_b_tool_main.dist_id as tool_dist_id,
|
||||||
t_b_tool_main.publish as tool_publish,
|
t_b_tool_main.entry_point as tool_entry_point,
|
||||||
t_b_tool_main.review as tool_review,
|
t_b_tool_main.publish as tool_publish,
|
||||||
t_b_tool_main.create_time as tool_create_time,
|
t_b_tool_main.review as tool_review,
|
||||||
t_b_tool_main.update_time as tool_update_time,
|
t_b_tool_main.publish_time as tool_publish_time,
|
||||||
t_b_tool_main.deleted as tool_deleted,
|
t_b_tool_main.create_time as tool_create_time,
|
||||||
t_b_tool_main.version as tool_version,
|
t_b_tool_main.update_time as tool_update_time,
|
||||||
tsu.id as user_id,
|
t_b_tool_main.deleted as tool_deleted,
|
||||||
tsu.username as user_username,
|
t_b_tool_main.version as tool_version,
|
||||||
tsui.id as user_info_id,
|
tsu.id as user_id,
|
||||||
tsui.nickname as user_info_nickname,
|
tsu.username as user_username,
|
||||||
tsui.avatar as user_info_avatar,
|
tsui.id as user_info_id,
|
||||||
tsui.email as user_info_email,
|
tsui.nickname as user_info_nickname,
|
||||||
tbtb.name as tool_base_name,
|
tsui.avatar as user_info_avatar,
|
||||||
tbtb.dist_id as tool_base_dist_id,
|
tsui.email as user_info_email,
|
||||||
tbtbd.data as tool_base_dist_data,
|
tbtb.name as tool_base_name,
|
||||||
tbts.data as tool_source_data,
|
tbtb.dist_id as tool_base_dist_id,
|
||||||
tbts.create_time as tool_source_create_time,
|
tbtbd.data as tool_base_dist_data,
|
||||||
tbts.update_time as tool_source_update_time,
|
tbts.data as tool_source_data,
|
||||||
tbts.deleted as tool_source_deleted,
|
tbts.create_time as tool_source_create_time,
|
||||||
tbts.version as tool_source_version,
|
tbts.update_time as tool_source_update_time,
|
||||||
tbtd.data as tool_dist_data,
|
tbts.deleted as tool_source_deleted,
|
||||||
tbtd.create_time as tool_dist_create_time,
|
tbts.version as tool_source_version,
|
||||||
tbtd.update_time as tool_dist_update_time,
|
tbtd.data as tool_dist_data,
|
||||||
tbtd.deleted as tool_dist_deleted,
|
tbtd.create_time as tool_dist_create_time,
|
||||||
tbtd.version as tool_dist_version,
|
tbtd.update_time as tool_dist_update_time,
|
||||||
tbtc.id as tool_category_id,
|
tbtd.deleted as tool_dist_deleted,
|
||||||
tbtc.name as tool_category_name,
|
tbtd.version as tool_dist_version,
|
||||||
tbtc.enable as tool_category_enable,
|
tbtc.id as tool_category_id,
|
||||||
tbtc.create_time as tool_category_create_time,
|
tbtc.name as tool_category_name,
|
||||||
tbtc.update_time as tool_category_update_time,
|
tbtc.enable as tool_category_enable,
|
||||||
tbtc.deleted as tool_category_deleted,
|
tbtc.create_time as tool_category_create_time,
|
||||||
tbtc.version as tool_category_version
|
tbtc.update_time as tool_category_update_time,
|
||||||
|
tbtc.deleted as tool_category_deleted,
|
||||||
|
tbtc.version as tool_category_version
|
||||||
from t_b_tool_main
|
from t_b_tool_main
|
||||||
left join (select * from t_s_user where deleted = 0) as tsu on tsu.id = t_b_tool_main.author_id
|
left join (select * from t_s_user where deleted = 0) as tsu on tsu.id = t_b_tool_main.author_id
|
||||||
left join (select * from t_s_user_info where deleted = 0) as tsui
|
left join (select * from t_s_user_info where deleted = 0) as tsui
|
||||||
@@ -104,6 +106,7 @@
|
|||||||
<id property="id" column="tool_id"/>
|
<id property="id" column="tool_id"/>
|
||||||
<result property="name" column="tool_name"/>
|
<result property="name" column="tool_name"/>
|
||||||
<result property="toolId" column="tool_tool_id"/>
|
<result property="toolId" column="tool_tool_id"/>
|
||||||
|
<result property="icon" column="tool_icon"/>
|
||||||
<result property="description" column="tool_description"/>
|
<result property="description" column="tool_description"/>
|
||||||
<result property="baseId" column="tool_base_id"/>
|
<result property="baseId" column="tool_base_id"/>
|
||||||
<result property="authorId" column="tool_author_id"/>
|
<result property="authorId" column="tool_author_id"/>
|
||||||
@@ -114,6 +117,7 @@
|
|||||||
<result property="entryPoint" column="tool_entry_point"/>
|
<result property="entryPoint" column="tool_entry_point"/>
|
||||||
<result property="publish" column="tool_publish"/>
|
<result property="publish" column="tool_publish"/>
|
||||||
<result property="review" column="tool_review"/>
|
<result property="review" column="tool_review"/>
|
||||||
|
<result property="publishTime" column="tool_publish_time"/>
|
||||||
<result property="updateTime" column="tool_update_time"/>
|
<result property="updateTime" column="tool_update_time"/>
|
||||||
<result property="createTime" column="tool_create_time"/>
|
<result property="createTime" column="tool_create_time"/>
|
||||||
<result property="deleted" column="tool_deleted"/>
|
<result property="deleted" column="tool_deleted"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user