|
|
@@ -1,8 +1,9 @@
|
|
|
package com.etotem.cfc.controller.dan;
|
|
|
|
|
|
-import com.etotem.cfc.dto.*;
|
|
|
+import com.etotem.cfc.common.Result;
|
|
|
+import com.etotem.cfc.config.JwtConfig;
|
|
|
+import com.etotem.cfc.entity.DanAssessmentExecution;
|
|
|
import com.etotem.cfc.service.DanAssessmentExecutionService;
|
|
|
-import com.etotem.cfc.util.JwtUtil;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
@@ -21,7 +22,7 @@ public class DanAssessmentExecutionController {
|
|
|
private DanAssessmentExecutionService executionService;
|
|
|
|
|
|
@Resource
|
|
|
- private JwtUtil jwtUtil;
|
|
|
+ private JwtConfig jwtConfig;
|
|
|
|
|
|
/**
|
|
|
* 规划师/评估师完成服务
|
|
|
@@ -33,7 +34,7 @@ public class DanAssessmentExecutionController {
|
|
|
if (token == null || !token.startsWith("Bearer ")) {
|
|
|
return Result.error("未提供认证 Token");
|
|
|
}
|
|
|
- Long userId = jwtUtil.getUserIdFromToken(token.replace("Bearer ", ""));
|
|
|
+ Long userId = jwtConfig.getUserIdFromToken(token.replace("Bearer ", ""));
|
|
|
if (userId == null) {
|
|
|
return Result.error("Token 无效");
|
|
|
}
|
|
|
@@ -53,7 +54,7 @@ public class DanAssessmentExecutionController {
|
|
|
if (token == null || !token.startsWith("Bearer ")) {
|
|
|
return Result.error("未提供认证 Token");
|
|
|
}
|
|
|
- Long userId = jwtUtil.getUserIdFromToken(token.replace("Bearer ", ""));
|
|
|
+ Long userId = jwtConfig.getUserIdFromToken(token.replace("Bearer ", ""));
|
|
|
if (userId == null) {
|
|
|
return Result.error("Token 无效");
|
|
|
}
|
|
|
@@ -72,7 +73,7 @@ public class DanAssessmentExecutionController {
|
|
|
if (token == null || !token.startsWith("Bearer ")) {
|
|
|
return Result.error("未提供认证 Token");
|
|
|
}
|
|
|
- Long userId = jwtUtil.getUserIdFromToken(token.replace("Bearer ", ""));
|
|
|
+ Long userId = jwtConfig.getUserIdFromToken(token.replace("Bearer ", ""));
|
|
|
if (userId == null) {
|
|
|
return Result.error("Token 无效");
|
|
|
}
|
|
|
@@ -98,7 +99,7 @@ public class DanAssessmentExecutionController {
|
|
|
*/
|
|
|
@PostMapping("/my-list")
|
|
|
public Result<List<DanAssessmentExecution>> myList(@RequestBody MyExecutionFilter filter, HttpServletRequest request) {
|
|
|
- Long userId = jwtUtil.getUserIdFromToken(request.getHeader("Authorization"));
|
|
|
+ Long userId = jwtConfig.getUserIdFromToken(request.getHeader("Authorization"));
|
|
|
List<DanAssessmentExecution> executions = executionService.getByFamilyId(filter.getFamilyId());
|
|
|
return Result.success(executions);
|
|
|
}
|