Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
android
/
dayu
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
cbed9b96
authored
Feb 05, 2018
by
罗翻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Api修改
parent
e0fe8b56
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
47 deletions
app/src/main/java/com/dayu/bigfish/api/Api.java
app/src/main/java/com/dayu/bigfish/api/ApiFactory.java
app/src/main/java/com/dayu/bigfish/api/Api.java
View file @
cbed9b96
...
@@ -35,15 +35,17 @@ public class Api {
...
@@ -35,15 +35,17 @@ public class Api {
private
static
Retrofit
downloadRetrofit
;
private
static
Retrofit
downloadRetrofit
;
/**
/**
*普通retrofit.
* 普通retrofit.
*
* @return
* @return
*/
*/
public
static
APIService
getService
(
)
{
public
static
<
T
>
T
getService
(
Class
<
T
>
cls
)
{
return
getRetrofit
().
create
(
APIService
.
clas
s
);
return
getRetrofit
().
create
(
cl
s
);
}
}
/**
/**
* 下载的retrofit.
* 下载的retrofit.
*
* @return
* @return
*/
*/
public
static
APIService
getDownloadService
()
{
public
static
APIService
getDownloadService
()
{
...
@@ -111,7 +113,6 @@ public class Api {
...
@@ -111,7 +113,6 @@ public class Api {
.
build
();
.
build
();
}
}
}
}
// Log.d("request_header", request.headers().toString());
return
chain
.
proceed
(
request
);
return
chain
.
proceed
(
request
);
}
}
}
}
...
...
app/src/main/java/com/dayu/bigfish/api/ApiFactory.java
View file @
cbed9b96
...
@@ -32,188 +32,188 @@ import okhttp3.RequestBody;
...
@@ -32,188 +32,188 @@ import okhttp3.RequestBody;
public
class
ApiFactory
{
public
class
ApiFactory
{
public
static
Observable
<
UserInfo
>
login
(
String
phone
,
String
smsCode
)
{
public
static
Observable
<
UserInfo
>
login
(
String
phone
,
String
smsCode
)
{
return
Api
.
getService
().
login
(
phone
,
smsCode
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
login
(
phone
,
smsCode
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
Boolean
>
sendCode
(
String
telephone
,
int
type
)
{
public
static
Observable
<
Boolean
>
sendCode
(
String
telephone
,
int
type
)
{
return
Api
.
getService
().
sendCode
(
telephone
,
type
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
sendCode
(
telephone
,
type
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
Boolean
>
modifyHead
(
int
accoutId
,
String
headURL
)
{
public
static
Observable
<
Boolean
>
modifyHead
(
int
accoutId
,
String
headURL
)
{
return
Api
.
getService
().
modifyHead
(
accoutId
,
headURL
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
modifyHead
(
accoutId
,
headURL
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
Boolean
>
commitVersionInfo
(
RequestBody
requestBody
)
{
public
static
Observable
<
Boolean
>
commitVersionInfo
(
RequestBody
requestBody
)
{
return
Api
.
getService
().
commitVersionInfo
(
requestBody
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
commitVersionInfo
(
requestBody
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
String
>
checkVersion
(
String
packageName
)
{
public
static
Observable
<
String
>
checkVersion
(
String
packageName
)
{
return
Api
.
getService
().
checkVersion
(
packageName
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
checkVersion
(
packageName
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
VersionInfo
>
getVersionInfo
(
String
appId
,
String
versionCode
)
{
public
static
Observable
<
VersionInfo
>
getVersionInfo
(
String
appId
,
String
versionCode
)
{
return
Api
.
getService
().
getVersionInfo
(
appId
,
versionCode
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
getVersionInfo
(
appId
,
versionCode
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
List
<
ErrorOrder
>>
getErrorOrders
(
int
userId
,
int
siteId
)
{
public
static
Observable
<
List
<
ErrorOrder
>>
getErrorOrders
(
int
userId
,
int
siteId
)
{
return
Api
.
getService
().
getErrorOrders
(
userId
,
siteId
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
getErrorOrders
(
userId
,
siteId
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
Boolean
>
receiveOrder
(
int
orderId
,
int
engineerId
)
{
public
static
Observable
<
Boolean
>
receiveOrder
(
int
orderId
,
int
engineerId
)
{
return
Api
.
getService
().
receiveOrder
(
orderId
,
engineerId
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
receiveOrder
(
orderId
,
engineerId
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
Boolean
>
subcriceTime
(
int
orderId
,
String
doorTime
,
String
doorComment
)
{
public
static
Observable
<
Boolean
>
subcriceTime
(
int
orderId
,
String
doorTime
,
String
doorComment
)
{
return
Api
.
getService
().
subcriceTime
(
orderId
,
doorTime
,
doorComment
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
subcriceTime
(
orderId
,
doorTime
,
doorComment
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
Integer
>
startOrder
(
RequestBody
body
)
{
public
static
Observable
<
Integer
>
startOrder
(
RequestBody
body
)
{
return
Api
.
getService
().
startOrder
(
body
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
startOrder
(
body
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
Integer
>
startServer
(
RequestBody
body
)
{
public
static
Observable
<
Integer
>
startServer
(
RequestBody
body
)
{
return
Api
.
getService
().
startServer
(
body
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
startServer
(
body
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
OrderDetail
>
getOrderInfo
(
int
orderId
)
{
public
static
Observable
<
OrderDetail
>
getOrderInfo
(
int
orderId
)
{
return
Api
.
getService
().
getOrderInfo
(
orderId
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
getOrderInfo
(
orderId
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
Integer
>
commitOrder
(
RequestBody
orderInfo
)
{
public
static
Observable
<
Integer
>
commitOrder
(
RequestBody
orderInfo
)
{
return
Api
.
getService
().
commitOrder
(
orderInfo
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
commitOrder
(
orderInfo
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
EngineerInfo
>
getEngineerInfo
(
int
accountId
)
{
public
static
Observable
<
EngineerInfo
>
getEngineerInfo
(
int
accountId
)
{
return
Api
.
getService
().
getEngineerInfo
(
accountId
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
getEngineerInfo
(
accountId
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
TodayBalance
>
getTodayBalance
(
int
accountId
)
{
public
static
Observable
<
TodayBalance
>
getTodayBalance
(
int
accountId
)
{
return
Api
.
getService
().
getTodayBalance
(
accountId
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
getTodayBalance
(
accountId
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
BasePageBean
<
AccountBalance
>>
getAccountBalanceList
(
int
page
,
int
pageSize
,
int
accountId
)
{
public
static
Observable
<
BasePageBean
<
AccountBalance
>>
getAccountBalanceList
(
int
page
,
int
pageSize
,
int
accountId
)
{
return
Api
.
getService
().
getAccountBalanceList
(
page
,
pageSize
,
accountId
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
getAccountBalanceList
(
page
,
pageSize
,
accountId
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
Boolean
>
boundAlipay
(
RequestBody
body
)
{
public
static
Observable
<
Boolean
>
boundAlipay
(
RequestBody
body
)
{
return
Api
.
getService
().
boundAlipay
(
body
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
boundAlipay
(
body
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
AlipayInfo
>
queryAlipay
(
int
accountId
)
{
public
static
Observable
<
AlipayInfo
>
queryAlipay
(
int
accountId
)
{
return
Api
.
getService
().
queryAlipay
(
accountId
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
queryAlipay
(
accountId
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
Boolean
>
modifyAlipay
(
RequestBody
body
)
{
public
static
Observable
<
Boolean
>
modifyAlipay
(
RequestBody
body
)
{
return
Api
.
getService
().
modifyAlipay
(
body
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
modifyAlipay
(
body
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
OrderDetail
>
queryOrderInfo
(
int
orderId
)
{
public
static
Observable
<
OrderDetail
>
queryOrderInfo
(
int
orderId
)
{
return
Api
.
getService
().
queryOrderInfo
(
orderId
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
queryOrderInfo
(
orderId
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
TodayAchievement
>
getAchievement
(
int
siteId
,
int
engineerId
)
{
public
static
Observable
<
TodayAchievement
>
getAchievement
(
int
siteId
,
int
engineerId
)
{
return
Api
.
getService
().
getAchievement
(
siteId
,
engineerId
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
getAchievement
(
siteId
,
engineerId
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
OrderRecord
>
getOrderScore
(
int
siteId
,
int
engineerId
)
{
public
static
Observable
<
OrderRecord
>
getOrderScore
(
int
siteId
,
int
engineerId
)
{
return
Api
.
getService
().
getOrderScore
(
siteId
,
engineerId
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
getOrderScore
(
siteId
,
engineerId
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
Boolean
>
postFeedBack
(
RequestBody
body
)
{
public
static
Observable
<
Boolean
>
postFeedBack
(
RequestBody
body
)
{
return
Api
.
getService
().
postFeedBack
(
body
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
postFeedBack
(
body
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
BasePageBean
<
Order
>>
getOrders
(
int
state
,
int
engineerId
,
int
siteId
,
int
page
,
int
pageSize
)
{
public
static
Observable
<
BasePageBean
<
Order
>>
getOrders
(
int
state
,
int
engineerId
,
int
siteId
,
int
page
,
int
pageSize
)
{
return
Api
.
getService
().
getOrders
(
state
,
engineerId
,
siteId
,
page
,
pageSize
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
getOrders
(
state
,
engineerId
,
siteId
,
page
,
pageSize
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
Tab
>
getTabNum
(
int
userId
,
int
siteId
)
{
public
static
Observable
<
Tab
>
getTabNum
(
int
userId
,
int
siteId
)
{
return
Api
.
getService
().
getTabNum
(
userId
,
siteId
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
getTabNum
(
userId
,
siteId
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
BasePageBean
<
NewMessage
>>
getHxMessage
(
String
hxAccount
,
int
category
,
int
page
,
int
pageSize
)
{
public
static
Observable
<
BasePageBean
<
NewMessage
>>
getHxMessage
(
String
hxAccount
,
int
category
,
int
page
,
int
pageSize
)
{
return
Api
.
getService
().
getHxMessage
(
hxAccount
,
category
,
page
,
pageSize
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
getHxMessage
(
hxAccount
,
category
,
page
,
pageSize
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
Integer
>
getHxNum
(
String
hxAccount
)
{
public
static
Observable
<
Integer
>
getHxNum
(
String
hxAccount
)
{
return
Api
.
getService
().
getHxNum
(
hxAccount
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
getHxNum
(
hxAccount
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
Boolean
>
readMessage
(
RequestBody
body
)
{
public
static
Observable
<
Boolean
>
readMessage
(
RequestBody
body
)
{
return
Api
.
getService
().
readMessage
(
body
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
readMessage
(
body
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
EngineerInfo
>
modifyUserInfo
(
RequestBody
body
)
{
public
static
Observable
<
EngineerInfo
>
modifyUserInfo
(
RequestBody
body
)
{
return
Api
.
getService
().
modifyUserInfo
(
body
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
modifyUserInfo
(
body
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
List
<
String
>>
uploadPhoto
(
MultipartBody
.
Part
[]
partMap
)
{
public
static
Observable
<
List
<
String
>>
uploadPhoto
(
MultipartBody
.
Part
[]
partMap
)
{
return
Api
.
getService
().
uploadPhoto
(
partMap
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
uploadPhoto
(
partMap
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
List
<
String
>>
uploadPhoto
(
MultipartBody
.
Part
part
)
{
public
static
Observable
<
List
<
String
>>
uploadPhoto
(
MultipartBody
.
Part
part
)
{
return
Api
.
getService
().
uploadPhoto
(
part
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
uploadPhoto
(
part
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
BasePageBean
<
ServerInstruction
>>
getInstruction
(
long
id
,
int
page
,
int
pageSize
)
{
public
static
Observable
<
BasePageBean
<
ServerInstruction
>>
getInstruction
(
long
id
,
int
page
,
int
pageSize
)
{
return
Api
.
getService
().
getInstruction
(
id
,
page
,
pageSize
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
getInstruction
(
id
,
page
,
pageSize
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
KaAddress
>
getKaAddress
(
int
companyId
)
{
public
static
Observable
<
KaAddress
>
getKaAddress
(
int
companyId
)
{
return
Api
.
getService
().
getKaAddress
(
companyId
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
getKaAddress
(
companyId
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
Boolean
>
applyPart
(
long
spOrderId
,
String
spComment
,
String
createBy
,
long
accountId
)
{
public
static
Observable
<
Boolean
>
applyPart
(
long
spOrderId
,
String
spComment
,
String
createBy
,
long
accountId
)
{
return
Api
.
getService
().
applyPart
(
spOrderId
,
spComment
,
createBy
,
accountId
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
applyPart
(
spOrderId
,
spComment
,
createBy
,
accountId
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
Boolean
>
cancleApply
(
int
partsId
,
String
modifyBy
)
{
public
static
Observable
<
Boolean
>
cancleApply
(
int
partsId
,
String
modifyBy
)
{
return
Api
.
getService
().
cancleApply
(
partsId
,
modifyBy
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
cancleApply
(
partsId
,
modifyBy
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
Boolean
>
returnPartSelf
(
RequestBody
body
)
{
public
static
Observable
<
Boolean
>
returnPartSelf
(
RequestBody
body
)
{
return
Api
.
getService
().
returnPartSelf
(
body
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
returnPartSelf
(
body
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
Boolean
>
returnPartByKA
(
RequestBody
body
)
{
public
static
Observable
<
Boolean
>
returnPartByKA
(
RequestBody
body
)
{
return
Api
.
getService
().
returnPartByKA
(
body
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
returnPartByKA
(
body
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
Boolean
>
receivePart
(
int
partsId
,
String
modifyBy
)
{
public
static
Observable
<
Boolean
>
receivePart
(
int
partsId
,
String
modifyBy
)
{
return
Api
.
getService
().
receivePart
(
partsId
,
modifyBy
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
receivePart
(
partsId
,
modifyBy
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
Boolean
>
refusePart
(
long
kaOrderSparePartsId
,
String
reason
)
{
public
static
Observable
<
Boolean
>
refusePart
(
long
kaOrderSparePartsId
,
String
reason
)
{
return
Api
.
getService
().
refusePart
(
kaOrderSparePartsId
,
reason
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
refusePart
(
kaOrderSparePartsId
,
reason
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
List
<
OrderPart
>>
queryPart
(
long
spOrderId
,
int
sources
)
{
public
static
Observable
<
List
<
OrderPart
>>
queryPart
(
long
spOrderId
,
int
sources
)
{
return
Api
.
getService
().
queryPart
(
spOrderId
,
sources
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
queryPart
(
spOrderId
,
sources
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
Boolean
>
modifyPart
(
RequestBody
body
)
{
public
static
Observable
<
Boolean
>
modifyPart
(
RequestBody
body
)
{
return
Api
.
getService
().
modifyPart
(
body
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
modifyPart
(
body
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
LogsticsInfo
>
queryLogistics
(
String
com
,
String
num
)
{
public
static
Observable
<
LogsticsInfo
>
queryLogistics
(
String
com
,
String
num
)
{
return
Api
.
getService
().
queryLogistics
(
com
,
num
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
queryLogistics
(
com
,
num
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
List
<
ShipperCompany
>>
queryShipperCompany
()
{
public
static
Observable
<
List
<
ShipperCompany
>>
queryShipperCompany
()
{
return
Api
.
getService
().
queryShipperCompany
().
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
APIService
.
class
).
queryShipperCompany
().
compose
(
Api
.
applySchedulers
());
}
}
}
}
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