package com.ningdatech.carapi.driver.controller;


import com.ningdatech.basic.model.PageVo;
import com.ningdatech.carapi.driver.manage.DriverStarManage;
import com.ningdatech.carapi.driver.model.po.ReqCompanyStarPO;
import com.ningdatech.carapi.driver.model.po.ReqDriverStarListPO;
import com.ningdatech.carapi.driver.model.po.ReqRegionStarPO;
import com.ningdatech.carapi.driver.model.vo.ResCompanyStarListVO;
import com.ningdatech.carapi.driver.model.vo.ResDriverStarListVO;
import com.ningdatech.carapi.driver.model.vo.ResRegionStarVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
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.validation.Valid;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author Liuxinxin
 * @since 2022-11-15
 */
@RequestMapping("/api/v1/start-manage")
@RestController
@Api(tags = "驾驶员星级管理")
@Validated
@RequiredArgsConstructor
public class StarManageController {

    public final DriverStarManage driverStarManage;

    @PostMapping("/driver-star-list")
    @ApiOperation("驾驶员星级列表筛选")
    public PageVo<ResDriverStarListVO> driverStarList(@Valid @RequestBody ReqDriverStarListPO request) {
        return driverStarManage.driverStarList(request);
    }

    @PostMapping("/region-star-summary")
    @ApiOperation("区域列表筛选")
    public PageVo<ResRegionStarVO> regionStarList(@Valid @RequestBody ReqRegionStarPO request) {
        return driverStarManage.regionStarList(request);
    }

    @PostMapping("/company-star-summary")
    @ApiOperation("公司星级列表筛选")
    public PageVo<ResCompanyStarListVO> companyStarList(@Valid @RequestBody ReqCompanyStarPO request) {
        return driverStarManage.companyStarList(request);
    }
}
