| | |
| | | import com.xcong.excoin.modules.contract.parameter.dto.SubmitEntrustDto; |
| | | import com.xcong.excoin.modules.contract.parameter.vo.ContractEntrustVo; |
| | | import com.xcong.excoin.modules.contract.service.ContractEntrustOrderService; |
| | | import com.xcong.excoin.utils.MessageSourceUtils; |
| | | import com.xcong.excoin.utils.TypeJudgeUtils; |
| | | import com.xcong.excoin.utils.api.response.Symbol; |
| | | import io.swagger.annotations.*; |
| | |
| | | @PostMapping(value = "/submitEntrustOrder") |
| | | public Result submitEntrustOrder(@RequestBody @Validated SubmitEntrustDto submitEntrustDto) { |
| | | if (StrUtil.isBlank(SymbolEnum.getNameByValue(submitEntrustDto.getSymbol()))) { |
| | | return Result.fail("非法币种"); |
| | | return Result.fail(MessageSourceUtils.getString("illegal_symbol")); |
| | | } |
| | | |
| | | if (!TypeJudgeUtils.entrustType(submitEntrustDto.getEntrustType())) { |
| | | return Result.fail("非法类型"); |
| | | return Result.fail(MessageSourceUtils.getString("illegal_type")); |
| | | } |
| | | |
| | | return contractEntrustOrderService.addContractEntrustOrder(submitEntrustDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取当前委托单列表", notes = "获取当前委托单列表") |
| | | @ApiResponse(code = 0, message = "success", response = ContractEntrustVo.class) |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 0, message = "success", response = ContractEntrustVo.class) |
| | | }) |
| | | @GetMapping(value = "/findCurrentEntrustOrderList") |
| | | public Result findCurrentEntrustOrderList() { |
| | | return contractEntrustOrderService.findEntrustOrderList(); |
| | | public Result findCurrentEntrustOrderList(@ApiParam(name = "symbol", value = "币种", example = "BTC/USDT") @RequestParam(value = "symbol", required = false) String symbol) { |
| | | return contractEntrustOrderService.findEntrustOrderList(symbol); |
| | | } |
| | | |
| | | |