package com.sinata.web.controller.backend; import com.sinata.common.core.domain.R; import com.sinata.common.entity.PageDTO; import com.sinata.system.domain.dto.MwTransitCarAnnualInspectionDTO; import com.sinata.system.domain.query.MwTransitCarAnnualInspectionQuery; import com.sinata.system.domain.vo.MwTransitCarAnnualInspectionVO; import com.sinata.system.service.MwTransitCarAnnualInspectionService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import lombok.RequiredArgsConstructor; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; 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 mitao * @since 2024-12-02 */ @Api(tags = {"车辆年检记录相关接口"}) @Validated @RestController @RequiredArgsConstructor @RequestMapping("/backend/mwTransitCarAnnualInspection") public class MwTransitCarAnnualInspectionController { private final MwTransitCarAnnualInspectionService mwTransitCarAnnualInspectionService; /** * 年检记录分页列表 * * @param query * @return */ @ApiOperation("年检记录分页列表") @PostMapping("/page") public R> pageList(@Valid @RequestBody MwTransitCarAnnualInspectionQuery query) { return R.ok(mwTransitCarAnnualInspectionService.pageList(query)); } /** * 详情 * * @param id * @return */ @ApiOperation("详情") @GetMapping("/{id}") public R detail(@ApiParam(name = "id", value = "年检记录id", required = true) @PathVariable("id") Long id) { return R.ok(mwTransitCarAnnualInspectionService.detail(id)); } /** * 新增年检记录 * * @param dto */ @ApiOperation("新增年检记录") @PostMapping("/add") public R add(@Valid @RequestBody MwTransitCarAnnualInspectionDTO dto) { mwTransitCarAnnualInspectionService.add(dto); return R.ok(); } /** * 编辑年检记录 * * @param dto * @return */ @ApiOperation("编辑年检记录") @PostMapping("/edit") public R edit(@Valid @RequestBody MwTransitCarAnnualInspectionDTO dto) { mwTransitCarAnnualInspectionService.edit(dto); return R.ok(); } /** * 删除 * * @param id * @return */ @ApiOperation("删除") @DeleteMapping("/{id}") public R delete(@ApiParam(name = "id", value = "年检记录id", required = true) @PathVariable("id") Long id) { mwTransitCarAnnualInspectionService.removeById(id); return R.ok(); } }