|
@@ -1,5 +1,6 @@
|
|
|
package com.zhongzheng.controller.base;
|
|
|
|
|
|
+import cn.hutool.core.lang.Validator;
|
|
|
import com.zhongzheng.common.annotation.Log;
|
|
|
import com.zhongzheng.common.core.controller.BaseController;
|
|
|
import com.zhongzheng.common.core.domain.AjaxResult;
|
|
@@ -10,22 +11,17 @@ import com.zhongzheng.common.utils.SecurityUtils;
|
|
|
import com.zhongzheng.common.utils.ServletUtils;
|
|
|
import com.zhongzheng.framework.web.service.WxTokenService;
|
|
|
import com.zhongzheng.modules.base.bo.ActionLockQueryBo;
|
|
|
-import com.zhongzheng.modules.base.bo.ApplyAreasQueryBo;
|
|
|
-import com.zhongzheng.modules.base.domain.ApplyAreas;
|
|
|
-import com.zhongzheng.modules.base.service.IApplyAreasService;
|
|
|
-import com.zhongzheng.modules.base.vo.ApplyAreasVo;
|
|
|
-import com.zhongzheng.modules.grade.bo.UserPeriodEditBo;
|
|
|
+
|
|
|
import com.zhongzheng.modules.user.entity.ClientLoginUser;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.List;
|
|
|
+
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
/**
|
|
@@ -51,10 +47,10 @@ public class LockController extends BaseController {
|
|
|
@PreAuthorize("@ss.hasPermi('grade:grade:edit')")
|
|
|
@Log(title = "锁定行为", businessType = BusinessType.UPDATE)
|
|
|
@PostMapping("/lockAction")
|
|
|
- public AjaxResult<Void> lockAction(@RequestBody ActionLockQueryBo bo) {
|
|
|
+ public AjaxResult<Void> lockAction(@Validated @RequestBody ActionLockQueryBo bo) {
|
|
|
ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
String key = "LockAppAction_"+bo.getAction()+"-"+loginUser.getUser().getUserId();
|
|
|
- redisCache.setCacheObject(key, SecurityUtils.getUsername(),13, TimeUnit.SECONDS);//13秒锁定
|
|
|
+ redisCache.setCacheObject(key, bo.getAction(),13, TimeUnit.SECONDS);//13秒锁定
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
|