add entrust close order interface
2 files modified
1 files added
| | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.xcong.excoin.common.enumerates.SymbolEnum; |
| | | import com.xcong.excoin.common.response.Result; |
| | | import com.xcong.excoin.modules.contract.parameter.dto.SubmitCloseEntrustDto; |
| | | 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; |
| | |
| | | public Result cancelEntrustOrder(@ApiParam(name = "id", value = "委托单ID", required = true, example = "1") @RequestParam("id") Long id) { |
| | | return contractEntrustOrderService.cancelEntrustOrder(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "全仓模式 -- 提交平仓委托单", notes = "平仓委托单") |
| | | @PostMapping(value = "/submitCloseEntrustOrder") |
| | | public Result submitCloseEntrustOrder(@RequestBody SubmitCloseEntrustDto submitCloseEntrustDto) { |
| | | return Result.ok("提交成功"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.xcong.excoin.modules.contract.parameter.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.Min; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @date 2020-08-14 |
| | | **/ |
| | | @Data |
| | | @ApiModel(value = "SubmitCloseEntrustDto", description = "提交委托平仓参数接收类") |
| | | public class SubmitCloseEntrustDto { |
| | | |
| | | @NotNull |
| | | @ApiModelProperty(value = "持仓订单ID", example = "1") |
| | | private Long id; |
| | | |
| | | @NotNull() |
| | | @Min(1) |
| | | @ApiModelProperty(value = "委托价", example = "9000.00") |
| | | private BigDecimal entrustPrice; |
| | | |
| | | @NotNull |
| | | @Min(1) |
| | | @ApiModelProperty(value = "币种数量", example = "1") |
| | | private int symbolCnt; |
| | | |
| | | } |
| | |
| | | *
|
| | | * @return
|
| | | */
|
| | | public static BigDecimal getForceSetPriceForWhole(@NotNull String symbol, @NotNull MemberEntity memberEntity) {
|
| | | public static void getForceSetPriceForWhole(@NotNull String symbol, @NotNull MemberEntity memberEntity) {
|
| | | ContractHoldOrderDao holdOrderDao = SpringContextHolder.getBean(ContractHoldOrderDao.class);
|
| | | MemberWalletContractDao walletContractDao = SpringContextHolder.getBean(MemberWalletContractDao.class);
|
| | | CacheSettingUtils cacheSettingUtils = SpringContextHolder.getBean(CacheSettingUtils.class);
|
| | |
| | | } else {
|
| | | throw new GlobalException("强平价异常");
|
| | | }
|
| | |
|
| | | return null;
|
| | | }
|
| | |
|
| | | private static void sendOrderBombMsg(Long id, int type, BigDecimal forceClosingPrice, String symbol, int operateNo) {
|