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
d8142a78
Commit
d8142a78
authored
Apr 17, 2024
by
zhengnw@sobot.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录权限修改 从表里取值
parent
d9013215
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
487 additions
and
34 deletions
+487
-34
build.gradle
app/build.gradle
+1
-1
build.gradle
sobot_album/build.gradle
+1
-1
build.gradle
sobot_common/build.gradle
+4
-4
sobot-common-publish-mavencentral.gradle
sobot_common/sobot-common-publish-mavencentral.gradle
+1
-1
SobotCommonHttpUtils.java
...ain/java/com/sobot/common/login/SobotCommonHttpUtils.java
+453
-0
SobotLoginTools.java
...src/main/java/com/sobot/common/login/SobotLoginTools.java
+3
-4
ServiceInfoManager.java
...in/java/com/sobot/common/login/db/ServiceInfoManager.java
+2
-3
SobotCommonDBHelper.java
...n/java/com/sobot/common/login/db/SobotCommonDBHelper.java
+1
-1
SobotServiceInfoModel.java
...a/com/sobot/common/login/model/SobotServiceInfoModel.java
+13
-13
SobotPermissionManager.java
...sobot/common/login/permission/SobotPermissionManager.java
+8
-6
No files found.
app/build.gradle
View file @
d8142a78
...
...
@@ -41,7 +41,7 @@ dependencies {
// api 'com.sobot.library:sobotcommon_x:1.0'
implementation
'com.github.bumptech.glide:glide:4.9.0'
implementation
'com.sobot.chat:sobotsupport-glidev4:
3.1
'
implementation
'com.sobot.chat:sobotsupport-glidev4:
2.3
'
// implementation 'com.facebook.fresco:fresco:1.13.0'
//android x 可以用这个 ,普通版不能用这个
// implementation 'com.facebook.fresco:fresco:2.6.0'
...
...
sobot_album/build.gradle
View file @
d8142a78
...
...
@@ -23,7 +23,7 @@ dependencies {
compileOnly
'androidx.appcompat:appcompat:1.0.0'
compileOnly
'androidx.recyclerview:recyclerview:1.0.0'
api
'com.sobot.library:widget_x:1.2.1'
api
'com.sobot.library:picture_x:1.
1.9
'
api
'com.sobot.library:picture_x:1.
2.0
'
}
...
...
sobot_common/build.gradle
View file @
d8142a78
...
...
@@ -11,7 +11,7 @@ android {
//这里就是打jar包
task
makeJar
(
type:
Copy
)
{
//删除旧的jar包
delete
'build/libs/sobot_common_x_1.
6.8
.jar'
delete
'build/libs/sobot_common_x_1.
7.0
.jar'
//原地址
from
(
'build/intermediates/packaged-classes/release/'
)
//导出jar包的地址
...
...
@@ -19,7 +19,7 @@ android {
//包含的jar包
include
(
'classes.jar'
)
//重命名jar包为mysdk
rename
(
'classes.jar'
,
'sobot_common_x_1.
6.8
.jar'
)
rename
(
'classes.jar'
,
'sobot_common_x_1.
7.0
.jar'
)
}
makeJar
.
dependsOn
(
build
)
}
...
...
@@ -34,8 +34,8 @@ dependencies {
api
'com.sobot.library:utils:1.1.3'
api
'com.sobot.library:picture_x:1.
1.9
'
api
'com.sobot.library:net:1.2.
2
'
api
'com.sobot.library:picture_x:1.
2.0
'
api
'com.sobot.library:net:1.2.
5
'
api
'com.sobot.library:gson:1.1.1'
}
...
...
sobot_common/sobot-common-publish-mavencentral.gradle
View file @
d8142a78
...
...
@@ -12,7 +12,7 @@ task androidSourcesJar(type: Jar) {
ext
{
PUBLISH_GROUP_ID
=
"com.sobot.library"
//项目包名
PUBLISH_ARTIFACT_ID
=
'sobotcommon_x'
//项目名
PUBLISH_VERSION
=
'1.
6.8
'
//版本号
PUBLISH_VERSION
=
'1.
7.0
'
//版本号
}
...
...
sobot_common/src/main/java/com/sobot/common/login/SobotCommonHttpUtils.java
0 → 100644
View file @
d8142a78
package
com
.
sobot
.
common
.
login
;
import
android.content.Context
;
import
android.text.TextUtils
;
import
com.sobot.network.http.SobotOkHttpUtils
;
import
com.sobot.network.http.builder.PostFormBuilder
;
import
com.sobot.network.http.builder.PostMultipartFormBuilder
;
import
com.sobot.network.http.callback.StringCallback
;
import
com.sobot.network.http.download.SobotDownload
;
import
com.sobot.network.http.download.SobotDownloadTask
;
import
com.sobot.network.http.log.SobotNetLogUtils
;
import
com.sobot.network.http.request.RequestCall
;
import
com.sobot.network.http.upload.SobotUpload
;
import
com.sobot.network.http.upload.SobotUploadTask
;
import
com.sobot.utils.SobotStringUtils
;
import
org.json.JSONObject
;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.Map
;
import
java.util.Random
;
import
okhttp3.Call
;
import
okhttp3.MediaType
;
import
okhttp3.Response
;
public
class
SobotCommonHttpUtils
{
private
static
SobotCommonHttpUtils
client
=
null
;
private
String
sobot_from
=
"2"
;
//android
private
SobotCommonHttpUtils
()
{
}
public
static
SobotCommonHttpUtils
getInstance
()
{
if
(
client
==
null
)
{
client
=
new
SobotCommonHttpUtils
();
}
return
client
;
}
private
static
String
getTokenId
(
Context
context
)
{
String
token
=
SobotLoginTools
.
getInstance
().
getToken
();
return
token
;
}
private
static
String
getLanguage
(
Context
context
)
{
String
languageStr
=
""
;
if
(
SobotLoginTools
.
getInstance
().
getServiceInfo
()
!=
null
)
{
languageStr
=
SobotStringUtils
.
checkStringIsNull
(
SobotLoginTools
.
getInstance
().
getServiceInfo
().
getServiceLanguage
());
}
return
languageStr
;
}
public
void
doPost
(
Object
cancelTag
,
Context
context
,
final
String
url_str
,
final
Map
<
String
,
Object
>
map
,
String
version
,
final
StringCallBack
callback
)
{
SobotNetLogUtils
.
i
(
"请求URL: --> "
+
url_str
);
SobotNetLogUtils
.
i
(
"请求参数: --> "
+
map
);
SobotNetLogUtils
.
i
(
"请求token: --> "
+
getTokenId
(
context
));
SobotNetLogUtils
.
i
(
"请求language: --> "
+
getLanguage
(
context
));
SobotOkHttpUtils
.
post
()
.
tag
(
cancelTag
)
.
url
(
url_str
)
.
params
(
map
)
.
addHeader
(
SobotCommonConstant
.
SOBOT_TOKEN
,
getTokenId
(
context
))
.
addHeader
(
SobotCommonConstant
.
KEY_TEMP_ID
,
getTokenId
(
context
))
.
addHeader
(
"language"
,
getLanguage
(
context
))
.
addHeader
(
"from"
,
sobot_from
)
.
addHeader
(
"version"
,
version
)
.
build
()
.
readTimeOut
(
8
*
1000
)
.
writeTimeOut
(
8
*
1000
)
.
connTimeOut
(
8
*
1000
).
execute
(
new
StringCallback
()
{
@Override
public
void
onResponse
(
String
response
)
{
SobotNetLogUtils
.
i
(
url_str
+
"----请求返回结果: --> "
+
response
);
callback
.
onResponse
(
response
);
}
@Override
public
void
onError
(
Call
call
,
Exception
e
)
{
SobotNetLogUtils
.
i
(
call
.
toString
());
e
.
printStackTrace
();
callback
.
onError
(
e
,
call
.
toString
(),
-
1
);
}
});
}
public
void
doPostByJson
(
Object
cancelTag
,
Context
context
,
final
String
url_str
,
final
Map
<
String
,
Object
>
map
,
String
version
,
final
StringCallBack
callback
)
{
SobotNetLogUtils
.
i
(
"请求URL: --> "
+
url_str
);
SobotNetLogUtils
.
i
(
"请求参数: --> "
+
map
);
SobotNetLogUtils
.
i
(
"请求token: --> "
+
getTokenId
(
context
));
SobotNetLogUtils
.
i
(
"请求language: --> "
+
getLanguage
(
context
));
SobotOkHttpUtils
.
postString
()
.
tag
(
cancelTag
)
.
url
(
url_str
)
.
addHeader
(
SobotCommonConstant
.
SOBOT_TOKEN
,
getTokenId
(
context
))
.
addHeader
(
SobotCommonConstant
.
KEY_TEMP_ID
,
getTokenId
(
context
))
.
mediaType
(
MediaType
.
get
(
"application/json"
))
.
content
(
map2Json
(
map
))
.
addHeader
(
"language"
,
getLanguage
(
context
))
.
addHeader
(
"from"
,
sobot_from
)
.
addHeader
(
"version"
,
version
)
.
build
()
.
readTimeOut
(
8
*
1000
)
.
writeTimeOut
(
8
*
1000
)
.
connTimeOut
(
8
*
1000
).
execute
(
new
StringCallback
()
{
@Override
public
void
onResponse
(
String
response
)
{
SobotNetLogUtils
.
i
(
url_str
+
"----请求返回结果: --> "
+
response
);
callback
.
onResponse
(
response
);
}
@Override
public
void
onError
(
Call
call
,
Exception
e
)
{
SobotNetLogUtils
.
i
(
call
.
toString
());
e
.
printStackTrace
();
callback
.
onError
(
e
,
call
.
toString
(),
-
1
);
}
});
}
public
void
doPostWithFile
(
Object
cancelTag
,
Context
context
,
final
String
url_str
,
final
Map
<
String
,
Object
>
map
,
String
path
,
String
version
,
final
StringCallBack
callback
)
{
SobotNetLogUtils
.
i
(
"请求URL: --> "
+
url_str
);
SobotNetLogUtils
.
i
(
"请求参数: --> "
+
map
);
SobotNetLogUtils
.
i
(
"请求token: --> "
+
getTokenId
(
context
));
SobotNetLogUtils
.
i
(
"请求language: --> "
+
getLanguage
(
context
));
PostMultipartFormBuilder
post
=
SobotOkHttpUtils
.
postMultipart
();
if
(!
TextUtils
.
isEmpty
(
path
))
{
File
file
=
new
File
(
path
);
if
(
file
.
exists
()
&&
file
.
isFile
())
{
post
.
addFile
(
"file"
,
file
.
getName
(),
file
);
}
}
post
.
tag
(
cancelTag
)
.
url
(
url_str
)
.
params
(
map
)
.
addHeader
(
SobotCommonConstant
.
SOBOT_TOKEN
,
getTokenId
(
context
))
.
addHeader
(
"language"
,
getLanguage
(
context
))
.
addHeader
(
"from"
,
sobot_from
)
.
addHeader
(
"version"
,
version
)
.
build
()
.
readTimeOut
(
8
*
1000
)
.
writeTimeOut
(
8
*
1000
)
.
connTimeOut
(
8
*
1000
).
execute
(
new
StringCallback
()
{
@Override
public
void
onResponse
(
String
response
)
{
SobotNetLogUtils
.
i
(
url_str
+
"----请求返回结果: --> "
+
response
);
callback
.
onResponse
(
response
);
}
@Override
public
void
onError
(
Call
call
,
Exception
e
)
{
SobotNetLogUtils
.
i
(
call
.
toString
());
e
.
printStackTrace
();
callback
.
onError
(
e
,
call
.
toString
(),
-
1
);
}
@Override
public
void
inProgress
(
float
progress
)
{
super
.
inProgress
(
progress
);
callback
.
inProgress
((
int
)
(
progress
*
100
));
}
});
}
public
void
doGet
(
Object
cancelTag
,
Context
context
,
final
String
url_str
,
final
Map
<
String
,
Object
>
map
,
String
version
,
final
StringCallBack
callback
)
{
SobotNetLogUtils
.
i
(
"请求URL: --> "
+
url_str
);
SobotNetLogUtils
.
i
(
"请求参数: --> "
+
map
);
SobotNetLogUtils
.
i
(
"请求token: --> "
+
getTokenId
(
context
));
SobotNetLogUtils
.
i
(
"请求language: --> "
+
getLanguage
(
context
));
SobotOkHttpUtils
.
get
()
.
tag
(
cancelTag
)
.
url
(
url_str
)
.
params
(
map
)
.
addHeader
(
SobotCommonConstant
.
SOBOT_TOKEN
,
getTokenId
(
context
))
.
addHeader
(
SobotCommonConstant
.
KEY_TEMP_ID
,
getTokenId
(
context
))
.
addHeader
(
"language"
,
getLanguage
(
context
))
.
addHeader
(
"from"
,
sobot_from
)
.
addHeader
(
"version"
,
version
)
.
build
()
.
readTimeOut
(
20
*
1000
)
.
writeTimeOut
(
20
*
1000
)
.
connTimeOut
(
20
*
1000
).
execute
(
new
StringCallback
()
{
@Override
public
void
onResponse
(
String
response
)
{
SobotNetLogUtils
.
i
(
url_str
+
"----请求返回结果: --> "
+
response
);
callback
.
onResponse
(
response
);
}
@Override
public
void
onError
(
Call
call
,
Exception
e
)
{
SobotNetLogUtils
.
i
(
call
.
toString
());
e
.
printStackTrace
();
callback
.
onError
(
e
,
call
.
toString
(),
-
1
);
}
});
}
public
void
doGetWithNoHeader
(
Object
cancelTag
,
final
String
url_str
,
final
Map
<
String
,
Object
>
map
,
String
version
,
final
StringCallBack
callback
)
{
SobotNetLogUtils
.
i
(
"请求URL: --> "
+
url_str
);
SobotNetLogUtils
.
i
(
"请求参数: --> "
+
map
);
SobotOkHttpUtils
.
get
()
.
tag
(
cancelTag
)
.
url
(
url_str
)
.
params
(
map
)
.
addHeader
(
"from"
,
sobot_from
)
.
addHeader
(
"version"
,
version
)
.
build
()
.
readTimeOut
(
8
*
1000
)
.
writeTimeOut
(
8
*
1000
)
.
connTimeOut
(
8
*
1000
).
execute
(
new
StringCallback
()
{
@Override
public
void
onResponse
(
String
response
)
{
SobotNetLogUtils
.
i
(
url_str
+
"----请求返回结果: --> "
+
response
);
callback
.
onResponse
(
response
);
}
@Override
public
void
onError
(
Call
call
,
Exception
e
)
{
SobotNetLogUtils
.
i
(
call
.
toString
());
e
.
printStackTrace
();
callback
.
onError
(
e
,
call
.
toString
(),
-
1
);
}
});
}
private
void
printLog
(
String
url_str
,
Map
<
String
,
String
>
map
)
{
try
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
"sobot---请求参数: url = "
+
url_str
+
" "
);
for
(
String
key
:
map
.
keySet
())
{
sb
.
append
(
key
+
"="
+
map
.
get
(
key
)
+
", "
);
}
SobotNetLogUtils
.
i
(
sb
.
toString
().
substring
(
0
,
sb
.
toString
().
length
()
-
2
));
}
catch
(
Exception
e
)
{
//ignor
}
}
public
void
download
(
String
url_str
,
File
file
,
Map
<
String
,
String
>
map
,
String
version
,
final
FileCallBack
callback
)
{
SobotNetLogUtils
.
i
(
"下载地址:"
+
url_str
);
SobotOkHttpUtils
.
get
()
.
url
(
url_str
)
.
addHeader
(
"from"
,
sobot_from
)
.
addHeader
(
"version"
,
version
)
.
build
()
.
connTimeOut
(
1000
*
30
)
.
readTimeOut
(
1000
*
30
)
.
writeTimeOut
(
1000
*
30
)
.
execute
(
new
com
.
sobot
.
network
.
http
.
callback
.
FileCallBack
(
file
.
getAbsolutePath
())
{
@Override
public
void
onError
(
Call
call
,
Exception
e
)
{
callback
.
onError
(
e
,
call
.
toString
(),
-
1
);
}
@Override
public
void
onResponse
(
File
file
)
{
callback
.
onResponse
(
file
);
}
@Override
public
void
inProgress
(
float
progress
,
long
total
)
{
callback
.
inProgress
((
int
)
(
progress
*
100
));
}
});
}
public
void
uploadFile
(
Object
cancelTag
,
Context
context
,
String
url_str
,
Map
<
String
,
Object
>
map
,
String
version
,
String
path
,
final
StringCallBack
callback
)
{
SobotNetLogUtils
.
i
(
"请求URL: --> "
+
url_str
);
SobotNetLogUtils
.
i
(
"请求参数: --> "
+
map
);
PostFormBuilder
post
=
SobotOkHttpUtils
.
post
();
if
(!
TextUtils
.
isEmpty
(
path
))
{
File
file
=
new
File
(
path
);
if
(
file
.
exists
()
&&
file
.
isFile
())
{
post
.
addFile
(
"file"
,
file
.
getName
(),
file
);
}
file
=
null
;
}
post
.
url
(
url_str
)
//
.
params
(
map
)
.
tag
(
cancelTag
)
.
addHeader
(
SobotCommonConstant
.
SOBOT_TOKEN
,
getTokenId
(
context
))
.
addHeader
(
SobotCommonConstant
.
KEY_TEMP_ID
,
getTokenId
(
context
))
.
addHeader
(
"language"
,
getLanguage
(
context
))
.
addHeader
(
"from"
,
sobot_from
)
.
addHeader
(
"version"
,
version
)
.
build
()
.
connTimeOut
(
1000
*
30
)
.
readTimeOut
(
1000
*
30
)
.
writeTimeOut
(
1000
*
30
)
.
execute
(
new
StringCallback
()
{
@Override
public
void
onResponse
(
String
response
)
{
callback
.
onResponse
(
response
);
}
@Override
public
void
onError
(
Call
call
,
Exception
e
)
{
callback
.
onError
(
e
,
call
.
toString
(),
-
1
);
}
@Override
public
void
inProgress
(
float
progress
)
{
super
.
inProgress
(
progress
);
callback
.
inProgress
((
int
)
(
progress
*
100
));
}
});
}
/**
* 添加上传文件任务
*
* @param msgTag 上传文件的识别码 这里相当于msgId
* @param url_str 上传文件的地址
* @param map 参数
* @param path 文件本地地址
* @param imageFile 视频文件的快照本地地址
* @return
*/
public
SobotUploadTask
addUploadFileTask
(
String
msgTag
,
String
url_str
,
Map
<
String
,
Object
>
map
,
String
version
,
String
path
,
String
imageFile
)
{
SobotNetLogUtils
.
i
(
"上传文件 请求URL: --> "
+
url_str
);
SobotNetLogUtils
.
i
(
"上传文件 请求参数: --> "
+
map
);
PostFormBuilder
post
=
SobotOkHttpUtils
.
post
();
if
(!
TextUtils
.
isEmpty
(
path
))
{
File
file
=
new
File
(
path
);
post
.
addFile
(
"file"
,
file
.
getName
(),
file
);
}
if
(!
TextUtils
.
isEmpty
(
imageFile
))
{
File
file2
=
new
File
(
imageFile
);
post
.
addFile
(
"imageFile"
,
file2
.
getName
(),
file2
);
}
RequestCall
requestCall
=
post
.
url
(
url_str
)
//
.
params
(
map
)
.
addHeader
(
"from"
,
sobot_from
)
.
addHeader
(
"version"
,
version
)
.
build
()
.
connTimeOut
(
1000
*
30
)
.
readTimeOut
(
1000
*
30
)
.
writeTimeOut
(
1000
*
30
);
Random
random
=
new
Random
();
// msgid
return
SobotUpload
.
request
(
msgTag
,
requestCall
)
.
priority
(
random
.
nextInt
(
100
))
.
tmpTag
(
msgTag
)
.
filePath
(
path
).
start
();
}
/**
* 添加下载文件任务
*
* @param msgTag 上传文件的识别码 这里相当于msgId
* @param url_str 文件的下载地址
* @param map 参数
* @return
*/
public
SobotDownloadTask
addDownloadFileTask
(
String
msgTag
,
String
url_str
,
String
fileName
,
Map
<
String
,
Object
>
map
,
String
version
)
{
if
(
TextUtils
.
isEmpty
(
msgTag
)
||
TextUtils
.
isEmpty
(
url_str
))
{
return
null
;
}
Random
random
=
new
Random
();
// msgid
return
SobotDownload
.
request
(
msgTag
,
obtainGetRequest
(
url_str
,
map
,
version
))
.
priority
(
random
.
nextInt
(
100
))
.
fileName
(
fileName
)
.
save
();
}
public
RequestCall
obtainGetRequest
(
String
url_str
,
Map
<
String
,
Object
>
map
,
String
version
)
{
return
SobotOkHttpUtils
.
get
().
url
(
url_str
)
.
params
(
map
)
.
addHeader
(
"from"
,
sobot_from
)
.
addHeader
(
"version"
,
version
)
.
build
()
.
connTimeOut
(
1000
*
30
)
.
readTimeOut
(
1000
*
30
)
.
writeTimeOut
(
1000
*
30
);
}
//同步
public
Response
doPostSync
(
Object
cancelTag
,
String
url_str
,
Map
<
String
,
Object
>
map
,
String
version
)
throws
IOException
{
return
SobotOkHttpUtils
.
post
()
.
tag
(
cancelTag
)
.
url
(
url_str
)
.
params
(
map
)
.
addHeader
(
"from"
,
sobot_from
)
.
addHeader
(
"version"
,
version
)
.
build
()
.
readTimeOut
(
8
*
1000
)
.
writeTimeOut
(
8
*
1000
)
.
connTimeOut
(
8
*
1000
).
execute
();
}
public
interface
StringCallBack
{
void
onResponse
(
String
result
);
void
onError
(
Exception
e
,
String
msg
,
int
responseCode
);
void
inProgress
(
int
progress
);
}
public
interface
FileCallBack
{
void
onResponse
(
File
result
);
void
onError
(
Exception
e
,
String
msg
,
int
responseCode
);
void
inProgress
(
int
progress
);
}
public
static
String
map2Json
(
Map
<
String
,
Object
>
map
)
{
if
(
map
!=
null
&&
map
.
size
()
>
0
)
{
JSONObject
a
=
new
JSONObject
(
map
);
return
a
.
toString
();
}
return
""
;
}
}
sobot_common/src/main/java/com/sobot/common/login/SobotLoginTools.java
View file @
d8142a78
...
...
@@ -62,8 +62,8 @@ public class SobotLoginTools {
//获取权限列表
public
List
<
ServiceFunctionVoModel
>
getServiceFunctionVoModel
()
{
if
(
functionVoModelList
==
null
&&
ServiceInfoManager
.
getInstance
().
getInfo
()
!=
null
)
{
functionVoModelList
=
ServiceInfoManager
.
getInstance
().
getInfo
().
getFunctionStr
();
if
(
functionVoModelList
==
null
&&
FunctionManager
.
getInstance
().
getFunctionVos
()
!=
null
)
{
functionVoModelList
=
FunctionManager
.
getInstance
().
getFunctionVos
();
}
if
(
functionVoModelList
==
null
)
{
functionVoModelList
=
new
ArrayList
<>();
...
...
@@ -726,7 +726,6 @@ public class SobotLoginTools {
}
}
}
serviceInfoModel
.
setFunctionStr
(
functions
);
//权限保存入库
FunctionManager
.
getInstance
().
setFunctionVos
(
functions
);
//先保存一次
...
...
@@ -839,7 +838,7 @@ public class SobotLoginTools {
if
(
infoModel
!=
null
)
{
Map
<
String
,
String
>
headers
=
new
HashMap
<>();
headers
.
put
(
"token"
,
SobotStringUtils
.
checkStringIsNull
(
infoModel
.
getToken
()));
headers
.
put
(
"language"
,
SobotStringUtils
.
checkStringIsNull
(
infoModel
.
getLanguage
()));
headers
.
put
(
"language"
,
SobotStringUtils
.
checkStringIsNull
(
infoModel
.
get
Service
Language
()));
SobotHttpUtils
.
doPost
(
cancelTag
,
host
+
"/chat-sdk/sdk/admin/v1/appLogin"
,
8000
,
params
,
headers
,
new
HttpBaseUtils
.
StringCallBack
()
{
@Override
public
void
onResponse
(
String
result
)
{
...
...
sobot_common/src/main/java/com/sobot/common/login/db/ServiceInfoManager.java
View file @
d8142a78
...
...
@@ -78,15 +78,14 @@ public class ServiceInfoManager extends SobotCommonDao<SobotServiceInfoModel> {
model
.
setRobotVersion
(
cursor
.
getInt
(
cursor
.
getColumnIndex
(
"robotVersion"
))
+
""
);
model
.
setOnlineVersion
(
cursor
.
getInt
(
cursor
.
getColumnIndex
(
"onlineVersion"
))
+
""
);
model
.
setCompanyId
(
cursor
.
getString
(
cursor
.
getColumnIndex
(
"companyId"
)));
model
.
setLanguage
(
cursor
.
getString
(
cursor
.
getColumnIndex
(
"local_language"
)));
model
.
setAccess_token
(
cursor
.
getString
(
cursor
.
getColumnIndex
(
SobotServiceInfoModel
.
ACCESS_TOKEN
)));
model
.
setLogin_time
(
cursor
.
getLong
(
cursor
.
getColumnIndex
(
SobotServiceInfoModel
.
LOGIN_TIME
)));
model
.
setLoginAccount
(
cursor
.
getString
(
cursor
.
getColumnIndex
(
"login_account"
)));
model
.
setLoginPwd
(
cursor
.
getString
(
cursor
.
getColumnIndex
(
"login_pwd"
)));
model
.
setWslinkDefault
(
cursor
.
getString
(
cursor
.
getColumnIndex
(
"wslinkDefault"
)));
model
.
setServiceId
(
cursor
.
getString
(
cursor
.
getColumnIndex
(
"serviceId"
)));
model
.
setServiceNo
(
cursor
.
getString
(
cursor
.
getColumnIndex
(
"serviceNo"
)));
model
.
setServiceName
(
cursor
.
getString
(
cursor
.
getColumnIndex
(
"serviceName"
)));
model
.
setServiceLanguage
(
cursor
.
getString
(
cursor
.
getColumnIndex
(
"serviceLanguage"
)));
model
.
setNewBossSwitch
(
cursor
.
getInt
(
cursor
.
getColumnIndex
(
"newBossSwitch"
)));
...
...
@@ -137,7 +136,6 @@ public class ServiceInfoManager extends SobotCommonDao<SobotServiceInfoModel> {
contentValues
.
put
(
"robotVersion"
,
infoModel
.
getRobotVersion
());
contentValues
.
put
(
"onlineVersion"
,
infoModel
.
getOnlineVersion
());
contentValues
.
put
(
"companyId"
,
infoModel
.
getCompanyId
());
contentValues
.
put
(
"local_language"
,
infoModel
.
getLanguage
());
contentValues
.
put
(
SobotServiceInfoModel
.
ACCESS_TOKEN
,
infoModel
.
getAccess_token
());
contentValues
.
put
(
SobotServiceInfoModel
.
LOGIN_TIME
,
infoModel
.
getLogin_time
());
contentValues
.
put
(
"login_account"
,
infoModel
.
getLoginAccount
());
...
...
@@ -145,6 +143,7 @@ public class ServiceInfoManager extends SobotCommonDao<SobotServiceInfoModel> {
contentValues
.
put
(
"wslinkDefault"
,
infoModel
.
getWslinkDefault
());
contentValues
.
put
(
"serviceId"
,
infoModel
.
getServiceId
());
contentValues
.
put
(
"serviceNo"
,
infoModel
.
getServiceNo
());
contentValues
.
put
(
"serviceName"
,
infoModel
.
getServiceName
());
contentValues
.
put
(
"serviceLanguage"
,
infoModel
.
getServiceLanguage
());
contentValues
.
put
(
"newBossSwitch"
,
infoModel
.
getNewBossSwitch
());
...
...
sobot_common/src/main/java/com/sobot/common/login/db/SobotCommonDBHelper.java
View file @
d8142a78
...
...
@@ -190,8 +190,8 @@ class SobotCommonDBHelper extends SQLiteOpenHelper {
"kbVersion INTEGER , "
+
"robotVersion INTEGER , "
+
"onlineVersion INTEGER , "
+
"local_language VARCHAR(10) , "
+
"serviceId VARCHAR(40),"
+
"serviceNo VARCHAR(60),"
+
"serviceName VARCHAR(600),"
+
"newBossSwitch INTEGER,"
+
"region INTEGER,"
+
...
...
sobot_common/src/main/java/com/sobot/common/login/model/SobotServiceInfoModel.java
View file @
d8142a78
...
...
@@ -17,6 +17,11 @@ public class SobotServiceInfoModel implements Serializable {
*/
private
String
serviceId
;
/**
* 客服工号
*/
private
String
serviceNo
;
/**
* 客服名字
*/
private
String
serviceName
;
...
...
@@ -52,11 +57,6 @@ public class SobotServiceInfoModel implements Serializable {
private
int
callV6Flag
;
/**
* 语言
*/
private
String
language
;
/**
* 时区
*/
private
String
timezone
;
...
...
@@ -380,6 +380,14 @@ public class SobotServiceInfoModel implements Serializable {
this
.
serviceId
=
serviceId
;
}
public
String
getServiceNo
()
{
return
serviceNo
;
}
public
void
setServiceNo
(
String
serviceNo
)
{
this
.
serviceNo
=
serviceNo
;
}
public
List
<
ServiceFunctionVoModel
>
getFunctionStr
()
{
return
functionStr
;
}
...
...
@@ -420,14 +428,6 @@ public class SobotServiceInfoModel implements Serializable {
this
.
region
=
region
;
}
public
String
getLanguage
()
{
return
language
;
}
public
void
setLanguage
(
String
language
)
{
this
.
language
=
language
;
}
public
String
getTimezone
()
{
return
timezone
;
}
...
...
sobot_common/src/main/java/com/sobot/common/login/permission/SobotPermissionManager.java
View file @
d8142a78
...
...
@@ -339,9 +339,10 @@ public class SobotPermissionManager {
SobotServiceInfoModel
serviceInfoModel
=
SobotLoginTools
.
getInstance
().
getServiceInfo
();
if
(
serviceInfoModel
!=
null
)
{
if
(
serviceInfoModel
.
getNewBossSwitch
()
>
0
)
{
if
(!
TextUtils
.
isEmpty
(
type
)
&&
serviceInfoModel
!=
null
&&
serviceInfoModel
.
getFunctionStr
()
!=
null
)
{
for
(
int
i
=
0
;
i
<
serviceInfoModel
.
getFunctionStr
().
size
();
i
++)
{
ServiceFunctionVoModel
cusFunctionVoModel
=
serviceInfoModel
.
getFunctionStr
().
get
(
i
);
List
<
ServiceFunctionVoModel
>
functionVoModelList
=
FunctionManager
.
getInstance
().
getFunctionVos
();
if
(!
TextUtils
.
isEmpty
(
type
)
&&
functionVoModelList
!=
null
)
{
for
(
int
i
=
0
;
i
<
functionVoModelList
.
size
();
i
++)
{
ServiceFunctionVoModel
cusFunctionVoModel
=
functionVoModelList
.
get
(
i
);
if
(
getCodeByType
(
type
).
equals
(
cusFunctionVoModel
.
getCode
()))
{
return
true
;
}
...
...
@@ -367,9 +368,10 @@ public class SobotPermissionManager {
SobotServiceInfoModel
serviceInfoModel
=
SobotLoginTools
.
getInstance
().
getServiceInfo
();
if
(
serviceInfoModel
!=
null
)
{
if
(
serviceInfoModel
.
getNewBossSwitch
()
>
0
)
{
if
(!
TextUtils
.
isEmpty
(
type
)
&&
serviceInfoModel
!=
null
&&
serviceInfoModel
.
getFunctionStr
()
!=
null
)
{
for
(
int
i
=
0
;
i
<
serviceInfoModel
.
getFunctionStr
().
size
();
i
++)
{
ServiceFunctionVoModel
cusFunctionVoModel
=
serviceInfoModel
.
getFunctionStr
().
get
(
i
);
List
<
ServiceFunctionVoModel
>
functionVoModelList
=
FunctionManager
.
getInstance
().
getFunctionVos
();
if
(!
TextUtils
.
isEmpty
(
type
)
&&
functionVoModelList
!=
null
)
{
for
(
int
i
=
0
;
i
<
functionVoModelList
.
size
();
i
++)
{
ServiceFunctionVoModel
cusFunctionVoModel
=
functionVoModelList
.
get
(
i
);
if
(
type
.
equals
(
cusFunctionVoModel
.
getCode
()))
{
return
true
;
}
...
...
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