package com.ningdatech.carapi.safe.controller;

import com.ningdatech.basic.model.PageVo;
import com.ningdatech.carapi.safe.model.dto.ViolationPageQuery;
import com.ningdatech.carapi.safe.manage.VehicleViolationManage;
import com.ningdatech.carapi.safe.model.vo.NdVehicleViolationVO;
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/violation")
@Api(value = "Violation", tags = "安全管理-违章管理")
@RequiredArgsConstructor
public class NdVehicleViolationController {

    private final VehicleViolationManage vehicleViolationManage;

    @ApiOperation(value = "违章管理", notes = "违章管理-列表")
    @GetMapping("/list")
    public PageVo<NdVehicleViolationVO> query(@Valid @ModelAttribute ViolationPageQuery violationPageQuery) {
        return vehicleViolationManage.query(violationPageQuery);
    }
}
