修改soc管理,增加了阿里云短信总数字段

This commit is contained in:
wen 2021-11-30 14:50:41 +08:00
parent 068d9d8bcb
commit db0b2d1685
3 changed files with 33 additions and 11 deletions

View File

@ -24,8 +24,8 @@ public class XhpcServiceDataUpdateController {
} }
@PostMapping("/update") @PostMapping("/update")
public AjaxResult update(@RequestParam(required = false) String SOC, @RequestParam(required = false) String version, @RequestParam(required = false) String phone){ public AjaxResult update(@RequestParam(required = false) String SOC, @RequestParam(required = false) String version, @RequestParam(required = false) String phone, @RequestParam(required = false) String aliyunMessageCount) {
return xhpcServiceDataUpdateService.update(SOC, version, phone); return xhpcServiceDataUpdateService.update(SOC, version, phone, aliyunMessageCount);
} }
} }

View File

@ -11,9 +11,25 @@ import java.util.Map;
*/ */
public interface IXhpcServiceDataUpdateService { public interface IXhpcServiceDataUpdateService {
/**
* 得到一个包含了socphoneversion的列表
*
* @return 一个装着socphoneversion的值的map集合
* @author WH
* @date 2021/11/30 14:37
* @since version-1.0
*/
Map<String, Object> list(); Map<String, Object> list();
AjaxResult update(String SOC, String version, String phone); /**
* 编辑全局soc全局phone全局version全局短信总条数
*
* @return 返回一个用于发送响应信息的AjaxResult对象
* @author WH
* @date 2021/11/30 14:44
* @since version-1.0
*/
AjaxResult update(String SOC, String version, String phone, String aliyunMessageCount);
} }

View File

@ -25,15 +25,17 @@ public class XhpcServiceDataUpdateServiceImpl implements IXhpcServiceDataUpdateS
String cacheSOC = redisService.getCacheObject("global:SOC"); String cacheSOC = redisService.getCacheObject("global:SOC");
String cacheVersion = redisService.getCacheObject("global:version"); String cacheVersion = redisService.getCacheObject("global:version");
String cachePhone = redisService.getCacheObject("global:phone"); String cachePhone = redisService.getCacheObject("global:phone");
String cacheAliyunMessageCount = redisService.getCacheObject("global:AliyunMessageCount");
list.put("SOC",cacheSOC); list.put("SOC",cacheSOC);
list.put("version",cacheVersion); list.put("version",cacheVersion);
list.put("phone", cachePhone); list.put("phone", cachePhone);
list.put("AliyunMessageCount", cacheAliyunMessageCount);
return list; return list;
} }
@Override @Override
public AjaxResult update(String SOC, String version, String phone) { public AjaxResult update(String SOC, String version, String phone, String aliyunMessageCount) {
if (SOC != null) { if (SOC != null) {
int soc = Integer.parseInt(SOC); int soc = Integer.parseInt(SOC);
@ -46,10 +48,14 @@ public class XhpcServiceDataUpdateServiceImpl implements IXhpcServiceDataUpdateS
return AjaxResult.error("号码格式错误"); return AjaxResult.error("号码格式错误");
} }
} }
if (aliyunMessageCount == null && "".equals(aliyunMessageCount)) {
return AjaxResult.error("短信条数为空");
}
redisService.setCacheObject("global:SOC", SOC); redisService.setCacheObject("global:SOC", SOC);
redisService.setCacheObject("global:version", version); redisService.setCacheObject("global:version", version);
redisService.setCacheObject("global:phone", phone); redisService.setCacheObject("global:phone", phone);
redisService.setCacheObject("global:AliyunMessageCount", aliyunMessageCount);
return AjaxResult.success(); return AjaxResult.success();
} }