package com.dhcc.finance.main.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.dhcc.finance.main.domain.CwBdScenario;
import com.dhcc.finance.main.service.CwBdReportlockService;
import com.github.pagehelper.PageInfo;
import com.dhcc.common.model.CurrencyMeta;
import com.dhcc.common.model.response.RestfulResponse;
import com.dhcc.finance.constant.MsConfigConsts;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping(value = MsConfigConsts.MS_API_PREFIX + CwBdReportlockController.API_PREFIX, 
              produces = {MediaType.APPLICATION_JSON_UTF8_VALUE }, consumes = { MediaType.APPLICATION_JSON_UTF8_VALUE })
@Api(value = "锁定期间明细controller", tags = { "锁定期间明细操作接口" })
public class CwBdReportlockController {
    
    // 锁定期间明细操作接口地址前缀
    public static final String API_PREFIX = "/cw_bd_reportlock";
    
    @Autowired
    CwBdReportlockService cwBdReportlockService;
    
    /**
     * 功能描述：期间锁定
     * @param cwBdReportlock
     * @return RestfulResponse<Object,CurrencyMeta>
     * @author likai
     * @date 2020年7月18日 上午10:40:11 
     * @修改日志：
     */
    @ApiOperation(value = "锁定期间", notes = "", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.ALL_VALUE)
    @ApiImplicitParams({
        @ApiImplicitParam(name = "lockPeriod", value = "锁定期间", required = true, dataType = "String", paramType="query")}) 
    @RequestMapping(value = { "/periodLock" }, method = RequestMethod.GET, consumes = MediaType.ALL_VALUE)
    public RestfulResponse<Object, CurrencyMeta> periodLock( @RequestParam(value="lockPeriod",required=true) String lockPeriod){
        return cwBdReportlockService.periodLock(lockPeriod);
    }
    
    /**
     * 功能描述：期间解锁
     * @param lockPeriod
     * @return RestfulResponse<Object,CurrencyMeta> 
     * @author likai
     * @date 2020年7月18日 下午4:11:25
     * @修改日志：
     */
    @ApiOperation(value = "期间解锁", notes = "", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.ALL_VALUE)
    @ApiImplicitParams({
        @ApiImplicitParam(name = "lockPeriod", value = "锁定期间", required = true, dataType = "String", paramType="query")}) 
    @RequestMapping(value = { "/periodUnlock" }, method = RequestMethod.GET, consumes = MediaType.ALL_VALUE)
    public RestfulResponse<Object, CurrencyMeta> periodUnlock( @RequestParam(value="lockPeriod",required=true) String lockPeriod){
        return cwBdReportlockService.periodUnlock(lockPeriod);
    }
    /**
     * 功能描述：查询表中期间锁定最大值
     * @param lockPeriod
     * @return RestfulResponse<Object,CurrencyMeta>
     * @author likai
     * @date 2020年7月18日 下午4:11:25
     * @修改日志：
     */
    @ApiOperation(value = "查询表中期间锁定最大值", notes = "", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.ALL_VALUE)
    @RequestMapping(value = { "/seachMaxLockPeroid" }, method = RequestMethod.GET, consumes = MediaType.ALL_VALUE)
    public RestfulResponse<String, CurrencyMeta> seachMaxLockPeroid(){
        return cwBdReportlockService.seachMaxLockPeroid();
    }

}
