mysql存储

This commit is contained in:
lizhengwei 2025-11-25 15:02:51 +08:00
parent bb9462f796
commit 2592f2d261
29 changed files with 219 additions and 343 deletions

View File

@ -21,22 +21,24 @@ SET FOREIGN_KEY_CHECKS = 0;
-- Table structure for h5_font -- Table structure for h5_font
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `h5_font`; DROP TABLE IF EXISTS `h5_font`;
CREATE TABLE `h5_font` ( CREATE TABLE `h5_font`
(
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID', `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`source` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '字体来源', `source_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '字体来源',
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '字体名称', `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '字体名称',
`font_family` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '字体族名称(唯一标识)', `preview` json NOT NULL COMMENT '预览JSON格式',
`lang` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '字体语言类型zh-中文en-英文', `lang` varchar(10) NOT NULL COMMENT '字体语言类型zh-中文en-英文',
`alias` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '字体别名', `alias` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '字体别名',
`authorization_id` bigint NULL DEFAULT NULL COMMENT '授权ID', `content` json NOT NULL COMMENT '字体内容JSON格式',
`user_over_role` int NULL DEFAULT NULL COMMENT '用户角色', `create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间戳',
`sale_type` int NULL DEFAULT NULL COMMENT '销售类型', `update_time` DATETIME ON UPDATE CURRENT_TIMESTAMP NULL COMMENT '更新时间戳',
`create_time` bigint NOT NULL COMMENT '创建时间戳',
`update_time` bigint NOT NULL COMMENT '更新时间戳',
PRIMARY KEY (`id`) USING BTREE, PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uk_font_family`(`font_family`) USING BTREE COMMENT '字体族名称唯一索引', UNIQUE INDEX `uk_name` (`name`) USING BTREE COMMENT '字体族名称唯一索引',
INDEX `idx_lang`(`lang`) USING BTREE COMMENT '语言类型索引', INDEX `idx_lang` (`lang`) USING BTREE COMMENT '语言类型索引',
INDEX `idx_name`(`name`) USING BTREE COMMENT '字体名称索引' INDEX `idx_name` (`name`) USING BTREE COMMENT '字体名称索引'
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '字体表' ROW_FORMAT = Dynamic; ) ENGINE = InnoDB
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_general_ci COMMENT = '字体表'
ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1; SET FOREIGN_KEY_CHECKS = 1;

View File

@ -5,8 +5,8 @@ CREATE TABLE `h5_form_submission`
ip_address bigint UNSIGNED DEFAULT NULL COMMENT '提交者IP地址', ip_address bigint UNSIGNED DEFAULT NULL COMMENT '提交者IP地址',
user_agent varchar(512) DEFAULT NULL COMMENT '用户代理信息', user_agent varchar(512) DEFAULT NULL COMMENT '用户代理信息',
form_data JSON NOT NULL COMMENT '表单数据JSON格式存储', form_data JSON NOT NULL COMMENT '表单数据JSON格式存储',
create_time bigint not null comment '创建时间戳', `create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间戳',
update_time bigint not null comment '更新时间戳', `update_time` DATETIME ON UPDATE CURRENT_TIMESTAMP NULL COMMENT '更新时间戳',
PRIMARY KEY (id), PRIMARY KEY (id),
KEY `idx_project_id` (project_id) KEY `idx_project_id` (project_id)
) ENGINE = InnoDB ) ENGINE = InnoDB

View File

