Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
21662788
Commit
21662788
authored
May 25, 2022
by
刘鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 账户注销功能
parent
5ab37efb
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
8 deletions
+31
-8
DemoGlobalConfig.java
app/src/main/java/com/ydl/component/base/DemoGlobalConfig.java
+4
-4
UserApi.kt
m-user/src/main/java/com/yidianling/user/http/UserApi.kt
+10
-1
UserHttp.kt
m-user/src/main/java/com/yidianling/user/http/UserHttp.kt
+5
-1
UserHttpImpl.kt
m-user/src/main/java/com/yidianling/user/http/UserHttpImpl.kt
+9
-1
AccountUnRegisterActivity.kt
m-user/src/main/java/com/yidianling/user/mine/AccountUnRegisterActivity.kt
+3
-1
No files found.
app/src/main/java/com/ydl/component/base/DemoGlobalConfig.java
View file @
21662788
...
...
@@ -20,10 +20,10 @@ import java.util.List;
*/
public
final
class
DemoGlobalConfig
implements
IConfigModule
{
String
APP_DOMAIN
=
"https://api.github.com/"
;
// public static String appEnv = YDLConstants.ENV_AUTO
_TEST;
// public static String appEnv = YDLConstants.ENV_
TEST
;
// public static String appEnv = YDLConstants.ENV_NEW_TEST;//配置未上传到maven库
public
static
String
appEnv
=
YDLConstants
.
ENV_PROD
;
public
static
String
appEnv
=
YDLConstants
.
ENV
_TEST
;
// public static String appEnv = YDLConstants.ENV_
PROD
;
// public static String appEnv = YDLConstants.ENV_NEW_TEST;//配置未上传到maven库
@Override
public
void
injectAppLifecycle
(
@NotNull
Context
context
,
@NotNull
List
<
IAppLifecycles
>
lifecycles
)
{
lifecycles
.
add
(
new
DemoAppLifecycles
());
...
...
m-user/src/main/java/com/yidianling/user/http/UserApi.kt
View file @
21662788
...
...
@@ -228,13 +228,22 @@ interface UserApi {
fun
unBindThirdLogin
(
@Body
body
:
RequestBody
):
Observable
<
BaseResponse
<
Any
>>
/**
* 用户注销账号
* 用户注销账号
(原有禁止登录逻辑)
*/
@FormUrlEncoded
@POST
(
"user/forbid_login"
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
fun
userForbidLogin
(
@FieldMap
params
:
Map
<
String
,
String
>):
Observable
<
BaseAPIResponse
<
Boolean
>>
/**
* 用户注销账号
*/
@FormUrlEncoded
@POST
(
"login/v2/accountLogOff"
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
fun
accountLogOff
(
@FieldMap
params
:
Map
<
String
,
String
>):
Observable
<
BaseAPIResponse
<
Boolean
>>
/**
* 是否需要强绑定手机号
*/
...
...
m-user/src/main/java/com/yidianling/user/http/UserHttp.kt
View file @
21662788
...
...
@@ -78,6 +78,9 @@ interface UserHttp {
fun
getNewUserJumpUrl
():
Observable
<
BaseAPIResponse
<
String
>>
/**用户注销账号*/
/**用户注销账号
(禁止登录)
*/
fun
userForbidLogin
(
param
:
UserForbidLoginParam
):
Observable
<
BaseAPIResponse
<
Boolean
>>
/**用户注销账号*/
fun
accountLogOff
(
param
:
UserForbidLoginParam
):
Observable
<
BaseAPIResponse
<
Boolean
>>
}
\ No newline at end of file
m-user/src/main/java/com/yidianling/user/http/UserHttpImpl.kt
View file @
21662788
...
...
@@ -230,13 +230,21 @@ class UserHttpImpl private constructor() : UserHttp {
}
/**
* 用户注销账号调用接口
* 用户注销账号调用接口
(禁止登陆)
* */
override
fun
userForbidLogin
(
param
:
UserForbidLoginParam
):
Observable
<
BaseAPIResponse
<
Boolean
>>
{
return
RxUtils
.
mapObservable
(
param
)
.
flatMap
{
getUserApi
().
userForbidLogin
(
it
)
}
}
/**
* 用户注销账号调用接口
* */
override
fun
accountLogOff
(
param
:
UserForbidLoginParam
):
Observable
<
BaseAPIResponse
<
Boolean
>>
{
return
RxUtils
.
mapObservable
(
param
)
.
flatMap
{
getUserApi
().
accountLogOff
(
it
)
}
}
private
object
Holder
{
val
INSTANCE
=
UserHttpImpl
()
}
...
...
m-user/src/main/java/com/yidianling/user/mine/AccountUnRegisterActivity.kt
View file @
21662788
...
...
@@ -60,7 +60,7 @@ class AccountUnRegisterActivity : BaseActivity() {
private
fun
userForbidLogin
()
{
val
param
=
UserForbidLoginParam
()
param
.
userPort
=
1
;
UserHttpImpl
.
getInstance
().
userForbidLogin
(
param
)
UserHttpImpl
.
getInstance
().
accountLogOff
(
param
)
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
{
...
...
@@ -68,6 +68,8 @@ class AccountUnRegisterActivity : BaseActivity() {
ToastUtil
.
toastShort
(
"账号已注销"
)
EventBus
.
getDefault
().
post
(
UnRegisterEvent
())
finish
()
}
else
{
ToastUtil
.
toastShort
(
it
.
msg
)
}
}
}
...
...
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