修改soc管理,增加了阿里云短信总数字段
This commit is contained in:
parent
87aed0f600
commit
47f7ab0e40
@ -24,8 +24,8 @@ public class XhpcServiceDataUpdateController {
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,9 +11,25 @@ import java.util.Map;
|
||||
*/
|
||||
public interface IXhpcServiceDataUpdateService {
|
||||
|
||||
Map<String,Object> list();
|
||||
/**
|
||||
* 得到一个包含了soc,phone,version的列表
|
||||
*
|
||||
* @return 一个装着soc,phone,version的值的map集合
|
||||
* @author WH
|
||||
* @date 2021/11/30 14:37
|
||||
* @since version-1.0
|
||||
*/
|
||||
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);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -25,31 +25,37 @@ public class XhpcServiceDataUpdateServiceImpl implements IXhpcServiceDataUpdateS
|
||||
String cacheSOC = redisService.getCacheObject("global:SOC");
|
||||
String cacheVersion = redisService.getCacheObject("global:version");
|
||||
String cachePhone = redisService.getCacheObject("global:phone");
|
||||
String cacheAliyunMessageCount = redisService.getCacheObject("global:AliyunMessageCount");
|
||||
list.put("SOC",cacheSOC);
|
||||
list.put("version",cacheVersion);
|
||||
list.put("phone",cachePhone);
|
||||
list.put("phone", cachePhone);
|
||||
list.put("AliyunMessageCount", cacheAliyunMessageCount);
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@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);
|
||||
if (!(soc >= 1 && soc <= 100)) {
|
||||
return AjaxResult.error("范围应为[1-100]");
|
||||
}
|
||||
}
|
||||
if(phone!=null) {
|
||||
if (phone != null) {
|
||||
if (phone.length() > 20) {
|
||||
return AjaxResult.error("号码格式错误");
|
||||
}
|
||||
}
|
||||
if (aliyunMessageCount == null && "".equals(aliyunMessageCount)) {
|
||||
return AjaxResult.error("短信条数为空");
|
||||
}
|
||||
|
||||
redisService.setCacheObject("global:SOC",SOC);
|
||||
redisService.setCacheObject("global:version",version);
|
||||
redisService.setCacheObject("global:phone",phone);
|
||||
redisService.setCacheObject("global:SOC", SOC);
|
||||
redisService.setCacheObject("global:version", version);
|
||||
redisService.setCacheObject("global:phone", phone);
|
||||
redisService.setCacheObject("global:AliyunMessageCount", aliyunMessageCount);
|
||||
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user