package com.ningdatech.carapi.open.controller;

import com.ningdatech.basic.model.PageVo;
import com.ningdatech.carapi.driver.manage.TrainingOrganizationManage;
import com.ningdatech.carapi.driver.model.po.ReqDriverTrainingListPO;
import com.ningdatech.carapi.driver.model.vo.ResDriverTrainingListVO;
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;

/**
 * @author liuxinxin
 * @date 2022/11/11 上午11:19
 */

@RequestMapping("/open/api/v1/driver/training-organization")
@RestController
@Api(tags = "驾驶员管理-培训管理-培训组织")
@Validated
@RequiredArgsConstructor
public class OpenApiTrainingOrganizationController {

    private final TrainingOrganizationManage trainingOrganizationManage;

    @PostMapping("/driver-training/list")
    @ApiOperation("驾驶员培训记录列表")
    public PageVo<ResDriverTrainingListVO> driverTrainingList(@Valid @RequestBody ReqDriverTrainingListPO request) {
        return trainingOrganizationManage.driverTrainingList(request);
    }
}
