| | |
| | | |
| | | import com.zy.acs.framework.common.Cools; |
| | | import com.zy.acs.framework.common.R; |
| | | import com.zy.acs.manager.common.annotation.IntegrationAuth; |
| | | import com.zy.acs.manager.common.annotation.OperationLog; |
| | | import com.zy.acs.manager.common.constant.Constants; |
| | | import com.zy.acs.manager.common.domain.TaskBoolDto; |
| | | import com.zy.acs.manager.core.domain.type.NamespaceType; |
| | | import com.zy.acs.manager.core.integrate.dto.OpenBusCancelParam; |
| | | import com.zy.acs.manager.core.integrate.dto.OpenBusCancelResult; |
| | | import com.zy.acs.manager.core.integrate.dto.OpenBusSubmitParam; |
| | | import com.zy.acs.manager.core.service.MainService; |
| | | import com.zy.acs.manager.manager.entity.Bus; |
| | | import com.zy.acs.manager.manager.entity.IntegrationRecord; |
| | | import com.zy.acs.manager.manager.entity.Task; |
| | | import com.zy.acs.manager.manager.enums.TaskStsType; |
| | | import com.zy.acs.manager.manager.service.BusService; |
| | |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | /** |
| | | * Created by vincent on 2023/6/12 |
| | |
| | | |
| | | @PostMapping("/bus/submit") |
| | | @OperationLog("generate task from open api") |
| | | public R submit(@RequestBody OpenBusSubmitParam param) { |
| | | IntegrationRecord integrationRecord = new IntegrationRecord( |
| | | null, // 编号 |
| | | null, // 名称空间 |
| | | null, // 接口地址 |
| | | null, // 平台密钥 |
| | | null, // 调用方标识 |
| | | null, // 方向[非空] |
| | | null, // 时间戳 |
| | | null, // 客户端IP |
| | | null, // 请求内容 |
| | | null, // 响应内容 |
| | | null, // 异常内容 |
| | | null, // 结果 |
| | | null, // 耗时 |
| | | null, // 状态 |
| | | null, // 添加时间[非空] |
| | | null, // 修改时间[非空] |
| | | null // 备注 |
| | | ); |
| | | |
| | | @IntegrationAuth(name = NamespaceType.RCS_BUS_RECEIVE) |
| | | public R submit(@RequestBody OpenBusSubmitParam param, HttpServletRequest request) { |
| | | mainService.generateBusAndTask(param, null); |
| | | return R.ok("generate tasks success"); |
| | | } |
| | | |
| | | @PostMapping("/task/cancel") |
| | | @OperationLog("cancel task from open api") |
| | | @IntegrationAuth(name = NamespaceType.RCS_TASK_CANCEL) |
| | | public R cancel(@RequestBody OpenBusCancelParam param) { |
| | | if (Cools.isEmpty(param.getBatchNo())) { |
| | | return R.error("batchNo is empty"); |