package com.sckw.fleet.controller;


import com.sckw.core.web.response.BaseResult;
import com.sckw.fleet.model.request.TruckAxleNumUpdateParam;
import com.sckw.fleet.model.vo.TruckAxleNumVO;
import com.sckw.fleet.service.KwfTruckAxleNumService;
import jakarta.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
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 java.util.List;

/**
*Author: donglang
*Time: 2025-10-24
*Des: 车辆轴数Controller
*Version: 1.0
*/

@RestController
@RequestMapping("/kwfAxle")
public class KwfTruckAxleNumController {

    @Autowired
    KwfTruckAxleNumService kwfTruckAxleNumService;

    /**
     * 查询轴数信息
     * @return
     */
    @PostMapping("/queryTruckAxleNumList")
    public BaseResult<List<TruckAxleNumVO>> queryTruckAxleNumList() {
        List<TruckAxleNumVO> truckAxleNumVOS = kwfTruckAxleNumService.queryTruckAxleNumList();
        return BaseResult.success(truckAxleNumVOS);
    }

    /**
     * 修改轴数
     * @return
     */
    @PostMapping("/updateTruckAxleNum")
    public BaseResult updateTruckAxleNum(@RequestBody @Valid TruckAxleNumUpdateParam param) {
        kwfTruckAxleNumService.updateTruckAxleNum(param);
        return BaseResult.success();
    }

}