Browse Source
# Conflicts: # epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java # epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java # epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.javamaster
17 changed files with 623 additions and 70 deletions
@ -0,0 +1,80 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
|
|||
/** |
|||
* 保存文章内容form |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-06-02 |
|||
*/ |
|||
@Data |
|||
public class DraftContentFromDTO implements Serializable { |
|||
|
|||
|
|||
private static final long serialVersionUID = -4206020151361420221L; |
|||
|
|||
|
|||
/** |
|||
* 草稿ID |
|||
*/ |
|||
private String draftId; |
|||
|
|||
/** |
|||
* 文章标题 |
|||
*/ |
|||
@NotBlank(message = "文章标题不能为空") |
|||
private String title; |
|||
|
|||
/** |
|||
* 内容列表 |
|||
*/ |
|||
private List<DraftContentDTO> contentList; |
|||
|
|||
@Data |
|||
public static class DraftContentDTO { |
|||
public DraftContentDTO() { |
|||
} |
|||
|
|||
/** |
|||
* 内容Id |
|||
*/ |
|||
private String draftContentId; |
|||
/** |
|||
* 内容 |
|||
*/ |
|||
private String content; |
|||
|
|||
/** |
|||
* 内容类型 图片:img;文字:text |
|||
*/ |
|||
private String contentType; |
|||
|
|||
/** |
|||
* 内容顺序 从1开始 |
|||
*/ |
|||
private Integer orderNum; |
|||
} |
|||
} |
@ -0,0 +1,277 @@ |
|||
DROP TABLE tag_default;/*SkipError*/ |
|||
CREATE TABLE tag_default( |
|||
ID VARCHAR(64) NOT NULL COMMENT '主键ID' , |
|||
TAG_NAME VARCHAR(32) NOT NULL COMMENT '标签名称' , |
|||
DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , |
|||
REVISION INT NOT NULL COMMENT '乐观锁' , |
|||
CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , |
|||
CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , |
|||
UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , |
|||
UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , |
|||
PRIMARY KEY (ID) |
|||
) COMMENT = '默认标签表 默认标签表'; |
|||
|
|||
ALTER TABLE tag_default COMMENT '默认标签表'; |
|||
DROP TABLE tag_customer;/*SkipError*/ |
|||
CREATE TABLE tag_customer( |
|||
ID VARCHAR(64) NOT NULL COMMENT '主键ID' , |
|||
CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , |
|||
TAG_NAME VARCHAR(32) NOT NULL COMMENT '标签名称' , |
|||
USE_COUNT INT NOT NULL DEFAULT 0 COMMENT '使用计数' , |
|||
DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , |
|||
REVISION INT NOT NULL COMMENT '乐观锁' , |
|||
CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , |
|||
CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , |
|||
UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , |
|||
UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , |
|||
PRIMARY KEY (ID) |
|||
) COMMENT = '客户标签表 客户标签表'; |
|||
|
|||
ALTER TABLE tag_customer ADD INDEX INX_TAG_NAME(TAG_NAME); |
|||
ALTER TABLE tag_customer COMMENT '客户标签表'; |
|||
DROP TABLE tag_grid;/*SkipError*/ |
|||
CREATE TABLE tag_grid( |
|||
ID VARCHAR(64) NOT NULL COMMENT '主键ID' , |
|||
CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , |
|||
GRID_ID VARCHAR(64) NOT NULL COMMENT '网格ID' , |
|||
TAG_ID VARCHAR(64) NOT NULL COMMENT '标签ID' , |
|||
TAG_NAME VARCHAR(32) NOT NULL COMMENT '标签名称' , |
|||
USE_COUNT INT NOT NULL DEFAULT 0 COMMENT '使用计数' , |
|||
DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , |
|||
REVISION INT NOT NULL COMMENT '乐观锁' , |
|||
CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , |
|||
CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , |
|||
UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , |
|||
UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , |
|||
PRIMARY KEY (ID) |
|||
) COMMENT = '网格标签表 网格标签表'; |
|||
|
|||
ALTER TABLE tag_grid COMMENT '网格标签表'; |
|||
DROP TABLE article_tags;/*SkipError*/ |
|||
CREATE TABLE article_tags( |
|||
ID VARCHAR(64) NOT NULL COMMENT '主键ID' , |
|||
CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , |
|||
ARTICLE_ID VARCHAR(64) NOT NULL COMMENT '文章ID' , |
|||
TAG_ID VARCHAR(64) NOT NULL COMMENT '标签ID' , |
|||
TAG_NAME VARCHAR(32) NOT NULL COMMENT '标签名称' , |
|||
DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , |
|||
REVISION INT NOT NULL COMMENT '乐观锁' , |
|||
CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , |
|||
CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , |
|||
UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , |
|||
UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , |
|||
PRIMARY KEY (ID) |
|||
) COMMENT = '文章标签表 文章标签表'; |
|||
|
|||
ALTER TABLE article_tags ADD INDEX IDX_ARTICLE_ID(ARTICLE_ID); |
|||
ALTER TABLE article_tags COMMENT '文章标签表'; |
|||
DROP TABLE draft;/*SkipError*/ |
|||
CREATE TABLE draft( |
|||
ID VARCHAR(64) NOT NULL COMMENT '主键ID' , |
|||
CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , |
|||
TITLE VARCHAR(128) NOT NULL COMMENT '文章标题' , |
|||
PREVIEW_CONTENT VARCHAR(512) NOT NULL COMMENT '文章内容 精简内容' , |
|||
IS_TOP INT NOT NULL COMMENT '是否置顶 1是;0否;' , |
|||
PUBLISH_RANGE_DESC VARCHAR(512) NOT NULL COMMENT '发布范围描述 所有发布范围集合' , |
|||
PUBLISHER_ID VARCHAR(64) NOT NULL COMMENT '发布单位ID' , |
|||
PUBLISHER_NAME VARCHAR(128) NOT NULL COMMENT '发布单位名称' , |
|||
PUBLISHER_TYPE VARCHAR(32) NOT NULL COMMENT '发布单位类型 机关:agency;部门:department;网格:grid' , |
|||
PUBLISH_DATE DATE NOT NULL COMMENT '发布时间' , |
|||
STATUS_FLAG VARCHAR(32) NOT NULL COMMENT '发布状态 未发布:unpublish ;已发布:published,审核中:auditing;审核失败:auditfail' , |
|||
TAGS VARCHAR(512) NOT NULL COMMENT '文章标签串 竖杠分割的标签名称' , |
|||
ORG_ID VARCHAR(64) COMMENT '组织ID' , |
|||
ORG_ID_PATH VARCHAR(512) COMMENT '组织ID路径 eg:字段为def:abc' , |
|||
GRID_ID VARCHAR(64) COMMENT '网格ID 数据权限使用' , |
|||
DEPARTMENT_ID VARCHAR(32) COMMENT '部门ID 数据权限使用' , |
|||
DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , |
|||
REVISION INT NOT NULL COMMENT '乐观锁' , |
|||
CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , |
|||
CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , |
|||
UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , |
|||
UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , |
|||
PRIMARY KEY (ID) |
|||
) COMMENT = '草稿表 草稿表'; |
|||
|
|||
ALTER TABLE draft COMMENT '草稿表'; |
|||
DROP TABLE draft_content;/*SkipError*/ |
|||
CREATE TABLE draft_content( |
|||
ID VARCHAR(64) NOT NULL COMMENT '主键ID 主键ID' , |
|||
CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , |
|||
DRAFT_ID VARCHAR(64) NOT NULL COMMENT '草稿ID' , |
|||
CONTENT VARCHAR(1024) NOT NULL COMMENT '内容' , |
|||
CONTENT_TYPE VARCHAR(32) NOT NULL COMMENT '内容类型 图片:img;文字:text' , |
|||
AUDIT_STATUS VARCHAR(32) COMMENT '审核状态 通过:pass;失败:fail;审核中:auditing;' , |
|||
AUDIT_REASON VARCHAR(128) COMMENT '审核理由' , |
|||
ORDER_NUM INT NOT NULL COMMENT '内容顺序 从1开始' , |
|||
DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , |
|||
REVISION INT NOT NULL COMMENT '乐观锁' , |
|||
CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , |
|||
CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , |
|||
UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , |
|||
UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , |
|||
PRIMARY KEY (ID) |
|||
) COMMENT = '草稿内容表 草稿内容表'; |
|||
|
|||
ALTER TABLE draft_content COMMENT '草稿内容表'; |
|||
DROP TABLE draft_publish_range;/*SkipError*/ |
|||
CREATE TABLE draft_publish_range( |
|||
ID VARCHAR(64) NOT NULL COMMENT '主键ID' , |
|||
CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , |
|||
DRAFT_ID VARCHAR(64) NOT NULL COMMENT 'ID草稿' , |
|||
GRID_ID VARCHAR(64) NOT NULL COMMENT '网格ID' , |
|||
AGENCY_GRID_NAME VARCHAR(64) NOT NULL COMMENT '组织-网格名称' , |
|||
OFF_LINE_TIME DATETIME COMMENT '下线时间' , |
|||
PUBLISH_STATUS VARCHAR(32) NOT NULL COMMENT '发布状态 未发布:unpublish ;已发布:published' , |
|||
DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , |
|||
REVISION INT NOT NULL COMMENT '乐观锁' , |
|||
CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , |
|||
CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , |
|||
UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , |
|||
UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , |
|||
PRIMARY KEY (ID) |
|||
) COMMENT = '草稿发布范围表 草稿发布范围表'; |
|||
|
|||
ALTER TABLE draft_publish_range COMMENT '草稿发布范围表'; |
|||
DROP TABLE draft_cover;/*SkipError*/ |
|||
CREATE TABLE draft_cover( |
|||
ID VARCHAR(64) NOT NULL COMMENT '主键ID' , |
|||
CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , |
|||
DRAFT_ID VARCHAR(64) NOT NULL COMMENT '草稿ID' , |
|||
IMG_URL VARCHAR(512) NOT NULL COMMENT '封面图片地址 url地址' , |
|||
AUDIT_STATUS VARCHAR(32) COMMENT '审核状态 通过:pass;失败:fail;审核中:auditing;' , |
|||
AUDIT_REASON VARCHAR(128) COMMENT '审核理由' , |
|||
DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , |
|||
REVISION INT NOT NULL COMMENT '乐观锁' , |
|||
CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , |
|||
CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , |
|||
UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , |
|||
UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , |
|||
PRIMARY KEY (ID) |
|||
) COMMENT = '草稿封面表 草稿封面表'; |
|||
|
|||
ALTER TABLE draft_cover COMMENT '草稿封面表'; |
|||
DROP TABLE article;/*SkipError*/ |
|||
CREATE TABLE article( |
|||
ID VARCHAR(64) NOT NULL COMMENT '主键ID' , |
|||
CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , |
|||
DRAFT_ID VARCHAR(64) NOT NULL COMMENT '草稿ID' , |
|||
TITLE VARCHAR(128) NOT NULL COMMENT '文章标题' , |
|||
PREVIEW_CONTENT VARCHAR(512) NOT NULL COMMENT '文章内容 精简内容' , |
|||
IS_TOP INT NOT NULL COMMENT '是否置顶 1是;0否;' , |
|||
PUBLISH_RANGE_DESC VARCHAR(512) NOT NULL COMMENT '发布范围描述 所有发布范围集合,顿号隔开' , |
|||
PUBLISHER_ID VARCHAR(64) NOT NULL COMMENT '发布单位ID' , |
|||
PUBLISHER_NAME VARCHAR(128) NOT NULL COMMENT '发布单位名称' , |
|||
PUBLISHER_TYPE VARCHAR(32) NOT NULL COMMENT '发布单位类型 机关:agency;部门:department;网格:grid' , |
|||
PUBLISH_DATE DATE NOT NULL COMMENT '发布时间' , |
|||
STATUS_FLAG VARCHAR(32) NOT NULL DEFAULT 0 COMMENT '发布状态 已发布:published;已下线:offline' , |
|||
OFF_LINE_TIME DATETIME COMMENT '下线时间' , |
|||
TAGS VARCHAR(512) COMMENT '文章标签串 竖杠分割的标签名称' , |
|||
ORG_ID VARCHAR(64) COMMENT '组织ID' , |
|||
ORG_ID_PATH VARCHAR(512) COMMENT '组织ID路径 eg:字段为def:abc' , |
|||
GRID_ID VARCHAR(64) COMMENT '网格ID 数据权限使用' , |
|||
DEPARTMENT_ID VARCHAR(32) COMMENT '部门ID 数据权限使用' , |
|||
DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , |
|||
REVISION INT NOT NULL COMMENT '乐观锁' , |
|||
CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , |
|||
CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , |
|||
UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , |
|||
UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , |
|||
PRIMARY KEY (ID) |
|||
) COMMENT = '文章表 正式文章表'; |
|||
|
|||
ALTER TABLE article COMMENT '文章表'; |
|||
DROP TABLE article_content;/*SkipError*/ |
|||
CREATE TABLE article_content( |
|||
ID VARCHAR(64) NOT NULL COMMENT '主键ID 主键ID' , |
|||
CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , |
|||
ARTICLE_ID VARCHAR(64) NOT NULL COMMENT '文章ID' , |
|||
CONTENT VARCHAR(1024) NOT NULL COMMENT '内容' , |
|||
CONTENT_TYPE VARCHAR(32) NOT NULL COMMENT '内容类型 图片:img;文字:text' , |
|||
AUDIT_STATUS VARCHAR(32) COMMENT '审核状态 通过:pass;失败:fail;审核中:auditing;' , |
|||
AUDIT_REASON VARCHAR(128) COMMENT '审核理由' , |
|||
ORDER_NUM INT NOT NULL COMMENT '内容顺序 从1开始' , |
|||
DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , |
|||
REVISION INT NOT NULL COMMENT '乐观锁' , |
|||
CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , |
|||
CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , |
|||
UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , |
|||
UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , |
|||
PRIMARY KEY (ID) |
|||
) COMMENT = '文章内容表 文章内容表'; |
|||
|
|||
ALTER TABLE article_content COMMENT '文章内容表'; |
|||
DROP TABLE article_cover;/*SkipError*/ |
|||
CREATE TABLE article_cover( |
|||
ID VARCHAR(64) NOT NULL COMMENT '主键ID' , |
|||
CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , |
|||
ARTICLE_ID VARCHAR(64) NOT NULL COMMENT '文章ID' , |
|||
IMG_URL VARCHAR(512) NOT NULL COMMENT '封面图片地址 url地址' , |
|||
AUDIT_STATUS VARCHAR(32) COMMENT '审核状态 通过:pass;失败:fail;审核中:auditing' , |
|||
AUDIT_REASON VARCHAR(128) COMMENT '审核理由' , |
|||
DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , |
|||
REVISION INT NOT NULL COMMENT '乐观锁' , |
|||
CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , |
|||
CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , |
|||
UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , |
|||
UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , |
|||
PRIMARY KEY (ID) |
|||
) COMMENT = '文章封面表 文章封面表'; |
|||
|
|||
ALTER TABLE article_cover COMMENT '文章封面表'; |
|||
DROP TABLE article_publish_range;/*SkipError*/ |
|||
CREATE TABLE article_publish_range( |
|||
ID VARCHAR(64) NOT NULL COMMENT '主键ID' , |
|||
CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , |
|||
ARTICLE_ID VARCHAR(64) NOT NULL COMMENT '文章ID' , |
|||
GRID_ID VARCHAR(64) NOT NULL COMMENT '网格ID' , |
|||
AGENCY_GRID_NAME VARCHAR(64) NOT NULL COMMENT '组织-网格名称' , |
|||
OFF_LINE_TIME DATETIME COMMENT '下线时间' , |
|||
PUBLISH_STATUS VARCHAR(32) NOT NULL COMMENT '发布状态 未发布:unpublish ;已发布:published' , |
|||
DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , |
|||
REVISION INT NOT NULL COMMENT '乐观锁' , |
|||
CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , |
|||
CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , |
|||
UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , |
|||
UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , |
|||
PRIMARY KEY (ID) |
|||
) COMMENT = '文章发布范围表 文章发布范围表'; |
|||
|
|||
ALTER TABLE article_publish_range ADD INDEX IDX_ARTICLE_ID(ARTICLE_ID); |
|||
ALTER TABLE article_publish_range COMMENT '文章发布范围表'; |
|||
DROP TABLE article_operate_record;/*SkipError*/ |
|||
CREATE TABLE article_operate_record( |
|||
ID VARCHAR(64) NOT NULL COMMENT '主键ID 主键ID' , |
|||
CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , |
|||
ARTICLE_ID VARCHAR(64) NOT NULL COMMENT '文章ID' , |
|||
OP_USER VARCHAR(128) NOT NULL COMMENT '执行人 xx街道-xx中心-姓名' , |
|||
CONTENT VARCHAR(512) NOT NULL COMMENT '操作内容 操作内容,eg:重新编辑文章;' , |
|||
OP_TYPE VARCHAR(32) NOT NULL COMMENT '操作类型 发布文章:publish;取消文章置顶:canceltop;设置置顶:settom;下线文章:offline;修改文章发布范围:updatepublishrange' , |
|||
OP_TIME DATETIME NOT NULL COMMENT '操作时间' , |
|||
DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , |
|||
REVISION INT NOT NULL COMMENT '乐观锁' , |
|||
CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , |
|||
CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , |
|||
UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , |
|||
UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , |
|||
PRIMARY KEY (ID) |
|||
) COMMENT = '文章操作记录表 文章操作记录表'; |
|||
|
|||
ALTER TABLE article_operate_record COMMENT '文章操作记录表'; |
|||
DROP TABLE article_visit_record;/*SkipError*/ |
|||
CREATE TABLE article_visit_record( |
|||
ID VARCHAR(64) NOT NULL COMMENT '主键ID' , |
|||
CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , |
|||
GRID_ID VARCHAR(64) NOT NULL COMMENT '网格ID' , |
|||
ARTICLE_ID VARCHAR(64) NOT NULL COMMENT '文章ID' , |
|||
USER_ID VARCHAR(64) NOT NULL COMMENT '用户ID' , |
|||
DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , |
|||
REVISION INT NOT NULL COMMENT '乐观锁' , |
|||
CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , |
|||
CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , |
|||
UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , |
|||
UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , |
|||
PRIMARY KEY (ID) |
|||
) COMMENT = '文章访问记录表 文章访问记录表'; |
|||
|
|||
ALTER TABLE article_visit_record ADD UNIQUE UNX_INDEX(ARTICLE_ID,GRID_ID,USER_ID); |
|||
ALTER TABLE article_visit_record COMMENT '文章访问记录表'; |
@ -0,0 +1,45 @@ |
|||
package com.epmet; |
|||
|
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.dto.form.DraftContentFromDTO; |
|||
import com.epmet.service.ArticleService; |
|||
import org.junit.Test; |
|||
import org.junit.runner.RunWith; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.boot.test.context.SpringBootTest; |
|||
import org.springframework.test.context.junit4.SpringRunner; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
@RunWith(SpringRunner.class) |
|||
@SpringBootTest |
|||
public class ArticleServiceTest { |
|||
|
|||
|
|||
|
|||
@Autowired |
|||
private ArticleService articleService; |
|||
|
|||
@Test |
|||
public void genToken() { |
|||
TokenDto tokenDto = new TokenDto(); |
|||
tokenDto.setCustomerId("1"); |
|||
tokenDto.setUserId("1"); |
|||
DraftContentFromDTO draftContentFromDTO = new DraftContentFromDTO(); |
|||
//draftContentFromDTO.setDraftId("1");
|
|||
draftContentFromDTO.setTitle("testTitle"); |
|||
List<DraftContentFromDTO.DraftContentDTO> list = new ArrayList<>(); |
|||
for (int i = 0; i <2 ; i++) { |
|||
DraftContentFromDTO.DraftContentDTO contentDTO = new DraftContentFromDTO.DraftContentDTO(); |
|||
contentDTO.setDraftContentId(""); |
|||
contentDTO.setContent("内容"+i); |
|||
contentDTO.setContentType("text"); |
|||
contentDTO.setOrderNum(1+i); |
|||
list.add(contentDTO); |
|||
} |
|||
draftContentFromDTO.setContentList(list); |
|||
String s = articleService.saveOrUpdateContent(tokenDto, draftContentFromDTO); |
|||
System.out.println(s); |
|||
} |
|||
} |
Loading…
Reference in new issue