|
@@ -6,6 +6,7 @@ import com.gis.common.constant.MsgCode;
|
|
|
import com.gis.common.constant.RedisConstant;
|
|
|
import com.gis.common.util.RedisUtil;
|
|
|
import com.gis.common.util.Result;
|
|
|
+import com.gis.domain.dto.WorkPwdDto;
|
|
|
import com.gis.domain.entity.WorkEntity;
|
|
|
import com.gis.service.FodderService;
|
|
|
import com.gis.service.SceneService;
|
|
@@ -18,6 +19,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import javax.validation.Valid;
|
|
|
+import javax.validation.constraints.NotBlank;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
|
|
@@ -87,9 +90,26 @@ public class WebController extends BaseController {
|
|
|
|
|
|
|
|
|
|
|
|
+// @ApiOperation("检验密码")
|
|
|
+// @PostMapping("checkPwd")
|
|
|
+// public Result checkPwd(String workId, String password) {
|
|
|
+// WorkEntity entity = workService.findById(workId);
|
|
|
+// if (entity == null) {
|
|
|
+// log.error("对象不存在, 场景码:{}", workId);
|
|
|
+// return Result.failure("对象不存在");
|
|
|
+// }
|
|
|
+//
|
|
|
+// String dbPassword = entity.getPassword();
|
|
|
+// if (!dbPassword.equals(password)) {
|
|
|
+// return Result.failure(MsgCode.e5004,"密码有误");
|
|
|
+// }
|
|
|
+// return Result.success(entity);
|
|
|
+// }
|
|
|
+
|
|
|
@ApiOperation("检验密码")
|
|
|
@PostMapping("checkPwd")
|
|
|
- public Result checkPwd(String workId, String password) {
|
|
|
+ public Result checkPwd(@Valid @RequestBody WorkPwdDto param) {
|
|
|
+ String workId = param.getWorkId();
|
|
|
WorkEntity entity = workService.findById(workId);
|
|
|
if (entity == null) {
|
|
|
log.error("对象不存在, 场景码:{}", workId);
|
|
@@ -97,7 +117,7 @@ public class WebController extends BaseController {
|
|
|
}
|
|
|
|
|
|
String dbPassword = entity.getPassword();
|
|
|
- if (!dbPassword.equals(password)) {
|
|
|
+ if (!dbPassword.equals(param.getPassword())) {
|
|
|
return Result.failure(MsgCode.e5004,"密码有误");
|
|
|
}
|
|
|
return Result.success(entity);
|