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 {
towerApi
.
getCommonConfig
(
requestParams
)
.
compose
(
TransformUtil
.
defaultSchedulers
())
.
subscribe
(
object
:
HttpResultObserver
<
GetCommonConfigBean
>()
{
override
fun
onSuccess
(
result
:
HttpResult
<
GetCommonConfigBean
>?)
{
.
subscribe
(
object
:
HttpResultObserver
<
GetCommonConfigBean
.
GetCommonConfigResponse
>()
{
override
fun
onSuccess
(
result
:
HttpResult
<
GetCommonConfigBean
.
GetCommonConfigResponse
>?)
{
apiCallback
.
getCommonConfigSuccess
(
result
?.
result
)
}
override
fun
onFailure
(
result
:
HttpResult
<
GetCommonConfigBean
>?)
{
override
fun
onFailure
(
result
:
HttpResult
<
GetCommonConfigBean
.
GetCommonConfigResponse
>?)
{
apiCallback
.
getCommonConfigFailure
(
result
?.
status
)
}
})
...
...
CommonLib/Common/src/main/java/com/yidian/common/http/CommonService.kt
View file @
0001530b
...
...
@@ -32,5 +32,5 @@ interface CommonService {
):
Observable
<
HttpResult
<
Any
?
>>
@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
import
com.google.gson.annotations.SerializedName
/**
* author: yinjiacheng
* date: 7/12/21 10:10 PM
* description: open-tower-api.go2yd.com/api/resource
*/
data class
GetCommonConfigBean
(
@SerializedName
(
"appid"
)
val
appid
:
String
,
@SerializedName
(
"created_at"
)
val
createdAt
:
String
,
@SerializedName
(
"creator"
)
val
creator
:
String
,
@SerializedName
(
"data"
)
val
`data`
:
Data
,
@SerializedName
(
"env"
)
val
env
:
Int
,
@SerializedName
(
"_id"
)
val
id
:
String
,
@SerializedName
(
"keyTag"
)
val
keyTag
:
String
,
@SerializedName
(
"note"
)
val
note
:
String
,
@SerializedName
(
"os"
)
val
os
:
Int
,
@SerializedName
(
"status"
)
val
status
:
String
,
@SerializedName
(
"uniqueKey"
)
val
uniqueKey
:
String
,
@SerializedName
(
"updated_at"
)
val
updatedAt
:
String
,
@SerializedName
(
"version"
)
val
version
:
String
)
class
GetCommonConfigBean
{
data class
GetCommonConfigResponse
(
@SerializedName
(
"appid"
)
val
appid
:
String
,
@SerializedName
(
"created_at"
)
val
createdAt
:
String
,
@SerializedName
(
"creator"
)
val
creator
:
String
,
@SerializedName
(
"data"
)
val
`data`
:
Data
,
@SerializedName
(
"env"
)
val
env
:
Int
,
@SerializedName
(
"_id"
)
val
id
:
String
,
@SerializedName
(
"keyTag"
)
val
keyTag
:
String
,
@SerializedName
(
"note"
)
val
note
:
String
,
@SerializedName
(
"os"
)
val
os
:
Int
,
@SerializedName
(
"status"
)
val
status
:
String
,
@SerializedName
(
"uniqueKey"
)
val
uniqueKey
:
String
,
@SerializedName
(
"updated_at"
)
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
(
@SerializedName
(
"is_show_app_upgrade"
)
val
isShowAppUpgrade
:
Int
,
@SerializedName
(
"merchant_manager_center"
)
val
merchantManagerCenter
:
MerchantManagerCenter
)
data class
MerchantManagerCenter
(
@SerializedName
(
"disable_text"
)
val
disableText
:
String
,
@SerializedName
(
"disable_url"
)
val
disableUrl
:
Any
,
@SerializedName
(
"items"
)
val
items
:
List
<
Item
>,
@SerializedName
(
"show"
)
val
show
:
Int
)
data class
MerchantManagerCenter
(
@SerializedName
(
"disable_text
"
)
val
disableText
:
String
,
@SerializedName
(
"disable_url
"
)
val
disableUrl
:
Any
,
@SerializedName
(
"items
"
)
val
items
:
List
<
Item
>
,
@SerializedName
(
"show"
)
val
show
:
Int
)
data class
Item
(
@SerializedName
(
"functions
"
)
val
functions
:
List
<
Function
>
,
@SerializedName
(
"group_id
"
)
val
groupId
:
Int
,
@SerializedName
(
"group_name
"
)
val
groupName
:
String
,
@SerializedName
(
"show"
)
val
show
:
Int
)
data class
Item
(
@SerializedName
(
"functions"
)
val
functions
:
List
<
Function
>,
@SerializedName
(
"group_id"
)
val
groupId
:
Int
,
@SerializedName
(
"group_name"
)
val
groupName
:
String
,
@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
)
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
* description: open-tower-api.go2yd.com/api/resource
*/
interface
IGetCommonConfigCallback
{
fun
getCommonConfigSuccess
(
result
:
GetCommonConfigBean
?)
fun
getCommonConfigSuccess
(
result
:
GetCommonConfigBean
.
GetCommonConfigResponse
?)
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
import
android.view.ViewGroup
import
androidx.recyclerview.widget.RecyclerView
import
com.bumptech.glide.Glide
import
com.yidian.common.http.bean.GetCommonConfigBean
import
com.yidian.shenghuoquan.newscontent.databinding.ItemMerchantServiceFunctionBinding
import
com.yidian.shenghuoquan.newscontent.http.httpbean.GetConfigListBean
/**
* author: yinjiacheng
...
...
@@ -16,7 +16,7 @@ import com.yidian.shenghuoquan.newscontent.http.httpbean.GetConfigListBean
*/
class
MerchantServiceFunctionAdapter
@JvmOverloads
constructor
(
val
context
:
Context
,
data
:
List
<
GetCo
nfigList
Bean
.
Function
>?
=
null
,
data
:
List
<
GetCo
mmonConfig
Bean
.
Function
>?
=
null
,
val
listener
:
OnItemClickListener
?
=
null
)
:
RecyclerView
.
Adapter
<
MerchantServiceFunctionAdapter
.
MerchantServiceViewHolder
>()
{
...
...
@@ -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
init
{
// 将不显示的数据去除
data
?.
let
{
(
it
as
ArrayList
<
GetCo
nfigList
Bean
.
Function
>).
iterator
().
apply
{
(
it
as
ArrayList
<
GetCo
mmonConfig
Bean
.
Function
>).
iterator
().
apply
{
while
(
hasNext
())
{
if
(
next
().
show
!=
FUNCTION_SHOW
)
remove
()
}
...
...
@@ -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
{
serviceData
.
clear
()
(
it
as
ArrayList
<
GetCo
nfigList
Bean
.
Function
>).
iterator
().
apply
{
(
it
as
ArrayList
<
GetCo
mmonConfig
Bean
.
Function
>).
iterator
().
apply
{
while
(
hasNext
())
{
if
(
next
().
show
!=
FUNCTION_SHOW
)
remove
()
}
...
...
@@ -72,12 +72,12 @@ class MerchantServiceFunctionAdapter @JvmOverloads constructor(
override
fun
onBindViewHolder
(
holder
:
MerchantServiceViewHolder
,
position
:
Int
)
{
val
data
=
serviceData
[
position
]
if
(
data
.
icon
_u
rl
.
isNotEmpty
())
{
Glide
.
with
(
context
).
load
(
data
.
icon
_u
rl
).
into
(
viewBinding
.
ivService
)
if
(
data
.
icon
U
rl
.
isNotEmpty
())
{
Glide
.
with
(
context
).
load
(
data
.
icon
U
rl
).
into
(
viewBinding
.
ivService
)
}
else
{
// 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
)
}
}
...
...
@@ -92,7 +92,7 @@ class MerchantServiceFunctionAdapter @JvmOverloads constructor(
RecyclerView
.
ViewHolder
(
itemView
)
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
import
android.view.ViewGroup
import
androidx.recyclerview.widget.GridLayoutManager
import
androidx.recyclerview.widget.RecyclerView
import
com.yidian.common.http.bean.GetCommonConfigBean
import
com.yidian.shenghuoquan.newscontent.databinding.ItemMerchantServiceGroupBinding
import
com.yidian.shenghuoquan.newscontent.http.httpbean.GetConfigListBean
import
com.yidian.utils.DensityUtil
/**
...
...
@@ -18,7 +18,7 @@ import com.yidian.utils.DensityUtil
*/
class
MerchantServiceGroupAdapter
@JvmOverloads
constructor
(
val
context
:
Context
,
data
:
List
<
GetCo
nfigList
Bean
.
Item
>?
=
null
,
data
:
List
<
GetCo
mmonConfig
Bean
.
Item
>?
=
null
,
val
listener
:
MerchantServiceFunctionAdapter
.
OnItemClickListener
?
=
null
)
:
RecyclerView
.
Adapter
<
MerchantServiceGroupAdapter
.
MerchantServiceGroupViewHolder
>()
{
...
...
@@ -34,7 +34,7 @@ class MerchantServiceGroupAdapter @JvmOverloads constructor(
* 数据源
*/
private
val
groupData
by
lazy
{
ArrayList
<
GetCo
nfigList
Bean
.
Item
>()
ArrayList
<
GetCo
mmonConfig
Bean
.
Item
>()
}
init
{
...
...
@@ -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
()
data
?.
let
{
it
.
forEach
{
item
->
...
...
@@ -81,7 +81,7 @@ class MerchantServiceGroupAdapter @JvmOverloads constructor(
override
fun
onBindViewHolder
(
holder
:
MerchantServiceGroupViewHolder
,
position
:
Int
)
{
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
.
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 {
isUmengRelease
:
'false'
,
// 上线时改成true,使用上线版本的友盟配置
isApplication
:
false
,
isAppUpgradeOnline:
'true'
,
// 上线前需要开启版本升级线上环境 true
towerApiEnv
:
'"
2
"'
// Tower Api环境 0:测试环境 1:内网-正式环境 2:外网-正式环境 3:内网外网-正式环境
towerApiEnv
:
'"
0
"'
// Tower Api环境 0:测试环境 1:内网-正式环境 2:外网-正式环境 3:内网外网-正式环境
]
// 高德地图的key
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