@ -29,8 +29,8 @@ CREATE TABLE `h5_group`
`type` int NOT NULL COMMENT '分组类型1-物料 2-用途 3-行业', `type` int NOT NULL COMMENT '分组类型1-物料 2-用途 3-行业',
`sort` int NOT NULL DEFAULT 0 COMMENT '排序', `sort` int NOT NULL DEFAULT 0 COMMENT '排序',
`status` int NOT NULL DEFAULT 1 COMMENT '状态0-禁用 1-启用', `status` int NOT NULL DEFAULT 1 COMMENT '状态0-禁用 1-启用',
`create_time` bigint NOT NULL COMMENT '创建时间戳', `create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间戳',
`update_time` bigint NULL DEFAULT NULL COMMENT '更新时间戳', `update_time` DATETIME ON UPDATE CURRENT_TIMESTAMP NULL COMMENT '更新时间戳',
INDEX `idx_parent_id` (`parent_id`) USING BTREE, INDEX `idx_parent_id` (`parent_id`) USING BTREE,
INDEX `idx_type` (`type`) USING BTREE INDEX `idx_type` (`type`) USING BTREE
) ENGINE = InnoDB ) ENGINE = InnoDB
@ -43,34 +43,34 @@ CREATE TABLE `h5_group`
-- 插入默认分组数据 -- 插入默认分组数据
-- ---------------------------- -- ----------------------------
INSERT INTO `h5_group` INSERT INTO `h5_group`
VALUES (1, '物料', 0, 1, 1, 1, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()); VALUES (1, '物料', 0, 1, 1, 1, CURRENT_TIMESTAMP(), null);
INSERT INTO `h5_group` INSERT INTO `h5_group`
VALUES (2, '用途', 0, 2, 2, 1, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()); VALUES (2, '用途', 0, 2, 2, 1, CURRENT_TIMESTAMP(), null);
INSERT INTO `h5_group` INSERT INTO `h5_group`
VALUES (3, '行业', 0, 3, 3, 1, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()); VALUES (3, '行业', 0, 3, 3, 1, CURRENT_TIMESTAMP(), null);
-- ---------------------------- -- ----------------------------
-- 插入二级分组数据 - 物料 -- 插入二级分组数据 - 物料
-- ---------------------------- -- ----------------------------
INSERT INTO `h5_group` INSERT INTO `h5_group`
VALUES (4, '长页', 1, 1, 1, 1, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()); VALUES (4, '长页', 1, 1, 1, 1, CURRENT_TIMESTAMP(), null);
INSERT INTO `h5_group` INSERT INTO `h5_group`
VALUES (5, '翻页', 1, 1, 2, 1, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()); VALUES (5, '翻页', 1, 1, 2, 1, CURRENT_TIMESTAMP(), null);
-- ---------------------------- -- ----------------------------
-- 插入二级分组数据 - 用途 -- 插入二级分组数据 - 用途
-- ---------------------------- -- ----------------------------
INSERT INTO `h5_group` INSERT INTO `h5_group`
VALUES (6, '通用', 2, 2, 1, 1, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()); VALUES (6, '通用', 2, 2, 1, 1, CURRENT_TIMESTAMP(), null);
INSERT INTO `h5_group` INSERT INTO `h5_group`
VALUES (7, '祝福问候', 2, 2, 2, 1, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()); VALUES (7, '祝福问候', 2, 2, 2, 1, CURRENT_TIMESTAMP(), null);
-- ---------------------------- -- ----------------------------
-- 插入二级分组数据 - 行业 -- 插入二级分组数据 - 行业
-- ---------------------------- -- ----------------------------
INSERT INTO `h5_group` INSERT INTO `h5_group`
VALUES (8, '金融', 3, 3, 1, 1, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()); VALUES (8, '金融', 3, 3, 1, 1, CURRENT_TIMESTAMP(), null);
INSERT INTO `h5_group` INSERT INTO `h5_group`
VALUES (9, '医疗', 3, 3, 2, 1, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()); VALUES (9, '医疗', 3, 3, 2, 1, CURRENT_TIMESTAMP(), null);
SET FOREIGN_KEY_CHECKS = 1; SET FOREIGN_KEY_CHECKS = 1;

View File

@ -26,15 +26,16 @@ CREATE TABLE `h5_project`
`id` bigint PRIMARY KEY NOT NULL AUTO_INCREMENT COMMENT '主键ID', `id` bigint PRIMARY KEY NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`type` varchar(10) NOT NULL COMMENT '类型', `type` varchar(10) NOT NULL COMMENT '类型',
`title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '标题', `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '标题',
`content_updated_at` bigint NULL DEFAULT NULL COMMENT '内容更新时间戳', `content` json NOT NULL COMMENT '项目内容JSON格式',
`description` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '描述', `content_updated_at` bigint NULL COMMENT '内容更新时间戳',
`preview_url` varchar(500) NULL DEFAULT NULL COMMENT '预览图URL', `description` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '描述',
`preview_url_watermark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '水印预览图URL', `preview_url` varchar(500) NULL COMMENT '预览图URL',
`preview_url_watermark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '水印预览图URL',
`preview_width` int NOT NULL COMMENT '预览图宽度', `preview_width` int NOT NULL COMMENT '预览图宽度',
`preview_height` int NOT NULL COMMENT '预览图高度', `preview_height` int NOT NULL COMMENT '预览图高度',
`status` tinyint NOT NULL COMMENT '状态', `status` tinyint NOT NULL COMMENT '状态',
`create_time` bigint NOT NULL COMMENT '创建时间戳', `create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间戳',
`update_time` bigint NULL DEFAULT NULL COMMENT '更新时间戳' `update_time` DATETIME ON UPDATE CURRENT_TIMESTAMP NULL COMMENT '更新时间戳'
) ENGINE = InnoDB ) ENGINE = InnoDB
AUTO_INCREMENT = 1 AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4 CHARACTER SET = utf8mb4

View File

