io.github.wslxm.springbootplus2.manage.test.controller.GcMenuController Maven / Gradle / Ivy
The newest version!
package io.github.wslxm.springbootplus2.manage.test.controller;
import io.github.wslxm.springbootplus2.core.base.model.BasePage;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.*;
import io.github.wslxm.springbootplus2.manage.test.model.vo.GcMenuVO;
import io.github.wslxm.springbootplus2.manage.test.model.dto.GcMenuDTO;
import io.github.wslxm.springbootplus2.manage.test.model.query.GcMenuQuery;
import io.github.wslxm.springbootplus2.manage.test.service.GcMenuService;
import io.github.wslxm.springbootplus2.core.base.controller.BaseController;
import io.github.wslxm.springbootplus2.core.constant.BaseConstant;
import io.github.wslxm.springbootplus2.core.result.Result;
import java.util.List;
/**
* base--gc--自关联测试表 (模拟菜单) 前端控制器
*
*
* ::本代码由[兮家小二]提供的代码生成器生成,如有问题,请手动修改 ::作者CSDN:https://blog.csdn.net/qq_41463655
*
*
* @author ws
* @email [email protected]
* @date 2023-08-28 15:16:59
*/
@RestController
@RequestMapping(BaseConstant.Uri.API_ADMIN + "/test/gcMenu")
@Api(value = "GcMenuController", tags = "base--gc--自关联测试表 (模拟菜单)")
public class GcMenuController extends BaseController {
@GetMapping(value = "/tree")
@ApiOperation(value = "树结构数据")
public Result> tree(@ModelAttribute @Validated GcMenuQuery query) {
return Result.success(baseService.tree(query));
}
@GetMapping(value = "/findPage")
@ApiOperation(value = "列表查询")
public Result> findPage(@ModelAttribute @Validated GcMenuQuery query) {
return Result.success(baseService.findPage(query));
}
@GetMapping(value = "/{id}")
@ApiOperation(value = "ID查询")
public Result findId(@PathVariable String id) {
return Result.success(baseService.findId(id));
}
@PostMapping
@ApiOperation(value = "添加")
public Result insert(@RequestBody @Validated GcMenuDTO dto) {
return Result.successInsert(baseService.insert(dto));
}
@PutMapping(value = "/{id}")
@ApiOperation(value = "ID编辑")
public Result upd(@PathVariable String id, @RequestBody @Validated GcMenuDTO dto) {
return Result.successUpdate(baseService.upd(id, dto));
}
@DeleteMapping(value = "/{id}")
@ApiOperation(value = "ID删除")
public Result del(@PathVariable String id) {
return Result.successDelete(baseService.del(id));
}
}