Commit 4b45c434 authored by 赵啸非's avatar 赵啸非

修改热门词汇

parent 56e64773
Pipeline #2405 failed with stages
......@@ -147,6 +147,21 @@ CREATE TABLE mortals_xhx_pubdatum(
-- ----------------------------
-- 填单服务基础设置表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_baseset`;
CREATE TABLE mortals_xhx_baseset(
`id` bigint(20) AUTO_INCREMENT COMMENT '主键,自增长',
`siteId` bigint(20) COMMENT '站点ID',
`printDisplay` int(4) COMMENT '空白打印材料展示数量',
`newsSource` tinyint(4) COMMENT '新闻来源(1.热点新闻,2.本地要闻,3.政策发布,4.通知公告)',
`createTime` datetime COMMENT '创建时间',
`createUserId` bigint(20) COMMENT '创建用户',
`updateTime` datetime COMMENT '修改时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='填单服务基础设置';
-- ----------------------------
-- 热门词汇业务表
-- ----------------------------
......@@ -155,8 +170,6 @@ CREATE TABLE mortals_xhx_hotword(
`id` bigint(20) AUTO_INCREMENT COMMENT '主键,自增长',
`siteId` bigint(20) COMMENT '站点ID',
`hotwords` varchar(512) COMMENT '热门词汇',
`printDisplay` int(4) COMMENT '空白打印材料展示数量',
`newsSource` tinyint(4) COMMENT '新闻来源(1.热点新闻,2.本地要闻,3.政策发布,4.通知公告)',
`searchCount` int(9) COMMENT '查询次数',
`wordsSource` tinyint(4) COMMENT '热门词汇来源(1.手动添加,2.查询添加)',
`createTime` datetime COMMENT '创建时间',
......
package com.mortals.xhx.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 热门词汇来源(1.手动添加,2.查询添加)枚举类
*
* @author zxfei
*/
public enum WordsSourceEnum {
手动添加(1, "手动添加"),
查询添加(2, "查询添加");
private Integer value;
private String desc;
WordsSourceEnum(Integer value, String desc) {
this.value = value;
this.desc = desc;
}
public Integer getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static WordsSourceEnum getByValue(Integer value) {
for (WordsSourceEnum wordsSourceEnum : WordsSourceEnum.values()) {
if (wordsSourceEnum.getValue() == value) {
return wordsSourceEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(Integer... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (WordsSourceEnum item : WordsSourceEnum.values()) {
try {
boolean hasE = false;
for (Integer e : eItem) {
if (item.getValue() == e) {
hasE = true;
break;
}
}
if (!hasE) {
resultMap.put(item.getValue() + "", item.getDesc());
}
} catch (Exception ex) {
}
}
return resultMap;
}
}
\ No newline at end of file
......@@ -31,4 +31,7 @@ public final class Constant {
public final static String PARAMS_NOTICE_URL = "notice_url";
public final static String PARAMS_HOTWORDS_DEFAULT_NUM = "hotwords_default_num";
}
package com.mortals.xhx.module.baseset.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.baseset.model.BasesetEntity;
import java.util.List;
/**
* 填单服务基础设置Dao
* 填单服务基础设置 DAO接口
*
* @author zxfei
* @date 2022-12-08
*/
public interface BasesetDao extends ICRUDDao<BasesetEntity,Long>{
}
package com.mortals.xhx.module.baseset.dao.ibatis;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.baseset.dao.BasesetDao;
import com.mortals.xhx.module.baseset.model.BasesetEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
* 填单服务基础设置DaoImpl DAO接口
*
* @author zxfei
* @date 2022-12-08
*/
@Repository("basesetDao")
public class BasesetDaoImpl extends BaseCRUDDaoMybatis<BasesetEntity,Long> implements BasesetDao {
}
package com.mortals.xhx.module.baseset.model;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.baseset.model.vo.BasesetVo;
/**
* 填单服务基础设置实体对象
*
* @author zxfei
* @date 2022-12-08
*/
public class BasesetEntity extends BasesetVo {
private static final long serialVersionUID = 1L;
/**
* 站点ID
*/
private Long siteId;
/**
* 空白打印材料展示数量
*/
private Integer printDisplay;
/**
* 新闻来源(1.热点新闻,2.本地要闻,3.政策发布,4.通知公告)
*/
private Integer newsSource;
public BasesetEntity(){}
/**
* 获取 站点ID
* @return Long
*/
public Long getSiteId(){
return siteId;
}
/**
* 设置 站点ID
* @param siteId
*/
public void setSiteId(Long siteId){
this.siteId = siteId;
}
/**
* 获取 空白打印材料展示数量
* @return Integer
*/
public Integer getPrintDisplay(){
return printDisplay;
}
/**
* 设置 空白打印材料展示数量
* @param printDisplay
*/
public void setPrintDisplay(Integer printDisplay){
this.printDisplay = printDisplay;
}
/**
* 获取 新闻来源(1.热点新闻,2.本地要闻,3.政策发布,4.通知公告)
* @return Integer
*/
public Integer getNewsSource(){
return newsSource;
}
/**
* 设置 新闻来源(1.热点新闻,2.本地要闻,3.政策发布,4.通知公告)
* @param newsSource
*/
public void setNewsSource(Integer newsSource){
this.newsSource = newsSource;
}
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof BasesetEntity) {
BasesetEntity tmp = (BasesetEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public String toString(){
StringBuilder sb = new StringBuilder("");
sb.append(",siteId:").append(getSiteId());
sb.append(",printDisplay:").append(getPrintDisplay());
sb.append(",newsSource:").append(getNewsSource());
return sb.toString();
}
public void initAttrValue(){
this.siteId = null;
this.printDisplay = 0;
this.newsSource = 1;
}
}
\ No newline at end of file
package com.mortals.xhx.module.baseset.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.baseset.model.BasesetEntity;
import com.mortals.xhx.module.hotword.model.HotwordEntity;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
* 填单服务基础设置视图对象
*
* @author zxfei
* @date 2022-12-08
*/
@Data
public class BasesetVo extends BaseEntityLong {
private List<HotwordEntity> hotwordList;
}
\ No newline at end of file
package com.mortals.xhx.module.baseset.service;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.baseset.model.BasesetEntity;
/**
* BasesetService
*
* 填单服务基础设置 service接口
*
* @author zxfei
* @date 2022-12-08
*/
public interface BasesetService extends ICRUDService<BasesetEntity,Long>{
}
\ No newline at end of file
package com.mortals.xhx.module.baseset.service.impl;
import com.mortals.framework.model.PageInfo;
import com.mortals.xhx.module.hotword.model.HotwordEntity;
import com.mortals.xhx.module.hotword.model.HotwordQuery;
import com.mortals.xhx.module.hotword.service.HotwordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.xhx.module.baseset.dao.BasesetDao;
import com.mortals.xhx.module.baseset.model.BasesetEntity;
import com.mortals.xhx.module.baseset.service.BasesetService;
import java.util.List;
/**
* BasesetService
* 填单服务基础设置 service实现
*
* @author zxfei
* @date 2022-12-08
*/
@Service("basesetService")
public class BasesetServiceImpl extends AbstractCRUDServiceImpl<BasesetDao, BasesetEntity, Long> implements BasesetService {
@Autowired
private HotwordService hotwordService;
@Override
protected void findAfter(BasesetEntity params, PageInfo pageInfo, Context context, List<BasesetEntity> list) throws AppException {
list.forEach(item -> {
List<HotwordEntity> hotwordEntities = hotwordService.find(new HotwordQuery().siteId(item.getSiteId()));
item.setHotwordList(hotwordEntities);
});
super.findAfter(params, pageInfo, context, list);
}
}
\ No newline at end of file
package com.mortals.xhx.module.baseset.web;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.module.baseset.model.BasesetEntity;
import com.mortals.xhx.module.baseset.service.BasesetService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/**
*
* 填单服务基础设置
*
* @author zxfei
* @date 2022-12-08
*/
@RestController
@RequestMapping("baseset")
public class BasesetController extends BaseCRUDJsonBodyMappingController<BasesetService,BasesetEntity,Long> {
@Autowired
private ParamService paramService;
public BasesetController(){
super.setModuleDesc( "填单服务基础设置");
}
@Override
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "newsSource", paramService.getParamBySecondOrganize("Baseset","newsSource"));
super.init(model, context);
}
}
\ No newline at end of file
......@@ -27,6 +27,9 @@ import com.mortals.xhx.feign.base.pdu.DeptPdu;
import com.mortals.xhx.feign.base.pdu.SitePdu;
import com.mortals.xhx.feign.rsp.ApiResp;
import com.mortals.xhx.feign.site.ISiteFeign;
import com.mortals.xhx.module.baseset.model.BasesetEntity;
import com.mortals.xhx.module.baseset.model.BasesetQuery;
import com.mortals.xhx.module.baseset.service.BasesetService;
import com.mortals.xhx.module.home.pdu.HomeQueryPdu;
import com.mortals.xhx.module.home.pdu.NoticeQueryPdu;
import com.mortals.xhx.module.hotword.model.HotwordEntity;
......@@ -64,6 +67,8 @@ public class HomeController extends BaseJsonBodyController {
private HotwordService hotwordService;
@Autowired
private ISiteFeign siteFeign;
@Autowired
private BasesetService basesetService;
@PostMapping({"site/list"})
public Rest<Object> list() {
......@@ -248,21 +253,26 @@ public class HomeController extends BaseJsonBodyController {
String busiDesc = "获取首页数据";
int code = VALUE_RESULT_SUCCESS;
try {
HotwordQuery hotwordQuery = new HotwordQuery();
hotwordQuery.siteId(homeQueryPdu.getSiteId());
List<OrderCol> orderColList = new ArrayList<>();
orderColList.add(new OrderCol("searchCount", OrderCol.DESCENDING));
orderColList.add(new OrderCol("wordsSource", OrderCol.ASCENDING));
hotwordQuery.setOrderColList(orderColList);
List<String> hotwordEntities = hotwordService.find(hotwordQuery, new PageInfo(), null).getList().stream()
PageInfo pageInfo = new PageInfo();
int nums = GlobalSysInfo.getParamIntValue(Constant.PARAMS_HOTWORDS_DEFAULT_NUM, 10);
pageInfo.setPrePageResult(nums);
List<HotwordEntity> hotwordEntities = hotwordService.find(hotwordQuery, pageInfo, null).getList();
/* List<String> hotwordEntities = hotwordService.find(hotwordQuery, new PageInfo(), null).getList().stream()
.map(HotwordEntity::getHotwords)
.flatMap(item -> StrUtil.split(item, ",".charAt(0)).stream())
.collect(Collectors.toList());
.collect(Collectors.toList());*/
model.put("hotWords", hotwordEntities);
MatterQuery matterQuery = new MatterQuery();
matterQuery.setSiteId(homeQueryPdu.getSiteId());
int matterCont = matterService.count(matterQuery, this.getContext());
......@@ -285,9 +295,12 @@ public class HomeController extends BaseJsonBodyController {
Rest<com.mortals.xhx.common.pdu.site.SitePdu> info = siteFeign.info(homeQueryPdu.getSiteId());
model.put("title", info == null ? "" : info.getData().getSiteName()); //标题
HotwordEntity hotwordEntity = hotwordService.selectOne(hotwordQuery.siteId(homeQueryPdu.getSiteId()));
model.put("blankCount", hotwordEntity == null ? 20 : hotwordEntity.getPrintDisplay()); //空白样表数量
model.put("newsSource", hotwordEntity == null ? 1 : hotwordEntity.getNewsSource()); //新闻来源
//HotwordEntity hotwordEntity = hotwordService.selectOne(hotwordQuery.siteId(homeQueryPdu.getSiteId()));
BasesetEntity basesetEntity = basesetService.selectOne(new BasesetQuery().siteId(homeQueryPdu.getSiteId()));
model.put("blankCount", basesetEntity == null ? 20 : basesetEntity.getPrintDisplay()); //空白样表数量
model.put("newsSource", basesetEntity == null ? 1 : basesetEntity.getNewsSource()); //新闻来源
model.put("message_info", busiDesc + "成功");
this.addDict(model, "newsSource", NewsSourceEnum.getEnumMap());
this.recordSysLog(this.request, busiDesc + " 【成功】");
......
......@@ -8,7 +8,7 @@ import java.util.List;
* 热门词汇业务 DAO接口
*
* @author zxfei
* @date 2022-12-06
* @date 2022-12-08
*/
public interface HotwordDao extends ICRUDDao<HotwordEntity,Long>{
......
......@@ -11,7 +11,7 @@ import java.util.List;
* 热门词汇业务DaoImpl DAO接口
*
* @author zxfei
* @date 2022-12-06
* @date 2022-12-08
*/
@Repository("hotwordDao")
public class HotwordDaoImpl extends BaseCRUDDaoMybatis<HotwordEntity,Long> implements HotwordDao {
......
package com.mortals.xhx.module.hotword.model;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.hotword.model.vo.HotwordVo;
/**
* 热门词汇业务实体对象
*
* @author zxfei
* @date 2022-12-07
*/
* 热门词汇业务实体对象
*
* @author zxfei
* @date 2022-12-08
*/
public class HotwordEntity extends HotwordVo {
private static final long serialVersionUID = 1L;
......@@ -19,14 +24,6 @@ public class HotwordEntity extends HotwordVo {
* 热门词汇
*/
private String hotwords;
/**
* 空白打印材料展示数量
*/
private Integer printDisplay;
/**
* 新闻来源(1.热点新闻,2.本地要闻,3.政策发布,4.通知公告)
*/
private Integer newsSource;
/**
* 查询次数
*/
......@@ -67,34 +64,6 @@ public class HotwordEntity extends HotwordVo {
public void setHotwords(String hotwords){
this.hotwords = hotwords;
}
/**
* 获取 空白打印材料展示数量
* @return Integer
*/
public Integer getPrintDisplay(){
return printDisplay;
}
/**
* 设置 空白打印材料展示数量
* @param printDisplay
*/
public void setPrintDisplay(Integer printDisplay){
this.printDisplay = printDisplay;
}
/**
* 获取 新闻来源(1.热点新闻,2.本地要闻,3.政策发布,4.通知公告)
* @return Integer
*/
public Integer getNewsSource(){
return newsSource;
}
/**
* 设置 新闻来源(1.热点新闻,2.本地要闻,3.政策发布,4.通知公告)
* @param newsSource
*/
public void setNewsSource(Integer newsSource){
this.newsSource = newsSource;
}
/**
* 获取 查询次数
* @return Integer
......@@ -147,8 +116,6 @@ public class HotwordEntity extends HotwordVo {
StringBuilder sb = new StringBuilder("");
sb.append(",siteId:").append(getSiteId());
sb.append(",hotwords:").append(getHotwords());
sb.append(",printDisplay:").append(getPrintDisplay());
sb.append(",newsSource:").append(getNewsSource());
sb.append(",searchCount:").append(getSearchCount());
sb.append(",wordsSource:").append(getWordsSource());
return sb.toString();
......@@ -160,10 +127,6 @@ public class HotwordEntity extends HotwordVo {
this.hotwords = "";
this.printDisplay = 0;
this.newsSource = 1;
this.searchCount = 0;
this.wordsSource = 1;
......
......@@ -3,11 +3,11 @@ package com.mortals.xhx.module.hotword.model;
import java.util.List;
import com.mortals.xhx.module.hotword.model.HotwordEntity;
/**
* 热门词汇业务查询对象
*
* @author zxfei
* @date 2022-12-07
*/
* 热门词汇业务查询对象
*
* @author zxfei
* @date 2022-12-08
*/
public class HotwordQuery extends HotwordEntity {
/** 开始 主键,自增长 */
private Long idStart;
......@@ -36,30 +36,6 @@ public class HotwordQuery extends HotwordEntity {
/** 热门词汇 */
private List<String> hotwordsList;
/** 开始 空白打印材料展示数量 */
private Integer printDisplayStart;
/** 结束 空白打印材料展示数量 */
private Integer printDisplayEnd;
/** 增加 空白打印材料展示数量 */
private Integer printDisplayIncrement;
/** 空白打印材料展示数量列表 */
private List <Integer> printDisplayList;
/** 开始 新闻来源(1.热点新闻,2.本地要闻,3.政策发布,4.通知公告) */
private Integer newsSourceStart;
/** 结束 新闻来源(1.热点新闻,2.本地要闻,3.政策发布,4.通知公告) */
private Integer newsSourceEnd;
/** 增加 新闻来源(1.热点新闻,2.本地要闻,3.政策发布,4.通知公告) */
private Integer newsSourceIncrement;
/** 新闻来源(1.热点新闻,2.本地要闻,3.政策发布,4.通知公告)列表 */
private List <Integer> newsSourceList;
/** 开始 查询次数 */
private Integer searchCountStart;
......@@ -259,134 +235,6 @@ public class HotwordQuery extends HotwordEntity {
public void setHotwordsList(List<String> hotwordsList){
this.hotwordsList = hotwordsList;
}
/**
* 获取 开始 空白打印材料展示数量
* @return printDisplayStart
*/
public Integer getPrintDisplayStart(){
return this.printDisplayStart;
}
/**
* 设置 开始 空白打印材料展示数量
* @param printDisplayStart
*/
public void setPrintDisplayStart(Integer printDisplayStart){
this.printDisplayStart = printDisplayStart;
}
/**
* 获取 结束 空白打印材料展示数量
* @return $printDisplayEnd
*/
public Integer getPrintDisplayEnd(){
return this.printDisplayEnd;
}
/**
* 设置 结束 空白打印材料展示数量
* @param printDisplayEnd
*/
public void setPrintDisplayEnd(Integer printDisplayEnd){
this.printDisplayEnd = printDisplayEnd;
}
/**
* 获取 增加 空白打印材料展示数量
* @return printDisplayIncrement
*/
public Integer getPrintDisplayIncrement(){
return this.printDisplayIncrement;
}
/**
* 设置 增加 空白打印材料展示数量
* @param printDisplayIncrement
*/
public void setPrintDisplayIncrement(Integer printDisplayIncrement){
this.printDisplayIncrement = printDisplayIncrement;
}
/**
* 获取 空白打印材料展示数量
* @return printDisplayList
*/
public List<Integer> getPrintDisplayList(){
return this.printDisplayList;
}
/**
* 设置 空白打印材料展示数量
* @param printDisplayList
*/
public void setPrintDisplayList(List<Integer> printDisplayList){
this.printDisplayList = printDisplayList;
}
/**
* 获取 开始 新闻来源(1.热点新闻,2.本地要闻,3.政策发布,4.通知公告)
* @return newsSourceStart
*/
public Integer getNewsSourceStart(){
return this.newsSourceStart;
}
/**
* 设置 开始 新闻来源(1.热点新闻,2.本地要闻,3.政策发布,4.通知公告)
* @param newsSourceStart
*/
public void setNewsSourceStart(Integer newsSourceStart){
this.newsSourceStart = newsSourceStart;
}
/**
* 获取 结束 新闻来源(1.热点新闻,2.本地要闻,3.政策发布,4.通知公告)
* @return $newsSourceEnd
*/
public Integer getNewsSourceEnd(){
return this.newsSourceEnd;
}
/**
* 设置 结束 新闻来源(1.热点新闻,2.本地要闻,3.政策发布,4.通知公告)
* @param newsSourceEnd
*/
public void setNewsSourceEnd(Integer newsSourceEnd){
this.newsSourceEnd = newsSourceEnd;
}
/**
* 获取 增加 新闻来源(1.热点新闻,2.本地要闻,3.政策发布,4.通知公告)
* @return newsSourceIncrement
*/
public Integer getNewsSourceIncrement(){
return this.newsSourceIncrement;
}
/**
* 设置 增加 新闻来源(1.热点新闻,2.本地要闻,3.政策发布,4.通知公告)
* @param newsSourceIncrement
*/
public void setNewsSourceIncrement(Integer newsSourceIncrement){
this.newsSourceIncrement = newsSourceIncrement;
}
/**
* 获取 新闻来源(1.热点新闻,2.本地要闻,3.政策发布,4.通知公告)
* @return newsSourceList
*/
public List<Integer> getNewsSourceList(){
return this.newsSourceList;
}
/**
* 设置 新闻来源(1.热点新闻,2.本地要闻,3.政策发布,4.通知公告)
* @param newsSourceList
*/
public void setNewsSourceList(List<Integer> newsSourceList){
this.newsSourceList = newsSourceList;
}
/**
* 获取 开始 查询次数
* @return searchCountStart
......@@ -752,96 +600,6 @@ public class HotwordQuery extends HotwordEntity {
return this;
}
/**
* 设置 空白打印材料展示数量
* @param printDisplay
*/
public HotwordQuery printDisplay(Integer printDisplay){
setPrintDisplay(printDisplay);
return this;
}
/**
* 设置 开始 空白打印材料展示数量
* @param printDisplayStart
*/
public HotwordQuery printDisplayStart(Integer printDisplayStart){
this.printDisplayStart = printDisplayStart;
return this;
}
/**
* 设置 结束 空白打印材料展示数量
* @param printDisplayEnd
*/
public HotwordQuery printDisplayEnd(Integer printDisplayEnd){
this.printDisplayEnd = printDisplayEnd;
return this;
}
/**
* 设置 增加 空白打印材料展示数量
* @param printDisplayIncrement
*/
public HotwordQuery printDisplayIncrement(Integer printDisplayIncrement){
this.printDisplayIncrement = printDisplayIncrement;
return this;
}
/**
* 设置 空白打印材料展示数量
* @param printDisplayList
*/
public HotwordQuery printDisplayList(List<Integer> printDisplayList){
this.printDisplayList = printDisplayList;
return this;
}
/**
* 设置 新闻来源(1.热点新闻,2.本地要闻,3.政策发布,4.通知公告)
* @param newsSource
*/
public HotwordQuery newsSource(Integer newsSource){
setNewsSource(newsSource);
return this;
}
/**
* 设置 开始 新闻来源(1.热点新闻,2.本地要闻,3.政策发布,4.通知公告)
* @param newsSourceStart
*/
public HotwordQuery newsSourceStart(Integer newsSourceStart){
this.newsSourceStart = newsSourceStart;
return this;
}
/**
* 设置 结束 新闻来源(1.热点新闻,2.本地要闻,3.政策发布,4.通知公告)
* @param newsSourceEnd
*/
public HotwordQuery newsSourceEnd(Integer newsSourceEnd){
this.newsSourceEnd = newsSourceEnd;
return this;
}
/**
* 设置 增加 新闻来源(1.热点新闻,2.本地要闻,3.政策发布,4.通知公告)
* @param newsSourceIncrement
*/
public HotwordQuery newsSourceIncrement(Integer newsSourceIncrement){
this.newsSourceIncrement = newsSourceIncrement;
return this;
}
/**
* 设置 新闻来源(1.热点新闻,2.本地要闻,3.政策发布,4.通知公告)
* @param newsSourceList
*/
public HotwordQuery newsSourceList(List<Integer> newsSourceList){
this.newsSourceList = newsSourceList;
return this;
}
/**
* 设置 查询次数
* @param searchCount
......
......@@ -7,7 +7,7 @@ import java.util.List;
* 热门词汇业务视图对象
*
* @author zxfei
* @date 2022-12-06
* @date 2022-12-08
*/
public class HotwordVo extends BaseEntityLong {
......
......@@ -7,7 +7,7 @@ import com.mortals.xhx.module.hotword.model.HotwordEntity;
* 热门词汇业务 service接口
*
* @author zxfei
* @date 2022-12-06
* @date 2022-12-08
*/
public interface HotwordService extends ICRUDService<HotwordEntity,Long>{
......
package com.mortals.xhx.module.hotword.service.impl;
import com.mortals.xhx.module.hotword.model.HotwordQuery;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
......@@ -7,14 +6,12 @@ import com.mortals.framework.model.Context;
import com.mortals.xhx.module.hotword.dao.HotwordDao;
import com.mortals.xhx.module.hotword.model.HotwordEntity;
import com.mortals.xhx.module.hotword.service.HotwordService;
import org.springframework.util.ObjectUtils;
/**
* HotwordService
* 热门词汇业务 service实现
*
* @author zxfei
* @date 2022-12-06
* @date 2022-12-08
*/
@Service("hotwordService")
public class HotwordServiceImpl extends AbstractCRUDServiceImpl<HotwordDao, HotwordEntity, Long> implements HotwordService {
......
package com.mortals.xhx.module.hotword.web;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.NewsSourceEnum;
import com.mortals.xhx.module.hotword.model.HotwordQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.module.hotword.model.HotwordEntity;
import com.mortals.xhx.module.hotword.service.HotwordService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/**
* 热门词汇业务
*
* @author zxfei
* @date 2022-12-06
*/
*
* 热门词汇业务
*
* @author zxfei
* @date 2022-12-08
*/
@RestController
@RequestMapping("hotword")
public class HotwordController extends BaseCRUDJsonBodyMappingController<HotwordService, HotwordEntity, Long> {
public class HotwordController extends BaseCRUDJsonBodyMappingController<HotwordService,HotwordEntity,Long> {
@Autowired
private ParamService paramService;
public HotwordController() {
super.setModuleDesc("热门词汇业务");
public HotwordController(){
super.setModuleDesc( "热门词汇业务");
}
@Override
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "newsSource", NewsSourceEnum.getEnumMap());
this.addDict(model, "wordsSource", paramService.getParamBySecondOrganize("Hotword","wordsSource"));
super.init(model, context);
}
@Override
protected void saveBefore(HotwordEntity entity, Map<String, Object> model, Context context) throws AppException {
HotwordEntity hotwordEntity = this.service.selectOne(new HotwordQuery().siteId(entity.getSiteId()));
if(!ObjectUtils.isEmpty(hotwordEntity)){
entity.setId(hotwordEntity.getId());
}
super.saveBefore(entity, model, context);
}
}
\ No newline at end of file
###登录
POST {{baseUrl}}/login/login
Content-Type: application/json
{
"loginName":"admin",
"password":"admin",
"securityCode":"8888"
}
> {%
client.global.set("SmsSet_id", JSON.parse(response.body).data.id);
client.global.set("authToken", JSON.parse(response.body).data.token);
%}
###填单服务基础设置列表
POST {{baseUrl}}/baseset/list
Authorization: {{authToken}}
Content-Type: application/json
{
"siteId":824,
"printDisplay":0,
"newsSource":1,
"page":1,
"size":10
}
###填单服务基础设置更新与保存
POST {{baseUrl}}/baseset/save
Authorization: {{authToken}}
Content-Type: application/json
{
"siteId":564,
"printDisplay":0,
"newsSource":1,
}
> {%
client.global.set("Baseset_id", JSON.parse(response.body).data.id);
%}
###填单服务基础设置查看
GET {{baseUrl}}/baseset/info?id={{Baseset_id}}
Authorization: {{authToken}}
Accept: application/json
###填单服务基础设置编辑
GET {{baseUrl}}/baseset/edit?id={{Baseset_id}}
Authorization: {{authToken}}
Accept: application/json
###填单服务基础设置删除
GET {{baseUrl}}/baseset/delete?id={{Baseset_id}}
Authorization: {{authToken}}
Accept: application/json
###登录
POST {{baseUrl}}/login/login
Content-Type: application/json
{
"loginName":"admin",
"password":"admin",
"securityCode":"8888"
}
> {%
client.global.set("SmsSet_id", JSON.parse(response.body).data.id);
client.global.set("authToken", JSON.parse(response.body).data.token);
%}
###热门词汇业务列表
POST {{baseUrl}}/hotword/list
Authorization: {{authToken}}
Content-Type: application/json
{
"siteId":889,
"hotwords":"jdjiit",
"searchCount":0,
"wordsSource":1,
"page":1,
"size":10
}
###热门词汇业务更新与保存
POST {{baseUrl}}/hotword/save
Authorization: {{authToken}}
Content-Type: application/json
{
"siteId":324,
"hotwords":"qxfiww",
"searchCount":0,
"wordsSource":1,
}
> {%
client.global.set("Hotword_id", JSON.parse(response.body).data.id);
%}
###热门词汇业务查看
GET {{baseUrl}}/hotword/info?id={{Hotword_id}}
Authorization: {{authToken}}
Accept: application/json
###热门词汇业务编辑
GET {{baseUrl}}/hotword/edit?id={{Hotword_id}}
Authorization: {{authToken}}
Accept: application/json
###热门词汇业务删除
GET {{baseUrl}}/hotword/delete?id={{Hotword_id}}
Authorization: {{authToken}}
Accept: application/json
......@@ -33,9 +33,8 @@ Content-Type: application/json
{
"siteId": 3,
"page": 1,
"size": 10,
"materiaFullName": "测试1"
"page": 2,
"size": 10
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment