From e944b967d16c5ee7049dde8cca0ec266ad449815 Mon Sep 17 00:00:00 2001 From: aaron Date: Mon, 11 Dec 2023 23:37:33 +0800 Subject: [PATCH 1/2] fix --- .../officialsite/common/enums/CodeEnums.java | 2 +- .../sharing/model/db/TbShare.java | 29 ++++++++++++++----- src/main/resources/application.yml | 4 +-- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/dl/officialsite/common/enums/CodeEnums.java b/src/main/java/com/dl/officialsite/common/enums/CodeEnums.java index 1c868b57..3c410dd8 100644 --- a/src/main/java/com/dl/officialsite/common/enums/CodeEnums.java +++ b/src/main/java/com/dl/officialsite/common/enums/CodeEnums.java @@ -22,7 +22,7 @@ public enum CodeEnums { MEMBER_ALREADY_REQUEST_TEAM("1007", "member already request team"), NOT_FOUND_JD("1008", "not found jd"), - NOT_FOUND_MEMBER("1008", "not found user"); + NOT_FOUND_MEMBER("1008", "not found user"), //Sharing SHARING_NOT_FOUND("5001", "Sharing not found"), SHARING_NOT_OWNER("5002", "You are no sharing user"), diff --git a/src/main/java/com/dl/officialsite/sharing/model/db/TbShare.java b/src/main/java/com/dl/officialsite/sharing/model/db/TbShare.java index 25e2cf34..a3bd7565 100644 --- a/src/main/java/com/dl/officialsite/sharing/model/db/TbShare.java +++ b/src/main/java/com/dl/officialsite/sharing/model/db/TbShare.java @@ -1,5 +1,7 @@ package com.dl.officialsite.sharing.model.db; +import com.dl.officialsite.sharing.constant.SharingLockStatus; +import com.dl.officialsite.sharing.constant.SharingMeetingType; import lombok.Data; import javax.persistence.*; @@ -7,9 +9,9 @@ @Data @Entity @Table(name = "tb_share", - uniqueConstraints={@UniqueConstraint(columnNames={"theme"})}, indexes= { - @Index(columnList="member_address") + @Index(name = "IDX_THEME",unique = true, columnList = "theme"), + @Index(name = "IDX_MEMBER_ADDRESS", columnList="member_address") }) public class TbShare { @@ -23,64 +25,75 @@ public class TbShare { /** * 分享主题 */ + @Column(name = "theme", nullable = false) private String theme; /** * 分享日期,2020-12-02 */ + @Column(name = "date", nullable = false) private String date; /** * 分享时间 20:00(UTC+8) */ + @Column(name = "time", nullable = false) private String time; /** * 分享语言 */ - private int language; // 0 Chinese 1 English + @Column(name = "language", nullable = false) + private int language = 0; // 0 Chinese 1 English /** * 分享人昵称 */ + @Column(name = "presenter",nullable = false) private String presenter; /** * 分享所属组织 */ + @Column(name = "org",nullable = true) private String org; /** * 分享人twitter */ + @Column(name = "twitter",nullable = true) private String twitter; /** * 分享人 */ - @Column(name = "member_address") + @Column(name = "member_address",length = 40, nullable = false) private String memberAddress; /** * 文档连接 */ - @Column(name = "sharing_doc") + @Column(name = "sharing_doc", nullable = true) private String sharingDoc; /** * 标签类别 */ + @Column(name = "label", nullable = true) private String label; /** * 锁定状态 */ - @Column(name = "lock_status") - private int lockStatus; + @Column(name = "lock_status", nullable = false) + private int lockStatus = SharingLockStatus.UNLOCKED.getCode(); - private int meetingType; + @Column(name = "meeting_type", nullable = false) + private int meetingType = SharingMeetingType.TENCENT.getCode(); + @Column(name = "meeting_id", nullable = true) private String meetingId; + @Column(name = "meeting_link", nullable = true) private String meetingLink; } diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 2f2b2c01..dc73fecf 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -10,8 +10,8 @@ spring: url: jdbc:mysql://127.0.0.1:3306/dl?allowPublicKeyRetrieval=true&useSSL=false #type: com.alibaba.druid.pool.DruidDataSource username: root -# password: 12345678 - password: {{SPRING_DATASOURCE_PASSWORD}} + password: 12345678 +# password: {{SPRING_DATASOURCE_PASSWORD}} maximum-pool-size: 20 jpa: From 20fad325444b868bedb1767e408446a8c76cd1f4 Mon Sep 17 00:00:00 2001 From: aaron Date: Mon, 11 Dec 2023 23:38:52 +0800 Subject: [PATCH 2/2] fix --- src/main/resources/application.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index dc73fecf..2f2b2c01 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -10,8 +10,8 @@ spring: url: jdbc:mysql://127.0.0.1:3306/dl?allowPublicKeyRetrieval=true&useSSL=false #type: com.alibaba.druid.pool.DruidDataSource username: root - password: 12345678 -# password: {{SPRING_DATASOURCE_PASSWORD}} +# password: 12345678 + password: {{SPRING_DATASOURCE_PASSWORD}} maximum-pool-size: 20 jpa: