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.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("/option-coin")
@Slf4j
public class ContractOptionCoinController extends BaseAdminController {

    /**
     * 获取期权合约交易对列表
     * @param pageModel
     * @return
     */
    @RequiresPermissions("option-coin:page-query")
    @PostMapping("page-query")
    @AccessLog(module = AdminModule.CONTRACTOPTION, operation = "期权合约交易对 列表")
    public MessageResult list(
            PageModel pageModel) {
        return null;
    }

    /**
     * 获取期权合约交易对详情
     * @param symbol
     * @return
     */
    @RequiresPermissions("option-coin:detail")
    @PostMapping("detail")
    @AccessLog(module = AdminModule.CONTRACTOPTION, operation = "期权合约交易对 详情")
    public MessageResult detail(@RequestParam(value = "symbol") String symbol) {
        return null;
    }

    /**
     * 添加期权合约交易对
     * @return
     */
    @RequiresPermissions("option-coin:add")
    @PostMapping("add")
    @AccessLog(module = AdminModule.CONTRACTOPTION, operation = "期权合约交易对 新增")
    public MessageResult add() {
        return null;
    }

    /**
     * 修改期权合约交易对
     * @param symbol
     * @param enable
     * @param enableBuy
     * @param enableSell
     * @param visible
     * @param sort
     * @param amount
     * @param feePercent
     * @param winFeePercent
     * @param openTimeGap
     * @param closeTimeGap
     * @param tiedType
     * @return
     */
    @RequiresPermissions("option-coin:alter")
    @PostMapping("alter")
    @AccessLog(module = AdminModule.CONTRACTOPTION, operation = "期权合约交易对 新增")
    public MessageResult alter(
            @RequestParam("symbol") String symbol,
            @RequestParam(value = "enable", required = false) Integer enable, // 上下架（1:上,2）
            @RequestParam(value = "enableBuy", required = false) Integer enableBuy, // 是否可买（1:是,0:否）
            @RequestParam(value = "enableSell", required = false) Integer enableSell, // 是否可卖（1:是,0:否）
            @RequestParam(value = "visible", required = false) Integer visible, // 是否显示（1:是,2）
            @RequestParam(value = "sort", required = false) Integer sort, // 排序
            @RequestParam(value = "amount", required = false) String amount, // 允许投注数量
            @RequestParam(value = "feePercent", required = false) BigDecimal feePercent,
            @RequestParam(value = "oods", required = false) BigDecimal oods,
            @RequestParam(value = "winFeePercent", required = false) BigDecimal winFeePercent,
            @RequestParam(value = "openTimeGap", required = false) Integer openTimeGap,
            @RequestParam(value = "closeTimeGap", required = false) Integer closeTimeGap,
            @RequestParam(value = "initBuyReward", required = false) BigDecimal initBuyReward,
            @RequestParam(value = "initSellReward", required = false) BigDecimal initSellReward,
            @RequestParam(value = "tiedType", required = false) Integer tiedType
    ) {
        return null;
    }
}
