Commit 5d1960cb by kenzo

add getExpertInfo

parent a90b10d0
...@@ -4,9 +4,9 @@ import com.cnooc.expert.common.response.ApiResult; ...@@ -4,9 +4,9 @@ import com.cnooc.expert.common.response.ApiResult;
import com.cnooc.expert.common.response.BasePageResp; import com.cnooc.expert.common.response.BasePageResp;
import com.cnooc.expert.controller.expert.model.request.CompanyPageReq; import com.cnooc.expert.controller.expert.model.request.CompanyPageReq;
import com.cnooc.expert.controller.expert.model.request.DictNofilterListReq; import com.cnooc.expert.controller.expert.model.request.DictNofilterListReq;
import com.cnooc.expert.controller.expert.model.response.DictListResp; import com.cnooc.expert.controller.expert.model.response.DictListItemResp;
import com.cnooc.expert.controller.expert.model.response.NofilterListResp; import com.cnooc.expert.controller.expert.model.response.NofilterListItemResp;
import com.cnooc.expert.controller.expert.model.response.SecondaryUnitListResp; import com.cnooc.expert.controller.expert.model.response.SecondaryUnitListItemResp;
import com.cnooc.expert.service.ExpertService; import com.cnooc.expert.service.ExpertService;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
...@@ -17,6 +17,8 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -17,6 +17,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@AllArgsConstructor @AllArgsConstructor
@RestController @RestController
@RequestMapping("/expert") @RequestMapping("/expert")
...@@ -38,7 +40,7 @@ public class ExpertController { ...@@ -38,7 +40,7 @@ public class ExpertController {
* @return * @return
*/ */
@PostMapping("/nofilter/list") @PostMapping("/nofilter/list")
public ApiResult<NofilterListResp> dictNofilterList(@RequestBody @Validated DictNofilterListReq req) { public ApiResult<List<NofilterListItemResp>> dictNofilterList(@RequestBody @Validated DictNofilterListReq req) {
return ApiResult.successWithResult(expertService.listDictNofilter(req)); return ApiResult.successWithResult(expertService.listDictNofilter(req));
} }
...@@ -48,7 +50,7 @@ public class ExpertController { ...@@ -48,7 +50,7 @@ public class ExpertController {
* @return * @return
*/ */
@PostMapping("/secondary-unit/list") @PostMapping("/secondary-unit/list")
public ApiResult<SecondaryUnitListResp> secondaryUnitList() { public ApiResult<List<SecondaryUnitListItemResp>> secondaryUnitList() {
return ApiResult.successWithResult(expertService.listSecondaryUnit()); return ApiResult.successWithResult(expertService.listSecondaryUnit());
} }
...@@ -58,7 +60,7 @@ public class ExpertController { ...@@ -58,7 +60,7 @@ public class ExpertController {
* @return * @return
*/ */
@PostMapping("/dict/guid4/list") @PostMapping("/dict/guid4/list")
public ApiResult<DictListResp> dictGuiud4List() { public ApiResult<List<DictListItemResp>> dictGuiud4List() {
return ApiResult.successWithResult(expertService.listDict4()); return ApiResult.successWithResult(expertService.listDict4());
} }
...@@ -68,7 +70,7 @@ public class ExpertController { ...@@ -68,7 +70,7 @@ public class ExpertController {
* @return * @return
*/ */
@PostMapping("/dict/guid5/list") @PostMapping("/dict/guid5/list")
public ApiResult<DictListResp> dictGuiud5List() { public ApiResult<List<DictListItemResp>> dictGuiud5List() {
return ApiResult.successWithResult(expertService.listDict5()); return ApiResult.successWithResult(expertService.listDict5());
} }
...@@ -79,12 +81,13 @@ public class ExpertController { ...@@ -79,12 +81,13 @@ public class ExpertController {
* @return * @return
*/ */
@PostMapping("/dict/guid6/list") @PostMapping("/dict/guid6/list")
public ApiResult<DictListResp> dictGuiud6List() { public ApiResult<List<DictListItemResp>> dictGuiud6List() {
return ApiResult.successWithResult(expertService.listDict6()); return ApiResult.successWithResult(expertService.listDict6());
} }
/** /**
* 公司列表 * 公司列表
*
* @return * @return
*/ */
@PostMapping("/company/page") @PostMapping("/company/page")
...@@ -92,6 +95,15 @@ public class ExpertController { ...@@ -92,6 +95,15 @@ public class ExpertController {
return ApiResult.successWithResult(expertService.pageCompany(req)); return ApiResult.successWithResult(expertService.pageCompany(req));
} }
/**
* 专家个人信息
*
* @return
*/
@PostMapping("/info")
public ApiResult<ExpertInfoGetResp> ExpertInfoGet(@RequestBody @Validated CompanyPageReq req) {
return ApiResult.successWithResult(expertService.getExpertInfo(req));
}
} }
...@@ -3,23 +3,14 @@ package com.cnooc.expert.controller.expert.model.response; ...@@ -3,23 +3,14 @@ package com.cnooc.expert.controller.expert.model.response;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
import java.util.List;
@Data @Data
@Builder @Builder
public class DictListResp { public class DictListItemResp {
private List<Item> data;
@Data
@Builder
public static class Item {
private String dictGuid; private String dictGuid;
private String key; private String key;
private String value; private String value;
}
} }
...@@ -3,21 +3,11 @@ package com.cnooc.expert.controller.expert.model.response; ...@@ -3,21 +3,11 @@ package com.cnooc.expert.controller.expert.model.response;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
import java.util.List;
@Data @Data
@Builder @Builder
public class NofilterListResp { public class NofilterListItemResp {
private List<Item> data;
@Data
@Builder
public static class Item {
private String id; private String id;
private String text; private String text;
}
} }
...@@ -3,21 +3,12 @@ package com.cnooc.expert.controller.expert.model.response; ...@@ -3,21 +3,12 @@ package com.cnooc.expert.controller.expert.model.response;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
import java.util.List;
@Data @Data
@Builder @Builder
public class SecondaryUnitListResp { public class SecondaryUnitListItemResp {
private List<Item> data;
@Data
@Builder
public static class Item {
private String code; private String code;
private String name; private String name;
}
} }
...@@ -4,10 +4,9 @@ import com.cnooc.expert.common.response.BasePageResp; ...@@ -4,10 +4,9 @@ import com.cnooc.expert.common.response.BasePageResp;
import com.cnooc.expert.controller.expert.model.request.CompanyPageReq; import com.cnooc.expert.controller.expert.model.request.CompanyPageReq;
import com.cnooc.expert.controller.expert.model.request.DictNofilterListReq; import com.cnooc.expert.controller.expert.model.request.DictNofilterListReq;
import com.cnooc.expert.controller.expert.model.response.CompanyPageResp; import com.cnooc.expert.controller.expert.model.response.CompanyPageResp;
import com.cnooc.expert.controller.expert.model.response.DictListResp; import com.cnooc.expert.controller.expert.model.response.DictListItemResp;
import com.cnooc.expert.controller.expert.model.response.NofilterListResp; import com.cnooc.expert.controller.expert.model.response.NofilterListItemResp;
import com.cnooc.expert.controller.expert.model.response.SecondaryUnitListResp; import com.cnooc.expert.controller.expert.model.response.SecondaryUnitListItemResp;
import com.cnooc.expert.controller.portal.model.response.MessagePageResp;
import com.cnooc.expert.external.expert.model.response.ExpertInfoGetResp; import com.cnooc.expert.external.expert.model.response.ExpertInfoGetResp;
import com.cnooc.expert.external.expert.service.ExpertServiceClient; import com.cnooc.expert.external.expert.service.ExpertServiceClient;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
...@@ -32,107 +31,87 @@ public class ExpertService { ...@@ -32,107 +31,87 @@ public class ExpertService {
return objectMapper.writeValueAsString(result); return objectMapper.writeValueAsString(result);
} }
public NofilterListResp listDictNofilter(DictNofilterListReq req) { public List<NofilterListItemResp> listDictNofilter(DictNofilterListReq req) {
ArrayList<NofilterListResp.Item> data = Lists.newArrayList( ArrayList<NofilterListItemResp> result = Lists.newArrayList(
NofilterListResp.Item.builder() NofilterListItemResp.builder()
.id("1") .id("1")
.text("汉族") .text("汉族")
.build(), .build(),
NofilterListResp.Item.builder() NofilterListItemResp.builder()
.id("2") .id("2")
.text("蒙古族") .text("蒙古族")
.build() .build()
); );
NofilterListResp result = NofilterListResp.builder()
.data(data)
.build();
return result; return result;
} }
public SecondaryUnitListResp listSecondaryUnit() { public List<SecondaryUnitListItemResp> listSecondaryUnit() {
ArrayList<SecondaryUnitListResp.Item> data = Lists.newArrayList( ArrayList<SecondaryUnitListItemResp> result = Lists.newArrayList(
SecondaryUnitListResp.Item.builder() SecondaryUnitListItemResp.builder()
.code("1") .code("1")
.name("中海油研究总院有限责任公司") .name("中海油研究总院有限责任公司")
.build(), .build(),
SecondaryUnitListResp.Item.builder() SecondaryUnitListItemResp.builder()
.code("2") .code("2")
.name("中海石油化工进出口有限公司") .name("中海石油化工进出口有限公司")
.build() .build()
); );
SecondaryUnitListResp result = SecondaryUnitListResp.builder()
.data(data)
.build();
return result; return result;
} }
public DictListResp listDict4() { public List<DictListItemResp> listDict4() {
ArrayList<DictListResp.Item> data = Lists.newArrayList( ArrayList<DictListItemResp> result = Lists.newArrayList(
DictListResp.Item.builder() DictListItemResp.builder()
.key("1") .key("1")
.value("一级建造师(通信与广电工程)") .value("一级建造师(通信与广电工程)")
.build(), .build(),
DictListResp.Item.builder() DictListItemResp.builder()
.key("2") .key("2")
.value("二级建造师(通信与广电工程)") .value("二级建造师(通信与广电工程)")
.build() .build()
); );
DictListResp result = DictListResp.builder()
.data(data)
.build();
return result; return result;
} }
public DictListResp listDict5() { public List<DictListItemResp> listDict5() {
ArrayList<DictListResp.Item> data = Lists.newArrayList( ArrayList<DictListItemResp> result = Lists.newArrayList(
DictListResp.Item.builder() DictListItemResp.builder()
.dictGuid("625ade01-00f0-4a1f-93d8-66d6b4c5a2b3") .dictGuid("625ade01-00f0-4a1f-93d8-66d6b4c5a2b3")
.key("") .key("")
.value("博士研究生") .value("博士研究生")
.build(), .build(),
DictListResp.Item.builder() DictListItemResp.builder()
.dictGuid("708932cc-794c-4d1a-b30e-a16afd364495") .dictGuid("708932cc-794c-4d1a-b30e-a16afd364495")
.key("") .key("")
.value("硕士研究生") .value("硕士研究生")
.build() .build()
); );
DictListResp result = DictListResp.builder()
.data(data)
.build();
return result; return result;
} }
public DictListResp listDict6() { public List<DictListItemResp> listDict6() {
ArrayList<DictListResp.Item> data = Lists.newArrayList( ArrayList<DictListItemResp> result = Lists.newArrayList(
DictListResp.Item.builder() DictListItemResp.builder()
.dictGuid("28a0942a-84ad-4329-8be4-8196ed3164fe") .dictGuid("28a0942a-84ad-4329-8be4-8196ed3164fe")
.key("") .key("")
.value("学士") .value("学士")
.build(), .build(),
DictListResp.Item.builder() DictListItemResp.builder()
.dictGuid("5676942a-84ad-4329-8be4-8196ed3164fe") .dictGuid("5676942a-84ad-4329-8be4-8196ed3164fe")
.key("") .key("")
.value("其他") .value("其他")
.build() .build()
); );
DictListResp result = DictListResp.builder()
.data(data)
.build();
return result; return result;
} }
...@@ -167,4 +146,10 @@ public class ExpertService { ...@@ -167,4 +146,10 @@ public class ExpertService {
.data(data) .data(data)
.build(); .build();
} }
public Object getExpertInfo(CompanyPageReq req) {
return null;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment