From e6688ccc5630325616b0c1f5faeb5f9e702da691 Mon Sep 17 00:00:00 2001 From: FatttSnake Date: Tue, 16 Jan 2024 18:09:46 +0800 Subject: [PATCH] Add tool tables --- .../api/controller/common/ToolController.kt | 5 + .../oxygen/api/entity/tool/RToolCategory.kt | 64 ++++++++ .../top/fatweb/oxygen/api/entity/tool/Tool.kt | 142 ++++++++++++++++++ .../oxygen/api/entity/tool/ToolCategory.kt | 63 ++++++++ .../fatweb/oxygen/api/entity/tool/ToolData.kt | 36 +++++ .../api/mapper/system/EventLogMapper.kt | 2 + .../api/mapper/system/SensitiveWordMapper.kt | 2 + .../api/mapper/system/StatisticsLogMapper.kt | 2 + .../api/mapper/tool/RToolCategoryMapper.kt | 16 ++ .../api/mapper/tool/ToolCategoryMapper.kt | 16 ++ .../oxygen/api/mapper/tool/ToolDataMapper.kt | 16 ++ .../oxygen/api/mapper/tool/ToolMapper.kt | 16 ++ .../api/service/tool/IRToolCategoryService.kt | 14 ++ .../api/service/tool/IToolCategoryService.kt | 14 ++ .../api/service/tool/IToolDataService.kt | 14 ++ .../oxygen/api/service/tool/IToolService.kt | 14 ++ .../tool/impl/RToolCategoryServiceImpl.kt | 18 +++ .../tool/impl/ToolCategoryServiceImpl.kt | 18 +++ .../service/tool/impl/ToolDataServiceImpl.kt | 18 +++ .../api/service/tool/impl/ToolServiceImpl.kt | 18 +++ ..._0_0_240115__Add_table_'t_b_tool_main'.sql | 23 +++ .../V1_0_0_240115__Add_table_'t_tools'.sql | 12 -- ..._240116__Add_table_'t_b_tool_category'.sql | 13 ++ ...17__Add_table_'t_r_tool_main_category'.sql | 12 ++ ..._0_0_240118__Add_table_'t_b_tool_data'.sql | 11 ++ ..._240119__Add_table_'t_b_tool_template'.sql | 16 ++ ..._0_0_240120__Add_table_'t_b_tool_base'.sql | 14 ++ 27 files changed, 597 insertions(+), 12 deletions(-) create mode 100644 src/main/kotlin/top/fatweb/oxygen/api/controller/common/ToolController.kt create mode 100644 src/main/kotlin/top/fatweb/oxygen/api/entity/tool/RToolCategory.kt create mode 100644 src/main/kotlin/top/fatweb/oxygen/api/entity/tool/Tool.kt create mode 100644 src/main/kotlin/top/fatweb/oxygen/api/entity/tool/ToolCategory.kt create mode 100644 src/main/kotlin/top/fatweb/oxygen/api/entity/tool/ToolData.kt create mode 100644 src/main/kotlin/top/fatweb/oxygen/api/mapper/tool/RToolCategoryMapper.kt create mode 100644 src/main/kotlin/top/fatweb/oxygen/api/mapper/tool/ToolCategoryMapper.kt create mode 100644 src/main/kotlin/top/fatweb/oxygen/api/mapper/tool/ToolDataMapper.kt create mode 100644 src/main/kotlin/top/fatweb/oxygen/api/mapper/tool/ToolMapper.kt create mode 100644 src/main/kotlin/top/fatweb/oxygen/api/service/tool/IRToolCategoryService.kt create mode 100644 src/main/kotlin/top/fatweb/oxygen/api/service/tool/IToolCategoryService.kt create mode 100644 src/main/kotlin/top/fatweb/oxygen/api/service/tool/IToolDataService.kt create mode 100644 src/main/kotlin/top/fatweb/oxygen/api/service/tool/IToolService.kt create mode 100644 src/main/kotlin/top/fatweb/oxygen/api/service/tool/impl/RToolCategoryServiceImpl.kt create mode 100644 src/main/kotlin/top/fatweb/oxygen/api/service/tool/impl/ToolCategoryServiceImpl.kt create mode 100644 src/main/kotlin/top/fatweb/oxygen/api/service/tool/impl/ToolDataServiceImpl.kt create mode 100644 src/main/kotlin/top/fatweb/oxygen/api/service/tool/impl/ToolServiceImpl.kt create mode 100644 src/main/resources/db/migration/master/V1_0_0_240115__Add_table_'t_b_tool_main'.sql delete mode 100644 src/main/resources/db/migration/master/V1_0_0_240115__Add_table_'t_tools'.sql create mode 100644 src/main/resources/db/migration/master/V1_0_0_240116__Add_table_'t_b_tool_category'.sql create mode 100644 src/main/resources/db/migration/master/V1_0_0_240117__Add_table_'t_r_tool_main_category'.sql create mode 100644 src/main/resources/db/migration/master/V1_0_0_240118__Add_table_'t_b_tool_data'.sql create mode 100644 src/main/resources/db/migration/master/V1_0_0_240119__Add_table_'t_b_tool_template'.sql create mode 100644 src/main/resources/db/migration/master/V1_0_0_240120__Add_table_'t_b_tool_base'.sql diff --git a/src/main/kotlin/top/fatweb/oxygen/api/controller/common/ToolController.kt b/src/main/kotlin/top/fatweb/oxygen/api/controller/common/ToolController.kt new file mode 100644 index 0000000..e759d7e --- /dev/null +++ b/src/main/kotlin/top/fatweb/oxygen/api/controller/common/ToolController.kt @@ -0,0 +1,5 @@ +package top.fatweb.oxygen.api.controller.common + + +class ToolController { +} \ No newline at end of file diff --git a/src/main/kotlin/top/fatweb/oxygen/api/entity/tool/RToolCategory.kt b/src/main/kotlin/top/fatweb/oxygen/api/entity/tool/RToolCategory.kt new file mode 100644 index 0000000..cce2436 --- /dev/null +++ b/src/main/kotlin/top/fatweb/oxygen/api/entity/tool/RToolCategory.kt @@ -0,0 +1,64 @@ +package top.fatweb.oxygen.api.entity.tool + +import com.baomidou.mybatisplus.annotation.* +import java.io.Serializable + +/** + * Tool category intermediate entity + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ +@TableName("t_r_tool_main_category") +class RToolCategory : Serializable { + /** + * ID + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ + @TableId("id") + var id: Long? = null + + /** + * Tool ID + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ + @TableField("tool_id") + var toolId: Long? = null + + /** + * Category ID + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ + @TableField("category_id") + var categoryId: Long? = null + + /** + * Deleted + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ + @TableField("deleted") + @TableLogic + var deleted: Long? = null + + /** + * Version + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ + @TableField("version") + @Version + var version: Int? = null + + override fun toString(): String { + return "RToolCategory(id=$id, toolId=$toolId, categoryId=$categoryId, deleted=$deleted, version=$version)" + } +} \ No newline at end of file diff --git a/src/main/kotlin/top/fatweb/oxygen/api/entity/tool/Tool.kt b/src/main/kotlin/top/fatweb/oxygen/api/entity/tool/Tool.kt new file mode 100644 index 0000000..c9178fd --- /dev/null +++ b/src/main/kotlin/top/fatweb/oxygen/api/entity/tool/Tool.kt @@ -0,0 +1,142 @@ +package top.fatweb.oxygen.api.entity.tool + +import com.baomidou.mybatisplus.annotation.* +import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler + +/** + * Tool entity + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ +@TableName("t_b_tool_main", autoResultMap = true) +class Tool { + /** + * ID + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ + @TableId("id") + var id: Long? = null + + /** + * Name + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ + @TableField("name") + var name: String? = null + + /** + * Tool ID + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ + @TableField("tool_id") + var toolId: String? = null + + /** + * Description + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ + @TableField("description") + var description: String? = null + + /** + * Author + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ + @TableField("author") + var author: Long? = null + + /** + * Version of tool + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ + @TableField("ver") + var ver: String? = null + + /** + * Privately + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ + @TableField("privately") + var privately: Int? = null + + /** + * Keyword + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ + @TableField("keyword", typeHandler = JacksonTypeHandler::class) + var keyword: List? = null + + /** + * Source code + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ + @TableField("source") + var source: Long? = null + + /** + * Compile product + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ + var dist: Long? = null + + /** + * Publish + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ + var publish: Int? = null + + /** + * Review + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ + var review: Int? = null + + /** + * Deleted + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ + @TableField("deleted") + @TableLogic + var deleted: Long? = null + + /** + * Version + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ + @TableField("version") + @Version + var version: Int? = null + + override fun toString(): String { + return "Tool(id=$id, name=$name, toolId=$toolId, description=$description, author=$author, ver=$ver, privately=$privately, keyword=$keyword, source=$source, dist=$dist, publish=$publish, review=$review, deleted=$deleted, version=$version)" + } +} \ No newline at end of file diff --git a/src/main/kotlin/top/fatweb/oxygen/api/entity/tool/ToolCategory.kt b/src/main/kotlin/top/fatweb/oxygen/api/entity/tool/ToolCategory.kt new file mode 100644 index 0000000..e441685 --- /dev/null +++ b/src/main/kotlin/top/fatweb/oxygen/api/entity/tool/ToolCategory.kt @@ -0,0 +1,63 @@ +package top.fatweb.oxygen.api.entity.tool + +import com.baomidou.mybatisplus.annotation.* + +/** + * Tool category entity + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ +@TableName("t_b_tool_category") +class ToolCategory { + /** + * ID + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ + @TableId("id") + var id: Long? = null + + /** + * Name + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ + @TableField("name") + var name: String? = null + + /** + * Enabel + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ + @TableField("enable") + var enable: Int? = null + + /** + * Deleted + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ + @TableField("deleted") + @TableLogic + var deleted: Long? = null + + /** + * Version + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ + @TableField("version") + @Version + var version: Int? = null + + override fun toString(): String { + return "ToolCategory(id=$id, name=$name, enable=$enable, deleted=$deleted, version=$version)" + } +} \ No newline at end of file diff --git a/src/main/kotlin/top/fatweb/oxygen/api/entity/tool/ToolData.kt b/src/main/kotlin/top/fatweb/oxygen/api/entity/tool/ToolData.kt new file mode 100644 index 0000000..84430c8 --- /dev/null +++ b/src/main/kotlin/top/fatweb/oxygen/api/entity/tool/ToolData.kt @@ -0,0 +1,36 @@ +package top.fatweb.oxygen.api.entity.tool + +import com.baomidou.mybatisplus.annotation.TableField +import com.baomidou.mybatisplus.annotation.TableId +import com.baomidou.mybatisplus.annotation.TableName + +/** + * Tool data entity + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ +@TableName("t_b_tool_data") +class ToolData { + /** + * ID + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ + @TableId("id") + var id: Long? = null + + /** + * Data + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ + @TableField("data") + var data: String? = null + + override fun toString(): String { + return "ToolData(id=$id, data=$data)" + } +} \ No newline at end of file diff --git a/src/main/kotlin/top/fatweb/oxygen/api/mapper/system/EventLogMapper.kt b/src/main/kotlin/top/fatweb/oxygen/api/mapper/system/EventLogMapper.kt index b9e5963..aaf96e0 100644 --- a/src/main/kotlin/top/fatweb/oxygen/api/mapper/system/EventLogMapper.kt +++ b/src/main/kotlin/top/fatweb/oxygen/api/mapper/system/EventLogMapper.kt @@ -9,6 +9,8 @@ import top.fatweb.oxygen.api.entity.system.EventLog * * @author FatttSnake, fatttsnake@gmail.com * @since 1.0.0 + * @see BaseMapper + * @see EventLog */ @Mapper interface EventLogMapper : BaseMapper \ No newline at end of file diff --git a/src/main/kotlin/top/fatweb/oxygen/api/mapper/system/SensitiveWordMapper.kt b/src/main/kotlin/top/fatweb/oxygen/api/mapper/system/SensitiveWordMapper.kt index c9dfd82..be01e0c 100644 --- a/src/main/kotlin/top/fatweb/oxygen/api/mapper/system/SensitiveWordMapper.kt +++ b/src/main/kotlin/top/fatweb/oxygen/api/mapper/system/SensitiveWordMapper.kt @@ -9,6 +9,8 @@ import top.fatweb.oxygen.api.entity.system.SensitiveWord * * @author FatttSnake, fatttsnake@gmail.com * @since 1.0.0 + * @see BaseMapper + * @see SensitiveWord */ @Mapper interface SensitiveWordMapper : BaseMapper \ No newline at end of file diff --git a/src/main/kotlin/top/fatweb/oxygen/api/mapper/system/StatisticsLogMapper.kt b/src/main/kotlin/top/fatweb/oxygen/api/mapper/system/StatisticsLogMapper.kt index 5c6266a..59b1523 100644 --- a/src/main/kotlin/top/fatweb/oxygen/api/mapper/system/StatisticsLogMapper.kt +++ b/src/main/kotlin/top/fatweb/oxygen/api/mapper/system/StatisticsLogMapper.kt @@ -9,6 +9,8 @@ import top.fatweb.oxygen.api.entity.system.StatisticsLog * * @author FatttSnake, fatttsnake@gmail.com * @since 1.0.0 + * @see BaseMapper + * @see StatisticsLog */ @Mapper interface StatisticsLogMapper : BaseMapper \ No newline at end of file diff --git a/src/main/kotlin/top/fatweb/oxygen/api/mapper/tool/RToolCategoryMapper.kt b/src/main/kotlin/top/fatweb/oxygen/api/mapper/tool/RToolCategoryMapper.kt new file mode 100644 index 0000000..1bc8be4 --- /dev/null +++ b/src/main/kotlin/top/fatweb/oxygen/api/mapper/tool/RToolCategoryMapper.kt @@ -0,0 +1,16 @@ +package top.fatweb.oxygen.api.mapper.tool + +import com.baomidou.mybatisplus.core.mapper.BaseMapper +import org.apache.ibatis.annotations.Mapper +import top.fatweb.oxygen.api.entity.tool.RToolCategory + +/** + * Tool category intermediate mapper + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + * @see BaseMapper + * @see RToolCategory + */ +@Mapper +interface RToolCategoryMapper : BaseMapper \ No newline at end of file diff --git a/src/main/kotlin/top/fatweb/oxygen/api/mapper/tool/ToolCategoryMapper.kt b/src/main/kotlin/top/fatweb/oxygen/api/mapper/tool/ToolCategoryMapper.kt new file mode 100644 index 0000000..414eb72 --- /dev/null +++ b/src/main/kotlin/top/fatweb/oxygen/api/mapper/tool/ToolCategoryMapper.kt @@ -0,0 +1,16 @@ +package top.fatweb.oxygen.api.mapper.tool + +import com.baomidou.mybatisplus.core.mapper.BaseMapper +import org.apache.ibatis.annotations.Mapper +import top.fatweb.oxygen.api.entity.tool.ToolCategory + +/** + * Tool category mapper + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + * @see BaseMapper + * @see ToolCategory + */ +@Mapper +interface ToolCategoryMapper : BaseMapper \ No newline at end of file diff --git a/src/main/kotlin/top/fatweb/oxygen/api/mapper/tool/ToolDataMapper.kt b/src/main/kotlin/top/fatweb/oxygen/api/mapper/tool/ToolDataMapper.kt new file mode 100644 index 0000000..088f219 --- /dev/null +++ b/src/main/kotlin/top/fatweb/oxygen/api/mapper/tool/ToolDataMapper.kt @@ -0,0 +1,16 @@ +package top.fatweb.oxygen.api.mapper.tool + +import com.baomidou.mybatisplus.core.mapper.BaseMapper +import org.apache.ibatis.annotations.Mapper +import top.fatweb.oxygen.api.entity.tool.ToolData + +/** + * Tool data mapper + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + * @see BaseMapper + * @see ToolData + */ +@Mapper +interface ToolDataMapper : BaseMapper \ No newline at end of file diff --git a/src/main/kotlin/top/fatweb/oxygen/api/mapper/tool/ToolMapper.kt b/src/main/kotlin/top/fatweb/oxygen/api/mapper/tool/ToolMapper.kt new file mode 100644 index 0000000..77dd30a --- /dev/null +++ b/src/main/kotlin/top/fatweb/oxygen/api/mapper/tool/ToolMapper.kt @@ -0,0 +1,16 @@ +package top.fatweb.oxygen.api.mapper.tool + +import com.baomidou.mybatisplus.core.mapper.BaseMapper +import org.apache.ibatis.annotations.Mapper +import top.fatweb.oxygen.api.entity.tool.Tool + +/** + * Tool mapper + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + * @see BaseMapper + * @see Tool + */ +@Mapper +interface ToolMapper : BaseMapper \ No newline at end of file diff --git a/src/main/kotlin/top/fatweb/oxygen/api/service/tool/IRToolCategoryService.kt b/src/main/kotlin/top/fatweb/oxygen/api/service/tool/IRToolCategoryService.kt new file mode 100644 index 0000000..4fc46c5 --- /dev/null +++ b/src/main/kotlin/top/fatweb/oxygen/api/service/tool/IRToolCategoryService.kt @@ -0,0 +1,14 @@ +package top.fatweb.oxygen.api.service.tool + +import com.baomidou.mybatisplus.extension.service.IService +import top.fatweb.oxygen.api.entity.tool.RToolCategory + +/** + * Tool category intermediate service interface + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + * @see IService + * @see RToolCategory + */ +interface IRToolCategoryService : IService \ No newline at end of file diff --git a/src/main/kotlin/top/fatweb/oxygen/api/service/tool/IToolCategoryService.kt b/src/main/kotlin/top/fatweb/oxygen/api/service/tool/IToolCategoryService.kt new file mode 100644 index 0000000..aac755e --- /dev/null +++ b/src/main/kotlin/top/fatweb/oxygen/api/service/tool/IToolCategoryService.kt @@ -0,0 +1,14 @@ +package top.fatweb.oxygen.api.service.tool + +import com.baomidou.mybatisplus.extension.service.IService +import top.fatweb.oxygen.api.entity.tool.ToolCategory + +/** + * Tool category service interface + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + * @see IService + * @see ToolCategory + */ +interface IToolCategoryService : IService \ No newline at end of file diff --git a/src/main/kotlin/top/fatweb/oxygen/api/service/tool/IToolDataService.kt b/src/main/kotlin/top/fatweb/oxygen/api/service/tool/IToolDataService.kt new file mode 100644 index 0000000..b8e9adc --- /dev/null +++ b/src/main/kotlin/top/fatweb/oxygen/api/service/tool/IToolDataService.kt @@ -0,0 +1,14 @@ +package top.fatweb.oxygen.api.service.tool + +import com.baomidou.mybatisplus.extension.service.IService +import top.fatweb.oxygen.api.entity.tool.ToolData + +/** + * Tool data service interface + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + * @see IService + * @see ToolData + */ +interface IToolDataService : IService \ No newline at end of file diff --git a/src/main/kotlin/top/fatweb/oxygen/api/service/tool/IToolService.kt b/src/main/kotlin/top/fatweb/oxygen/api/service/tool/IToolService.kt new file mode 100644 index 0000000..c0df740 --- /dev/null +++ b/src/main/kotlin/top/fatweb/oxygen/api/service/tool/IToolService.kt @@ -0,0 +1,14 @@ +package top.fatweb.oxygen.api.service.tool + +import com.baomidou.mybatisplus.extension.service.IService +import top.fatweb.oxygen.api.entity.tool.Tool + +/** + * Tool service interface + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + * @see IService + * @see Tool + */ +interface IToolService : IService \ No newline at end of file diff --git a/src/main/kotlin/top/fatweb/oxygen/api/service/tool/impl/RToolCategoryServiceImpl.kt b/src/main/kotlin/top/fatweb/oxygen/api/service/tool/impl/RToolCategoryServiceImpl.kt new file mode 100644 index 0000000..d7a6904 --- /dev/null +++ b/src/main/kotlin/top/fatweb/oxygen/api/service/tool/impl/RToolCategoryServiceImpl.kt @@ -0,0 +1,18 @@ +package top.fatweb.oxygen.api.service.tool.impl + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl +import top.fatweb.oxygen.api.entity.tool.RToolCategory +import top.fatweb.oxygen.api.mapper.tool.RToolCategoryMapper +import top.fatweb.oxygen.api.service.tool.IRToolCategoryService + +/** + * Tool category service implement + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + * @see ServiceImpl + * @see RToolCategoryMapper + * @see RToolCategory + * @see IRToolCategoryService + */ +class RToolCategoryServiceImpl : ServiceImpl(), IRToolCategoryService \ No newline at end of file diff --git a/src/main/kotlin/top/fatweb/oxygen/api/service/tool/impl/ToolCategoryServiceImpl.kt b/src/main/kotlin/top/fatweb/oxygen/api/service/tool/impl/ToolCategoryServiceImpl.kt new file mode 100644 index 0000000..4edbdb0 --- /dev/null +++ b/src/main/kotlin/top/fatweb/oxygen/api/service/tool/impl/ToolCategoryServiceImpl.kt @@ -0,0 +1,18 @@ +package top.fatweb.oxygen.api.service.tool.impl + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl +import top.fatweb.oxygen.api.entity.tool.ToolCategory +import top.fatweb.oxygen.api.mapper.tool.ToolCategoryMapper +import top.fatweb.oxygen.api.service.tool.IToolCategoryService + +/** + * Tool category service implement + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + * @see ServiceImpl + * @see ToolCategoryMapper + * @see ToolCategory + * @see IToolCategoryService + */ +class ToolCategoryServiceImpl : ServiceImpl(), IToolCategoryService \ No newline at end of file diff --git a/src/main/kotlin/top/fatweb/oxygen/api/service/tool/impl/ToolDataServiceImpl.kt b/src/main/kotlin/top/fatweb/oxygen/api/service/tool/impl/ToolDataServiceImpl.kt new file mode 100644 index 0000000..545a48a --- /dev/null +++ b/src/main/kotlin/top/fatweb/oxygen/api/service/tool/impl/ToolDataServiceImpl.kt @@ -0,0 +1,18 @@ +package top.fatweb.oxygen.api.service.tool.impl + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl +import top.fatweb.oxygen.api.entity.tool.ToolData +import top.fatweb.oxygen.api.mapper.tool.ToolDataMapper +import top.fatweb.oxygen.api.service.tool.IToolDataService + +/** + * Tool data service implement + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + * @see ServiceImpl + * @see ToolDataMapper + * @see ToolData + * @see IToolDataService + */ +class ToolDataServiceImpl : ServiceImpl(), IToolDataService \ No newline at end of file diff --git a/src/main/kotlin/top/fatweb/oxygen/api/service/tool/impl/ToolServiceImpl.kt b/src/main/kotlin/top/fatweb/oxygen/api/service/tool/impl/ToolServiceImpl.kt new file mode 100644 index 0000000..2fe45a2 --- /dev/null +++ b/src/main/kotlin/top/fatweb/oxygen/api/service/tool/impl/ToolServiceImpl.kt @@ -0,0 +1,18 @@ +package top.fatweb.oxygen.api.service.tool.impl + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl +import top.fatweb.oxygen.api.entity.tool.Tool +import top.fatweb.oxygen.api.mapper.tool.ToolMapper +import top.fatweb.oxygen.api.service.tool.IToolService + +/** + * Tool service implement + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + * @see ServiceImpl + * @see ToolMapper + * @see Tool + * @see IToolService + */ +class ToolServiceImpl : ServiceImpl(), IToolService \ No newline at end of file diff --git a/src/main/resources/db/migration/master/V1_0_0_240115__Add_table_'t_b_tool_main'.sql b/src/main/resources/db/migration/master/V1_0_0_240115__Add_table_'t_b_tool_main'.sql new file mode 100644 index 0000000..4bed7ef --- /dev/null +++ b/src/main/resources/db/migration/master/V1_0_0_240115__Add_table_'t_b_tool_main'.sql @@ -0,0 +1,23 @@ +drop table if exists t_b_tool_main; + +create table if not exists t_b_tool_main +( + id bigint not null primary key, + name varchar(50) not null comment '工具名', + tool_id varchar(50) not null comment '工具 ID', + description varchar(500) null comment '简介', + base bigint not null comment '基于', + author bigint not null comment '作者', + ver varchar(20) not null comment '版本', + privately int not null default 0 comment '私有', + keyword varchar(500) not null comment '关键字', + source bigint null comment '源码', + dist bigint null comment '产物', + publish int not null default 0 comment '发布', + review varchar(10) not null default 'NONE' 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_main_unique_tool_id unique (tool_id, author, deleted) +) comment '工具-主表'; \ No newline at end of file diff --git a/src/main/resources/db/migration/master/V1_0_0_240115__Add_table_'t_tools'.sql b/src/main/resources/db/migration/master/V1_0_0_240115__Add_table_'t_tools'.sql deleted file mode 100644 index b6c4905..0000000 --- a/src/main/resources/db/migration/master/V1_0_0_240115__Add_table_'t_tools'.sql +++ /dev/null @@ -1,12 +0,0 @@ -drop table if exists t_tools; - -create table if not exists t_tools ( - id bigint not null primary key , - name varchar(50) not null comment '工具名', - tool_id varchar(50) not null comment '工具 ID', - description varchar(500) null comment '简介', - version varchar(20) not null comment '版本', - private int not null default 0 comment '私有', - keyword varchar(500) not null comment '关键字', - category varchar(500) not null comment '类别' -) \ No newline at end of file diff --git a/src/main/resources/db/migration/master/V1_0_0_240116__Add_table_'t_b_tool_category'.sql b/src/main/resources/db/migration/master/V1_0_0_240116__Add_table_'t_b_tool_category'.sql new file mode 100644 index 0000000..21a15d5 --- /dev/null +++ b/src/main/resources/db/migration/master/V1_0_0_240116__Add_table_'t_b_tool_category'.sql @@ -0,0 +1,13 @@ +drop table if exists t_b_tool_category; + +create table if not exists t_b_tool_category +( + id bigint not null primary key, + name varchar(50) not null 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_tool_category_name unique (name, deleted) +) comment '工具-类别表'; \ No newline at end of file diff --git a/src/main/resources/db/migration/master/V1_0_0_240117__Add_table_'t_r_tool_main_category'.sql b/src/main/resources/db/migration/master/V1_0_0_240117__Add_table_'t_r_tool_main_category'.sql new file mode 100644 index 0000000..ceb3afc --- /dev/null +++ b/src/main/resources/db/migration/master/V1_0_0_240117__Add_table_'t_r_tool_main_category'.sql @@ -0,0 +1,12 @@ +drop table if exists t_r_tool_main_category; + +create table if not exists t_r_tool_main_category +( + id bigint not null primary key, + tool_id bigint not null comment '工具', + category_id bigint not null 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 +) comment '中间表-工具-主表-类别'; \ No newline at end of file diff --git a/src/main/resources/db/migration/master/V1_0_0_240118__Add_table_'t_b_tool_data'.sql b/src/main/resources/db/migration/master/V1_0_0_240118__Add_table_'t_b_tool_data'.sql new file mode 100644 index 0000000..fc61740 --- /dev/null +++ b/src/main/resources/db/migration/master/V1_0_0_240118__Add_table_'t_b_tool_data'.sql @@ -0,0 +1,11 @@ +drop table if exists t_b_tool_data; + +create table if not exists t_b_tool_data +( + id bigint not null primary key, + data text not null 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 +) comment '工具-数据表'; \ No newline at end of file diff --git a/src/main/resources/db/migration/master/V1_0_0_240119__Add_table_'t_b_tool_template'.sql b/src/main/resources/db/migration/master/V1_0_0_240119__Add_table_'t_b_tool_template'.sql new file mode 100644 index 0000000..d9c8b71 --- /dev/null +++ b/src/main/resources/db/migration/master/V1_0_0_240119__Add_table_'t_b_tool_template'.sql @@ -0,0 +1,16 @@ +drop table if exists t_b_tool_template; + +create table if not exists t_b_tool_template +( + id bigint not null primary key, + name varchar(40) not null comment '模板名', + ver varchar(20) not null comment '版本', + base varchar(20) not null comment '基于', + source bigint not null comment '源码', + dist bigint not null 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) +) comment '工具-模板表' \ No newline at end of file diff --git a/src/main/resources/db/migration/master/V1_0_0_240120__Add_table_'t_b_tool_base'.sql b/src/main/resources/db/migration/master/V1_0_0_240120__Add_table_'t_b_tool_base'.sql new file mode 100644 index 0000000..84f0df4 --- /dev/null +++ b/src/main/resources/db/migration/master/V1_0_0_240120__Add_table_'t_b_tool_base'.sql @@ -0,0 +1,14 @@ +drop table if exists t_b_tool_base; + +create table if not exists t_b_tool_base +( + id bigint not null primary key, + name varchar(20) not null comment '基板名', + source bigint not null comment '源码', + dist bigint not null 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) +) \ No newline at end of file