Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ShenghuoquanBusiness
Project
Project
Details
Activity
Releases
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
bp
ShenghuoquanBusiness
Commits
0001530b
Commit
0001530b
authored
Jul 13, 2021
by
yinjiacheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 接入TowerPro通用配置模块同步修改商户管理中心逻辑
parent
c43fdfa1
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
212 additions
and
211 deletions
+212
-211
CommonDataSource.kt
.../src/main/java/com/yidian/common/http/CommonDataSource.kt
+3
-3
CommonService.kt
...mon/src/main/java/com/yidian/common/http/CommonService.kt
+1
-1
GetCommonConfigBean.kt
...n/java/com/yidian/common/http/bean/GetCommonConfigBean.kt
+70
-67
IGetCommonConfigCallback.kt
...m/yidian/common/http/callback/IGetCommonConfigCallback.kt
+1
-1
MerchantServiceFunctionAdapter.kt
...uan/newscontent/adapter/MerchantServiceFunctionAdapter.kt
+10
-10
MerchantServiceGroupAdapter.kt
...uoquan/newscontent/adapter/MerchantServiceGroupAdapter.kt
+5
-5
MerchantCenterActivity.kt
...nghuoquan/newscontent/ui/center/MerchantCenterActivity.kt
+121
-123
config.gradle
config/config.gradle
+1
-1
No files found.
CommonLib/Common/src/main/java/com/yidian/common/http/CommonDataSource.kt
View file @
0001530b
...
@@ -76,12 +76,12 @@ object CommonDataSource {
...
@@ -76,12 +76,12 @@ object CommonDataSource {
towerApi
towerApi
.
getCommonConfig
(
requestParams
)
.
getCommonConfig
(
requestParams
)
.
compose
(
TransformUtil
.
defaultSchedulers
())
.
compose
(
TransformUtil
.
defaultSchedulers
())
.
subscribe
(
object
:
HttpResultObserver
<
GetCommonConfigBean
>()
{
.
subscribe
(
object
:
HttpResultObserver
<
GetCommonConfigBean
.
GetCommonConfigResponse
>()
{
override
fun
onSuccess
(
result
:
HttpResult
<
GetCommonConfigBean
>?)
{
override
fun
onSuccess
(
result
:
HttpResult
<
GetCommonConfigBean
.
GetCommonConfigResponse
>?)
{
apiCallback
.
getCommonConfigSuccess
(
result
?.
result
)
apiCallback
.
getCommonConfigSuccess
(
result
?.
result
)
}
}
override
fun
onFailure
(
result
:
HttpResult
<
GetCommonConfigBean
>?)
{
override
fun
onFailure
(
result
:
HttpResult
<
GetCommonConfigBean
.
GetCommonConfigResponse
>?)
{
apiCallback
.
getCommonConfigFailure
(
result
?.
status
)
apiCallback
.
getCommonConfigFailure
(
result
?.
status
)
}
}
})
})
...
...
CommonLib/Common/src/main/java/com/yidian/common/http/CommonService.kt
View file @
0001530b
...
@@ -32,5 +32,5 @@ interface CommonService {
...
@@ -32,5 +32,5 @@ interface CommonService {
):
Observable
<
HttpResult
<
Any
?
>>
):
Observable
<
HttpResult
<
Any
?
>>
@GET
(
getCommonConfig
)
@GET
(
getCommonConfig
)
fun
getCommonConfig
(
@QueryMap
requestParams
:
Map
<
String
,
String
>):
Observable
<
HttpResult
<
GetCommonConfigBean
>>
fun
getCommonConfig
(
@QueryMap
requestParams
:
Map
<
String
,
String
>):
Observable
<
HttpResult
<
GetCommonConfigBean
.
GetCommonConfigResponse
>>
}
}
CommonLib/Common/src/main/java/com/yidian/common/http/bean/GetCommonConfigBean.kt
View file @
0001530b
...
@@ -2,79 +2,82 @@ package com.yidian.common.http.bean
...
@@ -2,79 +2,82 @@ package com.yidian.common.http.bean
import
com.google.gson.annotations.SerializedName
import
com.google.gson.annotations.SerializedName
/**
/**
* author: yinjiacheng
* author: yinjiacheng
* date: 7/12/21 10:10 PM
* date: 7/12/21 10:10 PM
* description: open-tower-api.go2yd.com/api/resource
* description: open-tower-api.go2yd.com/api/resource
*/
*/
data class
GetCommonConfigBean
(
class
GetCommonConfigBean
{
@SerializedName
(
"appid"
)
val
appid
:
String
,
data class
GetCommonConfigResponse
(
@SerializedName
(
"created_at"
)
@SerializedName
(
"appid"
)
val
createdAt
:
String
,
val
appid
:
String
,
@SerializedName
(
"creator"
)
@SerializedName
(
"created_at"
)
val
creator
:
String
,
val
createdAt
:
String
,
@SerializedName
(
"data"
)
@SerializedName
(
"creator"
)
val
`data`
:
Data
,
val
creator
:
String
,
@SerializedName
(
"env"
)
@SerializedName
(
"data"
)
val
env
:
Int
,
val
`data`
:
Data
,
@SerializedName
(
"_id"
)
@SerializedName
(
"env"
)
val
id
:
String
,
val
env
:
Int
,
@SerializedName
(
"keyTag"
)
@SerializedName
(
"_id"
)
val
keyTag
:
String
,
val
id
:
String
,
@SerializedName
(
"note"
)
@SerializedName
(
"keyTag"
)
val
note
:
String
,
val
keyTag
:
String
,
@SerializedName
(
"os"
)
@SerializedName
(
"note"
)
val
os
:
Int
,
val
note
:
String
,
@SerializedName
(
"status"
)
@SerializedName
(
"os"
)
val
status
:
String
,
val
os
:
Int
,
@SerializedName
(
"uniqueKey"
)
@SerializedName
(
"status"
)
val
uniqueKey
:
String
,
val
status
:
String
,
@SerializedName
(
"updated_at"
)
@SerializedName
(
"uniqueKey"
)
val
updatedAt
:
String
,
val
uniqueKey
:
String
,
@SerializedName
(
"version"
)
@SerializedName
(
"updated_at"
)
val
version
:
String
val
updatedAt
:
String
,
)
@SerializedName
(
"version"
)
val
version
:
String
)
data class
Data
(
@SerializedName
(
"is_show_app_upgrade"
)
val
isShowAppUpgrade
:
Int
,
@SerializedName
(
"merchant_manager_center"
)
val
merchantManagerCenter
:
MerchantManagerCenter
)
data class
Data
(
data class
MerchantManagerCenter
(
@SerializedName
(
"is_show_app_upgrade"
)
@SerializedName
(
"disable_text"
)
val
isShowAppUpgrade
:
Int
,
val
disableText
:
String
,
@SerializedName
(
"merchant_manager_center"
)
@SerializedName
(
"disable_url"
)
val
merchantManagerCenter
:
MerchantManagerCenter
val
disableUrl
:
Any
,
)
@SerializedName
(
"items"
)
val
items
:
List
<
Item
>,
@SerializedName
(
"show"
)
val
show
:
Int
)
data class
MerchantManagerCenter
(
data class
Item
(
@SerializedName
(
"disable_text
"
)
@SerializedName
(
"functions
"
)
val
disableText
:
String
,
val
functions
:
List
<
Function
>
,
@SerializedName
(
"disable_url
"
)
@SerializedName
(
"group_id
"
)
val
disableUrl
:
Any
,
val
groupId
:
Int
,
@SerializedName
(
"items
"
)
@SerializedName
(
"group_name
"
)
val
items
:
List
<
Item
>
,
val
groupName
:
String
,
@SerializedName
(
"show"
)
@SerializedName
(
"show"
)
val
show
:
Int
val
show
:
Int
)
)
data class
Item
(
data class
Function
(
@SerializedName
(
"functions"
)
@SerializedName
(
"function_id"
)
val
functions
:
List
<
Function
>,
val
functionId
:
Int
,
@SerializedName
(
"group_id"
)
@SerializedName
(
"function_name"
)
val
groupId
:
Int
,
val
functionName
:
String
,
@SerializedName
(
"group_name"
)
@SerializedName
(
"icon_url"
)
val
groupName
:
String
,
val
iconUrl
:
String
,
@SerializedName
(
"show"
)
@SerializedName
(
"link_url"
)
val
show
:
Int
val
linkUrl
:
Any
,
)
@SerializedName
(
"show"
)
val
show
:
Int
)
data class
Function
(
}
@SerializedName
(
"function_id"
)
val
functionId
:
Int
,
@SerializedName
(
"function_name"
)
val
functionName
:
String
,
@SerializedName
(
"icon_url"
)
val
iconUrl
:
String
,
@SerializedName
(
"link_url"
)
val
linkUrl
:
Any
,
@SerializedName
(
"show"
)
val
show
:
Int
)
CommonLib/Common/src/main/java/com/yidian/common/http/callback/IGetCommonConfigCallback.kt
View file @
0001530b
...
@@ -8,6 +8,6 @@ import com.yidian.common.http.bean.GetCommonConfigBean
...
@@ -8,6 +8,6 @@ import com.yidian.common.http.bean.GetCommonConfigBean
* description: open-tower-api.go2yd.com/api/resource
* description: open-tower-api.go2yd.com/api/resource
*/
*/
interface
IGetCommonConfigCallback
{
interface
IGetCommonConfigCallback
{
fun
getCommonConfigSuccess
(
result
:
GetCommonConfigBean
?)
fun
getCommonConfigSuccess
(
result
:
GetCommonConfigBean
.
GetCommonConfigResponse
?)
fun
getCommonConfigFailure
(
message
:
String
?)
fun
getCommonConfigFailure
(
message
:
String
?)
}
}
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/adapter/MerchantServiceFunctionAdapter.kt
View file @
0001530b
...
@@ -6,8 +6,8 @@ import android.view.View
...
@@ -6,8 +6,8 @@ import android.view.View
import
android.view.ViewGroup
import
android.view.ViewGroup
import
androidx.recyclerview.widget.RecyclerView
import
androidx.recyclerview.widget.RecyclerView
import
com.bumptech.glide.Glide
import
com.bumptech.glide.Glide
import
com.yidian.common.http.bean.GetCommonConfigBean
import
com.yidian.shenghuoquan.newscontent.databinding.ItemMerchantServiceFunctionBinding
import
com.yidian.shenghuoquan.newscontent.databinding.ItemMerchantServiceFunctionBinding
import
com.yidian.shenghuoquan.newscontent.http.httpbean.GetConfigListBean
/**
/**
* author: yinjiacheng
* author: yinjiacheng
...
@@ -16,7 +16,7 @@ import com.yidian.shenghuoquan.newscontent.http.httpbean.GetConfigListBean
...
@@ -16,7 +16,7 @@ import com.yidian.shenghuoquan.newscontent.http.httpbean.GetConfigListBean
*/
*/
class
MerchantServiceFunctionAdapter
@JvmOverloads
constructor
(
class
MerchantServiceFunctionAdapter
@JvmOverloads
constructor
(
val
context
:
Context
,
val
context
:
Context
,
data
:
List
<
GetCo
nfigList
Bean
.
Function
>?
=
null
,
data
:
List
<
GetCo
mmonConfig
Bean
.
Function
>?
=
null
,
val
listener
:
OnItemClickListener
?
=
null
val
listener
:
OnItemClickListener
?
=
null
)
:
)
:
RecyclerView
.
Adapter
<
MerchantServiceFunctionAdapter
.
MerchantServiceViewHolder
>()
{
RecyclerView
.
Adapter
<
MerchantServiceFunctionAdapter
.
MerchantServiceViewHolder
>()
{
...
@@ -29,14 +29,14 @@ class MerchantServiceFunctionAdapter @JvmOverloads constructor(
...
@@ -29,14 +29,14 @@ class MerchantServiceFunctionAdapter @JvmOverloads constructor(
/**
/**
* 数据源
* 数据源
*/
*/
private
val
serviceData
by
lazy
{
ArrayList
<
GetCo
nfigList
Bean
.
Function
>()
}
private
val
serviceData
by
lazy
{
ArrayList
<
GetCo
mmonConfig
Bean
.
Function
>()
}
private
lateinit
var
viewBinding
:
ItemMerchantServiceFunctionBinding
private
lateinit
var
viewBinding
:
ItemMerchantServiceFunctionBinding
init
{
init
{
// 将不显示的数据去除
// 将不显示的数据去除
data
?.
let
{
data
?.
let
{
(
it
as
ArrayList
<
GetCo
nfigList
Bean
.
Function
>).
iterator
().
apply
{
(
it
as
ArrayList
<
GetCo
mmonConfig
Bean
.
Function
>).
iterator
().
apply
{
while
(
hasNext
())
{
while
(
hasNext
())
{
if
(
next
().
show
!=
FUNCTION_SHOW
)
remove
()
if
(
next
().
show
!=
FUNCTION_SHOW
)
remove
()
}
}
...
@@ -48,10 +48,10 @@ class MerchantServiceFunctionAdapter @JvmOverloads constructor(
...
@@ -48,10 +48,10 @@ class MerchantServiceFunctionAdapter @JvmOverloads constructor(
/**
/**
* 更新数据 将不显示的数据去除
* 更新数据 将不显示的数据去除
*/
*/
fun
updateData
(
data
:
List
<
GetCo
nfigList
Bean
.
Function
>?)
{
fun
updateData
(
data
:
List
<
GetCo
mmonConfig
Bean
.
Function
>?)
{
data
?.
let
{
data
?.
let
{
serviceData
.
clear
()
serviceData
.
clear
()
(
it
as
ArrayList
<
GetCo
nfigList
Bean
.
Function
>).
iterator
().
apply
{
(
it
as
ArrayList
<
GetCo
mmonConfig
Bean
.
Function
>).
iterator
().
apply
{
while
(
hasNext
())
{
while
(
hasNext
())
{
if
(
next
().
show
!=
FUNCTION_SHOW
)
remove
()
if
(
next
().
show
!=
FUNCTION_SHOW
)
remove
()
}
}
...
@@ -72,12 +72,12 @@ class MerchantServiceFunctionAdapter @JvmOverloads constructor(
...
@@ -72,12 +72,12 @@ class MerchantServiceFunctionAdapter @JvmOverloads constructor(
override
fun
onBindViewHolder
(
holder
:
MerchantServiceViewHolder
,
position
:
Int
)
{
override
fun
onBindViewHolder
(
holder
:
MerchantServiceViewHolder
,
position
:
Int
)
{
val
data
=
serviceData
[
position
]
val
data
=
serviceData
[
position
]
if
(
data
.
icon
_u
rl
.
isNotEmpty
())
{
if
(
data
.
icon
U
rl
.
isNotEmpty
())
{
Glide
.
with
(
context
).
load
(
data
.
icon
_u
rl
).
into
(
viewBinding
.
ivService
)
Glide
.
with
(
context
).
load
(
data
.
icon
U
rl
).
into
(
viewBinding
.
ivService
)
}
else
{
}
else
{
// TODO: 6/11/21 显示本地icon
// TODO: 6/11/21 显示本地icon
}
}
holder
.
viewBinding
.
tvService
.
text
=
data
.
function
_n
ame
holder
.
viewBinding
.
tvService
.
text
=
data
.
function
N
ame
holder
.
viewBinding
.
root
.
setOnClickListener
{
listener
?.
onItemClick
(
it
,
position
,
data
)
}
holder
.
viewBinding
.
root
.
setOnClickListener
{
listener
?.
onItemClick
(
it
,
position
,
data
)
}
}
}
...
@@ -92,7 +92,7 @@ class MerchantServiceFunctionAdapter @JvmOverloads constructor(
...
@@ -92,7 +92,7 @@ class MerchantServiceFunctionAdapter @JvmOverloads constructor(
RecyclerView
.
ViewHolder
(
itemView
)
RecyclerView
.
ViewHolder
(
itemView
)
interface
OnItemClickListener
{
interface
OnItemClickListener
{
fun
onItemClick
(
view
:
View
,
position
:
Int
,
data
:
GetCo
nfigList
Bean
.
Function
)
fun
onItemClick
(
view
:
View
,
position
:
Int
,
data
:
GetCo
mmonConfig
Bean
.
Function
)
}
}
}
}
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/adapter/MerchantServiceGroupAdapter.kt
View file @
0001530b
...
@@ -7,8 +7,8 @@ import android.view.View
...
@@ -7,8 +7,8 @@ import android.view.View
import
android.view.ViewGroup
import
android.view.ViewGroup
import
androidx.recyclerview.widget.GridLayoutManager
import
androidx.recyclerview.widget.GridLayoutManager
import
androidx.recyclerview.widget.RecyclerView
import
androidx.recyclerview.widget.RecyclerView
import
com.yidian.common.http.bean.GetCommonConfigBean
import
com.yidian.shenghuoquan.newscontent.databinding.ItemMerchantServiceGroupBinding
import
com.yidian.shenghuoquan.newscontent.databinding.ItemMerchantServiceGroupBinding
import
com.yidian.shenghuoquan.newscontent.http.httpbean.GetConfigListBean
import
com.yidian.utils.DensityUtil
import
com.yidian.utils.DensityUtil
/**
/**
...
@@ -18,7 +18,7 @@ import com.yidian.utils.DensityUtil
...
@@ -18,7 +18,7 @@ import com.yidian.utils.DensityUtil
*/
*/
class
MerchantServiceGroupAdapter
@JvmOverloads
constructor
(
class
MerchantServiceGroupAdapter
@JvmOverloads
constructor
(
val
context
:
Context
,
val
context
:
Context
,
data
:
List
<
GetCo
nfigList
Bean
.
Item
>?
=
null
,
data
:
List
<
GetCo
mmonConfig
Bean
.
Item
>?
=
null
,
val
listener
:
MerchantServiceFunctionAdapter
.
OnItemClickListener
?
=
null
val
listener
:
MerchantServiceFunctionAdapter
.
OnItemClickListener
?
=
null
)
:
)
:
RecyclerView
.
Adapter
<
MerchantServiceGroupAdapter
.
MerchantServiceGroupViewHolder
>()
{
RecyclerView
.
Adapter
<
MerchantServiceGroupAdapter
.
MerchantServiceGroupViewHolder
>()
{
...
@@ -34,7 +34,7 @@ class MerchantServiceGroupAdapter @JvmOverloads constructor(
...
@@ -34,7 +34,7 @@ class MerchantServiceGroupAdapter @JvmOverloads constructor(
* 数据源
* 数据源
*/
*/
private
val
groupData
by
lazy
{
private
val
groupData
by
lazy
{
ArrayList
<
GetCo
nfigList
Bean
.
Item
>()
ArrayList
<
GetCo
mmonConfig
Bean
.
Item
>()
}
}
init
{
init
{
...
@@ -51,7 +51,7 @@ class MerchantServiceGroupAdapter @JvmOverloads constructor(
...
@@ -51,7 +51,7 @@ class MerchantServiceGroupAdapter @JvmOverloads constructor(
/**
/**
* 刷新数据
* 刷新数据
*/
*/
fun
updateData
(
data
:
List
<
GetCo
nfigList
Bean
.
Item
>?)
{
fun
updateData
(
data
:
List
<
GetCo
mmonConfig
Bean
.
Item
>?)
{
groupData
.
clear
()
groupData
.
clear
()
data
?.
let
{
data
?.
let
{
it
.
forEach
{
item
->
it
.
forEach
{
item
->
...
@@ -81,7 +81,7 @@ class MerchantServiceGroupAdapter @JvmOverloads constructor(
...
@@ -81,7 +81,7 @@ class MerchantServiceGroupAdapter @JvmOverloads constructor(
override
fun
onBindViewHolder
(
holder
:
MerchantServiceGroupViewHolder
,
position
:
Int
)
{
override
fun
onBindViewHolder
(
holder
:
MerchantServiceGroupViewHolder
,
position
:
Int
)
{
val
data
=
groupData
[
position
]
val
data
=
groupData
[
position
]
holder
.
viewBinding
.
tvTitle
.
text
=
data
.
group
_n
ame
holder
.
viewBinding
.
tvTitle
.
text
=
data
.
group
N
ame
viewBinding
.
rvService
.
layoutManager
=
GridLayoutManager
(
context
,
4
)
viewBinding
.
rvService
.
layoutManager
=
GridLayoutManager
(
context
,
4
)
viewBinding
.
rvService
.
adapter
=
MerchantServiceFunctionAdapter
(
context
,
data
.
functions
,
listener
)
viewBinding
.
rvService
.
adapter
=
MerchantServiceFunctionAdapter
(
context
,
data
.
functions
,
listener
)
}
}
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/center/MerchantCenterActivity.kt
View file @
0001530b
This diff is collapsed.
Click to expand it.
config/config.gradle
View file @
0001530b
...
@@ -10,7 +10,7 @@ ext {
...
@@ -10,7 +10,7 @@ ext {
isUmengRelease
:
'false'
,
// 上线时改成true,使用上线版本的友盟配置
isUmengRelease
:
'false'
,
// 上线时改成true,使用上线版本的友盟配置
isApplication
:
false
,
isApplication
:
false
,
isAppUpgradeOnline:
'true'
,
// 上线前需要开启版本升级线上环境 true
isAppUpgradeOnline:
'true'
,
// 上线前需要开启版本升级线上环境 true
towerApiEnv
:
'"
2
"'
// Tower Api环境 0:测试环境 1:内网-正式环境 2:外网-正式环境 3:内网外网-正式环境
towerApiEnv
:
'"
0
"'
// Tower Api环境 0:测试环境 1:内网-正式环境 2:外网-正式环境 3:内网外网-正式环境
]
]
// 高德地图的key
// 高德地图的key
amap
=
[
amap
=
[
...
...
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