src/main/java/com/zgn/hospital/controller/DeptController.java

(完整代码) 1KB

package com.zgn.hospital.controller;

import com.zgn.hospital.entity.dept;
import com.zgn.hospital.service.DeptService;
import com.zgn.hospital.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: hospital_info
 * @description:
 * @author: ZGN
 * @create: 2023-03-14 20:26
 */
@RestController
@RequestMapping("/dept")
public class DeptController {
    @Autowired
    DeptService deptService;


    @PostMapping("/select/{currentPage}/{size}")
    R select(@PathVariable("currentPage") int currentPage, @PathVariable("size") int size, @RequestBody dept dept){
        return deptService.selectByPage(currentPage,size,dept);
    }

    @PostMapping("/update")
    R update(@RequestBody dept dept){
        return deptService.update(dept);
    }

    @PostMapping("/add")
    R add(@RequestBody dept dept){
        return deptService.add(dept);
    }

    @DeleteMapping("/delete/{id}")
    R delete(@PathVariable("id") Integer id){
        return deptService.delete(id);
    }


}

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。