Add icon and publish time to tool

This commit is contained in:
2024-01-26 17:31:26 +08:00
parent a66c5caa60
commit 3dc935a98a
7 changed files with 121 additions and 63 deletions

View File

@@ -25,6 +25,7 @@ object ToolConverter {
id = tool.id,
name = tool.name,
toolId = tool.toolId,
icon = tool.icon,
description = tool.description,
baseId = tool.baseId,
author = tool.author?.let(UserConverter::userToUserWithInfoVo),
@@ -37,6 +38,7 @@ object ToolConverter {
entryPoint = tool.entryPoint,
publish = tool.publish == 1,
review = tool.review,
publishTime = tool.publishTime,
createTime = tool.createTime,
updateTime = tool.updateTime
)

View File

@@ -51,6 +51,15 @@ class Tool {
@TableField("tool_id")
var toolId: String? = null
/**
* Icon
*
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
*/
@TableField("icon")
var icon: String? = null
/**
* Description
*
@@ -146,10 +155,21 @@ class Tool {
*
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
* @see ReviewType
*/
@TableField("review")
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
*
@@ -236,6 +256,6 @@ class Tool {
var dist: ToolData? = null
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)"
}
}

View File

@@ -38,6 +38,16 @@ data class ToolCreateParam(
)
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
*

View File

@@ -62,6 +62,7 @@ class EditServiceImpl(
val tool = Tool().apply {
name = toolCreateParam.name!!.trim()
toolId = toolCreateParam.toolId
icon = toolCreateParam.icon
description = toolCreateParam.description
baseId = template.base!!.id
authorId = WebUtil.getLoginUserId() ?: throw UserNotFoundException()

View File

@@ -41,6 +41,15 @@ data class ToolVo(
@Schema(description = "工具 ID")
val toolId: String?,
/**
* Icon
*
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
*/
@Schema(description = "图标")
val icon: String?,
/**
* Description
*
@@ -155,6 +164,16 @@ data class ToolVo(
@Schema(description = "审核")
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
*