diff --git a/src/main/java/com/corewing/app/entity/CourseCategory.java b/src/main/java/com/corewing/app/entity/CourseCategory.java new file mode 100644 index 0000000..182c93a --- /dev/null +++ b/src/main/java/com/corewing/app/entity/CourseCategory.java @@ -0,0 +1,64 @@ +package com.corewing.app.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 教程分类 + */ +@Data +@TableName("app_course_category") +public class CourseCategory implements Serializable { + + /** + * 分类id + */ + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 图标 + */ + private String icon; + + /** + * 分类名称 + */ + private String categoryTitle; + + /** + * 分类描述 + */ + private String description; + + /** + * 类别:category分类,tag标签 + */ + private String type; + + /** + * 置首页:0不置首,1置首页 + */ + private Integer firstStatus; + + /** + * 状态:1正常,2关闭 + */ + private Integer status; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新时间 + */ + private Date updateTime; + +} diff --git a/src/main/java/com/corewing/app/entity/CourseCategoryRelation.java b/src/main/java/com/corewing/app/entity/CourseCategoryRelation.java new file mode 100644 index 0000000..dad1658 --- /dev/null +++ b/src/main/java/com/corewing/app/entity/CourseCategoryRelation.java @@ -0,0 +1,32 @@ +package com.corewing.app.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; + +/** + * 教程与分类关系实体 + */ +@Data +@TableName("app_course_category_relation") +public class CourseCategoryRelation implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private Long id; + + /** + * 教程id + */ + private Long CourseId; + + /** + * 教程分类id + */ + private Long CategoryId; + +} diff --git a/src/main/java/com/corewing/app/service/CourseCategoryService.java b/src/main/java/com/corewing/app/service/CourseCategoryService.java new file mode 100644 index 0000000..16042c4 --- /dev/null +++ b/src/main/java/com/corewing/app/service/CourseCategoryService.java @@ -0,0 +1,7 @@ +package com.corewing.app.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.corewing.app.entity.CourseCategory; + +public interface CourseCategoryService extends IService { +} diff --git a/src/main/java/com/corewing/app/service/impl/CourseCategoryServiceImpl.java b/src/main/java/com/corewing/app/service/impl/CourseCategoryServiceImpl.java new file mode 100644 index 0000000..a061047 --- /dev/null +++ b/src/main/java/com/corewing/app/service/impl/CourseCategoryServiceImpl.java @@ -0,0 +1,11 @@ +package com.corewing.app.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.corewing.app.entity.CourseCategory; +import com.corewing.app.mapper.CourseCategoryMapper; +import com.corewing.app.service.CourseCategoryService; +import org.springframework.stereotype.Service; + +@Service +public class CourseCategoryServiceImpl extends ServiceImpl implements CourseCategoryService { +} diff --git a/src/main/resources/db/app_course_category.sql b/src/main/resources/db/app_course_category.sql new file mode 100644 index 0000000..3d12be6 --- /dev/null +++ b/src/main/resources/db/app_course_category.sql @@ -0,0 +1,44 @@ +/* + Navicat Premium Dump SQL + + Source Server : 120.24.204.180 + Source Server Type : MySQL + Source Server Version : 80036 (8.0.36) + Source Host : 120.24.204.180:3306 + Source Schema : app + + Target Server Type : MySQL + Target Server Version : 80036 (8.0.36) + File Encoding : 65001 + + Date: 28/10/2025 13:46:32 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for app_course_category +-- ---------------------------- +DROP TABLE IF EXISTS `app_course_category`; +CREATE TABLE `app_course_category` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id', + `icon` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '图标', + `category_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '分类名称', + `description` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '分类描述', + `first_status` int NOT NULL DEFAULT '2' COMMENT '置首页:1置首,2不置首', + `type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '类别:category分类,tag标签', + `status` tinyint(1) DEFAULT '0' COMMENT '状态:1正常,2关闭', + `create_time` datetime NOT NULL COMMENT '创建时间', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='使用教程分类/标签表'; + +-- ---------------------------- +-- Records of app_course_category +-- ---------------------------- +BEGIN; +INSERT INTO `app_course_category` (`id`, `icon`, `category_title`, `description`, `first_status`, `type`, `status`, `create_time`, `update_time`) VALUES (1, NULL, '快速指南', NULL, 1, 'category', 1, '2025-10-28 12:06:03', NULL); +COMMIT; + +SET FOREIGN_KEY_CHECKS = 1;