Add icon and publish time to tool
This commit is contained in:
@@ -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
|
||||
)
|
||||
|
||||
@@ -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)"
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
*
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user