|  |  |  | 
|---|
|  |  |  | import com.xcong.excoin.common.enumerates.SymbolEnum; | 
|---|
|  |  |  | import com.xcong.excoin.common.response.Result; | 
|---|
|  |  |  | 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.TypeJudgeUtils; | 
|---|
|  |  |  | import com.xcong.excoin.utils.api.response.Symbol; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | import io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | import io.swagger.annotations.*; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.springframework.validation.annotation.Validated; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.PostMapping; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RequestBody; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RequestMapping; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RestController; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import javax.annotation.Resource; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "合约提交委托订单", notes = "提交委托订单") | 
|---|
|  |  |  | @PostMapping(value = "/submitEntrustOrder") | 
|---|
|  |  |  | public Result submitEntrustOrder(@RequestBody @Validated SubmitEntrustDto submitEntrustDto) { | 
|---|
|  |  |  | if (StrUtil.isBlank(SymbolEnum.getNameByValue(submitEntrustDto.getSymbol()))){ | 
|---|
|  |  |  | if (StrUtil.isBlank(SymbolEnum.getNameByValue(submitEntrustDto.getSymbol()))) { | 
|---|
|  |  |  | return Result.fail("非法币种"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | return Result.fail("非法类型"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return Result.ok("123"); | 
|---|
|  |  |  | return contractEntrustOrderService.addContractEntrustOrder(submitEntrustDto); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "获取当前委托单列表", notes = "获取当前委托单列表") | 
|---|
|  |  |  | @ApiResponses({ | 
|---|
|  |  |  | @ApiResponse(code = 0, message = "success", response = ContractEntrustVo.class) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | @GetMapping(value = "/findCurrentEntrustOrderList") | 
|---|
|  |  |  | public Result findCurrentEntrustOrderList(@ApiParam(name = "symbol", value = "币种",  example = "BTC/USDT") @RequestParam(value = "symbol", required = false) String symbol) { | 
|---|
|  |  |  | return contractEntrustOrderService.findEntrustOrderList(symbol); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "撤销委托单", notes = "撤销委托单") | 
|---|
|  |  |  | @GetMapping(value = "/cancelEntrustOrder") | 
|---|
|  |  |  | public Result cancelEntrustOrder(@ApiParam(name = "id", value = "委托单ID", required = true, example = "1") @RequestParam("id") Long id) { | 
|---|
|  |  |  | return contractEntrustOrderService.cancelEntrustOrder(id); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|