|
|
|
package com.zhonglai.luhui.order.service.controller;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
import com.ruoyi.common.utils.DESUtil;
|
|
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
...
|
...
|
@@ -36,7 +39,7 @@ public class ContentGroupManagementController extends BaseController |
|
|
|
{
|
|
|
|
@Autowired
|
|
|
|
private IContentGroupManagementService contentGroupManagementService;
|
|
|
|
|
|
|
|
public static String ENCODE_KEY = "com/zhonglai";
|
|
|
|
/**
|
|
|
|
* 查询分组内容管理列表
|
|
|
|
*/
|
|
...
|
...
|
@@ -65,9 +68,34 @@ public class ContentGroupManagementController extends BaseController |
|
|
|
@ApiOperation("新增分组内容管理")
|
|
|
|
@Log(title = "分组内容管理", businessType = BusinessType.INSERT)
|
|
|
|
@PostMapping
|
|
|
|
public AjaxResult add(@RequestBody ContentGroupManagement contentGroupManagement)
|
|
|
|
public AjaxResult add(@RequestBody ContentGroupManagement contentGroupManagement, HttpServletRequest httpServletRequest)
|
|
|
|
{
|
|
|
|
if(StringUtils.isNoneBlank(contentGroupManagement.getPhone()))
|
|
|
|
{
|
|
|
|
String key = httpServletRequest.getHeader("key");
|
|
|
|
String code = httpServletRequest.getParameter("code");
|
|
|
|
if(org.apache.commons.lang3.StringUtils.isBlank(key) || key.equals("undefined"))
|
|
|
|
{
|
|
|
|
return AjaxResult.error("请求密钥错误");
|
|
|
|
}
|
|
|
|
|
|
|
|
String[] keys = DESUtil.decode(key, ENCODE_KEY).split("_");
|
|
|
|
Integer time = Integer.parseInt(keys[2]);
|
|
|
|
if((DateUtils.getNowTimeMilly()-time)>5*60)
|
|
|
|
{
|
|
|
|
return AjaxResult.success("验证码超时");
|
|
|
|
}
|
|
|
|
//code
|
|
|
|
if(!keys[0].equals(code))
|
|
|
|
{
|
|
|
|
return AjaxResult.success("验证码错误");
|
|
|
|
}
|
|
|
|
//phone
|
|
|
|
if(!keys[1].equals(contentGroupManagement.getPhone()))
|
|
|
|
{
|
|
|
|
return AjaxResult.success("手机号不一致");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
contentGroupManagement.setCreate_time(DateUtils.getNowTimeMilly());
|
|
|
|
contentGroupManagement.setUpdate_time(contentGroupManagement.getCreate_time());
|
|
|
|
return toAjax(contentGroupManagementService.insertContentGroupManagement(contentGroupManagement));
|
...
|
...
|
|