Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 5365be9a
authored
Jul 12, 2023
by
chamberone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 更新user模块url前缀
1 parent
2fb85b77
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
118 deletions
config-init/config/project-gateway.yaml
project-gateway/src/main/java/com/dituhui/pea/gateway/auth/UserAuthService.java
project-interface/src/main/java/com/dituhui/pea/user/ITeam.java
project-interface/src/main/java/com/dituhui/pea/user/IUser.java
config-init/config/project-gateway.yaml
View file @
5365be9
...
...
@@ -5,7 +5,7 @@ spring:
-
id
:
user
uri
:
lb://project-user
predicates
:
-
Path=/pea-user/**
, /user/**, /v1/team/**, /v1/user/**
-
Path=/pea-user/**
-
id
:
order
uri
:
lb://project-order
predicates
:
...
...
project-gateway/src/main/java/com/dituhui/pea/gateway/auth/UserAuthService.java
View file @
5365be9
...
...
@@ -8,7 +8,6 @@ import com.dituhui.pea.enums.ThirdPartyEnum;
import
com.dituhui.pea.exception.BusinessException
;
import
com.dituhui.pea.gateway.commom.RedisService
;
import
com.dituhui.pea.pojo.*
;
import
com.dituhui.pea.user.ITeam
;
import
com.dituhui.pea.user.IUser
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.codec.digest.DigestUtils
;
...
...
@@ -37,9 +36,6 @@ public class UserAuthService {
@Autowired
private
IUser
iUser
;
@Autowired
private
ITeam
iTeam
;
/**
* 获取用户认证token信息, 为了提高效率应该使用缓存
*/
...
...
project-interface/src/main/java/com/dituhui/pea/user/ITeam.java
deleted
100644 → 0
View file @
2fb85b7
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
);
}
project-interface/src/main/java/com/dituhui/pea/user/IUser.java
View file @
5365be9
...
...
@@ -20,10 +20,10 @@ import com.dituhui.pea.pojo.WebResult;
@FeignClient
(
value
=
"user"
)
public
interface
IUser
{
@RequestMapping
(
value
=
"/user/login"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/
pea-
user/login"
,
method
=
RequestMethod
.
POST
)
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
);
/**
...
...
@@ -33,7 +33,7 @@ public interface IUser {
* @param needTeamInfo 是否返回团队信息
* @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
,
@RequestParam
(
name
=
"needTeamInfo"
,
required
=
false
)
Boolean
needTeamInfo
);
...
...
@@ -42,7 +42,7 @@ public interface IUser {
* @param id 用户ID
* @return
*/
@RequestMapping
(
value
=
"/
v1/
user/get"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/
pea-
user/get"
,
method
=
RequestMethod
.
GET
)
WebResult
<
UserInfo
>
queryUserById
(
@RequestParam
(
"id"
)
String
id
);
/**
...
...
@@ -51,7 +51,7 @@ public interface IUser {
* @param account 用户账号
* @return
*/
@RequestMapping
(
value
=
"/
v1/
user/getByAccount"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/
pea-
user/getByAccount"
,
method
=
RequestMethod
.
GET
)
WebResult
<
UserInfo
>
queryUserByAccount
(
@RequestParam
(
"account"
)
String
account
);
/**
...
...
@@ -60,7 +60,7 @@ public interface IUser {
* @param phone 用户电话
* @return
*/
@RequestMapping
(
value
=
"/
v1/
user/getByPhone"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/
pea-
user/getByPhone"
,
method
=
RequestMethod
.
GET
)
WebResult
<
UserInfo
>
queryUserByPhone
(
@RequestParam
(
"phone"
)
String
phone
);
/**
...
...
@@ -70,7 +70,7 @@ public interface IUser {
* @param type 第三方类型
* @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
);
...
...
@@ -79,7 +79,7 @@ public interface IUser {
* @param userInfo 用户信息
* @return
*/
@RequestMapping
(
value
=
"/
v1/
user/add"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/
pea-
user/add"
,
method
=
RequestMethod
.
POST
)
WebResult
<
UserInfo
>
addUser
(
@RequestBody
UserInfo
userInfo
);
...
...
@@ -88,7 +88,7 @@ public interface IUser {
* @param userInfo 用户信息
* @return
*/
@RequestMapping
(
value
=
"/
v1/
user/update"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/
pea-
user/update"
,
method
=
RequestMethod
.
POST
)
WebResult
<
UserInfo
>
updateUser
(
@RequestBody
UserInfo
userInfo
);
/**
...
...
@@ -96,7 +96,7 @@ public interface IUser {
* @param userId 用户ID
* @return
*/
@RequestMapping
(
value
=
"/
v1/
user/delete"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/
pea-
user/delete"
,
method
=
RequestMethod
.
POST
)
WebResult
<
Boolean
>
deleteUser
(
@RequestParam
(
"id"
)
String
userId
);
/**
...
...
@@ -104,7 +104,7 @@ public interface IUser {
* @param userInfo 用户信息
* @return
*/
@RequestMapping
(
value
=
"/
v1/
user/register"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/
pea-
user/register"
,
method
=
RequestMethod
.
POST
)
WebResult
<
UserInfo
>
register
(
@RequestBody
UserInfo
userInfo
);
/**
...
...
@@ -112,7 +112,7 @@ public interface IUser {
* @param thirdUserInfo 第三方用户信息
* @return
*/
@RequestMapping
(
value
=
"/
v1/
user/thirdRegister"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/
pea-
user/thirdRegister"
,
method
=
RequestMethod
.
POST
)
WebResult
<
UserInfo
>
thirdRegister
(
@RequestBody
ThirdUserInfo
thirdUserInfo
);
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment