56 lines
1.7 KiB
Java
56 lines
1.7 KiB
Java
|
|
package com.gunshi.project.hsz.controller;
|
||
|
|
|
||
|
|
import com.gunshi.core.result.R;
|
||
|
|
import com.gunshi.project.hsz.model.RiskControlMenu;
|
||
|
|
import com.gunshi.project.hsz.service.RiskControlMenuService;
|
||
|
|
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-22 14:16:35
|
||
|
|
*/
|
||
|
|
@Tag(name = "风险管控目录")
|
||
|
|
@RestController
|
||
|
|
@RequestMapping(value="/risk/menu")
|
||
|
|
public class RiskControlMenuController {
|
||
|
|
|
||
|
|
@Autowired
|
||
|
|
private RiskControlMenuService service;
|
||
|
|
|
||
|
|
|
||
|
|
@Operation(summary = "新增")
|
||
|
|
@PostMapping("/insert")
|
||
|
|
public R<RiskControlMenu> insert(@Validated(Insert.class) @RequestBody RiskControlMenu dto) {
|
||
|
|
return R.ok(service.saveData(dto));
|
||
|
|
}
|
||
|
|
|
||
|
|
@Operation(summary = "修改")
|
||
|
|
@PostMapping("/update")
|
||
|
|
public R<RiskControlMenu> update(@Validated(Update.class) @RequestBody RiskControlMenu 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("/tree")
|
||
|
|
public R<List<RiskControlMenu>> tree() {
|
||
|
|
return R.ok(service.tree());
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|