Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
answer-backend
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
answer
answer-backend
Commits
534927e6
Commit
534927e6
authored
Aug 11, 2022
by
袁伟铭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新API微信登录方法
parent
e20011cc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
3 deletions
+48
-3
api-server/src/main/java/com/zq/api/feign/UserFeign.java
+16
-3
api-server/src/main/java/com/zq/api/service/IApiLogic.java
+12
-0
api-server/src/main/java/com/zq/api/service/impl/ApiV100Logic.java
+20
-0
No files found.
api-server/src/main/java/com/zq/api/feign/UserFeign.java
View file @
534927e6
...
@@ -3,14 +3,15 @@ package com.zq.api.feign;
...
@@ -3,14 +3,15 @@ package com.zq.api.feign;
import
com.zq.api.config.FeignConfig
;
import
com.zq.api.config.FeignConfig
;
import
com.zq.common.vo.ResultVo
;
import
com.zq.common.vo.ResultVo
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.Map
;
/**
/**
* @author wilmiam
* @author wilmiam
* @since 2021-07-13 09:56
* @since 2021-07-13 09:56
*/
*/
@FeignClient
(
name
=
"USER-SERVER"
,
path
=
"/user/ap
p
"
,
configuration
=
FeignConfig
.
class
)
@FeignClient
(
name
=
"USER-SERVER"
,
path
=
"/user/ap
i
"
,
configuration
=
FeignConfig
.
class
)
public
interface
UserFeign
{
public
interface
UserFeign
{
/**
/**
...
@@ -22,4 +23,16 @@ public interface UserFeign {
...
@@ -22,4 +23,16 @@ public interface UserFeign {
@GetMapping
(
value
=
"/sendCode"
)
@GetMapping
(
value
=
"/sendCode"
)
ResultVo
sendCode
(
@RequestParam
String
phone
);
ResultVo
sendCode
(
@RequestParam
String
phone
);
@PostMapping
(
value
=
"/wxLogin"
)
ResultVo
wxLogin
(
@RequestBody
Map
<
String
,
Object
>
paramsMap
);
@PostMapping
(
value
=
"/getWxPhone"
)
ResultVo
getWxPhone
(
@RequestBody
Map
<
String
,
Object
>
paramsMap
);
@PostMapping
(
value
=
"/updateWxUserInfo"
)
ResultVo
updateWxUserInfo
(
@RequestBody
Map
<
String
,
Object
>
paramsMap
);
@GetMapping
(
value
=
"/getWxUserInfo/{userId}"
)
ResultVo
getWxUserInfo
(
@PathVariable
String
userId
);
}
}
api-server/src/main/java/com/zq/api/service/IApiLogic.java
View file @
534927e6
...
@@ -14,4 +14,16 @@ public interface IApiLogic extends IApiCommon {
...
@@ -14,4 +14,16 @@ public interface IApiLogic extends IApiCommon {
@ApiMethod
(
name
=
"发送验证码"
,
service
=
"USER-SERVER"
)
@ApiMethod
(
name
=
"发送验证码"
,
service
=
"USER-SERVER"
)
ApiResp
sendCode
(
ApiForm
form
);
ApiResp
sendCode
(
ApiForm
form
);
@ApiMethod
(
name
=
"微信登录"
,
service
=
"USER-SERVER"
)
ApiResp
wxLogin
(
ApiForm
form
);
@ApiMethod
(
name
=
"解密获取微信用户手机号"
,
service
=
"USER-SERVER"
)
ApiResp
getWxPhone
(
ApiForm
form
);
@ApiMethod
(
name
=
"微信用户信息更新"
,
service
=
"USER-SERVER"
)
ApiResp
updateWxUserInfo
(
ApiForm
form
);
@ApiMethod
(
name
=
"获取微信用户信息"
,
service
=
"USER-SERVER"
)
ApiResp
getWxUserInfo
(
ApiForm
form
);
}
}
api-server/src/main/java/com/zq/api/service/impl/ApiV100Logic.java
View file @
534927e6
...
@@ -25,4 +25,24 @@ public class ApiV100Logic extends BaseApiLogic implements IApiLogic {
...
@@ -25,4 +25,24 @@ public class ApiV100Logic extends BaseApiLogic implements IApiLogic {
return
ApiUtils
.
toApiResp
(
form
,
userFeign
.
sendCode
(
form
.
getString
(
"phone"
)));
return
ApiUtils
.
toApiResp
(
form
,
userFeign
.
sendCode
(
form
.
getString
(
"phone"
)));
}
}
@Override
public
ApiResp
wxLogin
(
ApiForm
form
)
{
return
ApiUtils
.
toApiResp
(
form
,
userFeign
.
wxLogin
(
form
.
getParamsMap
()));
}
@Override
public
ApiResp
getWxPhone
(
ApiForm
form
)
{
return
ApiUtils
.
toApiResp
(
form
,
userFeign
.
getWxPhone
(
form
.
getParamsMap
()));
}
@Override
public
ApiResp
updateWxUserInfo
(
ApiForm
form
)
{
return
ApiUtils
.
toApiResp
(
form
,
userFeign
.
updateWxUserInfo
(
form
.
getParamsMap
(
true
,
"id"
)));
}
@Override
public
ApiResp
getWxUserInfo
(
ApiForm
form
)
{
return
ApiUtils
.
toApiResp
(
form
,
userFeign
.
getWxUserInfo
(
form
.
getUserId
()));
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment