Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
T
tanpu-community
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
探普后端
tanpu-community
Commits
1ec475f3
Commit
1ec475f3
authored
Aug 06, 2021
by
张辰
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into 'master'
Dev See merge request
!4
parents
bcfbd8dc
4e7816dd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
95 deletions
+70
-95
ThemeManager.java
...c/main/java/com/tanpu/community/manager/ThemeManager.java
+9
-3
create.sql
docs/create.sql
+61
-92
No files found.
community-service/src/main/java/com/tanpu/community/manager/ThemeManager.java
View file @
1ec475f3
...
...
@@ -52,6 +52,7 @@ import org.springframework.transaction.annotation.Transactional;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.HashSet
;
...
...
@@ -160,6 +161,8 @@ public class ThemeManager {
if
(
CollectionUtils
.
isEmpty
(
req
.
getContent
()))
{
throw
new
BizException
(
"正文内容不能为空"
);
}
//校验参数
checkAttachment
(
req
.
getContent
());
// 保存主题表
ThemeEntity
themeEntity
=
new
ThemeEntity
();
...
...
@@ -169,8 +172,7 @@ public class ThemeManager {
checkContent
(
req
);
themeEntity
.
setContent
(
JsonUtil
.
toJson
(
req
.
getContent
()));
//附件校验
checkAttachment
(
req
.
getContent
());
if
(
StringUtils
.
isBlank
(
req
.
getEditThemeId
()))
{
// 新建
...
...
@@ -207,9 +209,13 @@ public class ThemeManager {
*/
private
void
checkAttachment
(
List
<
ThemeContentReq
>
themeAttachments
)
{
for
(
ThemeContentReq
content
:
themeAttachments
)
{
if
(
content
.
getType
()
==
null
)
{
if
(
content
.
getType
()
==
null
)
{
throw
new
IllegalArgumentException
(
"主题内容ThemeContentReq缺少类型"
);
}
Set
<
String
>
types
=
Arrays
.
stream
(
RelTypeEnum
.
values
()).
map
(
o
->
o
.
type
).
collect
(
Collectors
.
toSet
());
if
(!
types
.
contains
(
content
.
getType
())){
throw
new
IllegalArgumentException
(
"主题内容ThemeContentReq类型错误"
);
}
if
(
content
.
getType
().
equals
(
RelTypeEnum
.
FUND
.
type
))
{
if
(
content
.
getProductType
()
==
null
)
{
throw
new
IllegalArgumentException
(
"附件产品FUND缺少类型"
);
...
...
docs/create.sql
View file @
1ec475f3
-- tamp_community.black_list definition
CREATE
TABLE
`black_list`
(
`id`
bigint
(
32
)
NOT
NULL
AUTO_INCREMENT
COMMENT
'id'
,
`blocker`
varchar
(
64
)
NOT
NULL
COMMENT
'屏蔽发起人'
,
`blocked_type`
int
(
4
)
NOT
NULL
COMMENT
'屏蔽类型,1:用户,2:内容'
,
`blocked_id`
varchar
(
64
)
NOT
NULL
COMMENT
'被屏蔽的'
,
`create_by`
varchar
(
64
)
DEFAULT
''
,
`create_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
,
`update_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
,
`delete_tag`
int
(
3
)
NOT
NULL
DEFAULT
'0'
,
PRIMARY
KEY
(
`id`
),
KEY
`uk_blocker`
(
`blocker`
),
KEY
`uk_blocked`
(
`blocked_id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'黑名单'
;
-- tamp_community.collection definition
CREATE
TABLE
`collection`
(
`id`
varchar
(
64
)
NOT
NULL
COMMENT
'id'
,
`collection_type`
int
(
4
)
NOT
NULL
COMMENT
'类型 1:点赞主题,2:收藏主题 3、点赞评论'
,
`user_id`
varchar
(
64
)
NOT
NULL
COMMENT
'用户id'
,
`target_id`
varchar
(
64
)
NOT
NULL
COMMENT
'目标id'
,
`collection_type`
int
(
4
)
NOT
NULL
DEFAULT
'-1'
COMMENT
'类型 1:点赞主题,2:收藏主题 3、点赞评论'
,
`user_id`
varchar
(
64
)
NOT
NULL
DEFAULT
''
COMMENT
'用户id'
,
`target_id`
varchar
(
64
)
NOT
NULL
DEFAULT
''
COMMENT
'目标id'
,
`collection_time`
datetime
DEFAULT
NULL
COMMENT
'收藏时间'
,
`uncollection_time`
datetime
DEFAULT
NULL
COMMENT
'取消收藏时间'
,
`create_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
,
`update_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
,
`delete_tag`
int
(
3
)
NOT
NULL
DEFAULT
'0'
,
PRIMARY
KEY
(
`id`
),
PRIMARY
KEY
(
`id`
)
USING
BTREE
,
UNIQUE
KEY
`uk_user_type_target`
(
`user_id`
,
`collection_type`
,
`target_id`
)
USING
BTREE
,
KEY
`idx_target_id_and_type`
(
`target_id`
,
`collection_time`
)
USING
BTREE
,
KEY
`idx_create_time`
(
`create_time`
)
USING
BTREE
,
KEY
`idx_user_type`
(
`user_id`
,
`collection_type`
)
USING
BTREE
KEY
`idx_user_create_time`
(
`user_id`
,
`create_time`
)
USING
BTREE
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'收藏/点赞'
;
...
...
@@ -38,11 +21,11 @@ CREATE TABLE `collection` (
CREATE
TABLE
`comment`
(
`id`
bigint
(
32
)
NOT
NULL
AUTO_INCREMENT
COMMENT
'id'
,
`comment_id`
varchar
(
64
)
NOT
NULL
COMMENT
'评论主键Id'
,
`comment_type`
int
(
4
)
NOT
NULL
COMMENT
'类型 1:评论'
,
`comment_id`
varchar
(
64
)
NOT
NULL
DEFAULT
''
COMMENT
'评论主键Id'
,
`comment_type`
int
(
4
)
NOT
NULL
DEFAULT
'-1'
COMMENT
'类型 1:评论'
,
`content`
varchar
(
1024
)
NOT
NULL
DEFAULT
''
COMMENT
'文本内容'
,
`author_id`
varchar
(
64
)
NOT
NULL
COMMENT
'作者id'
,
`theme_id`
varchar
(
64
)
NOT
NULL
COMMENT
'主题id'
,
`author_id`
varchar
(
64
)
NOT
NULL
DEFAULT
''
COMMENT
'作者id'
,
`theme_id`
varchar
(
64
)
NOT
NULL
DEFAULT
''
COMMENT
'主题id'
,
`parent_id`
varchar
(
64
)
NOT
NULL
DEFAULT
''
COMMENT
'一级评论id'
,
`reply_id`
varchar
(
64
)
NOT
NULL
DEFAULT
''
COMMENT
'回复评论id'
,
`review_status`
int
(
4
)
NOT
NULL
DEFAULT
'0'
COMMENT
'审核状态 0:初始值 1:已通过(管理后台使用)'
,
...
...
@@ -50,30 +33,30 @@ CREATE TABLE `comment` (
`create_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
,
`update_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
,
`delete_tag`
int
(
3
)
NOT
NULL
DEFAULT
'0'
,
PRIMARY
KEY
(
`id`
),
PRIMARY
KEY
(
`id`
)
USING
BTREE
,
UNIQUE
KEY
`uk_comment`
(
`comment_id`
)
USING
BTREE
,
KEY
`idx_author`
(
`author_id`
)
USING
BTREE
,
KEY
`idx_
target
`
(
`reply_id`
)
USING
BTREE
,
KEY
`idx_theme`
(
`theme_id`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
153
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'评论'
;
KEY
`idx_
reply
`
(
`reply_id`
)
USING
BTREE
,
KEY
`idx_theme`
(
`theme_id`
)
USING
BTREE
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'评论'
;
-- tamp_community.file_record definition
CREATE
TABLE
`file_record`
(
`id`
bigint
(
32
)
NOT
NULL
AUTO_INCREMENT
COMMENT
'id'
,
`file_id`
varchar
(
64
)
NOT
NULL
COMMENT
'文件主键Id'
,
`file_type`
int
(
4
)
NOT
NULL
COMMENT
'类型:1:图片'
,
`file_name`
varchar
(
64
)
NOT
NULL
COMMENT
'文件名称'
,
`file_oss_key`
varchar
(
64
)
NOT
NULL
COMMENT
'阿里云key'
,
`file_id`
varchar
(
64
)
NOT
NULL
DEFAULT
''
COMMENT
'文件主键Id'
,
`file_type`
int
(
4
)
NOT
NULL
DEFAULT
'-1'
COMMENT
'类型:1:图片'
,
`file_name`
varchar
(
64
)
NOT
NULL
DEFAULT
''
COMMENT
'文件名称'
,
`file_oss_key`
varchar
(
64
)
NOT
NULL
DEFAULT
''
COMMENT
'阿里云key'
,
`preview_url`
varchar
(
512
)
NOT
NULL
DEFAULT
''
COMMENT
'预签名预览url'
,
`create_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
,
`update_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
,
`delete_tag`
int
(
3
)
NOT
NULL
DEFAULT
'0'
,
`ext_info`
varchar
(
100
)
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
),
UNIQUE
KEY
`uk_
logic`
(
`file_oss_key
`
)
USING
BTREE
,
KEY
`idx_file`
(
`file_id`
)
PRIMARY
KEY
(
`id`
)
USING
BTREE
,
UNIQUE
KEY
`uk_
fileId`
(
`file_id
`
)
USING
BTREE
,
UNIQUE
KEY
`uk_osskey`
(
`file_oss_key`
)
USING
BTREE
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'上传文件'
;
...
...
@@ -81,19 +64,17 @@ CREATE TABLE `file_record` (
CREATE
TABLE
`follow_rel`
(
`id`
bigint
(
32
)
NOT
NULL
AUTO_INCREMENT
COMMENT
'id'
,
`idol_id`
varchar
(
64
)
NOT
NULL
COMMENT
'被关注的人id'
,
`fans_id`
varchar
(
64
)
NOT
NULL
COMMENT
'粉丝id'
,
`idol_id`
varchar
(
64
)
NOT
NULL
DEFAULT
''
COMMENT
'被关注的人id'
,
`fans_id`
varchar
(
64
)
NOT
NULL
DEFAULT
''
COMMENT
'粉丝id'
,
`follow_time`
datetime
DEFAULT
NULL
COMMENT
'关注时间'
,
`unfollow_time`
datetime
DEFAULT
NULL
COMMENT
'取消关注时间'
,
`create_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
,
`update_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
,
`delete_tag`
int
(
3
)
NOT
NULL
DEFAULT
'0'
,
PRIMARY
KEY
(
`id`
),
UNIQUE
KEY
`uk_idol_follower`
(
`idol_id`
,
`fans_id`
),
KEY
`idx_follower`
(
`fans_id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'粉丝关系'
;
PRIMARY
KEY
(
`id`
)
USING
BTREE
,
UNIQUE
KEY
`uk_idol_follower`
(
`idol_id`
,
`fans_id`
)
USING
BTREE
,
KEY
`idx_follower`
(
`fans_id`
)
USING
BTREE
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'粉丝关系'
;
-- tamp_community.rank_log definition
...
...
@@ -104,12 +85,14 @@ CREATE TABLE `rank_log` (
`page_number`
int
(
11
)
NOT
NULL
COMMENT
'页码'
,
`page_size`
int
(
11
)
NOT
NULL
COMMENT
'页面大小'
,
`content`
text
COMMENT
'排序内容'
,
`round`
bigint
(
20
)
NOT
NULL
DEFAULT
'0'
,
`rank_cost`
bigint
(
20
)
NOT
NULL
DEFAULT
'0'
COMMENT
'花费间隔,单位毫秒'
,
`rank_time`
datetime
DEFAULT
NULL
COMMENT
'排序时间'
,
`create_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
,
`update_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
,
`delete_tag`
int
(
3
)
NOT
NULL
DEFAULT
'0'
,
PRIMARY
KEY
(
`id`
)
PRIMARY
KEY
(
`id`
)
USING
BTREE
,
KEY
`uk_round_pageNumber`
(
`type`
,
`round`
,
`page_number`
)
USING
BTREE
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'话题排序日志记录’'
;
...
...
@@ -129,9 +112,10 @@ CREATE TABLE `report_log` (
`create_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
,
`update_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
,
`delete_tag`
int
(
3
)
NOT
NULL
DEFAULT
'0'
,
PRIMARY
KEY
(
`id`
),
KEY
`uk_user`
(
`user_id`
),
KEY
`uk_report_target_id`
(
`target_id`
)
PRIMARY
KEY
(
`id`
)
USING
BTREE
,
KEY
`idx_user`
(
`user_id`
)
USING
BTREE
,
KEY
`idx_report_target_id`
(
`target_id`
)
USING
BTREE
,
KEY
`idx_targetUserId`
(
`target_user_id`
)
USING
BTREE
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'举报记录'
;
...
...
@@ -139,24 +123,24 @@ CREATE TABLE `report_log` (
CREATE
TABLE
`theme`
(
`id`
bigint
(
32
)
NOT
NULL
AUTO_INCREMENT
COMMENT
'id'
,
`theme_id`
varchar
(
64
)
NOT
NULL
COMMENT
'主题主键Id'
,
`theme_id`
varchar
(
64
)
NOT
NULL
DEFAULT
''
COMMENT
'主题主键Id'
,
`title`
varchar
(
128
)
NOT
NULL
DEFAULT
''
COMMENT
'标题'
,
`theme_type`
int
(
4
)
NOT
NULL
COMMENT
'类型 1:讨论无标题 2:长文有标题 3:转发'
,
`content`
longtext
COMMENT
'文本内容(json),type:附件类型(108:文本,88:产品 3:直播 6:短视频 303:新版课程-视频,304: 新版课程-音频,109:单图(长文) 110:多图(讨论)),productType:基金类型(0 公募,1 私募,2 白名单,3 私有)'
,
`author_id`
varchar
(
64
)
NOT
NULL
COMMENT
'作者id'
,
`former_theme_id`
varchar
(
64
)
DEFAULT
NULL
COMMENT
'转发的主题'
,
`topic_id`
varchar
(
64
)
DEFAULT
NULL
COMMENT
'所属的话题'
,
`theme_type`
int
(
4
)
NOT
NULL
DEFAULT
'-1'
COMMENT
'类型 1:讨论无标题 2:长文有标题 3:转发'
,
`content`
longtext
NOT
NULL
COMMENT
'文本内容(json),type:附件类型(108:文本,88:产品 3:直播 6:短视频 303:新版课程-视频,304: 新版课程-音频,109:单图(长文) 110:多图(讨论)),productType:基金类型(0 公募,1 私募,2 白名单,3 私有)'
,
`author_id`
varchar
(
64
)
NOT
NULL
DEFAULT
''
COMMENT
'作者id'
,
`former_theme_id`
varchar
(
64
)
NOT
NULL
DEFAULT
''
COMMENT
'转发的主题'
,
`topic_id`
varchar
(
64
)
NOT
NULL
DEFAULT
''
COMMENT
'所属的话题'
,
`review_status`
int
(
4
)
NOT
NULL
DEFAULT
'0'
COMMENT
'审核状态 0:未审核 1:审核通过(管理后台使用)'
,
`report_status`
int
(
4
)
NOT
NULL
DEFAULT
'0'
COMMENT
'举报状态 0:未被举报 1:被举报 2:已处理'
,
`create_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
,
`update_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
,
`delete_tag`
int
(
3
)
NOT
NULL
DEFAULT
'0'
COMMENT
'1:删除'
,
PRIMARY
KEY
(
`id`
),
KEY
`idx_author`
(
`author_id`
),
KEY
`idx_former`
(
`former_theme_id`
),
PRIMARY
KEY
(
`id`
)
USING
BTREE
,
UNIQUE
KEY
`uk_themeId`
(
`theme_id`
)
USING
BTREE
,
KEY
`idx_author_createTime`
(
`author_id`
,
`create_time`
)
USING
BTREE
,
KEY
`idx_former`
(
`former_theme_id`
)
USING
BTREE
,
KEY
`idx_create_time`
(
`create_time`
)
USING
BTREE
,
KEY
`idx_topic_id_create_time`
(
`topic_id`
,
`create_time`
)
USING
BTREE
,
KEY
`idx_theme_id_createTime`
(
`theme_id`
,
`create_time`
)
USING
BTREE
KEY
`idx_topic_id_create_time`
(
`topic_id`
,
`create_time`
)
USING
BTREE
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'主题内容'
;
...
...
@@ -164,16 +148,16 @@ CREATE TABLE `theme` (
CREATE
TABLE
`theme_attachment`
(
`id`
varchar
(
64
)
NOT
NULL
COMMENT
'id'
,
`theme_id`
varchar
(
64
)
NOT
NULL
COMMENT
'主题ID'
,
`attach_type`
int
(
4
)
NOT
NULL
COMMENT
'附件类型:108:文本,88:产品 3:直播 6:短视频 303:新版课程-视频,304: 新版课程-音频,109:单图(长文) 110:多图(讨论))'
,
`attach_id`
varchar
(
64
)
NOT
NULL
COMMENT
'附件对应的ID'
,
`theme_id`
varchar
(
64
)
NOT
NULL
DEFAULT
''
COMMENT
'主题ID'
,
`attach_type`
int
(
4
)
NOT
NULL
DEFAULT
'-1'
COMMENT
'附件类型:108:文本,88:产品 3:直播 6:短视频 303:新版课程-视频,304: 新版课程-音频,109:单图(长文) 110:多图(讨论))'
,
`attach_id`
varchar
(
64
)
NOT
NULL
DEFAULT
''
COMMENT
'附件对应的ID'
,
`create_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
,
`update_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
,
`delete_tag`
int
(
3
)
NOT
NULL
DEFAULT
'0'
,
`ext_info`
varchar
(
128
)
NOT
NULL
DEFAULT
''
,
PRIMARY
KEY
(
`id`
),
`ext_info`
varchar
(
512
)
NOT
NULL
DEFAULT
''
,
PRIMARY
KEY
(
`id`
)
USING
BTREE
,
KEY
`theme_id`
(
`theme_id`
)
USING
BTREE
,
KEY
`uk_attach_type`
(
`attach_id`
,
`attach_type`
)
KEY
`uk_attach_type`
(
`attach_id`
,
`attach_type`
)
USING
BTREE
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'主题附件'
;
...
...
@@ -181,35 +165,20 @@ CREATE TABLE `theme_attachment` (
CREATE
TABLE
`topic`
(
`id`
bigint
(
32
)
NOT
NULL
AUTO_INCREMENT
COMMENT
'id'
,
`topic_id`
varchar
(
64
)
NOT
NULL
COMMENT
'话题主键Id'
,
`topic_title`
varchar
(
64
)
NOT
NULL
COMMENT
'话题名称'
,
`topic_id`
varchar
(
64
)
NOT
NULL
DEFAULT
''
COMMENT
'话题主键Id'
,
`topic_title`
varchar
(
64
)
NOT
NULL
DEFAULT
''
COMMENT
'话题名称'
,
`is_top`
int
(
4
)
NOT
NULL
DEFAULT
'0'
COMMENT
'是否置顶'
,
`is_conceal`
int
(
4
)
NOT
NULL
DEFAULT
'0'
COMMENT
'是否隐藏'
,
`view_cnt_adjust`
int
(
11
)
NOT
NULL
DEFAULT
'0'
COMMENT
'浏览量调整基数'
,
`create_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
,
`update_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
,
`delete_tag`
int
(
3
)
NOT
NULL
DEFAULT
'0'
,
PRIMARY
KEY
(
`id`
),
UNIQUE
KEY
`uk_title`
(
`topic_title`
),
UNIQUE
KEY
`uk_topicId`
(
`topic_id`
)
PRIMARY
KEY
(
`id`
)
USING
BTREE
,
UNIQUE
KEY
`uk_title`
(
`topic_title`
)
USING
BTREE
,
UNIQUE
KEY
`uk_topicId`
(
`topic_id`
)
USING
BTREE
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'话题'
;
-- tamp_community.user_visit_statistics definition
CREATE
TABLE
`user_visit_statistics`
(
`id`
bigint
(
32
)
unsigned
NOT
NULL
AUTO_INCREMENT
,
`visitor_id`
varchar
(
64
)
DEFAULT
NULL
,
`ref_id`
varchar
(
64
)
DEFAULT
NULL
,
`ref_type`
int
(
8
)
DEFAULT
NULL
,
`total_duration`
bigint
(
20
)
DEFAULT
NULL
,
`first_visit_time`
datetime
DEFAULT
NULL
,
`last_visit_time`
datetime
DEFAULT
NULL
,
`total_visit`
int
(
16
)
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
;
-- tamp_community.visit_log definition
CREATE
TABLE
`visit_log`
(
...
...
@@ -223,10 +192,10 @@ CREATE TABLE `visit_log` (
`create_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
,
`update_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
,
`delete_tag`
int
(
3
)
NOT
NULL
DEFAULT
'0'
,
PRIMARY
KEY
(
`id`
),
PRIMARY
KEY
(
`id`
)
USING
BTREE
,
KEY
`idx_session`
(
`ident`
)
USING
BTREE
,
KEY
`idx_visitor
`
(
`visitor_id
`
)
USING
BTREE
,
KEY
`idx_author
`
(
`author_id
`
)
USING
BTREE
,
KEY
`idx_visitor
_ref`
(
`visitor_id`
,
`ref_id`
,
`ref_type
`
)
USING
BTREE
,
KEY
`idx_author
_ref`
(
`author_id`
,
`ref_id`
,
`ref_type
`
)
USING
BTREE
,
KEY
`idx_ref_id_and_type`
(
`ref_id`
,
`ref_type`
)
USING
BTREE
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'浏览记录'
;
...
...
@@ -241,6 +210,6 @@ CREATE TABLE `worker_node` (
`launch_date`
date
NOT
NULL
COMMENT
'launch date'
,
`created`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'created time'
,
`modified`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'modified time'
,
PRIMARY
KEY
(
`id`
),
UNIQUE
KEY
`idx_host_name_port`
(
`host_name`
,
`port`
)
PRIMARY
KEY
(
`id`
)
USING
BTREE
,
UNIQUE
KEY
`idx_host_name_port`
(
`host_name`
,
`port`
)
USING
BTREE
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'分布式唯一ID生成,DB WorkerID Assigner for UID Generator'
;
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment