package com.ningdatech.carapi.safe.controller;

import com.ningdatech.basic.model.PageVo;
import com.ningdatech.carapi.safe.manage.SecurityHonestyManage;
import com.ningdatech.carapi.safe.model.dto.SecurityHonestyPageQuery;
import com.ningdatech.carapi.safe.model.vo.NdSafetyCommitmentVO;
import com.ningdatech.carapi.safe.model.vo.NdSafetyCreditVO;
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;

/**
 * @Classname SecurityHonestyController
 * @Description
 * @Date 2022/10/20 16:03
 * @Created by PoffyZhang
 */
@Slf4j
@Validated
@RestController
@RequestMapping("/api/safe/security-honesty")
@Api(value = "SecurityHonesty", tags = "安全管理-安全诚信")
@RequiredArgsConstructor
public class SecurityHonestyController {

    private final SecurityHonestyManage securityHonestyManage;

    @ApiOperation(value = "安全承诺", notes = "安全承诺")
    @GetMapping("/commitment")
    public PageVo<NdSafetyCommitmentVO> queryCommitment(@Valid @ModelAttribute SecurityHonestyPageQuery securityAdvisoryPageQuery) {
        return securityHonestyManage.queryCommitment(securityAdvisoryPageQuery);
    }

    @ApiOperation(value = "安全信用", notes = "安全信用")
    @GetMapping("/credit")
    public PageVo<NdSafetyCreditVO> queryCredit(@Valid @ModelAttribute SecurityHonestyPageQuery securityAdvisoryPageQuery) {
        return securityHonestyManage.queryCredit(securityAdvisoryPageQuery);
    }
}
