67 lines
2.1 KiB
Java
67 lines
2.1 KiB
Java
|
|
package com.gunshi.project.hsz.controller;
|
||
|
|
|
||
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||
|
|
import com.gunshi.core.result.R;
|
||
|
|
import com.gunshi.project.hsz.entity.so.MaintainPageSo;
|
||
|
|
import com.gunshi.project.hsz.model.MaintainService;
|
||
|
|
import com.gunshi.project.hsz.service.MaintainServiceService;
|
||
|
|
import com.gunshi.project.hsz.validate.markers.Insert;
|
||
|
|
import com.gunshi.project.hsz.validate.markers.Update;
|
||
|
|
import io.swagger.v3.oas.annotations.Operation;
|
||
|
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
||
|
|
import org.springframework.validation.annotation.Validated;
|
||
|
|
import org.springframework.web.bind.annotation.*;
|
||
|
|
|
||
|
|
import java.io.Serializable;
|
||
|
|
import java.util.List;
|
||
|
|
/**
|
||
|
|
* 描述: 维修养护
|
||
|
|
* author: xusan
|
||
|
|
* date: 2024-08-27 15:15:14
|
||
|
|
*/
|
||
|
|
@Tag(name = "维修养护")
|
||
|
|
@RestController
|
||
|
|
@RequestMapping(value="/maintain/service")
|
||
|
|
public class MaintainServiceController extends AbstractCommonFileController{
|
||
|
|
|
||
|
|
@Autowired
|
||
|
|
private MaintainServiceService service;
|
||
|
|
|
||
|
|
|
||
|
|
@Operation(summary = "新增")
|
||
|
|
@PostMapping("/insert")
|
||
|
|
public R<MaintainService> insert(@Validated(Insert.class) @RequestBody MaintainService dto) {
|
||
|
|
return R.ok(service.saveData(dto));
|
||
|
|
}
|
||
|
|
|
||
|
|
@Operation(summary = "修改")
|
||
|
|
@PostMapping("/update")
|
||
|
|
public R<MaintainService> update(@Validated(Update.class) @RequestBody MaintainService dto) {
|
||
|
|
return R.ok(service.updateData(dto));
|
||
|
|
}
|
||
|
|
|
||
|
|
@Operation(summary = "删除")
|
||
|
|
@GetMapping("/del/{id}")
|
||
|
|
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||
|
|
return R.ok(service.delData(id));
|
||
|
|
}
|
||
|
|
|
||
|
|
@Operation(summary = "列表")
|
||
|
|
@PostMapping("/list")
|
||
|
|
public R<List<MaintainService>> list() {
|
||
|
|
return R.ok(service.lambdaQuery().list());
|
||
|
|
}
|
||
|
|
|
||
|
|
@Operation(summary = "分页")
|
||
|
|
@PostMapping("/page")
|
||
|
|
public R<Page<MaintainService>> page(@RequestBody MaintainPageSo page) {
|
||
|
|
return R.ok(service.pageQuery(page));
|
||
|
|
}
|
||
|
|
|
||
|
|
@Override
|
||
|
|
public String getGroupId() {
|
||
|
|
return "maintainService";
|
||
|
|
}
|
||
|
|
}
|