buhuazhen
2026-05-08 a40e2a665a077625deb18560ba5a02a303049374
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package com.ruoyi.production.controller;
 
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.framework.web.domain.R;
import com.ruoyi.production.bean.dto.WorkshopDto;
import com.ruoyi.production.bean.vo.SaveWorkshopVo;
import com.ruoyi.production.bean.vo.SearchWorkshopVo;
import com.ruoyi.production.service.WorkshopService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
 
/**
 * @author buhuazhen
 * @date 2026/5/8
 * @email 3038525872@qq.com
 */
@AllArgsConstructor
@RequestMapping("/workshop")
@RestController
public class WorkshopController {
    private final WorkshopService workshopService;
 
    @PostMapping("/save")
    public R<Void> save(@RequestBody SaveWorkshopVo saveWorkshopVo){
        workshopService.save(saveWorkshopVo);
        return R.ok();
    }
 
    @PostMapping("/deleteById/{id}")
    public R<Void> deleteById(@PathVariable Long id){
        workshopService.deleteById(id);
        return R.ok();
    }
 
    @PostMapping("/page")
    public R<Page<WorkshopDto>> page(@RequestBody SearchWorkshopVo searchWorkshopVo){
        Page<WorkshopDto> workshopDtoPage = workshopService.pageList(searchWorkshopVo);
        return R.ok(workshopDtoPage);
    }
}