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; }