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.ContractOptionScreen;
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")
@Slf4j
public class ContractOptionController extends BaseAdminController {
    /**
     * 查询
     * @param pageModel
     * @param screen
     * @return
     */
    @RequiresPermissions("option:page-query")
    @PostMapping("page-query")
    @AccessLog(module = AdminModule.CONTRACTOPTION, operation = "期权合约交易对 列表")
    public MessageResult detail(
            PageModel pageModel,
            ContractOptionScreen screen) {
        return null;
    }


    /**
     * 修改预设价格
     * @param presetPrice 预设价格
     * @return
     */
    @RequiresPermissions("option:alter")
    @PostMapping("alter")
    @AccessLog(module = AdminModule.CONTRACTOPTION, operation = "期权合约 修改预设价格")
    public MessageResult alter(
            @RequestParam(value = "id",required = true) Long id,
            @RequestParam(value = "presetPrice", required = true) BigDecimal presetPrice// 允许投注数量
    ) {
        return null;
    }
}
