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
5fc07d16
authored
Mar 14, 2018
by
罗翻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加uat环境
parent
568bf94e
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
122 additions
and
23 deletions
app/src/main/java/com/dayu/bigfish/MyApplication.java
baseSDK/build.gradle
baseSDK/src/main/assets/config.properties
baseSDK/src/main/java/com/dayu/base/api/Api.java
baseSDK/src/main/java/com/dayu/common/Constants.java
baseSDK/src/main/java/com/dayu/utils/LogUtils.java
baseSDK/src/main/java/com/dayu/utils/PropertyUtils.java
build.gradle
orderCenter/src/main/java/com/dayu/order/presenter/orderdoing/OrderDoingPresenter.java
app/src/main/java/com/dayu/bigfish/MyApplication.java
View file @
5fc07d16
...
@@ -10,7 +10,6 @@ import android.os.Handler;
...
@@ -10,7 +10,6 @@ import android.os.Handler;
import
com.dayu.bigfish.utils.HxManager
;
import
com.dayu.bigfish.utils.HxManager
;
import
com.dayu.common.BaseApplication
;
import
com.dayu.common.BaseApplication
;
import
com.dayu.common.Constants
;
import
com.dayu.location.base.LocationUtils
;
import
com.dayu.location.base.LocationUtils
;
import
com.dayu.order.greendao.GreenDaoManager
;
import
com.dayu.order.greendao.GreenDaoManager
;
import
com.dayu.utils.NetworkConnectChangedReceiver
;
import
com.dayu.utils.NetworkConnectChangedReceiver
;
...
@@ -63,7 +62,6 @@ public class MyApplication extends BaseApplication {
...
@@ -63,7 +62,6 @@ public class MyApplication extends BaseApplication {
* 初始化友盟.
* 初始化友盟.
*/
*/
private
void
initUM
()
{
private
void
initUM
()
{
MobclickAgent
.
setDebugMode
(
Constants
.
IS_DEBUG
);
UMConfigure
.
init
(
this
,
UMConfigure
.
DEVICE_TYPE_PHONE
,
null
);
UMConfigure
.
init
(
this
,
UMConfigure
.
DEVICE_TYPE_PHONE
,
null
);
UMConfigure
.
setLogEnabled
(
true
);
UMConfigure
.
setLogEnabled
(
true
);
UMConfigure
.
setEncryptEnabled
(
true
);
UMConfigure
.
setEncryptEnabled
(
true
);
...
@@ -89,8 +87,4 @@ public class MyApplication extends BaseApplication {
...
@@ -89,8 +87,4 @@ public class MyApplication extends BaseApplication {
public
static
Context
getContext
()
{
public
static
Context
getContext
()
{
return
mContext
;
return
mContext
;
}
}
public
static
synchronized
MyApplication
context
()
{
return
(
MyApplication
)
mContext
;
}
}
}
baseSDK/build.gradle
View file @
5fc07d16
...
@@ -39,9 +39,9 @@ dependencies {
...
@@ -39,9 +39,9 @@ dependencies {
androidTestImplementation
(
'com.android.support.test.espresso:espresso-core:3.0.1'
,
{
androidTestImplementation
(
'com.android.support.test.espresso:espresso-core:3.0.1'
,
{
exclude
group:
'com.android.support'
,
module:
'support-annotations'
exclude
group:
'com.android.support'
,
module:
'support-annotations'
})
})
compile
'com.android.support:design:2
6
.1.0'
compile
'com.android.support:design:2
7
.1.0'
//mutidex
//mutidex
compile
'com.android.support:multidex:1.0.
2
'
compile
'com.android.support:multidex:1.0.
3
'
//eventBus
//eventBus
compile
'org.greenrobot:eventbus:3.1.1'
compile
'org.greenrobot:eventbus:3.1.1'
//retrofit
//retrofit
...
...
baseSDK/src/main/assets/config.properties
0 → 100644
View file @
5fc07d16
##rel
BASE_URL
=
"https://mobile.dayu.ai"
UP_PHOTO
=
"/file/uploadMore?targetPath=online/sp/mobile/android/business/checkApply"
WEB_SOP
=
"https://sop.kf.ai/#/sop"
WEB_ZHI_SHI
=
"https://sop.kf.ai/#/detail"
LOG_LEVEL
=
0
IS_DEBUG
=
""
##uat
#BASE_URL = "http://47.94.101.239:3112"
#LOG_LEVEL = 0
#UP_PHOTO =
#WEB_SOP
#WEB_ZHI_SHI
#IS_DEBUG
\ No newline at end of file
baseSDK/src/main/java/com/dayu/base/api/Api.java
View file @
5fc07d16
package
com
.
dayu
.
base
.
api
;
package
com
.
dayu
.
base
.
api
;
import
android.support.annotation.NonNull
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
com.dayu.base.api.protocol.BaseResponse
;
import
com.dayu.base.api.protocol.BaseResponse
;
import
com.dayu.common.BaseConstant
;
import
com.dayu.common.BaseConstant
;
import
com.dayu.common.Constants
;
import
com.dayu.common.Constants
;
import
com.dayu.event.UserInfo
;
import
com.dayu.utils.LogUtils
;
import
com.dayu.utils.LogUtils
;
import
com.dayu.utils.
SPUtils
;
import
com.dayu.utils.
UserManager
;
import
com.google.gson.Gson
;
import
com.google.gson.Gson
;
import
com.google.gson.GsonBuilder
;
import
com.google.gson.GsonBuilder
;
...
@@ -27,7 +29,8 @@ import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
...
@@ -27,7 +29,8 @@ import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import
retrofit2.converter.gson.GsonConverterFactory
;
import
retrofit2.converter.gson.GsonConverterFactory
;
/**
/**
* Created by luofan on 2017/11/09.
* Created by luofan
* on 2017/11/09.
*/
*/
public
class
Api
{
public
class
Api
{
private
static
Retrofit
mRetrofit
;
private
static
Retrofit
mRetrofit
;
...
@@ -102,10 +105,13 @@ public class Api {
...
@@ -102,10 +105,13 @@ public class Api {
public
static
class
TokenInterceptord
implements
Interceptor
{
public
static
class
TokenInterceptord
implements
Interceptor
{
@Override
@Override
public
Response
intercept
(
Chain
chain
)
throws
IOException
{
public
Response
intercept
(
@NonNull
Chain
chain
)
throws
IOException
{
Request
request
=
chain
.
request
();
Request
request
=
chain
.
request
();
String
token
=
(
String
)
SPUtils
.
get
(
BaseConstant
.
TOKEN
,
""
);
UserInfo
userInfo
=
UserManager
.
getInstance
().
getUser
();
token
=
"2ab7a346308043f6bb4060ac52edfd61"
;
String
token
=
""
;
if
(
userInfo
!=
null
)
{
token
=
userInfo
.
getToken
();
}
if
(!
TextUtils
.
isEmpty
(
token
)
&&
!
request
.
url
().
toString
().
contains
(
Constants
.
BASE_URL
+
Constants
.
LOGIN_URL
))
{
if
(!
TextUtils
.
isEmpty
(
token
)
&&
!
request
.
url
().
toString
().
contains
(
Constants
.
BASE_URL
+
Constants
.
LOGIN_URL
))
{
request
=
request
.
newBuilder
()
request
=
request
.
newBuilder
()
.
header
(
BaseConstant
.
TOKEN
,
token
)
.
header
(
BaseConstant
.
TOKEN
,
token
)
...
...
baseSDK/src/main/java/com/dayu/common/Constants.java
View file @
5fc07d16
...
@@ -12,17 +12,27 @@ public class Constants {
...
@@ -12,17 +12,27 @@ public class Constants {
/**
/**
* 测试环境配置.
* 测试环境配置.
*/
*/
public
static
final
int
DEBUGLEVEL
=
LogUtils
.
LEVEL_ALL
;
// public static final int LOG_LEVEL = LogUtils.LEVEL_ALL;
public
static
final
String
BASE_URL
=
"http://47.94.101.239:3112"
;
// public static final String BASE_URL = "http://47.94.101.239:3112";
// public final static String UP_PHOTO = "/file/uploadMore?targetPath=test/sp/mobile/android/business/checkApply";
// public final static String WEB_SOP = "http://47.94.101.239:9004/#/sop";
// public final static String WEB_ZHI_SHI = "http://47.94.101.239:9004/#/detail";
// public static final boolean IS_DEBUG = true;
/**
* uat环境配置.
*/
public
static
final
int
LOG_LEVEL
=
LogUtils
.
LEVEL_ALL
;
public
static
final
String
BASE_URL
=
"http://47.95.223.6:3112"
;
public
final
static
String
UP_PHOTO
=
"/file/uploadMore?targetPath=test/sp/mobile/android/business/checkApply"
;
public
final
static
String
UP_PHOTO
=
"/file/uploadMore?targetPath=test/sp/mobile/android/business/checkApply"
;
public
final
static
String
WEB_SOP
=
"http://47.9
4.101.239
:9004/#/sop"
;
public
final
static
String
WEB_SOP
=
"http://47.9
5.223.6
:9004/#/sop"
;
public
final
static
String
WEB_ZHI_SHI
=
"http://47.9
4.101.239
:9004/#/detail"
;
public
final
static
String
WEB_ZHI_SHI
=
"http://47.9
5.223.6
:9004/#/detail"
;
public
static
final
boolean
IS_DEBUG
=
true
;
public
static
final
boolean
IS_DEBUG
=
true
;
/**
/**
* 正式环境.
* 正式环境.
*/
*/
// public static final int
DEBUG
LEVEL = LogUtils.LEVEL_OFF;
// public static final int
LOG_
LEVEL = LogUtils.LEVEL_OFF;
// public static final String BASE_URL = "https://mobile.dayu.ai";
// public static final String BASE_URL = "https://mobile.dayu.ai";
// public final static String UP_PHOTO = "/file/uploadMore?targetPath=online/sp/mobile/android/business/checkApply";
// public final static String UP_PHOTO = "/file/uploadMore?targetPath=online/sp/mobile/android/business/checkApply";
// public final static String WEB_SOP = "https://sop.kf.ai/#/sop";
// public final static String WEB_SOP = "https://sop.kf.ai/#/sop";
...
@@ -102,7 +112,6 @@ public class Constants {
...
@@ -102,7 +112,6 @@ public class Constants {
public
final
static
String
ENGINEERINFO
=
"engineer_info"
;
public
final
static
String
ENGINEERINFO
=
"engineer_info"
;
public
final
static
String
TYPE
=
"type"
;
public
final
static
String
TYPE
=
"type"
;
public
final
static
String
DESCRIBE
=
"describe"
;
public
static
final
String
PART_ID
=
"part_id"
;
public
static
final
String
PART_ID
=
"part_id"
;
public
static
final
String
SHIPPER_CODE
=
"shipper_code"
;
public
static
final
String
SHIPPER_CODE
=
"shipper_code"
;
...
...
baseSDK/src/main/java/com/dayu/utils/LogUtils.java
View file @
5fc07d16
...
@@ -33,7 +33,7 @@ public class LogUtils {
...
@@ -33,7 +33,7 @@ public class LogUtils {
public
static
final
int
LEVEL_SYSTEM
=
6
;
public
static
final
int
LEVEL_SYSTEM
=
6
;
/** 是否允许输出log */
/** 是否允许输出log */
private
static
int
mDebuggable
=
Constants
.
DEBUG
LEVEL
;
private
static
int
mDebuggable
=
Constants
.
LOG_
LEVEL
;
/** 用于记时的变量 */
/** 用于记时的变量 */
private
static
long
mTimestamp
=
0
;
private
static
long
mTimestamp
=
0
;
...
...
baseSDK/src/main/java/com/dayu/utils/PropertyUtils.java
0 → 100644
View file @
5fc07d16
/**
* CopyRight (C), 2013, www.winchannel.net
*/
package
com
.
dayu
.
utils
;
import
android.text.TextUtils
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.Properties
;
public
class
PropertyUtils
{
/**
* The key for navigation address
*/
public
static
final
String
BASE_URL
=
"BASE_URL"
;
private
static
final
String
DEFAULT_CONFIG_FILE
=
"/assets/config.properties"
;
private
Properties
mProperties
;
private
static
PropertyUtils
sProperty
;
public
static
PropertyUtils
getInstance
()
{
if
(
null
==
sProperty
)
{
sProperty
=
new
PropertyUtils
();
}
return
sProperty
;
}
private
PropertyUtils
()
{
mProperties
=
new
Properties
();
}
public
void
load
(
String
path
)
{
if
(
TextUtils
.
isEmpty
(
path
))
{
path
=
DEFAULT_CONFIG_FILE
;
}
InputStream
in
=
null
;
try
{
in
=
PropertyUtils
.
class
.
getResourceAsStream
(
path
);
mProperties
.
load
(
in
);
}
catch
(
Exception
e
)
{
LogUtils
.
e
(
e
);
}
finally
{
if
(
in
!=
null
)
{
try
{
in
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
}
public
String
getParameter
(
String
key
)
{
String
para
=
null
;
if
(
null
!=
mProperties
)
{
para
=
mProperties
.
getProperty
(
key
);
if
(
null
!=
para
)
{
para
=
para
.
trim
();
}
}
return
para
;
}
public
String
getParameter
(
String
key
,
String
defaultValue
)
{
String
para
=
null
;
if
(
null
!=
mProperties
)
{
para
=
mProperties
.
getProperty
(
key
,
defaultValue
);
if
(
null
!=
para
)
{
para
=
para
.
trim
();
}
}
return
para
;
}
}
build.gradle
View file @
5fc07d16
// Top-level build file where you can add configuration options common to all sub-projects/modules.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript
{
buildscript
{
ext
.
compile_sdk_version
=
2
6
ext
.
compile_sdk_version
=
2
7
ext
.
build_tools_version
=
"2
6
.0.2"
ext
.
build_tools_version
=
"2
7
.0.2"
ext
.
min_sdk_version
=
16
ext
.
min_sdk_version
=
16
ext
.
target_sdk_version
=
23
ext
.
target_sdk_version
=
23
ext
.
version_code
=
7
ext
.
version_code
=
7
...
...
orderCenter/src/main/java/com/dayu/order/presenter/orderdoing/OrderDoingPresenter.java
View file @
5fc07d16
...
@@ -27,7 +27,7 @@ import okhttp3.RequestBody;
...
@@ -27,7 +27,7 @@ import okhttp3.RequestBody;
* on 2017/11/8.
* on 2017/11/8.
*/
*/
public
class
OrderDoingPresenter
extends
orderDoingContract
.
Presenter
{
public
class
OrderDoingPresenter
extends
orderDoingContract
.
Presenter
{
p
ublic
ObservableField
<
Object
>
datas
=
new
ObservableField
();
p
rivate
ObservableField
<
Object
>
datas
=
new
ObservableField
<>
();
private
int
mUserId
;
private
int
mUserId
;
private
int
mSiteId
;
private
int
mSiteId
;
private
int
mState
;
private
int
mState
;
...
...
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