Commit 5365be9a by chamberone

feat: 更新user模块url前缀

1 parent 2fb85b77
...@@ -5,7 +5,7 @@ spring: ...@@ -5,7 +5,7 @@ spring:
- id: user - id: user
uri: lb://project-user uri: lb://project-user
predicates: predicates:
- Path=/pea-user/**, /user/**, /v1/team/**, /v1/user/** - Path=/pea-user/**
- id: order - id: order
uri: lb://project-order uri: lb://project-order
predicates: predicates:
......
...@@ -8,7 +8,6 @@ import com.dituhui.pea.enums.ThirdPartyEnum; ...@@ -8,7 +8,6 @@ import com.dituhui.pea.enums.ThirdPartyEnum;
import com.dituhui.pea.exception.BusinessException; import com.dituhui.pea.exception.BusinessException;
import com.dituhui.pea.gateway.commom.RedisService; import com.dituhui.pea.gateway.commom.RedisService;
import com.dituhui.pea.pojo.*; import com.dituhui.pea.pojo.*;
import com.dituhui.pea.user.ITeam;
import com.dituhui.pea.user.IUser; import com.dituhui.pea.user.IUser;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.codec.digest.DigestUtils;
...@@ -37,9 +36,6 @@ public class UserAuthService { ...@@ -37,9 +36,6 @@ public class UserAuthService {
@Autowired @Autowired
private IUser iUser; private IUser iUser;
@Autowired
private ITeam iTeam;
/** /**
* 获取用户认证token信息, 为了提高效率应该使用缓存 * 获取用户认证token信息, 为了提高效率应该使用缓存
*/ */
......
package com.dituhui.pea.user;
import com.dituhui.pea.pojo.RoleInfo;
import com.dituhui.pea.pojo.TeamInfo;
import com.dituhui.pea.pojo.UserInfo;
import com.dituhui.pea.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);
}
...@@ -20,10 +20,10 @@ import com.dituhui.pea.pojo.WebResult; ...@@ -20,10 +20,10 @@ import com.dituhui.pea.pojo.WebResult;
@FeignClient(value = "user") @FeignClient(value = "user")
public interface IUser { public interface IUser {
@RequestMapping(value = "/user/login", method = RequestMethod.POST) @RequestMapping(value = "/pea-user/login", method = RequestMethod.POST)
public Result<?> userLogin(@RequestBody UserLoginParam user); public Result<?> userLogin(@RequestBody UserLoginParam user);
@RequestMapping(value = "/user/userInfo", method = RequestMethod.GET) @RequestMapping(value = "/pea-user/userInfo", method = RequestMethod.GET)
public Result<?> getUserInfo(@RequestParam(name = "token") String token); public Result<?> getUserInfo(@RequestParam(name = "token") String token);
/** /**
...@@ -33,7 +33,7 @@ public interface IUser { ...@@ -33,7 +33,7 @@ public interface IUser {
* @param needTeamInfo 是否返回团队信息 * @param needTeamInfo 是否返回团队信息
* @return * @return
*/ */
@RequestMapping(value = "/v1/user/getCurrentUserInfo", method = RequestMethod.GET) @RequestMapping(value = "/pea-user/getCurrentUserInfo", method = RequestMethod.GET)
WebResult<UserInfo> getCurrentUserInfo(@RequestParam(name = "userToken") String userToken, WebResult<UserInfo> getCurrentUserInfo(@RequestParam(name = "userToken") String userToken,
@RequestParam(name = "needTeamInfo", required = false) Boolean needTeamInfo); @RequestParam(name = "needTeamInfo", required = false) Boolean needTeamInfo);
...@@ -42,7 +42,7 @@ public interface IUser { ...@@ -42,7 +42,7 @@ public interface IUser {
* @param id 用户ID * @param id 用户ID
* @return * @return
*/ */
@RequestMapping(value = "/v1/user/get", method = RequestMethod.GET) @RequestMapping(value = "/pea-user/get", method = RequestMethod.GET)
WebResult<UserInfo> queryUserById(@RequestParam("id") String id); WebResult<UserInfo> queryUserById(@RequestParam("id") String id);
/** /**
...@@ -51,7 +51,7 @@ public interface IUser { ...@@ -51,7 +51,7 @@ public interface IUser {
* @param account 用户账号 * @param account 用户账号
* @return * @return
*/ */
@RequestMapping(value = "/v1/user/getByAccount", method = RequestMethod.GET) @RequestMapping(value = "/pea-user/getByAccount", method = RequestMethod.GET)
WebResult<UserInfo> queryUserByAccount(@RequestParam("account") String account); WebResult<UserInfo> queryUserByAccount(@RequestParam("account") String account);
/** /**
...@@ -60,7 +60,7 @@ public interface IUser { ...@@ -60,7 +60,7 @@ public interface IUser {
* @param phone 用户电话 * @param phone 用户电话
* @return * @return
*/ */
@RequestMapping(value = "/v1/user/getByPhone", method = RequestMethod.GET) @RequestMapping(value = "/pea-user/getByPhone", method = RequestMethod.GET)
WebResult<UserInfo> queryUserByPhone(@RequestParam("phone") String phone); WebResult<UserInfo> queryUserByPhone(@RequestParam("phone") String phone);
/** /**
...@@ -70,7 +70,7 @@ public interface IUser { ...@@ -70,7 +70,7 @@ public interface IUser {
* @param type 第三方类型 * @param type 第三方类型
* @return * @return
*/ */
@RequestMapping(value = "/v1/user/getByThirdParty", method = RequestMethod.GET) @RequestMapping(value = "/pea-user/getByThirdParty", method = RequestMethod.GET)
WebResult<UserInfo> queryUserByThirdParty(@RequestParam("id") String id, @RequestParam("type") ThirdPartyEnum type); WebResult<UserInfo> queryUserByThirdParty(@RequestParam("id") String id, @RequestParam("type") ThirdPartyEnum type);
...@@ -79,7 +79,7 @@ public interface IUser { ...@@ -79,7 +79,7 @@ public interface IUser {
* @param userInfo 用户信息 * @param userInfo 用户信息
* @return * @return
*/ */
@RequestMapping(value = "/v1/user/add", method = RequestMethod.POST) @RequestMapping(value = "/pea-user/add", method = RequestMethod.POST)
WebResult<UserInfo> addUser(@RequestBody UserInfo userInfo); WebResult<UserInfo> addUser(@RequestBody UserInfo userInfo);
...@@ -88,7 +88,7 @@ public interface IUser { ...@@ -88,7 +88,7 @@ public interface IUser {
* @param userInfo 用户信息 * @param userInfo 用户信息
* @return * @return
*/ */
@RequestMapping(value = "/v1/user/update", method = RequestMethod.POST) @RequestMapping(value = "/pea-user/update", method = RequestMethod.POST)
WebResult<UserInfo> updateUser(@RequestBody UserInfo userInfo); WebResult<UserInfo> updateUser(@RequestBody UserInfo userInfo);
/** /**
...@@ -96,7 +96,7 @@ public interface IUser { ...@@ -96,7 +96,7 @@ public interface IUser {
* @param userId 用户ID * @param userId 用户ID
* @return * @return
*/ */
@RequestMapping(value = "/v1/user/delete", method = RequestMethod.POST) @RequestMapping(value = "/pea-user/delete", method = RequestMethod.POST)
WebResult<Boolean> deleteUser(@RequestParam("id") String userId); WebResult<Boolean> deleteUser(@RequestParam("id") String userId);
/** /**
...@@ -104,7 +104,7 @@ public interface IUser { ...@@ -104,7 +104,7 @@ public interface IUser {
* @param userInfo 用户信息 * @param userInfo 用户信息
* @return * @return
*/ */
@RequestMapping(value = "/v1/user/register", method = RequestMethod.POST) @RequestMapping(value = "/pea-user/register", method = RequestMethod.POST)
WebResult<UserInfo> register(@RequestBody UserInfo userInfo); WebResult<UserInfo> register(@RequestBody UserInfo userInfo);
/** /**
...@@ -112,7 +112,7 @@ public interface IUser { ...@@ -112,7 +112,7 @@ public interface IUser {
* @param thirdUserInfo 第三方用户信息 * @param thirdUserInfo 第三方用户信息
* @return * @return
*/ */
@RequestMapping(value = "/v1/user/thirdRegister", method = RequestMethod.POST) @RequestMapping(value = "/pea-user/thirdRegister", method = RequestMethod.POST)
WebResult<UserInfo> thirdRegister(@RequestBody ThirdUserInfo thirdUserInfo); WebResult<UserInfo> thirdRegister(@RequestBody ThirdUserInfo thirdUserInfo);
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!