Commit 630da36ac33b01f72f748984ccc60aec0ff7d961

Authored by 徐烜
1 parent cf2081a8

配置dubbo,添加前世验证时刻表服务。

src/main/java/com/bsth/controller/schedule/core/SchedulePlanController_dubbo.java
1 1 package com.bsth.controller.schedule.core;
2 2  
  3 +import com.bsth.common.ResponseCode;
3 4 import com.bsth.control_v2.plan_module.common.dto.schedule.PlanDto;
  5 +import com.bsth.control_v2.plan_module.common.service.schedule.validate.PlanPreValidateFacade;
4 6 import com.bsth.controller.schedule.BController_facade;
  7 +import org.springframework.beans.factory.annotation.Autowired;
  8 +import org.springframework.web.bind.annotation.PathVariable;
5 9 import org.springframework.web.bind.annotation.RequestMapping;
  10 +import org.springframework.web.bind.annotation.RequestMethod;
6 11 import org.springframework.web.bind.annotation.RestController;
7 12  
  13 +import java.util.Date;
  14 +import java.util.HashMap;
  15 +import java.util.Map;
  16 +
8 17 @RestController
9 18 @RequestMapping("spc")
10 19 public class SchedulePlanController_dubbo extends BController_facade<Long, PlanDto> {
  20 + @Autowired
  21 + private PlanPreValidateFacade planPreValidateFacade;
  22 +
  23 + /**
  24 + * 创建指定线路,指定时间范围内的排班计划,使用的时刻表情况
  25 + * @param xlid 线路id
  26 + * @param from 开始时间
  27 + * @param to 结束时间
  28 + * @return
  29 + * @throws Exception
  30 + */
  31 + @RequestMapping(value = "/valttinfo/{xlid}/{from}/{to}", method = RequestMethod.GET)
  32 + public Map<String, Object> validateTTInfo(
  33 + @PathVariable(value = "xlid") Integer xlid,
  34 + @PathVariable(value = "from") Date from,
  35 + @PathVariable(value = "to") Date to
  36 + ) throws Exception {
  37 + Map<String, Object> rtn = new HashMap<>();
  38 + rtn.put("status", ResponseCode.SUCCESS);
  39 + rtn.put("data", planPreValidateFacade.validateTTInfo(xlid, from, to));
  40 + return rtn;
  41 + }
11 42  
12 43 // TODO
13 44 }
... ...
src/main/resources/dubbo/applicationContext_dubbo_consumer.xml
... ... @@ -15,6 +15,7 @@
15 15 <!-- 计划排班服务接口 -->
16 16 <dubbo:reference interface="com.bsth.control_v2.plan_module.common.service.schedule.PlanServiceFacade" id="planServiceFacadeImpl" check="false" />
17 17 <dubbo:reference interface="com.bsth.control_v2.plan_module.common.service.schedule.PlanInfoServiceFacade" id="planInfoServiceFacadeImpl" check="false" />
  18 + <dubbo:reference interface="com.bsth.control_v2.plan_module.common.service.schedule.validate.PlanPreValidateFacade" id="planPreValidateFacadeImpl" check="false" />
18 19  
19 20  
20 21 </beans>
21 22 \ No newline at end of file
... ...