package com.ningdatech.carapi.safe.controller;

import com.ningdatech.basic.model.PageVo;
import com.ningdatech.carapi.safe.manage.LawEnforcementManage;
import com.ningdatech.carapi.safe.model.dto.LawEnforcementPageQuery;
import com.ningdatech.carapi.safe.model.vo.LawCertificateVerificationVO;
import com.ningdatech.carapi.safe.model.vo.LawEquipmentInstallVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author PoffyZhang
 * @since 2022-10-12
 */
@Slf4j
@Validated
@RestController
@RequestMapping("/api/safe/law-enforcement")
@Api(value = "LawEnforcement", tags = "安全管理-行政执法")
@RequiredArgsConstructor
public class LawEnforcementController {

    private final LawEnforcementManage lawEnforcementManage;

    @ApiOperation(value = "设备安装", notes = "设备安装")
    @GetMapping("/equipment-install")
    public PageVo<LawEquipmentInstallVO> queryEquipmentInstall(@Valid @ModelAttribute LawEnforcementPageQuery lawEnforcementPageQuery) {
        return lawEnforcementManage.queryEquipmentInstall(lawEnforcementPageQuery);
    }

    @ApiOperation(value = "证件核查", notes = "证件核查")
    @GetMapping("/certificate-verification")
    public PageVo<LawCertificateVerificationVO> queryCertificateVerification(@Valid @ModelAttribute LawEnforcementPageQuery lawEnforcementPageQuery) {
        return lawEnforcementManage.queryCertificateVerification(lawEnforcementPageQuery);
    }
}
