Explorar o código

修改错误,原来调错接口。加上非空判断。

xuxuan %!s(int64=5) %!d(string=hai) anos
pai
achega
dfe70a0671

+ 6 - 4
core/src/main/java/com/mooctest/crowd/domain/repository/UserRepo.java

@@ -413,11 +413,13 @@ public class UserRepo implements IUserRepo {
             userResult.setEnterpriseAuthentication(Converter.convert(EnterpriseAuthentication.class, enterpriseAuthenticationPO));
         }
         //获取用户能力
+        List<String> abailities = new ArrayList<>();
          String []abilities=userPO.getPersonalCompetence().split(",");
-        List<String>  abailities= new ArrayList<>();
-        for(int i=0;i<abilities.length;i++){
-            String  abilityName=testTypeDao.findByCode(abilities[i]).get().getName();
-            abailities.add(abilityName);
+        if(abilities!=null) {
+            for (int i = 0; i < abilities.length; i++) {
+                String abilityName = testTypeDao.findByCode(abilities[i]).get().getName();
+                abailities.add(abilityName);
+            }
         }
         userResult.setPersonAbilities(abailities);
         /*获取区域管理员信息*/

+ 4 - 4
site/src/main/java/com/mooctest/crowd/site/controller/AgencyController.java

@@ -131,13 +131,13 @@ public class AgencyController extends BaseSearchController {
     /**
      * 获取机构认证信息
      *
-     * @param userId
+     * @param anencyId
      * @return
      */
     @LoginRequired
-    @RequestMapping(value = "/user/{userId}/agency", method = RequestMethod.GET)
-    public AgencyVO getAgencyInfo(@PathVariable("userId") Long userId) {
-        return agencyService.getAgencyDetails(userId);
+    @RequestMapping(value = "/user/{agencyId}/agency", method = RequestMethod.GET)
+    public ResponseVO getAgencyInfo(@PathVariable("agencyId") Long anencyId) {
+        return     new ResponseVO(ServerCode.SUCCESS ,agencyService.getDetailById(anencyId));
     }
 
     @RequestMapping(value = "/agency/list", method = RequestMethod.GET)

+ 1 - 1
site/src/main/java/com/mooctest/crowd/site/controller/UserController.java

@@ -81,7 +81,7 @@ public class UserController extends BaseController{
 
     @RequestMapping(value = "/user/detail/{userId}", method = RequestMethod.GET)
     public ResponseVO<UserVO> getUserDetail(@PathVariable Long userId) {
-        return new ResponseVO<>(ServerCode.SUCCESS, userService.getUserDetail(userId));
+        return new ResponseVO(ServerCode.SUCCESS, userService.getUser(userId));
     }
 
     /**

+ 6 - 4
site/src/main/java/com/mooctest/crowd/site/service/impl/AgencyServiceImpl.java

@@ -83,10 +83,12 @@ public class AgencyServiceImpl implements AgencyService {
         String userCompetence = userPO.get().getPersonalCompetence();
         //将 userConpetence按逗号分搁
         String compentence[] = userCompetence.split(",");//JKCS,JRXCE,KKXCS,WDXCS
-        for (int i = 0; i < compentence.length; i++) {
-            //查询对应code的测试类型的名称比如接口测试,兼用型测试等。
-            Optional<TestTypePO> testTypePO = testTypeDao.findByCode(compentence[i]);
-            agencyAbilities.add(testTypePO.get().getName());
+        if(compentence!=null) {
+            for (int i = 0; i < compentence.length; i++) {
+                //查询对应code的测试类型的名称比如接口测试,兼用型测试等。
+                Optional<TestTypePO> testTypePO = testTypeDao.findByCode(compentence[i]);
+                agencyAbilities.add(testTypePO.get().getName());
+            }
         }
         EvaluationAgencyVO agencyVO = new EvaluationAgencyVO(evaluationAgency);
         agencyVO.setAuthStatus(evaluationAgency.getIsAuthentication());