package com.bizzan.bitrade.controller.option;

import com.bizzan.bitrade.annotation.AccessLog;
import com.bizzan.bitrade.constant.AdminModule;
import com.bizzan.bitrade.constant.PageModel;
import com.bizzan.bitrade.controller.common.BaseAdminController;
import com.bizzan.bitrade.model.screen.ContractSecondOrderScreen;
import com.bizzan.bitrade.util.MessageResult;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;

@RestController
@RequestMapping("/second-order")
@Slf4j
public class ContractSecondOrderController extends BaseAdminController {


    /**
     * 分页查询所有订单
     * @param pageModel
     * @param screen
     * @return
     */
    @RequiresPermissions("second:order:page-query")
    @PostMapping("page-query")
    @AccessLog(module = AdminModule.CONTRACTOPTION, operation = "期权合约订单 列表")
    public MessageResult detail(
            PageModel pageModel,
            ContractSecondOrderScreen screen) {
        return null;
    }



    /**
     * 设置预设平仓价格
     * @return
     */
    @RequiresPermissions("second:order:alter")
    @PostMapping("alter")
    @AccessLog(module = AdminModule.CONTRACTOPTION, operation = "设置预设平仓价格")
    public MessageResult alter(
            @RequestParam(value = "id",required = true) Long id,
            @RequestParam(value = "preClosePrice", required = true) BigDecimal presetPrice){
        return null;
    }

}
