|
@@ -1,9 +1,12 @@
|
|
|
package com.ym.mec.web.controller;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.ym.mec.biz.dal.dao.AppVersionInfoDao;
|
|
|
+import com.ym.mec.biz.dal.entity.AppVersionInfo;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
@@ -20,9 +23,6 @@ import com.ym.mec.biz.service.SysMessageService;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
import com.ym.mec.common.page.PageInfo;
|
|
|
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.LinkedHashMap;
|
|
|
-
|
|
|
@RestController
|
|
|
@Api(tags = "消息服务")
|
|
|
@RequestMapping("sysMessage")
|
|
@@ -34,6 +34,9 @@ public class SysMessageController extends BaseController {
|
|
|
@Autowired
|
|
|
private SysUserFeignService sysUserFeignService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private AppVersionInfoDao appVersionInfoDao;
|
|
|
+
|
|
|
@ApiOperation("获取所有消息列表")
|
|
|
@GetMapping(value = "list")
|
|
|
public Object list(SysMessageQueryInfo queryInfo){
|
|
@@ -51,7 +54,20 @@ public class SysMessageController extends BaseController {
|
|
|
|
|
|
@ApiOperation("获取消息分类类型")
|
|
|
@GetMapping(value = "typeList")
|
|
|
- public Object typeList(){
|
|
|
+ public Object typeList(String memo){
|
|
|
+ //如果用户使用的版本比当前版本号大,那么屏蔽缴费信息
|
|
|
+ if(StringUtils.isNotEmpty(memo)){
|
|
|
+ //获取当前使用的版本
|
|
|
+ AppVersionInfo appVersionInfo = appVersionInfoDao.queryNewestByPlatform("ios-education").get(0);
|
|
|
+ int defaultVersion = Integer.parseInt(appVersionInfo.getVersion().replaceAll("\\.",""));
|
|
|
+ int currentVersion = Integer.parseInt(memo.replaceAll("\\.",""));
|
|
|
+ if(currentVersion > defaultVersion){
|
|
|
+ return succeed(JSON.parseArray("[{\"value\":\"全部\",\"key\":\"ALL\"}," +
|
|
|
+ "{\"value\":\"学员信息\",\"key\":\"STUDENT\"}," +
|
|
|
+ "{\"value\":\"乐团信息\",\"key\":\"MUSIC\"}," +
|
|
|
+ "{\"value\":\"其他\",\"key\":\"DEFAULT\"}]"));
|
|
|
+ }
|
|
|
+ }
|
|
|
return succeed(JSON.parseArray("[{\"value\":\"全部\",\"key\":\"ALL\"}," +
|
|
|
"{\"value\":\"缴费信息\",\"key\":\"PAY\"}," +
|
|
|
"{\"value\":\"学员信息\",\"key\":\"STUDENT\"}," +
|