10 changed files with 158 additions and 11 deletions
@ -0,0 +1,38 @@ |
|||
package com.elink.esua.epdc.controller; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.psychology.form.PsychologyUnansweredFormDTO; |
|||
import com.elink.esua.epdc.dto.psychology.result.PsychologyUnansweredResultDTO; |
|||
import com.elink.esua.epdc.service.WorkPropertyService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author: qushutong |
|||
* @Date: 2020/5/12 11:11 |
|||
* @Description: 物业相关 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("work/property") |
|||
public class ApiWorkPropertyController { |
|||
|
|||
@Autowired |
|||
private WorkPropertyService workPropertyService; |
|||
|
|||
/** |
|||
* 工作端--待解答的心理咨询问题列表 |
|||
* |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result < PsychologyUnansweredResultDTO > |
|||
* @params [userDetail, formDto] |
|||
* @author liuchuang |
|||
* @since 2019/10/22 15:33 |
|||
*/ |
|||
@GetMapping("psychology/listQuestion") |
|||
public Result<List<PsychologyUnansweredResultDTO>> listQuestion(PsychologyUnansweredFormDTO formDto) { |
|||
return workPropertyService.listUnansweredQuestion(formDto); |
|||
} |
|||
} |
@ -0,0 +1,33 @@ |
|||
package com.elink.esua.epdc.feign; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.config.FeignRequestInterceptor; |
|||
import com.elink.esua.epdc.dto.psychology.form.PsychologyUnansweredFormDTO; |
|||
import com.elink.esua.epdc.dto.psychology.result.PsychologyUnansweredResultDTO; |
|||
import com.elink.esua.epdc.feign.fallback.WorkPropertyFeignClientFallback; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
import org.springframework.http.MediaType; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 项目模块调用-移动app端 |
|||
* @Author zhangyuan |
|||
* @Date 2020/6/9 16:39 |
|||
*/ |
|||
@FeignClient(name = ServiceConstant.EPDC_EVENTS_SERVER, fallback = WorkPropertyFeignClientFallback.class, configuration = FeignRequestInterceptor.class) |
|||
public interface WorkPropertyFeignClient { |
|||
|
|||
/*** |
|||
* 工作端--待解答的心理咨询问题列表 |
|||
* @param fromDTO |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result < PsychologyAnswerListResultDTO > |
|||
* @author zhangyuan |
|||
* @date 2020/6/8 9:25 |
|||
*/ |
|||
@PostMapping(value = "news/epdc-app/psychology/listUnansweredQuestion", consumes = MediaType.APPLICATION_JSON_VALUE) |
|||
Result<List<PsychologyUnansweredResultDTO>> listUnansweredQuestion(@RequestBody PsychologyUnansweredFormDTO fromDTO); |
|||
} |
@ -0,0 +1,24 @@ |
|||
package com.elink.esua.epdc.feign.fallback; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; |
|||
import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.psychology.form.PsychologyUnansweredFormDTO; |
|||
import com.elink.esua.epdc.dto.psychology.result.PsychologyUnansweredResultDTO; |
|||
import com.elink.esua.epdc.feign.WorkPropertyFeignClient; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author LPF |
|||
* @Date 2019/11/18 16:39 |
|||
*/ |
|||
@Component |
|||
public class WorkPropertyFeignClientFallback implements WorkPropertyFeignClient { |
|||
|
|||
@Override |
|||
public Result<List<PsychologyUnansweredResultDTO>> listUnansweredQuestion(PsychologyUnansweredFormDTO formDto) { |
|||
return ModuleUtils.feignConError(ServiceConstant.EPDC_PROPERTY_SERVER, "listUnansweredQuestion", formDto); |
|||
} |
|||
} |
@ -0,0 +1,26 @@ |
|||
package com.elink.esua.epdc.service; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.psychology.form.PsychologyUnansweredFormDTO; |
|||
import com.elink.esua.epdc.dto.psychology.result.PsychologyUnansweredResultDTO; |
|||
|
|||
import java.util.List; |
|||
|
|||
|
|||
/** |
|||
* @author: zhangyuan |
|||
* @Date: 2020/5/12 13:21 |
|||
* @Description: 心理咨询 |
|||
*/ |
|||
public interface WorkPropertyService { |
|||
|
|||
/** |
|||
* 工作端--待解答的心理咨询问题列表 |
|||
* |
|||
* @param formDto 查询参数 |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List < com.elink.esua.epdc.dto.epdc.result.PsychologyAnswerListResultDTO>> |
|||
* @author zhangyuan |
|||
* @date 2020/6/8 09:15 |
|||
*/ |
|||
Result<List<PsychologyUnansweredResultDTO>> listUnansweredQuestion(PsychologyUnansweredFormDTO formDto); |
|||
} |
@ -0,0 +1,30 @@ |
|||
package com.elink.esua.epdc.service.impl; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.psychology.form.PsychologyUnansweredFormDTO; |
|||
import com.elink.esua.epdc.dto.psychology.result.PsychologyUnansweredResultDTO; |
|||
import com.elink.esua.epdc.feign.WorkPropertyFeignClient; |
|||
import com.elink.esua.epdc.service.WorkPropertyService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
|
|||
/** |
|||
* @author: zhangyuan |
|||
* @Date: 2020/6/9 13:23 |
|||
* @Description: 心理咨询 |
|||
*/ |
|||
@Service |
|||
public class WorkPropertyServiceImpl implements WorkPropertyService { |
|||
|
|||
@Autowired |
|||
private WorkPropertyFeignClient workPropertyFeignClient; |
|||
|
|||
@Override |
|||
public Result<List<PsychologyUnansweredResultDTO>> listUnansweredQuestion(PsychologyUnansweredFormDTO formDto) { |
|||
|
|||
return workPropertyFeignClient.listUnansweredQuestion(formDto); |
|||
} |
|||
} |
Loading…
Reference in new issue