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
8a206296
Commit
8a206296
authored
Nov 19, 2019
by
konghaorui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UserRouterImpl 模块增加判空、升级版本
parent
85cfa249
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
34 deletions
+45
-34
config.gradle
config.gradle
+23
-23
modular.gradle
m-user/modular.gradle
+1
-1
UserHelper.kt
m-user/src/main/java/com/yidianling/user/UserHelper.kt
+2
-5
UserRouterImp.kt
m-user/src/main/java/com/yidianling/user/route/UserRouterImp.kt
+19
-5
No files found.
config.gradle
View file @
8a206296
...
...
@@ -42,13 +42,13 @@ ext {
ydlPublishVersion
=
[
// -------------- 业务模块 --------------
//第三步 若干
"m-confide"
:
"0.0.1
6
"
,
"m-consultant"
:
"0.0.2
3
"
,
"m-course"
:
"0.0.
9
"
,
"m-fm"
:
"0.0.1
2
"
,
"m-muse"
:
"0.0.
8
"
,
"m-tests"
:
"0.0.
5
"
,
"m-user"
:
"0.0.2
6
"
,
"m-confide"
:
"0.0.1
8
"
,
"m-consultant"
:
"0.0.2
5
"
,
"m-course"
:
"0.0.
11
"
,
"m-fm"
:
"0.0.1
4
"
,
"m-muse"
:
"0.0.
10
"
,
"m-tests"
:
"0.0.
7
"
,
"m-user"
:
"0.0.2
8
"
,
//-------------- 业务模块 API 层 --------------
"m-audioim-api"
:
"0.0.1"
,
"m-confide-api"
:
"0.0.1"
,
...
...
@@ -57,18 +57,18 @@ ext {
"m-fm-api"
:
"0.0.2"
,
"m-muse-api"
:
"0.0.1"
,
"m-tests-api"
:
"0.0.1"
,
"m-user-api"
:
"0.0.
5
"
,
"m-user-api"
:
"0.0.
7
"
,
//-------------- 功能组件 --------------
//第一步
"ydl-platform"
:
"0.0.2
2
"
,
"ydl-platform"
:
"0.0.2
4
"
,
//第二步 若干
"ydl-webview"
:
"0.0.2
1
"
,
"ydl-media"
:
"0.0.1
0
"
,
"ydl-pay"
:
"0.0.
7
"
,
"m-audioim"
:
"0.0.1
3
"
,
"ydl-webview"
:
"0.0.2
4
"
,
"ydl-media"
:
"0.0.1
2
"
,
"ydl-pay"
:
"0.0.
9
"
,
"m-audioim"
:
"0.0.1
5
"
,
//以下 几乎不会动
"router"
:
"0.0.1"
,
"ydl-net"
:
"0.0.
1
"
,
"ydl-net"
:
"0.0.
2
"
,
"ydl-utils"
:
"0.0.2"
,
"ydl-flutter-base"
:
"0.0.3"
,
]
...
...
@@ -91,18 +91,18 @@ ext {
"m-fm-api"
:
"0.0.2"
,
"m-muse-api"
:
"0.0.1"
,
"m-tests-api"
:
"0.0.1"
,
"m-user-api"
:
"0.0.
5
"
,
"m-user-api"
:
"0.0.
7
"
,
//-------------- 功能组件 --------------
//第一步
"ydl-platform"
:
"0.0.2
1
"
,
"ydl-platform"
:
"0.0.2
4
"
,
//第二步 若干
"ydl-webview"
:
"0.0.2
1
"
,
"ydl-media"
:
"0.0.1
0
"
,
"ydl-pay"
:
"0.0.
7
"
,
"m-audioim"
:
"0.0.1
3
"
,
"ydl-webview"
:
"0.0.2
4
"
,
"ydl-media"
:
"0.0.1
2
"
,
"ydl-pay"
:
"0.0.
9
"
,
"m-audioim"
:
"0.0.1
5
"
,
//以下 几乎不会动
"router"
:
"0.0.1"
,
"ydl-net"
:
"0.0.
1
"
,
"ydl-net"
:
"0.0.
2
"
,
"ydl-utils"
:
"0.0.2"
,
"ydl-flutter-base"
:
"0.0.3"
,
]
...
...
@@ -235,10 +235,10 @@ ext {
"imagepicker"
:
"com.ydl:imagepicker:1.0.6"
,
"protector"
:
"com.ydl:protector:1.0.1-SNAPSHOT@aar"
,
"ydl-hnet"
:
"com.ydl:h-net:0.0.8"
,
"ydl-utils"
:
"com.ydl:ydl-utils:0.0.2"
,
"ydl-net"
:
"com.ydl:ydl-net:0.0.1"
,
"ydl-user-router"
:
"com.ydl:router:1.0.0-SNAPSHOT@aar"
,
"ydl-device"
:
"com.ydl:device-id:0.0.7@aar"
,
"ydl-net"
:
"com.ydl:ydl-net:${ydlCompileVersion["
ydl
-
net
"]}"
,
"ydl-utils"
:
"com.ydl:ydl-utils:${ydlCompileVersion["
ydl
-
utils
"]}"
,
//flutter功能组件升级===>发布ydl-flutter-base组件===>引用flutter相关的业务模块
"ydl-flutter"
:
"com.ydl:ydl-flutter:0.0.7@aar"
,
...
...
m-user/modular.gradle
View file @
8a206296
...
...
@@ -24,7 +24,7 @@ modular {
groupId
=
"com.ydl"
artifactId
=
"m-user-api"
//开发时注释掉版本号,发布api时打开
version
=
rootProject
.
ext
.
ydlPublishVersion
[
childProject
.
getName
()+
"-api"
]
//
version = rootProject.ext.ydlPublishVersion[childProject.getName()+"-api"]
// API 层打包时需要引入的依赖
apiDependencies
{
implementation
"com.google.code.gson:gson:2.8.2"
...
...
m-user/src/main/java/com/yidianling/user/UserHelper.kt
View file @
8a206296
...
...
@@ -64,9 +64,8 @@ object UserHelper {
try
{
return
SharedPreferencesEditor
.
getFileString
(
user_info_name_sp
,
user_info_key_sp
)
}
catch
(
e
:
Exception
)
{
userTemp
=
UserResponseBean
()
return
""
}
return
gson
.
toJson
(
userTemp
)
}
fun
updateUserinfo
(
userInfo
:
UserResponseBean
.
UserInfo
?)
{
...
...
@@ -139,8 +138,7 @@ object UserHelper {
try
{
return
SharedPreferencesEditor
.
getFileString
(
user_setting_name_sp
,
user_setting_key_sp
)
}
catch
(
e
:
Exception
)
{
userSetting
=
UserSettingBean
()
return
""
}
return
gson
.
toJson
(
userSetting
)
}
}
\ No newline at end of file
m-user/src/main/java/com/yidianling/user/route/UserRouterImp.kt
View file @
8a206296
...
...
@@ -27,16 +27,26 @@ import com.yidianling.user.ui.login.RegisterAndLoginActivity
class
UserRouterImp
:
IUserRouter
{
val
gson
:
Gson
=
Gson
()
override
fun
getUserSetting
():
UserSetting
{
return
gson
.
fromJson
(
UserHelper
.
getUserSettingStr
(),
UserSetting
::
class
.
java
)
override
fun
getUserSetting
():
UserSetting
?
{
var
infoStr
=
UserHelper
.
getUserSettingStr
()
if
(
TextUtils
.
isEmpty
(
infoStr
)){
return
null
}
return
gson
.
fromJson
(
infoStr
,
UserSetting
::
class
.
java
)
}
override
fun
updateUserInfoSp
(
userInfo
:
UserResponse
.
UserInfo
?)
{
val
info
:
UserResponseBean
.
UserInfo
=
gson
.
fromJson
(
gson
.
toJson
(
userInfo
),
UserResponseBean
.
UserInfo
::
class
.
java
)
if
(
userInfo
==
null
){
return
}
val
info
:
UserResponseBean
.
UserInfo
=
gson
.
fromJson
(
gson
.
toJson
(
userInfo
),
UserResponseBean
.
UserInfo
::
class
.
java
)
UserHelper
.
updateUserinfo
(
info
)
}
override
fun
updateUserSetingSp
(
userSetting
:
UserSetting
?)
{
if
(
userSetting
==
null
){
return
}
val
info
:
UserSettingBean
=
gson
.
fromJson
(
gson
.
toJson
(
userSetting
),
UserSettingBean
::
class
.
java
)
UserHelper
.
updateUserSetting
(
info
)
}
...
...
@@ -50,8 +60,12 @@ class UserRouterImp : IUserRouter {
UserHelper
.
setUserinfo
(
info
)
}
override
fun
getUserResponse
():
UserResponse
{
return
gson
.
fromJson
(
UserHelper
.
getUserInfoStr
(),
UserResponse
::
class
.
java
)
override
fun
getUserResponse
():
UserResponse
?
{
var
infoStr
=
UserHelper
.
getUserInfoStr
()
if
(
TextUtils
.
isEmpty
(
infoStr
)){
return
null
}
return
gson
.
fromJson
(
infoStr
,
UserResponse
::
class
.
java
)
}
override
fun
isLogin
():
Boolean
{
...
...
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