Merge remote-tracking branch 'origin/master'
This commit is contained in:
2
.idea/gradle.xml
generated
2
.idea/gradle.xml
generated
@@ -19,10 +19,10 @@
|
||||
<option value="$PROJECT_DIR$/modules" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-realtime" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-tanlu" />
|
||||
<option value="$PROJECT_DIR$/modules/realtime" />
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveModulePerSourceSet" value="false" />
|
||||
<option name="useQualifiedModuleNames" value="true" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
|
||||
@@ -43,4 +43,7 @@ dependencies {
|
||||
|
||||
implementation 'com.elegant.spi:api:1.0.9'
|
||||
annotationProcessor 'com.elegant.spi:compiler:1.0.3'
|
||||
|
||||
implementation project(path: ':foudations:mogo-passport')
|
||||
implementation project(path: ':foudations:mogo-commons')
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.tanlu;
|
||||
package com.mogo.cloud;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.mogo.tanlu">
|
||||
package="com.mogo.cloud">
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.mogo.cloud;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.cloud.api.ITanluUploadCallback;
|
||||
import com.mogo.cloud.bean.InformationBody;
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @description
|
||||
* @since 2021/1/21
|
||||
*/
|
||||
public class UploadManager {
|
||||
private static UploadManager sInstance;
|
||||
private Context mContext;
|
||||
|
||||
private UploadManager (Context context) {
|
||||
mContext = context;
|
||||
}
|
||||
|
||||
public static UploadManager getInstance(Context context) {
|
||||
if (sInstance == null) {
|
||||
synchronized (UploadManager.class) {
|
||||
sInstance = new UploadManager(context);
|
||||
}
|
||||
}
|
||||
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param sn
|
||||
* @param informationBody
|
||||
* @param callback
|
||||
*/
|
||||
public void loadUpload(String sn, InformationBody informationBody, ITanluUploadCallback callback) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.mogo.cloud.api;
|
||||
|
||||
|
||||
import com.mogo.cloud.bean.InformationBody;
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @description
|
||||
* @since 2021/1/20
|
||||
*/
|
||||
public interface ILoadUpload {
|
||||
void loadUpload(String sn, InformationBody informationBody, ITanluUploadCallback callback);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.mogo.cloud.api;
|
||||
|
||||
import com.mogo.cloud.bean.RoadInfos;
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @description
|
||||
* @since 2021/1/20
|
||||
*/
|
||||
public interface IRoadInfoSearchCallback {
|
||||
void onSuccess(RoadInfos result);
|
||||
void onFailure(int code);
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
package com.mogo.tanlu.api;
|
||||
package com.mogo.cloud.api;
|
||||
|
||||
import com.mogo.tanlu.bean.UploadResult;
|
||||
import com.mogo.cloud.bean.UploadResult;
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @description
|
||||
* @since 2021/1/20
|
||||
*/
|
||||
public interface ITanluUpload {
|
||||
public interface ITanluUploadCallback {
|
||||
void onSuccess(UploadResult result);
|
||||
void onFailure(int code);
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.tanlu.bean;
|
||||
package com.mogo.cloud.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.mogo.tanlu.bean;
|
||||
package com.mogo.cloud.bean;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.mogo.tanlu.bean.location.MarkerLocation;
|
||||
import com.mogo.cloud.bean.location.MarkerLocation;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.tanlu.bean;
|
||||
package com.mogo.cloud.bean;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.tanlu.bean;
|
||||
package com.mogo.cloud.bean;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.mogo.tanlu.bean;
|
||||
package com.mogo.cloud.bean;
|
||||
|
||||
import com.mogo.tanlu.bean.location.Location;
|
||||
import com.mogo.cloud.bean.location.Location;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.tanlu.bean;
|
||||
package com.mogo.cloud.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.tanlu.bean;
|
||||
package com.mogo.cloud.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.tanlu.bean.location;
|
||||
package com.mogo.cloud.bean.location;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.tanlu.bean.location;
|
||||
package com.mogo.cloud.bean.location;
|
||||
|
||||
|
||||
import android.text.TextUtils;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.tanlu.bean.location;
|
||||
package com.mogo.cloud.bean.location;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.tanlu.constant;
|
||||
package com.mogo.cloud.constant;
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.mogo.cloud.impl;
|
||||
|
||||
import com.mogo.cloud.api.ILoadUpload;
|
||||
import com.mogo.cloud.api.ITanluUploadCallback;
|
||||
import com.mogo.cloud.bean.InformationBody;
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @description 请求上报
|
||||
* @since 2021/1/20
|
||||
*/
|
||||
public class LoadUploadImpl {
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mogo.tanlu.net;
|
||||
package com.mogo.cloud.net;
|
||||
|
||||
import com.mogo.tanlu.bean.RoadInfos;
|
||||
import com.mogo.tanlu.bean.UploadResult;
|
||||
import com.mogo.cloud.bean.RoadInfos;
|
||||
import com.mogo.cloud.bean.UploadResult;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
package com.mogo.tanlu;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.PersistableBundle;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.elegant.spi.AbstractDelegateManager;
|
||||
import com.mogo.tanlu.api.ILoadUpload;
|
||||
import com.mogo.tanlu.api.ITanluUpload;
|
||||
import com.mogo.tanlu.bean.InformationBody;
|
||||
import com.mogo.tanlu.bean.UploadResult;
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @description 纯测试,没有注册类
|
||||
* @since 2021/1/20
|
||||
*/
|
||||
public class TestActivity extends AppCompatActivity {
|
||||
|
||||
// private TanluDelegateManager testDelegateManager;
|
||||
private UploadDelegateManager uploadDelegateManager;
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState, @Nullable PersistableBundle persistentState) {
|
||||
super.onCreate(savedInstanceState, persistentState);
|
||||
|
||||
// testDelegateManager = new TanluDelegateManager();
|
||||
uploadDelegateManager = new UploadDelegateManager();
|
||||
}
|
||||
|
||||
|
||||
//如何回调回去成功和失败,
|
||||
//如何更加简化使用api
|
||||
//是不是意味着使用方也需要添加spi
|
||||
public class UploadDelegateManager extends AbstractDelegateManager<ILoadUpload> {
|
||||
public UploadDelegateManager() {
|
||||
//加载实现了spi接口的自定义服务
|
||||
loadDelegates(TestActivity.this, ILoadUpload.class, new DelegateListener<ILoadUpload>() {
|
||||
@Override
|
||||
public void onDelegate(String unit, ILoadUpload p) {
|
||||
//加载成功,调用各个服务自定义show方法 TODO
|
||||
p.loadUpload("F803EB2046PZD00228", new InformationBody());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//实现AbstractDelegateManager
|
||||
// public class TanluDelegateManager extends AbstractDelegateManager<ITanluUpload> {
|
||||
// public TanluDelegateManager() {
|
||||
// //加载实现了spi接口的自定义服务
|
||||
// loadDelegates(TestActivity.this, ITanluUpload.class, new DelegateListener<ITanluUpload>() {
|
||||
// @Override
|
||||
// public void onDelegate(String unit, ITanluUpload p) {
|
||||
// //加载成功,调用各个服务自定义show方法
|
||||
// p.onFailure(0);
|
||||
// p.onSuccess(new UploadResult());
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.mogo.tanlu.api;
|
||||
|
||||
|
||||
import com.mogo.tanlu.bean.InformationBody;
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @description
|
||||
* @since 2021/1/20
|
||||
*/
|
||||
public interface ILoadUpload {
|
||||
void loadUpload(String sn, InformationBody informationBody);
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.mogo.tanlu.impl;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.elegant.spi.annotations.Service;
|
||||
import com.mogo.tanlu.api.ILoadUpload;
|
||||
import com.mogo.tanlu.bean.InformationBody;
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @description 请求上报
|
||||
* @since 2021/1/20
|
||||
*/
|
||||
@Service(value = LoadUploadImpl.class, unit = "tanlu")
|
||||
public class LoadUploadImpl implements ILoadUpload {
|
||||
@Override
|
||||
public void loadUpload(String sn, InformationBody informationBody) {
|
||||
//TODO
|
||||
Log.d("liyz", "loadUpload sn = " + sn);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.mogo.tanlu.impl;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.elegant.spi.annotations.Service;
|
||||
import com.mogo.tanlu.api.ITanluUpload;
|
||||
import com.mogo.tanlu.bean.UploadResult;
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @description
|
||||
* @since 2021/1/20
|
||||
*/
|
||||
@Service(value = ITanluUpload.class, unit = "tanlu")
|
||||
public class TanluUploadImpl implements ITanluUpload {
|
||||
|
||||
@Override
|
||||
public void onSuccess(UploadResult result) {
|
||||
Log.d("liyz", "onSuccess ----->");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(int code) {
|
||||
Log.e("liyz", "onFailure ----->");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.tanlu;
|
||||
package com.mogo.cloud;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
include ':modules:mogo-realtime'
|
||||
include ':modules:mogo-realtime'
|
||||
include ':modules:realtime'
|
||||
include ':modules:mogo-tanlu'
|
||||
include ':foudations:mogo-commons'
|
||||
include ':foudations:mogo-httpdns'
|
||||
|
||||
Reference in New Issue
Block a user