package com.ym.mec.web.controller;


import com.ym.mec.biz.dal.entity.TenantContractRecord;
import com.ym.mec.biz.service.TenantContractRecordService;
import com.ym.mec.common.controller.BaseController;
import com.ym.mec.common.entity.HttpResponseResult;
import com.ym.mec.common.page.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * 机构协议记录表(TenantContractRecord)表控制层
 *
 * @author hgw
 * @since 2022-02-12 16:16:40
 */
@Api(tags = "机构协议记录表")
@RestController
@RequestMapping("/tenantContractRecord")
public class TenantContractRecordController extends BaseController {
    /**
     * 服务对象
     */
    @Resource
    private TenantContractRecordService tenantContractRecordService;

    @ApiImplicitParams({
            @ApiImplicitParam(name = "tenantId", dataType = "Integer", value = "机构Id"),
            @ApiImplicitParam(name = "type", dataType = "Integer", value = "协议类型 0机构开通 1机构续费 待补充"),
            @ApiImplicitParam(name = "page", dataType = "Integer", value = "页数"),
            @ApiImplicitParam(name = "rows", dataType = "Integer", value = "每页数量"),
    })
    @ApiOperation("分页查询")
    @PostMapping("/queryPage")
    @PreAuthorize("@pcs.hasPermissions('tenantContractRecord/queryPage')")
    public HttpResponseResult<PageInfo<TenantContractRecord>> queryPage(@RequestBody Map<String, Object> param) {
        return succeed(tenantContractRecordService.queryPage(param));
    }

}

