LaborGroupDictController.java 2 KB
package com.subsidy.controller;


import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.model.LaborGroupDictDO;
import com.subsidy.service.LaborGroupDictService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;

/**
 * <p>
 * 伙伴群组字典表 前端控制器
 * </p>
 *
 * @author Tuyp
 * @since 2024-07-23
 */
@RestController
@Api(tags = "伙伴群组字典表")
@RequestMapping("/laborGroupDict")
public class LaborGroupDictController {

    @Autowired
    private LaborGroupDictService laborGroupDictService;

    @PostMapping("allGroups")
    @ApiOperation("查看所有群组+人数  laborId")
    public ResponseVO allGroups(@RequestBody LaborGroupDictDO laborGroupDictDO){
        return ResponseData.generateCreatedResponse(0,laborGroupDictService.allGroups(laborGroupDictDO));
    }

    @PostMapping("addGroup")
    @ApiOperation("添加群组  laborId parentId 父节点id  groupName")
    public ResponseVO addGroup(@RequestBody LaborGroupDictDO laborGroupDictDO){
        laborGroupDictService.addGroup(laborGroupDictDO);
        return ResponseData.generateCreatedResponse(0);
    }

    @PostMapping("updateGroup")
    @ApiOperation("修改群组 id groupName")
    public ResponseVO updateGroup(@RequestBody LaborGroupDictDO laborGroupDictDO){
        laborGroupDictService.updateGroup(laborGroupDictDO);
        return ResponseData.generateCreatedResponse(0);
    }

    @PostMapping("deleteGroup")
    @ApiOperation("删除群组  id")
    public ResponseVO deleteGroup(@RequestBody LaborGroupDictDO laborGroupDictDO){
        laborGroupDictService.deleteGroup(laborGroupDictDO);
        return ResponseData.generateCreatedResponse(0);
    }
}