package com.zd.bottle.controller;

import com.zd.bottle.domain.UsegasAuditRecord;
import com.zd.bottle.service.UsegasAuditRecordService;
import com.zd.common.core.domain.per.PerFun;
import com.zd.common.core.domain.per.PerPrefix;
import com.zd.common.core.web.domain.ResultData;
import com.zd.common.core.web.page.TableDataInfo;
import com.zd.common.security.annotation.PreAuthorize;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.zd.common.core.web.controller.BaseController;
import java.util.List;

/**
 * <p>
 * 用气审核表 前端控制器
 * </p>
 *
 * @author hanson
 * @since 2022-09-08
 */
@RestController
@Api(tags = "【用气审核表】")
@RequestMapping("/usegasAuditRecord")
public class UsegasAuditRecordController extends BaseController<UsegasAuditRecord> {

    @Autowired
    private UsegasAuditRecordService usegasAuditRecordService;

    @PreAuthorize(hasPermi = PerPrefix.QP_USEGASAUDITRECORD + PerFun.LIST)
    @ApiModelProperty(value = "审核记录列表")
    @GetMapping("/auditRecordList")
    public TableDataInfo <UsegasAuditRecord> auditRecordList(UsegasAuditRecord usegasAuditRecord){
        List <UsegasAuditRecord> list = usegasAuditRecordService.auditRecordList(usegasAuditRecord);
        return getDataTable(list);
    }

    @PreAuthorize(hasPermi = PerPrefix.QP_USEGASAUDITRECORD + PerFun.ADD)
    @ApiModelProperty(value = "审核通过")
    @PostMapping("/auditPass")
    public ResultData auditPass(@RequestBody UsegasAuditRecord usegasAuditRecord){
        return ResultData.result(usegasAuditRecordService.auditPass(usegasAuditRecord));
    }

}
