123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- package com.fdkankan.task.controller;
- import com.mybatisflex.core.paginate.Page;
- 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.PutMapping;
- import org.springframework.web.bind.annotation.RequestBody;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.beans.factory.annotation.Autowired;
- import com.fdkankan.task.entity.TbSceneNum;
- import com.fdkankan.task.service.TbSceneNumService;
- import org.springframework.web.bind.annotation.RestController;
- import java.io.Serializable;
- import java.util.List;
- /**
- * 控制层。
- *
- * @author Admin
- * @since 2023-12-01
- */
- @RestController
- @RequestMapping("/tbSceneNum")
- public class TbSceneNumController {
- @Autowired
- private TbSceneNumService tbSceneNumService;
- /**
- * 添加。
- *
- * @param tbSceneNum
- * @return {@code true} 添加成功,{@code false} 添加失败
- */
- @PostMapping("save")
- public boolean save(@RequestBody TbSceneNum tbSceneNum) {
- return tbSceneNumService.save(tbSceneNum);
- }
- /**
- * 根据主键删除。
- *
- * @param id 主键
- * @return {@code true} 删除成功,{@code false} 删除失败
- */
- @DeleteMapping("remove/{id}")
- public boolean remove(@PathVariable Serializable id) {
- return tbSceneNumService.removeById(id);
- }
- /**
- * 根据主键更新。
- *
- * @param tbSceneNum
- * @return {@code true} 更新成功,{@code false} 更新失败
- */
- @PutMapping("update")
- public boolean update(@RequestBody TbSceneNum tbSceneNum) {
- return tbSceneNumService.updateById(tbSceneNum);
- }
- /**
- * 查询所有。
- *
- * @return 所有数据
- */
- @GetMapping("list")
- public List<TbSceneNum> list() {
- return tbSceneNumService.list();
- }
- /**
- * 根据主键获取详细信息。
- *
- * @param id 主键
- * @return 详情
- */
- @GetMapping("getInfo/{id}")
- public TbSceneNum getInfo(@PathVariable Serializable id) {
- return tbSceneNumService.getById(id);
- }
- /**
- * 分页查询。
- *
- * @param page 分页对象
- * @return 分页对象
- */
- @GetMapping("page")
- public Page<TbSceneNum> page(Page<TbSceneNum> page) {
- return tbSceneNumService.page(page);
- }
- }
|