@ -26,7 +26,7 @@ CREATE TABLE `h5_project_group`
`id` bigint PRIMARY KEY AUTO_INCREMENT COMMENT '主键ID', `id` bigint PRIMARY KEY AUTO_INCREMENT COMMENT '主键ID',
`project_id` bigint NOT NULL COMMENT '项目ID', `project_id` bigint NOT NULL COMMENT '项目ID',
`group_id` bigint NOT NULL COMMENT '分组ID', `group_id` bigint NOT NULL COMMENT '分组ID',
`create_time` bigint NOT NULL COMMENT '创建时间戳', `create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间戳',
INDEX `idx_project_id` (`project_id`) USING BTREE, INDEX `idx_project_id` (`project_id`) USING BTREE,
INDEX `idx_group_id` (`group_id`) USING BTREE INDEX `idx_group_id` (`group_id`) USING BTREE
) ENGINE = InnoDB ) ENGINE = InnoDB

View File

@ -11,13 +11,11 @@ Content-Type: application/json
"url": "https://st0.dancf.com/csc/49/fonts/0/20200809-105104-c105.svg", "url": "https://st0.dancf.com/csc/49/fonts/0/20200809-105104-c105.svg",
"width": 490, "width": 490,
"height": 80, "height": 80,
"partial_video": "", "partialVideo": "",
"video": "", "video": "",
"hex": "", "hex": "",
"duration": 0 "duration": 0
}, },
"price": null,
"items": [],
"content": { "content": {
"family": "Open Sans", "family": "Open Sans",
"alias": "Open Sans Bold", "alias": "Open Sans Bold",
@ -26,13 +24,13 @@ Content-Type: application/json
"woff": "https://gd-filems.dancf.com/gaoding/editor/20240116-211715-jaeea.woff", "woff": "https://gd-filems.dancf.com/gaoding/editor/20240116-211715-jaeea.woff",
"ttf": "https://gd-filems.dancf.com/gaoding/editor/20240116-211715-kiige.ttf", "ttf": "https://gd-filems.dancf.com/gaoding/editor/20240116-211715-kiige.ttf",
"lang": "en", "lang": "en",
"origin_file": { "originFile": {
"size": 104120, "size": 104120,
"url": "https://st0.dancf.com/csc/49/fonts/0/20200809-105059-cc06.ttf" "url": "https://st0.dancf.com/csc/49/fonts/0/20200809-105059-cc06.ttf"
}, },
"woff_size": 56092, "woffSize": 56092,
"ttf_size": 92500, "ttfSize": 92500,
"meta_data": { "metaData": {
"ascent": 2189, "ascent": 2189,
"descent": -600, "descent": -600,
"emSize": 2048, "emSize": 2048,
@ -51,13 +49,11 @@ Content-Type: application/json
"xheight": 1118 "xheight": 1118
} }
}, },
"content_id": null,
"content_url": "https://gd-filems.dancf.com/xi19e5/xi19e5/0/32d51454-451e-4b80-a8b2-138fa5d185e750.json?auth_key=1763092800-10a7b6d1071b4787b7225660db3f71a1-0-8c6b2cbd6b9aae7a0943fd4190e16094",
"lang": "en", "lang": "en",
"alias": "Open Sans Bold", "alias": "Open Sans Bold",
"authorization_id": 26, "authorizationId": 26,
"user_over_role": 0, "userOverRole": 0,
"sale_type": 0, "saleType": 0,
"createTime": 1602230400, "createTime": 1602230400,
"updateTime": 1602230400 "updateTime": 1602230400
} }

View File

@ -83,12 +83,6 @@
<groupId>org.apache.dubbo</groupId> <groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-nacos-spring-boot-starter</artifactId> <artifactId>dubbo-nacos-spring-boot-starter</artifactId>
</dependency> </dependency>
<!--mongodb 支持-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -2,7 +2,7 @@ package com.luban.api.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.luban.api.entity.Font; import com.luban.api.entity.Font;
import com.luban.api.mongo.entity.FontContent; import com.luban.api.dto.FontDTO;
import com.luban.api.service.FontService; import com.luban.api.service.FontService;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
@ -24,8 +24,8 @@ public class FontController {
@Operation(summary = "批量上传字体") @Operation(summary = "批量上传字体")
@PostMapping("create") @PostMapping("create")
public Boolean create(@RequestBody List<FontContent> fontContents) { public Boolean create(@RequestBody List<FontDTO> fontDTOS) {
return fontService.batchSaveFonts(fontContents); return fontService.batchSaveFonts(fontDTOS);
} }
@Operation(summary = "分页查询字体") @Operation(summary = "分页查询字体")
@ -39,8 +39,8 @@ public class FontController {
@Operation(summary = "根据字体族名称列表查询字体") @Operation(summary = "根据字体族名称列表查询字体")
@PostMapping("list") @PostMapping("list")
public List<FontContent> list(@RequestBody List<String> fontFamilyNames) { public List<String> list(@RequestBody List<String> names) {
List<FontContent> fontContents = fontService.listFontsByFamilyNames(fontFamilyNames); List<String> fontContents = fontService.listFontsByNames(names);
if (fontContents == null) { if (fontContents == null) {
return new ArrayList<>(); return new ArrayList<>();
} }
@ -49,7 +49,7 @@ public class FontController {
@Operation(summary = "根据ID获取字体详情") @Operation(summary = "根据ID获取字体详情")
@GetMapping("/{id}") @GetMapping("/{id}")
public FontContent getFontById(@PathVariable Long id) { public String getFontById(@PathVariable Long id) {
return fontService.getFontDetail(id); return fontService.getFontDetail(id);
} }
} }

View File

@ -90,9 +90,6 @@ public class H5GroupController {
@Operation(summary = "创建H5分组") @Operation(summary = "创建H5分组")
@PostMapping @PostMapping
public boolean createH5Group(@RequestBody H5Group h5Group) { public boolean createH5Group(@RequestBody H5Group h5Group) {
long currentTime = System.currentTimeMillis();
h5Group.setCreateTime(currentTime);
h5Group.setUpdateTime(currentTime);
return h5GroupService.save(h5Group); return h5GroupService.save(h5Group);
} }
@ -107,7 +104,6 @@ public class H5GroupController {
@PutMapping("/{id}") @PutMapping("/{id}")
public boolean updateH5Group(@PathVariable Long id, @RequestBody H5Group h5Group) { public boolean updateH5Group(@PathVariable Long id, @RequestBody H5Group h5Group) {
h5Group.setId(id); h5Group.setId(id);
h5Group.setUpdateTime(System.currentTimeMillis());
return h5GroupService.updateById(h5Group); return h5GroupService.updateById(h5Group);
} }

View File

@ -3,7 +3,7 @@ package com.luban.api.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.luban.api.entity.H5Project; import com.luban.api.entity.H5Project;
import com.luban.api.mongo.entity.H5ProjectContent; import com.luban.api.dto.H5ProjectContentDTO;
import com.luban.api.service.H5ProjectService; import com.luban.api.service.H5ProjectService;
import com.luban.api.vo.H5ProjectDetailVO; import com.luban.api.vo.H5ProjectDetailVO;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
@ -72,16 +72,9 @@ public class H5ProjectController {
H5ProjectDetailVO detailVO = new H5ProjectDetailVO(); H5ProjectDetailVO detailVO = new H5ProjectDetailVO();
detailVO.setProject(h5Project); detailVO.setProject(h5Project);
// 获取项目内容
if (h5Project != null) {
H5ProjectContent content = h5ProjectService.getProjectContent(h5Project.getId());
detailVO.setContent(content);
}
// 获取项目关联的分组ID列表 // 获取项目关联的分组ID列表
List<Long> groupIds = h5ProjectService.getProjectGroupIds(id); List<Long> groupIds = h5ProjectService.getProjectGroupIds(id);
detailVO.setGroupIds(groupIds); detailVO.setGroupIds(groupIds);
return detailVO; return detailVO;
} }
@ -161,7 +154,7 @@ public class H5ProjectController {
public static class CreateH5ProjectRequest { public static class CreateH5ProjectRequest {
private String type; private String type;
private String title; private String title;
private H5ProjectContent content; private H5ProjectContentDTO content;
private Long contentUpdatedAt; private Long contentUpdatedAt;
private String description; private String description;
private String previewUrl; private String previewUrl;

View File

@ -1,11 +1,10 @@
package com.luban.api.mongo.entity; package com.luban.api.dto;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.luban.api.util.TimestampToLocalDateTimeDeserializer;
import lombok.Data; import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import java.util.List; import java.time.LocalDateTime;
import java.util.Map;
/** /**
* 字体内容实体类 (存储在MongoDB中) * 字体内容实体类 (存储在MongoDB中)
@ -13,17 +12,14 @@ import java.util.Map;
* @author your-name * @author your-name
*/ */
@Data @Data
@Document(collection = "h5_font_content") public class FontDTO {
public class FontContent {
/** /**
* 主键ID与MySQL中Font的ID对应 * 主键ID
*/ */
@Id
private Long id; private Long id;
/** /**
* 字体来源ID * 字体来源
*/ */
private String sourceId; private String sourceId;
@ -33,69 +29,36 @@ public class FontContent {
private String name; private String name;
/** /**
* 预览信息 * 预览JSON格式
*/ */
private Preview preview; private Preview preview;
/** /**
* 价格 * 字体语言类型zh-中文en-英文
*/
private Object price;
/**
* 项目列表
*/
private List<Object> items;
/**
* 字体内容详情
*/
private Content content;
/**
* 内容ID
*/
private Object contentId;
/**
* 内容URL
*/
private String contentUrl;
/**
* 语言
*/ */
private String lang; private String lang;
/** /**
* 别名 * 字体别名
*/ */
private String alias; private String alias;
/** /**
* 授权ID * 字体内容JSON格式
*/ */
private Long authorizationId; private Content content;
/**
* 用户角色
*/
private Integer userOverRole;
/**
* 销售类型
*/
private Integer saleType;
/** /**
* 创建时间戳 * 创建时间戳
*/ */
private Long createTime; @JsonDeserialize(using = TimestampToLocalDateTimeDeserializer.class)
private LocalDateTime createTime;
/** /**
* 更新时间戳 * 更新时间戳
*/ */
private Long updateTime; @JsonDeserialize(using = TimestampToLocalDateTimeDeserializer.class)
private LocalDateTime updateTime;
/** /**
* 预览信息类 * 预览信息类

View File

@ -2,6 +2,8 @@ package com.luban.api.dto;
import lombok.Data; import lombok.Data;
import java.time.LocalDateTime;
/** /**
* 表单数据传输对象 * 表单数据传输对象
* *
@ -38,10 +40,10 @@ public class H5FormSubmissionDTO {
/** /**
* 创建时间戳 * 创建时间戳
*/ */
private Long createTime; private LocalDateTime createTime;
/** /**
* 更新时间戳 * 更新时间戳
*/ */
private Long updateTime; private LocalDateTime updateTime;
} }

View File

@ -1,14 +1,15 @@
package com.luban.api.mongo.entity; package com.luban.api.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.luban.api.util.TimestampToLocalDateTimeDeserializer;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.Getter; import lombok.Getter;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -18,13 +19,11 @@ import java.util.Map;
* @author your-name * @author your-name
*/ */
@Data @Data
@Document(collection = "h5_project_content") public class H5ProjectContentDTO {
public class H5ProjectContent {
/** /**
* 主键ID与MySQL中H5Project的ID对应 * 主键ID与MySQL中H5Project的ID对应
*/ */
@Id
private Long id; private Long id;
/** /**
@ -50,12 +49,14 @@ public class H5ProjectContent {
/** /**
* 创建时间戳 * 创建时间戳
*/ */
private Long createTime; @JsonDeserialize(using = TimestampToLocalDateTimeDeserializer.class)
private LocalDateTime createTime;
/** /**
* 更新时间戳 * 更新时间戳
*/ */
private Long updateTime; @JsonDeserialize(using = TimestampToLocalDateTimeDeserializer.class)
private LocalDateTime updateTime;
/** /**
* 全局配置类 * 全局配置类

View File

@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime;
/** /**
* 字体实体类 * 字体实体类
@ -31,7 +32,7 @@ public class Font implements Serializable {
/** /**
* 字体来源 * 字体来源
*/ */
private String source; private String sourceId;
/** /**
* 字体名称 * 字体名称
@ -39,9 +40,9 @@ public class Font implements Serializable {
private String name; private String name;
/** /**
* 字体族名称唯一标识 * 预览JSON格式
*/ */
private String fontFamily; private String preview;
/** /**
* 字体语言类型zh-中文en-英文 * 字体语言类型zh-中文en-英文
@ -54,27 +55,17 @@ public class Font implements Serializable {
private String alias; private String alias;
/** /**
* 授权ID * 字体内容JSON格式
*/ */
private Long authorizationId; private String content;
/**
* 用户角色
*/
private Integer userOverRole;
/**
* 销售类型
*/
private Integer saleType;
/** /**
* 创建时间戳 * 创建时间戳
*/ */
private Long createTime; private LocalDateTime createTime;
/** /**
* 更新时间戳 * 更新时间戳
*/ */
private Long updateTime; private LocalDateTime updateTime;
} }

View File

@ -8,6 +8,7 @@ import lombok.experimental.Accessors;
import java.io.Serial; import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime;
/** /**
* 表单提交记录实体类 * 表单提交记录实体类
@ -58,11 +59,11 @@ public class FormSubmission implements Serializable {
* 创建时间戳 * 创建时间戳
*/ */
@TableField("create_time") @TableField("create_time")
private Long createTime; private LocalDateTime createTime;
/** /**
* 更新时间戳 * 更新时间戳
*/ */
@TableField("update_time") @TableField("update_time")
private Long updateTime; private LocalDateTime updateTime;
} }

View File

@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime;
/** /**
* H5分组实体类 * H5分组实体类
@ -56,11 +57,11 @@ public class H5Group implements Serializable {
/** /**
* 创建时间戳 * 创建时间戳
*/ */
private Long createTime; private LocalDateTime createTime;
/** /**
* 更新时间戳 * 更新时间戳
*/ */
private Long updateTime; private LocalDateTime updateTime;
} }

View File

@ -9,6 +9,7 @@ import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime;
/** /**
* H5项目实体类 * H5项目实体类
@ -40,6 +41,10 @@ public class H5Project implements Serializable {
*/ */
private String title; private String title;
/**
* 项目内容JSON格式
*/
private String content;
/** /**
* 内容更新时间戳 * 内容更新时间戳
@ -79,11 +84,11 @@ public class H5Project implements Serializable {
/** /**
* 创建时间戳 * 创建时间戳
*/ */
private Long createTime; private LocalDateTime createTime;
/** /**
* 更新时间戳 * 更新时间戳
*/ */
private Long updateTime; private LocalDateTime updateTime;
} }

View File

@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime;
/** /**
* H5项目与分组关联实体类 * H5项目与分组关联实体类
@ -41,6 +42,6 @@ public class H5ProjectGroup implements Serializable {
/** /**
* 创建时间戳 * 创建时间戳
*/ */
private Long createTime; private LocalDateTime createTime;
} }

View File

@ -1,12 +0,0 @@
package com.luban.api.mongo.dao;
import com.luban.api.mongo.entity.FontContent;
import org.springframework.data.mongodb.repository.MongoRepository;
/**
* 字体内容 Repository
*
* @author your-name
*/
public interface FontContentRepository extends MongoRepository<FontContent, Long> {
}

View File

@ -1,12 +0,0 @@
package com.luban.api.mongo.dao;
import com.luban.api.mongo.entity.H5ProjectContent;
import org.springframework.data.mongodb.repository.MongoRepository;
/**
* H5项目内容 Repository
*
* @author your-name
*/
public interface H5ProjectContentRepository extends MongoRepository<H5ProjectContent, Long> {
}

View File

@ -3,7 +3,8 @@ package com.luban.api.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.luban.api.entity.Font; import com.luban.api.entity.Font;
import com.luban.api.mongo.entity.FontContent; import com.luban.api.dto.FontDTO;
// Removed MongoDB import
import java.util.List; import java.util.List;
@ -19,10 +20,10 @@ public interface FontService extends IService<Font> {
/** /**
* 批量上传字体 * 批量上传字体
* *
* @param fontContents 字体内容列表 * @param fontJsonList 字体内容列表JSON字符串
* @return 是否保存成功 * @return 是否保存成功
*/ */
boolean batchSaveFonts(List<FontContent> fontContents); boolean batchSaveFonts(List<FontDTO> fontJsonList);
/** /**
* 分页查询字体 * 分页查询字体
@ -38,10 +39,10 @@ public interface FontService extends IService<Font> {
/** /**
* 根据字体族名称批量查询字体 * 根据字体族名称批量查询字体
* *
* @param fontFamilyList 字体族名称列表 * @param fontNameList 字体族名称列表
* @return 字体列表 * @return 字体列表
*/ */
List<FontContent> listFontsByFamilyNames(List<String> fontFamilyList); List<String> listFontsByNames(List<String> fontNameList);
/** /**
* 根据ID获取字体详情 * 根据ID获取字体详情
@ -49,5 +50,5 @@ public interface FontService extends IService<Font> {
* @param id 字体ID * @param id 字体ID
* @return 字体详情 * @return 字体详情
*/ */
FontContent getFontDetail(Long id); String getFontDetail(Long id);
} }

View File

@ -2,7 +2,7 @@ package com.luban.api.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.luban.api.entity.H5Project; import com.luban.api.entity.H5Project;
import com.luban.api.mongo.entity.H5ProjectContent; import com.luban.api.dto.H5ProjectContentDTO;
import java.util.List; import java.util.List;
@ -23,7 +23,7 @@ public interface H5ProjectService extends IService<H5Project> {
* @param groupIds 分组ID列表 * @param groupIds 分组ID列表
* @return 是否保存成功 * @return 是否保存成功
*/ */
boolean saveH5ProjectWithContent(H5Project h5Project, H5ProjectContent content, List<Long> groupIds); boolean saveH5ProjectWithContent(H5Project h5Project, H5ProjectContentDTO content, List<Long> groupIds);
/** /**
* 更新H5项目及其内容 * 更新H5项目及其内容
@ -33,7 +33,7 @@ public interface H5ProjectService extends IService<H5Project> {
* @param groupIds 分组ID列表 * @param groupIds 分组ID列表
* @return 是否更新成功 * @return 是否更新成功
*/ */
boolean updateH5ProjectWithContent(H5Project h5Project, H5ProjectContent content, List<Long> groupIds); boolean updateH5ProjectWithContent(H5Project h5Project, H5ProjectContentDTO content, List<Long> groupIds);
/** /**
* 根据ID获取H5项目及其内容 * 根据ID获取H5项目及其内容
@ -62,8 +62,8 @@ public interface H5ProjectService extends IService<H5Project> {
/** /**
* 获取项目内容 * 获取项目内容
* *
* @param contentId 内容ID * @param projectId 项目ID
* @return 项目内容 * @return 项目内容
*/ */
H5ProjectContent getProjectContent(Long contentId); String getProjectContent(Long projectId);
} }

View File

@ -1,21 +1,21 @@
package com.luban.api.service.impl; package com.luban.api.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.luban.api.dao.FontDao; import com.luban.api.dao.FontDao;
import com.luban.api.entity.Font; import com.luban.api.entity.Font;
import com.luban.api.mongo.dao.FontContentRepository; // Removed MongoDB imports
import com.luban.api.mongo.entity.FontContent; import com.luban.api.dto.FontDTO;
import com.luban.api.service.FontService; import com.luban.api.service.FontService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -29,43 +29,25 @@ import java.util.stream.Collectors;
@Service @Service
public class FontServiceImpl extends ServiceImpl<FontDao, Font> implements FontService { public class FontServiceImpl extends ServiceImpl<FontDao, Font> implements FontService {
@Autowired
private FontContentRepository fontContentRepository;
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean batchSaveFonts(List<FontContent> fontContents) { public boolean batchSaveFonts(List<FontDTO> fontDTOS) {
if (CollectionUtils.isEmpty(fontContents)) { if (CollectionUtils.isEmpty(fontDTOS)) {
return false; return false;
} }
List<Font> fonts = fontDTOS.stream().map(dto -> {
// 获取当前时间戳
long currentTime = System.currentTimeMillis();
for (FontContent fontContent : fontContents) {
// 保存到MongoDB
fontContent.setCreateTime(currentTime);
fontContent.setUpdateTime(currentTime);
fontContentRepository.save(fontContent);
// 保存基本信息到MySQL
Font font = new Font(); Font font = new Font();
font.setId(fontContent.getId()); BeanUtil.copyProperties(dto, font);
font.setSource(fontContent.getSourceId());
font.setName(fontContent.getName());
font.setFontFamily(fontContent.getContent().getFamily());
font.setLang(fontContent.getContent().getLang());
font.setAlias(fontContent.getContent().getAlias());
font.setAuthorizationId(fontContent.getAuthorizationId());
font.setUserOverRole(fontContent.getUserOverRole());
font.setSaleType(fontContent.getSaleType());
font.setCreateTime(currentTime);
font.setUpdateTime(currentTime);
// 使用insertOrUpdate避免重复插入 if (dto.getPreview() != null) {
this.saveOrUpdate(font); font.setPreview(JSONUtil.toJsonStr(dto.getPreview()));
} }
if (dto.getContent() != null ) {
return true; font.setContent(JSONUtil.toJsonStr(dto.getContent()));
}
return font;
}).collect(Collectors.toList());
return this.saveOrUpdateBatch(fonts);
} }
@Override @Override
@ -89,33 +71,29 @@ public class FontServiceImpl extends ServiceImpl<FontDao, Font> implements FontS
} }
@Override @Override
public List<FontContent> listFontsByFamilyNames(List<String> fontFamilyList) { public List<String> listFontsByNames(List<String> fontNameList) {
if (CollectionUtils.isEmpty(fontFamilyList)) { if (CollectionUtils.isEmpty(fontNameList)) {
return null; return null;
} }
// 先从MySQL查询ID列表 // 从MySQL查询字体内容
List<Font> fonts = this.list(new LambdaQueryWrapper<Font>() List<Font> fonts = this.list(new LambdaQueryWrapper<Font>()
.in(Font::getFontFamily, fontFamilyList)); .in(Font::getName, fontNameList)
.isNotNull(Font::getContent));
if (CollectionUtils.isEmpty(fonts)) { if (CollectionUtils.isEmpty(fonts)) {
return null; return null;
} }
// 根据ID列表从MongoDB查询详细信息 // 提取JSON内容
List<FontContent> fontContents = new ArrayList<>(); return fonts.stream()
for (Font font : fonts) { .map(Font::getContent)
FontContent fontContent = fontContentRepository.findById(font.getId()).orElse(null); .collect(Collectors.toList());
if (fontContent != null) {
fontContents.add(fontContent);
}
}
return fontContents;
} }
@Override @Override
public FontContent getFontDetail(Long id) { public String getFontDetail(Long id) {
return fontContentRepository.findById(id).orElse(null); Font font = this.getById(id);
return font != null ? font.getContent() : null;
} }
} }

View File

@ -33,13 +33,8 @@ public class FormServiceImpl extends ServiceImpl<FormSubmissionDao, FormSubmissi
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean submitFormData(H5FormSubmissionDTO dto) { public boolean submitFormData(H5FormSubmissionDTO dto) {
// 转换DTO为实体并保存到MySQL
FormSubmission entity = FormSubmissionConvert.toEntity(dto); FormSubmission entity = FormSubmissionConvert.toEntity(dto);
// 设置创建和更新时间
long currentTime = System.currentTimeMillis();
entity.setId(null); entity.setId(null);
entity.setCreateTime(currentTime);
entity.setUpdateTime(currentTime);
return this.save(entity); return this.save(entity);
} }

View File

@ -1,12 +1,12 @@
package com.luban.api.service.impl; package com.luban.api.service.impl;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.luban.api.dao.H5ProjectDao; import com.luban.api.dao.H5ProjectDao;
import com.luban.api.dao.H5ProjectGroupDao; import com.luban.api.dao.H5ProjectGroupDao;
import com.luban.api.entity.H5Project; import com.luban.api.entity.H5Project;
import com.luban.api.entity.H5ProjectGroup; import com.luban.api.entity.H5ProjectGroup;
import com.luban.api.mongo.dao.H5ProjectContentRepository; import com.luban.api.dto.H5ProjectContentDTO;
import com.luban.api.mongo.entity.H5ProjectContent;
import com.luban.api.service.H5ProjectService; import com.luban.api.service.H5ProjectService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -25,35 +25,21 @@ import java.util.stream.Collectors;
@Service @Service
public class H5ProjectServiceImpl extends ServiceImpl<H5ProjectDao, H5Project> implements H5ProjectService { public class H5ProjectServiceImpl extends ServiceImpl<H5ProjectDao, H5Project> implements H5ProjectService {
@Autowired
private H5ProjectContentRepository h5ProjectContentRepository;
@Autowired @Autowired
private H5ProjectGroupDao h5ProjectGroupDao; private H5ProjectGroupDao h5ProjectGroupDao;
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean saveH5ProjectWithContent(H5Project h5Project, H5ProjectContent content, List<Long> groupIds) { public boolean saveH5ProjectWithContent(H5Project h5Project, H5ProjectContentDTO content, List<Long> groupIds) {
// 设置创建和更新时间戳 // 设置创建和更新时间戳
long currentTime = System.currentTimeMillis(); h5Project.setContent(JSONUtil.toJsonStr(content));
h5Project.setCreateTime(currentTime);
h5Project.setUpdateTime(currentTime);
// 保存H5Project基本信息到MySQL // 保存H5Project基本信息到MySQL
boolean saved = this.save(h5Project); boolean saved = this.save(h5Project);
if (saved && content != null) {
// 保存H5ProjectContent到MongoDB
content.setId(h5Project.getId());
content.setCreateTime(currentTime);
content.setUpdateTime(currentTime);
h5ProjectContentRepository.save(content);
}
// 保存项目与分组的关联关系 // 保存项目与分组的关联关系
if (saved && groupIds != null && !groupIds.isEmpty()) { if (saved && groupIds != null && !groupIds.isEmpty()) {
saveProjectGroups(h5Project.getId(), groupIds, currentTime); saveProjectGroups(h5Project.getId(), groupIds);
} }
return saved; return saved;
@ -61,29 +47,20 @@ public class H5ProjectServiceImpl extends ServiceImpl<H5ProjectDao, H5Project> i
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean updateH5ProjectWithContent(H5Project h5Project, H5ProjectContent content, List<Long> groupIds) { public boolean updateH5ProjectWithContent(H5Project h5Project, H5ProjectContentDTO content, List<Long> groupIds) {
// 设置更新时间戳 // 设置更新时间戳
long currentTime = System.currentTimeMillis(); h5Project.setContent(JSONUtil.toJsonStr(content));
h5Project.setUpdateTime(currentTime);
// 更新H5Project基本信息到MySQL // 更新H5Project基本信息到MySQL
boolean updated = this.updateById(h5Project); boolean updated = this.updateById(h5Project);
if (updated && content != null) {
// 更新或创建H5ProjectContent到MongoDB
content.setId(h5Project.getId());
content.setUpdateTime(currentTime);
h5ProjectContentRepository.save(content);
}
// 更新项目与分组的关联关系 // 更新项目与分组的关联关系
if (updated && groupIds != null) { if (updated && groupIds != null) {
h5ProjectGroupDao.delete(new com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<H5ProjectGroup>() h5ProjectGroupDao.delete(new com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<H5ProjectGroup>()
.eq(H5ProjectGroup::getProjectId, h5Project.getId())); .eq(H5ProjectGroup::getProjectId, h5Project.getId()));
if (!groupIds.isEmpty()) { if (!groupIds.isEmpty()) {
saveProjectGroups(h5Project.getId(), groupIds, currentTime); saveProjectGroups(h5Project.getId(), groupIds);
} }
} }
@ -92,22 +69,14 @@ public class H5ProjectServiceImpl extends ServiceImpl<H5ProjectDao, H5Project> i
@Override @Override
public H5Project getH5ProjectWithContent(Long id) { public H5Project getH5ProjectWithContent(Long id) {
// 获取MySQL中的H5Project基本信息 return this.getById(id);
H5Project h5Project = this.getById(id);
if (h5Project != null) {
// 获取MongoDB中的内容
H5ProjectContent h5ProjectContent = h5ProjectContentRepository.findById(id).orElse(null);
// 可以在这里将content设置到h5Project的某个属性中如果需要的话
}
return h5Project;
} }
@Override @Override
public H5ProjectContent getProjectContent(Long contentId) { public String getProjectContent(Long projectId) {
if (contentId != null) { if (projectId != null) {
return h5ProjectContentRepository.findById(contentId).orElse(null); H5Project project = this.getById(projectId);
return project != null ? project.getContent() : null;
} }
return null; return null;
} }
@ -117,14 +86,9 @@ public class H5ProjectServiceImpl extends ServiceImpl<H5ProjectDao, H5Project> i
public boolean removeH5ProjectWithContent(Long id) { public boolean removeH5ProjectWithContent(Long id) {
H5Project h5Project = this.getById(id); H5Project h5Project = this.getById(id);
if (h5Project != null) { if (h5Project != null) {
// 先删除MongoDB中的内容
h5ProjectContentRepository.deleteById(id);
// 删除项目与分组的关联关系
h5ProjectGroupDao.delete(new com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<H5ProjectGroup>() h5ProjectGroupDao.delete(new com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<H5ProjectGroup>()
.eq(H5ProjectGroup::getProjectId, id)); .eq(H5ProjectGroup::getProjectId, id));
// 再删除MySQL中的记录
return this.removeById(id); return this.removeById(id);
} }
return false; return false;
@ -135,14 +99,12 @@ public class H5ProjectServiceImpl extends ServiceImpl<H5ProjectDao, H5Project> i
* *
* @param projectId 项目ID * @param projectId 项目ID
* @param groupIds 分组ID列表 * @param groupIds 分组ID列表
* @param currentTime 当前时间戳
*/ */
private void saveProjectGroups(Long projectId, List<Long> groupIds, long currentTime) { private void saveProjectGroups(Long projectId, List<Long> groupIds) {
for (Long groupId : groupIds) { for (Long groupId : groupIds) {
H5ProjectGroup projectGroup = new H5ProjectGroup(); H5ProjectGroup projectGroup = new H5ProjectGroup();
projectGroup.setProjectId(projectId); projectGroup.setProjectId(projectId);
projectGroup.setGroupId(groupId); projectGroup.setGroupId(groupId);
projectGroup.setCreateTime(currentTime);
h5ProjectGroupDao.insert(projectGroup); h5ProjectGroupDao.insert(projectGroup);
} }
} }

View File

@ -0,0 +1,26 @@
package com.luban.api.util;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import java.io.IOException;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
public class TimestampToLocalDateTimeDeserializer extends JsonDeserializer<LocalDateTime> {
@Override
public LocalDateTime deserialize(JsonParser p, DeserializationContext deserializationContext) throws IOException, JacksonException {
long timestamp = p.getValueAsLong();
// 处理秒级时间戳
if (timestamp < 10000000000L) {
return LocalDateTime.ofInstant(Instant.ofEpochSecond(timestamp), ZoneId.systemDefault());
} else {
// 处理毫秒级时间戳
return LocalDateTime.ofInstant(Instant.ofEpochMilli(timestamp), ZoneId.systemDefault());
}
}
}

View File

@ -1,7 +1,6 @@
package com.luban.api.vo; package com.luban.api.vo;
import com.luban.api.entity.H5Project; import com.luban.api.entity.H5Project;
import com.luban.api.mongo.entity.H5ProjectContent;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@ -24,12 +23,6 @@ public class H5ProjectDetailVO {
@Schema(title = "项目基本信息") @Schema(title = "项目基本信息")
private H5Project project; private H5Project project;
/**
* 项目内容
*/
@Schema(title = "项目内容")
private H5ProjectContent content;
/** /**
* 项目关联的分组ID列表 * 项目关联的分组ID列表
*/ */

View File

@ -5,6 +5,8 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.time.LocalDateTime;
/** /**
* H5项目视图对象 * H5项目视图对象
* *
@ -84,11 +86,11 @@ public class H5ProjectVO {
/** /**
* 创建时间戳 * 创建时间戳
*/ */
private Long createTime; private LocalDateTime createTime;
/** /**
* 更新时间戳 * 更新时间戳
*/ */
private Long updateTime; private LocalDateTime updateTime;
} }

View File

@ -73,10 +73,6 @@ spring:
max-idle: 10 max-idle: 10
# 连接池中的最小空闲连接 # 连接池中的最小空闲连接
min-idle: 0 min-idle: 0
mongodb:
database: h5
host: 127.0.0.1
port: 27017
springdoc: springdoc:
api-docs: api-docs: