ITeam.java 2.88 KB
package com.dituhui.mp.user;


import com.dituhui.mp.pojo.RoleInfo;
import com.dituhui.mp.pojo.TeamInfo;
import com.dituhui.mp.pojo.UserInfo;
import com.dituhui.mp.pojo.WebResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 团队相关接口
 * @author zl
 */
@FeignClient(value = "user")
public interface ITeam {

    /**
     * 根据ID获取团队
     * @param teamId 团队ID
     * @return WebResult
     */
    @RequestMapping(value = "/v1/team/get", method = RequestMethod.GET)
    WebResult<TeamInfo> queryById(@RequestParam("id") String teamId);

    /**
     * 根据ak获取团队
     *
     * @param ak 团队ak
     * @return WebResult
     */
    @RequestMapping(value = "/v1/team/queryByAppKey", method = RequestMethod.GET)
    WebResult<TeamInfo> queryByAppKey(@RequestParam("ak") String ak);


    /**
     * 添加团队
     * @param teamInfo 团队相关信息
     * @return WebResult
     */
    @RequestMapping(value = "/v1/team/add", method = RequestMethod.POST)
    WebResult<TeamInfo> addTeam(@RequestBody TeamInfo teamInfo);


    /**
     * 更新团队
     * @param teamInfo 团队相关信息
     * @return WebResult
     */
    @RequestMapping(value = "/v1/team/update", method = RequestMethod.POST)
    WebResult<TeamInfo> updateTeam(@RequestBody TeamInfo teamInfo);


    /**
     * 根据Id删除团队
     * @param teamId 团队ID
     * @return WebResult
     */
    @RequestMapping(value = "/v1/team/delete", method = RequestMethod.POST)
    WebResult<Boolean> deleteTeam(@RequestParam("id") String teamId);

    /**
     * 添加团队用户
     * @param teamId 团队ID
     * @param userId 用户ID
     * @return
     */
    @RequestMapping(value = "/v1/team/addUser", method = RequestMethod.POST)
    WebResult<Boolean> addTeamUser(@RequestParam("id") String teamId, @RequestParam("userId") String userId);

    /**
     * 删除团队用户
     * @param teamId 团队ID
     * @param userId 用户ID
     * @return
     */
    @RequestMapping(value = "/v1/team/deleteUser",method = RequestMethod.POST)
    WebResult<Boolean> deleteTeamUser(@RequestParam("id") String teamId, @RequestParam("userId") String userId);

    /**
     * 获取团队用户
     * @param teamId 团队ID
     * @return
     */
    @RequestMapping(value = "/v1/team/getUsers", method = RequestMethod.GET)
    WebResult<List<UserInfo>> getTeamUser(@RequestParam("teamId") String teamId);

    /**
     * 获取团队角色
     * @param teamId 团队ID
     * @return
     */
    @RequestMapping(value = "/v1/team/getRoles", method = RequestMethod.GET)
    WebResult<List<RoleInfo>> getTeamRole(@RequestParam("teamId") String teamId);

}