Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
Sobot_module_Dev
Project
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
sobot_android
Sobot_module_Dev
Commits
c87db149
Commit
c87db149
authored
Dec 17, 2024
by
郭倩芳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
common 1.3.0 多语言+拨号盘权限
parent
04b868ae
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
22 deletions
+19
-22
sobot-common-publish-mavencentral.gradle
sobot_common/sobot-common-publish-mavencentral.gradle
+1
-1
SobotLoginTools.java
...src/main/java/com/sobot/common/login/SobotLoginTools.java
+14
-10
ServiceInfoManager.java
...in/java/com/sobot/common/login/db/ServiceInfoManager.java
+2
-2
SobotServiceInfoModel.java
...a/com/sobot/common/login/model/SobotServiceInfoModel.java
+0
-9
SobotPermissionManager.java
...sobot/common/login/permission/SobotPermissionManager.java
+2
-0
No files found.
sobot_common/sobot-common-publish-mavencentral.gradle
View file @
c87db149
...
@@ -12,7 +12,7 @@ task androidSourcesJar(type: Jar) {
...
@@ -12,7 +12,7 @@ task androidSourcesJar(type: Jar) {
ext
{
ext
{
PUBLISH_GROUP_ID
=
"com.sobot.library"
//项目包名
PUBLISH_GROUP_ID
=
"com.sobot.library"
//项目包名
PUBLISH_ARTIFACT_ID
=
'sobotcommon_x'
//项目名
PUBLISH_ARTIFACT_ID
=
'sobotcommon_x'
//项目名
PUBLISH_VERSION
=
'
2.1
.0'
//版本号
PUBLISH_VERSION
=
'
1.3
.0'
//版本号
}
}
...
...
sobot_common/src/main/java/com/sobot/common/login/SobotLoginTools.java
View file @
c87db149
...
@@ -52,7 +52,7 @@ public class SobotLoginTools {
...
@@ -52,7 +52,7 @@ public class SobotLoginTools {
private
SobotServiceInfoModel
mServiceInfoModel
;
private
SobotServiceInfoModel
mServiceInfoModel
;
private
String
lang
=
""
;
private
String
lang
=
""
;
public
SobotServiceInfoModel
getServiceInfo
()
{
public
SobotServiceInfoModel
getServiceInfo
()
{
if
(
mServiceInfoModel
==
null
)
{
if
(
mServiceInfoModel
==
null
)
{
...
@@ -60,14 +60,15 @@ public class SobotLoginTools {
...
@@ -60,14 +60,15 @@ public class SobotLoginTools {
}
}
return
mServiceInfoModel
;
return
mServiceInfoModel
;
}
}
public
String
getServicLang
(){
if
(
lang
!=
null
&&
TextUtils
.
isEmpty
(
lang
))
{
public
String
getServicLang
()
{
if
(
lang
!=
null
&&
TextUtils
.
isEmpty
(
lang
))
{
SobotServiceInfoModel
infoModel
=
getServiceInfo
();
SobotServiceInfoModel
infoModel
=
getServiceInfo
();
if
(
infoModel
!=
null
)
{
if
(
infoModel
!=
null
)
{
lang
=
infoModel
.
getServiceWorkbenchLang
();
lang
=
infoModel
.
getServiceWorkbenchLang
();
}
}
}
}
if
(
lang
==
null
||
TextUtils
.
isEmpty
(
lang
))
{
if
(
lang
==
null
||
TextUtils
.
isEmpty
(
lang
))
{
lang
=
"zh"
;
lang
=
"zh"
;
}
}
return
lang
;
return
lang
;
...
@@ -88,12 +89,12 @@ public class SobotLoginTools {
...
@@ -88,12 +89,12 @@ public class SobotLoginTools {
public
void
setServiceInfo
(
SobotServiceInfoModel
newServiceInfo
)
{
public
void
setServiceInfo
(
SobotServiceInfoModel
newServiceInfo
)
{
ServiceInfoManager
.
getInstance
().
deleteAll
();
ServiceInfoManager
.
getInstance
().
deleteAll
();
lang
=
""
;
mServiceInfoModel
=
newServiceInfo
;
mServiceInfoModel
=
newServiceInfo
;
if
(
mServiceInfoModel
!=
null
)
{
if
(
mServiceInfoModel
!=
null
)
{
lang
=
mServiceInfoModel
.
getServiceWorkbenchLang
();
lang
=
mServiceInfoModel
.
getServiceWorkbenchLang
();
ServiceInfoManager
.
getInstance
().
insert
(
mServiceInfoModel
);
ServiceInfoManager
.
getInstance
().
insert
(
mServiceInfoModel
);
}
else
{
}
else
{
lang
=
""
;
ServiceInfoManager
.
getInstance
().
deleteAll
();
ServiceInfoManager
.
getInstance
().
deleteAll
();
}
}
}
}
...
@@ -190,6 +191,7 @@ public class SobotLoginTools {
...
@@ -190,6 +191,7 @@ public class SobotLoginTools {
public
void
clearLoginInfo
(
boolean
isClearHost
)
{
public
void
clearLoginInfo
(
boolean
isClearHost
)
{
ServiceInfoManager
.
getInstance
().
deleteAll
();
ServiceInfoManager
.
getInstance
().
deleteAll
();
mServiceInfoModel
=
null
;
mServiceInfoModel
=
null
;
lang
=
null
;
if
(
isClearHost
)
{
if
(
isClearHost
)
{
HostManager
.
getInstance
().
deleteAll
();
HostManager
.
getInstance
().
deleteAll
();
}
}
...
@@ -428,7 +430,8 @@ public class SobotLoginTools {
...
@@ -428,7 +430,8 @@ public class SobotLoginTools {
}
}
});
});
}
}
public
void
requestLanguage
(
String
host
,
String
token
,
String
language
){
public
void
requestLanguage
(
String
host
,
String
token
,
String
language
)
{
Map
<
String
,
Object
>
tokebMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
tokebMap
=
new
HashMap
<>();
String
nowMills
=
System
.
currentTimeMillis
()
+
""
;
String
nowMills
=
System
.
currentTimeMillis
()
+
""
;
tokebMap
.
put
(
"create_time"
,
nowMills
);
tokebMap
.
put
(
"create_time"
,
nowMills
);
...
@@ -440,7 +443,7 @@ public void requestLanguage(String host,String token, String language ){
...
@@ -440,7 +443,7 @@ public void requestLanguage(String host,String token, String language ){
Map
<
String
,
String
>
headerMap
=
new
HashMap
<>();
Map
<
String
,
String
>
headerMap
=
new
HashMap
<>();
if
(!
SobotStringUtils
.
isEmpty
(
token
))
{
if
(!
SobotStringUtils
.
isEmpty
(
token
))
{
headerMap
.
put
(
"temp-id"
,
token
);
headerMap
.
put
(
"temp-id"
,
token
);
headerMap
.
put
(
"authorization"
,
"Bearer "
+
token
);
headerMap
.
put
(
"authorization"
,
"Bearer "
+
token
);
}
}
if
(!
SobotStringUtils
.
isEmpty
(
language
))
{
if
(!
SobotStringUtils
.
isEmpty
(
language
))
{
headerMap
.
put
(
"language"
,
language
);
headerMap
.
put
(
"language"
,
language
);
...
@@ -463,7 +466,8 @@ public void requestLanguage(String host,String token, String language ){
...
@@ -463,7 +466,8 @@ public void requestLanguage(String host,String token, String language ){
}
}
});
});
}
}
/**
/**
* 执行登录操作
* 执行登录操作
* 1、通过账号密码登录获取token;2、根据token获取客服角色权限等信息;3、如果是呼叫V6或者电销,先获取AccessToken;4、再根据客服app或者客服SDK登录同时又买了在线产品判断是否执行在线操作逻辑
* 1、通过账号密码登录获取token;2、根据token获取客服角色权限等信息;3、如果是呼叫V6或者电销,先获取AccessToken;4、再根据客服app或者客服SDK登录同时又买了在线产品判断是否执行在线操作逻辑
...
@@ -579,7 +583,7 @@ public void requestLanguage(String host,String token, String language ){
...
@@ -579,7 +583,7 @@ public void requestLanguage(String host,String token, String language ){
params
.
put
(
"loginUser"
,
loginAcount
);
params
.
put
(
"loginUser"
,
loginAcount
);
Map
<
String
,
String
>
headerParams
=
new
HashMap
<>();
Map
<
String
,
String
>
headerParams
=
new
HashMap
<>();
headerParams
.
put
(
"temp-id"
,
getToken
());
headerParams
.
put
(
"temp-id"
,
getToken
());
headerParams
.
put
(
"authorization"
,
"Bearer "
+
getToken
());
headerParams
.
put
(
"authorization"
,
"Bearer "
+
getToken
());
headerParams
.
put
(
"from"
,
"2"
);
headerParams
.
put
(
"from"
,
"2"
);
SobotHttpUtils
.
doPost
(
cancelTag
,
host
+
"/basic-login/serviceLogOut/4"
,
8000
,
params
,
headerParams
,
new
HttpBaseUtils
.
StringCallBack
()
{
SobotHttpUtils
.
doPost
(
cancelTag
,
host
+
"/basic-login/serviceLogOut/4"
,
8000
,
params
,
headerParams
,
new
HttpBaseUtils
.
StringCallBack
()
{
@Override
@Override
...
@@ -627,7 +631,7 @@ public void requestLanguage(String host,String token, String language ){
...
@@ -627,7 +631,7 @@ public void requestLanguage(String host,String token, String language ){
Map
<
String
,
String
>
headerMap
=
new
HashMap
<>();
Map
<
String
,
String
>
headerMap
=
new
HashMap
<>();
if
(!
SobotStringUtils
.
isEmpty
(
token
))
{
if
(!
SobotStringUtils
.
isEmpty
(
token
))
{
headerMap
.
put
(
"temp-id"
,
token
);
headerMap
.
put
(
"temp-id"
,
token
);
headerMap
.
put
(
"authorization"
,
"Bearer "
+
token
);
headerMap
.
put
(
"authorization"
,
"Bearer "
+
token
);
}
}
if
(!
SobotStringUtils
.
isEmpty
(
language
))
{
if
(!
SobotStringUtils
.
isEmpty
(
language
))
{
headerMap
.
put
(
"language"
,
language
);
headerMap
.
put
(
"language"
,
language
);
...
...
sobot_common/src/main/java/com/sobot/common/login/db/ServiceInfoManager.java
View file @
c87db149
...
@@ -83,7 +83,7 @@ public class ServiceInfoManager extends SobotCommonDao<SobotServiceInfoModel> {
...
@@ -83,7 +83,7 @@ public class ServiceInfoManager extends SobotCommonDao<SobotServiceInfoModel> {
model
.
setServiceId
(
cursor
.
getString
(
cursor
.
getColumnIndex
(
"serviceId"
)));
model
.
setServiceId
(
cursor
.
getString
(
cursor
.
getColumnIndex
(
"serviceId"
)));
model
.
setServiceNo
(
cursor
.
getString
(
cursor
.
getColumnIndex
(
"serviceNo"
)));
model
.
setServiceNo
(
cursor
.
getString
(
cursor
.
getColumnIndex
(
"serviceNo"
)));
model
.
setServiceName
(
cursor
.
getString
(
cursor
.
getColumnIndex
(
"serviceName"
)));
model
.
setServiceName
(
cursor
.
getString
(
cursor
.
getColumnIndex
(
"serviceName"
)));
model
.
setService
Language
(
cursor
.
getString
(
cursor
.
getColumnIndex
(
"serviceLanguage"
)));
model
.
setService
WorkbenchLang
(
cursor
.
getString
(
cursor
.
getColumnIndex
(
"serviceLanguage"
)));
model
.
setNewBossSwitch
(
cursor
.
getInt
(
cursor
.
getColumnIndex
(
"newBossSwitch"
)));
model
.
setNewBossSwitch
(
cursor
.
getInt
(
cursor
.
getColumnIndex
(
"newBossSwitch"
)));
model
.
setRegion
(
cursor
.
getInt
(
cursor
.
getColumnIndex
(
"region"
)));
model
.
setRegion
(
cursor
.
getInt
(
cursor
.
getColumnIndex
(
"region"
)));
model
.
setTimezone
(
cursor
.
getString
(
cursor
.
getColumnIndex
(
"timezone"
)));
model
.
setTimezone
(
cursor
.
getString
(
cursor
.
getColumnIndex
(
"timezone"
)));
...
@@ -137,7 +137,7 @@ public class ServiceInfoManager extends SobotCommonDao<SobotServiceInfoModel> {
...
@@ -137,7 +137,7 @@ public class ServiceInfoManager extends SobotCommonDao<SobotServiceInfoModel> {
contentValues
.
put
(
"serviceId"
,
infoModel
.
getServiceId
());
contentValues
.
put
(
"serviceId"
,
infoModel
.
getServiceId
());
contentValues
.
put
(
"serviceNo"
,
infoModel
.
getServiceNo
());
contentValues
.
put
(
"serviceNo"
,
infoModel
.
getServiceNo
());
contentValues
.
put
(
"serviceName"
,
infoModel
.
getServiceName
());
contentValues
.
put
(
"serviceName"
,
infoModel
.
getServiceName
());
contentValues
.
put
(
"serviceLanguage"
,
infoModel
.
getService
Language
());
contentValues
.
put
(
"serviceLanguage"
,
infoModel
.
getService
WorkbenchLang
());
contentValues
.
put
(
"newBossSwitch"
,
infoModel
.
getNewBossSwitch
());
contentValues
.
put
(
"newBossSwitch"
,
infoModel
.
getNewBossSwitch
());
contentValues
.
put
(
"region"
,
infoModel
.
getRegion
());
contentValues
.
put
(
"region"
,
infoModel
.
getRegion
());
contentValues
.
put
(
"timezone"
,
infoModel
.
getTimezone
());
contentValues
.
put
(
"timezone"
,
infoModel
.
getTimezone
());
...
...
sobot_common/src/main/java/com/sobot/common/login/model/SobotServiceInfoModel.java
View file @
c87db149
...
@@ -5,7 +5,6 @@ import com.sobot.gson.annotations.SerializedName;
...
@@ -5,7 +5,6 @@ import com.sobot.gson.annotations.SerializedName;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* 登录后的客服信息
* 登录后的客服信息
...
@@ -42,7 +41,6 @@ public class SobotServiceInfoModel implements Serializable {
...
@@ -42,7 +41,6 @@ public class SobotServiceInfoModel implements Serializable {
*/
*/
private
List
<
ServiceFunctionVoModel
>
functionStr
;
private
List
<
ServiceFunctionVoModel
>
functionStr
;
private
String
serviceLanguage
;
//区域环境(0国内 1国外)
//区域环境(0国内 1国外)
private
int
region
;
private
int
region
;
...
@@ -397,13 +395,6 @@ public class SobotServiceInfoModel implements Serializable {
...
@@ -397,13 +395,6 @@ public class SobotServiceInfoModel implements Serializable {
this
.
newBossSwitch
=
newBossSwitch
;
this
.
newBossSwitch
=
newBossSwitch
;
}
}
public
String
getServiceLanguage
()
{
return
serviceLanguage
;
}
public
void
setServiceLanguage
(
String
serviceLanguage
)
{
this
.
serviceLanguage
=
serviceLanguage
;
}
public
int
getRegion
()
{
public
int
getRegion
()
{
return
region
;
return
region
;
...
...
sobot_common/src/main/java/com/sobot/common/login/permission/SobotPermissionManager.java
View file @
c87db149
...
@@ -212,6 +212,8 @@ public class SobotPermissionManager {
...
@@ -212,6 +212,8 @@ public class SobotPermissionManager {
public
static
final
String
CCCV6_WHRW_RWXXBJ
=
"cccv6-whrw-rwxxbj"
;
public
static
final
String
CCCV6_WHRW_RWXXBJ
=
"cccv6-whrw-rwxxbj"
;
// 任务总结-编辑
// 任务总结-编辑
public
static
final
String
CCCV6_WHRW_RWZJBJ
=
"cccv6-whrw-rwzjbj"
;
public
static
final
String
CCCV6_WHRW_RWZJBJ
=
"cccv6-whrw-rwzjbj"
;
// 拨号盘-权限
public
static
final
String
CCCV6_DHT_BHP
=
"app-cccv6-dht-bhp"
;
//-----------------------------------电销权限----------------------------------------
//-----------------------------------电销权限----------------------------------------
//电销
//电销
...
...
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