12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- package com.yihu.hos.controllers;
- import com.yihu.ehr.framework.model.Result;
- import com.yihu.hos.services.ESBCamelService;
- import io.swagger.annotations.ApiOperation;
- import io.swagger.annotations.ApiParam;
- import org.springframework.stereotype.Controller;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestMethod;
- import org.springframework.web.bind.annotation.RequestParam;
- import org.springframework.web.bind.annotation.ResponseBody;
- import javax.annotation.Resource;
- /**
- * Created by lingfeng on 2016/8/4.
- */
- @Controller
- @RequestMapping("/esb")
- public class ESBCamelController {
- @Resource(name= ESBCamelService.BEAN_ID)
- ESBCamelService esbCamelService;
- @RequestMapping(value = "/processor", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
- @ResponseBody
- @ApiOperation(value = "新增Processor处理器", produces = "application/json", notes = "当外界组件通知一个新的processor处理器被定义时,该事件被触发")
- public Result onProcessorAdded(
- @ApiParam(name = "serviceFlow", value = "服务名称", required = true)
- @RequestParam(value = "serviceFlow") String serviceFlow,
- @ApiParam(name = "packageName", value = "包名", required = true)
- @RequestParam(value = "packageName") String packageName,
- @ApiParam(name = "className", value = "类名", required = true)
- @RequestParam(value = "className") String className,
- @ApiParam(name = "path", value = "class文件路径", required = true)
- @RequestParam(value = "path") String path) {
- return Result.success("成功!");
- // return esbCamelService.onProcessorAdded(serviceFlow, packageName, className, path);
- }
- @RequestMapping(value = "/processor", produces = "application/json;charset=UTF-8", method = RequestMethod.PUT)
- @ResponseBody
- @ApiOperation(value = "修改Processor处理器", produces = "application/json", notes = "当外界组件通知一个已有的processor处理器data部分发生变化时,该事件被触发")
- public Result onProcessorDataChanged(
- @ApiParam(name = "serviceFlow", value = "服务名称", required = true)
- @RequestParam(value = "serviceFlow") String serviceFlow,
- @ApiParam(name = "packageName", value = "包名", required = true)
- @RequestParam(value = "packageName") String packageName,
- @ApiParam(name = "className", value = "类名", required = true)
- @RequestParam(value = "className") String className,
- @ApiParam(name = "path", value = "class文件路径", required = true)
- @RequestParam(value = "path") String path) {
- return esbCamelService.onProcessorDataChanged(serviceFlow, packageName, className, path);
- }
- @RequestMapping(value = "/route", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
- @ResponseBody
- @ApiOperation(value = "新增Route路由", produces = "application/json", notes = "当外界组件通知一个新的RouteDefine路由被定义时,该事件被触发")
- public Result onRouteDefineAdded(
- @ApiParam(name = "serviceFlow", value = "服务名称", required = true)
- @RequestParam(value = "serviceFlow") String serviceFlow,
- @ApiParam(name = "packageName", value = "包名", required = true)
- @RequestParam(value = "packageName") String packageName,
- @ApiParam(name = "className", value = "类名", required = true)
- @RequestParam(value = "className") String className,
- @ApiParam(name = "path", value = "class文件路径", required = true)
- @RequestParam(value = "path") String path) {
- return esbCamelService.onRouteDefineAdded(serviceFlow, packageName, className, path);
- }
- @RequestMapping(value = "/route", produces = "application/json;charset=UTF-8", method = RequestMethod.PUT)
- @ResponseBody
- @ApiOperation(value = "修改Route路由", produces = "application/json", notes = "当外界组件通知一个已有的RouteDefine路由定义被改变时,主要就是路由定义内容被改变时,该事件被触发")
- public Result onRouteDefineChanged(
- @ApiParam(name = "serviceFlow", value = "服务名称", required = true)
- @RequestParam(value = "serviceFlow") String serviceFlow,
- @ApiParam(name = "packageName", value = "包名", required = true)
- @RequestParam(value = "packageName") String packageName,
- @ApiParam(name = "className", value = "类名", required = true)
- @RequestParam(value = "className") String className,
- @ApiParam(name = "path", value = "class文件路径", required = true)
- @RequestParam(value = "path") String path) {
- return esbCamelService.onRouteDefineChanged(serviceFlow, packageName, className, path);
- }
- @RequestMapping(value = "/route", produces = "application/json;charset=UTF-8", method = RequestMethod.DELETE)
- @ResponseBody
- @ApiOperation(value = "删除Route路由", produces = "application/json", notes = "当外界组件通知一个已有的RouteDefine路由定义被删除时,该事件被触发")
- public Result onRouteDefineDelete(
- @ApiParam(name = "serviceFlow", value = "服务名称", required = true)
- @RequestParam(value = "serviceFlow") String serviceFlow,
- @ApiParam(name = "packageName", value = "包名", required = true)
- @RequestParam(value = "packageName") String packageName,
- @ApiParam(name = "className", value = "类名", required = true)
- @RequestParam(value = "className") String className) {
- return esbCamelService.onRouteDefineDelete(serviceFlow, packageName, className);
- }
- }
|