| New file |
| | |
| | | package com.java110.intf.api; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.config.feign.FeignConfiguration; |
| | | import com.java110.po.advert.AdvertItemPo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | |
| | | @FeignClient(name = "${java110.api-service}", configuration = {FeignConfiguration.class}) |
| | | @RequestMapping("/apiCallBack") |
| | | public interface IApiCallBackInnerServiceSMO { |
| | | |
| | | @RequestMapping(value = "/webSentParkingArea", method = RequestMethod.POST) |
| | | public int webSentParkingArea(@RequestBody JSONObject reqJson); |
| | | } |
| | |
| | | basePackages = {"com.java110.api.listener"}) |
| | | @EnableSwagger2 |
| | | //@EnableConfigurationProperties(EventProperties.class) |
| | | @EnableFeignClients(basePackages = {"com.java110.intf"}) |
| | | @EnableFeignClients(basePackages = { |
| | | "com.java110.intf.acct", |
| | | "com.java110.intf.code", |
| | | "com.java110.intf.common", |
| | | "com.java110.intf.community", |
| | | "com.java110.intf.demo", |
| | | "com.java110.intf.dev", |
| | | "com.java110.intf.fee", |
| | | "com.java110.intf.goods", |
| | | "com.java110.intf.job", |
| | | "com.java110.intf.oa", |
| | | "com.java110.intf.order", |
| | | "com.java110.intf.report", |
| | | "com.java110.intf.store", |
| | | "com.java110.intf.user" |
| | | }) |
| | | @EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class}) |
| | | @EnableAsync |
| | | public class ApiApplicationStart { |
| | |
| | | private IUserInnerServiceSMO userInnerServiceSMOImpl; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 健康检查 服务 |
| | | * |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | public IApiServiceSMO getApiServiceSMOImpl() { |
| | | return apiServiceSMOImpl; |
| | | } |
| New file |
| | |
| | | package com.java110.api.smo.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.websocket.ParkingAreaWebsocket; |
| | | import com.java110.intf.api.IApiCallBackInnerServiceSMO; |
| | | import com.java110.utils.exception.SMOException; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | @RestController |
| | | public class ApiCallBackInnerServiceSMOImpl implements IApiCallBackInnerServiceSMO { |
| | | @Override |
| | | public int webSentParkingArea(@RequestBody JSONObject reqJson) { |
| | | JSONObject param = JSONObject.parseObject(reqJson.toString()); |
| | | try { |
| | | ParkingAreaWebsocket.sendInfo(param.toJSONString(), param.getString("extBoxId")); |
| | | } catch (Exception e) { |
| | | throw new SMOException(e.getMessage()); |
| | | } |
| | | return 1; |
| | | } |
| | | } |
| | |
| | | "com.java110.intf.job", |
| | | "com.java110.intf.order", |
| | | "com.java110.intf.oa", |
| | | "com.java110.intf.report" |
| | | "com.java110.intf.report", |
| | | "com.java110.intf.api" |
| | | }) |
| | | public class CommonServiceApplicationStart { |
| | | |
| | |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.Cmd; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.intf.api.IApiCallBackInnerServiceSMO; |
| | | import com.java110.utils.constant.KafkaConstant; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.kafka.KafkaFactory; |
| | | import com.java110.vo.ResultVo; |
| | | import org.slf4j.Logger; |
| | | import com.java110.core.log.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | /** |
| | | * 类表述:保存 |
| | |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(OpenParkingAreaDoorControlLogCmd.class); |
| | | |
| | | @Autowired |
| | | private IApiCallBackInnerServiceSMO apiCallBackInnerServiceSMOImpl; |
| | | |
| | | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | |
| | | @Override |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | |
| | | try { |
| | | KafkaFactory.sendKafkaMessage(KafkaConstant.TOPIC_API_SEND_PARKING_AREA_WEB, reqJson.toJSONString()); |
| | | } catch (Exception e) { |
| | | logger.error("发送停车场信息失败", e); |
| | | } |
| | | // try { |
| | | // KafkaFactory.sendKafkaMessage(KafkaConstant.TOPIC_API_SEND_PARKING_AREA_WEB, reqJson.toJSONString()); |
| | | // } catch (Exception e) { |
| | | // logger.error("发送停车场信息失败", e); |
| | | // } |
| | | apiCallBackInnerServiceSMOImpl.webSentParkingArea(reqJson); |
| | | cmdDataFlowContext.setResponseEntity(ResultVo.success()); |
| | | } |
| | | } |