TeamDictController.java 4.77 KB
package com.laowu.controller;


import com.laowu.dto.team.*;
import com.laowu.model.TeamDictDO;
import com.laowu.service.TeamDictService;
import com.laowu.util.ResponseData;
import com.laowu.util.ResponseVO;
import io.swagger.annotations.Api;
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;

/**
 * <p>
 * 团队字典表 前端控制器
 * </p>
 *
 * @author Tuyp
 * @since 2023-03-29
 */
@RestController
@Api(tags = "团队字典表")
@RequestMapping("/teamDict")
public class TeamDictController {

    @Autowired
    private TeamDictService teamDictService;

    @PostMapping("teams")
    @ApiOperation("工作站下的团队  pageSize  pageNum  stationId  teamName")
    public ResponseVO teams(@RequestBody TeamsDTO teamsDTO){
        return ResponseData.generateCreatedResponse(0,teamDictService.teams(teamsDTO));
    }

    @PostMapping("totalTeams")
    @ApiOperation("总团队数  stationId")
    public ResponseVO totalTeams(@RequestBody TeamDictDO teamDictDO){
        return ResponseData.generateCreatedResponse(0,teamDictService.totalTeams(teamDictDO));
    }

    @PostMapping("deleteTeam")
    @ApiOperation("删除团队 id")
    public ResponseVO deleteTeam(@RequestBody TeamDictDO teamDictDO){
        return ResponseData.generateCreatedResponse(0,teamDictService.deleteTeam(teamDictDO));
    }

    @PostMapping("addTeam")
    @ApiOperation("添加团队  stationId teamName  comment memberId")
    public ResponseVO addTeam(@RequestBody TeamDictDO teamDictDO){
        return ResponseData.generateCreatedResponse(0,teamDictService.addTeam(teamDictDO));
    }

    @PostMapping("updateTeam")
    @ApiOperation("id  stationId teamName  comment memberId")
    public ResponseVO updateTeam(@RequestBody TeamDictDO teamDict){
        return ResponseData.generateCreatedResponse(0,teamDictService.updateTeam(teamDict));
    }

    @PostMapping("teamMember")
    @ApiOperation("查看团队成员信息  teamId")
    public ResponseVO teamMember(@RequestBody TeamMemberDTO teamMemberDTO){
        return ResponseData.generateCreatedResponse(0,teamDictService.teamMember(teamMemberDTO));
    }

    @PostMapping("oneTeamInfo")
    @ApiOperation("查看一个团队详情  id")
    public ResponseVO oneTeamInfo(@RequestBody TeamDictDO teamDictDO){
        return ResponseData.generateCreatedResponse(0,teamDictService.oneTeamInfo(teamDictDO));
    }

    @PostMapping("noTeamMembers")
    @ApiOperation("查看没有团队的成员信息 pageSize pageNum teamId userName")
    public ResponseVO noTeamMembers(@RequestBody TeamMemberDTO teamMemberDTO){
        return ResponseData.generateCreatedResponse(0,teamDictService.noTeamMembers(teamMemberDTO));
    }

    @PostMapping("updateTeamMembers")
    @ApiOperation("编辑团队信息  teamId  memberIds[] ")
    public ResponseVO updateMembers(@RequestBody UpdateTeamMembersDTO updateTeamMembersDTO){
        return ResponseData.generateCreatedResponse(0,teamDictService.updateMembers(updateTeamMembersDTO));
    }

    @PostMapping("leaderMembers")
    @ApiOperation("团队带头人 stationId  pageSize pageNum ")
    public ResponseVO leaderMembers(@RequestBody LeaderMembersDTO leaderMembersDTO){
        return ResponseData.generateCreatedResponse(0,teamDictService.leaderMembers(leaderMembersDTO));
    }

    @PostMapping("leaderMemberCounts")
    @ApiOperation("团队带头人数  stationId")
    public ResponseVO leaderMemberCounts(@RequestBody TeamDictDO teamDictDO){
        return ResponseData.generateCreatedResponse(0,teamDictService.leaderMemberCounts(teamDictDO));
    }

    @PostMapping("provinceStationTeam")
    @ApiOperation("省-工作站-团队 userId")
    public ResponseVO provinceStationTeam(@RequestBody ProvinceStationTeamDTO provinceStationTeamDTO){
        return ResponseData.generateCreatedResponse(0,teamDictService.provinceStationTeam(provinceStationTeamDTO));
    }

    @PostMapping("memberManagement")
    @ApiOperation("人员管理  pageSize  pageNum  teamId  stationId  province  jobStatus  userName")
    public ResponseVO memberManagement (@RequestBody MemberManagementDTO memberManagementDTO){
        return ResponseData.generateCreatedResponse(0,teamDictService.memberManagement(memberManagementDTO));
    }

    @PostMapping("memberManagementCount")
    @ApiOperation("人员管理  人数 teamId  stationId  province  jobStatus  userName")
    public ResponseVO memberManagementCount(@RequestBody MemberManagementDTO memberManagementDTO){
        return ResponseData.generateCreatedResponse(0,teamDictService.memberManagementCount(memberManagementDTO));
    }

}