完成首页弹窗功能

dev
胡锐 1 month ago
parent c2dd5c1c52
commit c7f3ac4b5a
  1. 2
      bweb/src/main/java/com/bweb/controller/CmsController.java
  2. 9
      cweb/src/main/java/com/cweb/controller/CmsController.java
  3. 2
      service/src/main/java/com/hfkj/sysenum/cms/CmsTypeEnum.java

@ -47,8 +47,6 @@ public class CmsController {
if (body == null if (body == null
|| body.getType() == null || body.getType() == null
|| StringUtils.isBlank(body.getImgUrl()) || StringUtils.isBlank(body.getImgUrl())
|| body.getJumpType() == null
|| StringUtils.isBlank(body.getJumpUrl())
) { ) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR);
} }

@ -93,11 +93,12 @@ public class CmsController {
redisUtil.hset(CmsContentServiceImpl.CACHE_CMS_ONLINE, "" + type, dataList); redisUtil.hset(CmsContentServiceImpl.CACHE_CMS_ONLINE, "" + type, dataList);
} }
for (CmsContent data : dataList) { for (CmsContent data : dataList) {
if (CmsTypeEnum.type1.getType().equals(data.getType()) && userSession != null) { if (CmsTypeEnum.type2.getType().equals(data.getType()) && userSession != null) {
// 用户是否阅读 // 用户是否阅读,阅读过就不展示
data.setExt1(""+cmsContentReadService.isRead(data.getId(), userSession.getUser().getId())); data.setExt1(""+(!cmsContentReadService.isRead(data.getId(), userSession.getUser().getId())));
} else { } else {
data.setExt1("false"); // 展示
data.setExt1("true");
} }
} }
return ResponseMsgUtil.success(dataList); return ResponseMsgUtil.success(dataList);

@ -19,7 +19,7 @@ public enum CmsTypeEnum {
/** /**
* 首页弹出框 * 首页弹出框
*/ */
type2(1 , "首页弹出框"), type2(2 , "首页弹出框"),
; ;
private Integer type; private Integer type;

Loading…
Cancel
Save