将车聊聊工程代码加入到项目中,保证能跑起来了,后续做架构升级
Signed-off-by: 董宏宇 <martindhy@gmail.com>
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package com.zhidao.carchattingprovider
|
||||
|
||||
class CallChattingProviderConstant {
|
||||
|
||||
companion object{
|
||||
const val CCPROVIDER_NICK_NAME = "userName"
|
||||
const val CCPROVIDER_USER_IMG = "userHead"
|
||||
const val CCPROVIDER_USER_SEX = "gender"
|
||||
const val CCPROVIDER_USER_AGE = "age"
|
||||
const val CCPROVIDER_ADDRESS = "location"
|
||||
const val CCPROVIDER_CAR_TYPE = "carTypeName"
|
||||
const val CCPROVIDER_SN = "sn"
|
||||
const val CCPROVIDER_LAT = "lat"
|
||||
const val CCPROVIDER_LON = "lon"
|
||||
const val CAR_CALL_PROVIDER = "/callchat/provider"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package com.zhidao.carchattingprovider;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public interface ICallChatResponse extends ICallProviderResponse {
|
||||
|
||||
@Override
|
||||
default void canCall(boolean canCall) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
default void callInvokeError(@NotNull String msg) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
default void isFriend(boolean friend) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
default void addFriend(boolean addFriend) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
default void invisibleUser(boolean visible) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
default void isOnLine(boolean onLine, @Nullable String errorMsg) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
default void userInfoCallBack(@Nullable String userInfo, @Nullable String errorMsg) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
default void hangUp(boolean hangUp, int type) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
default void refuse(boolean refuse, int type) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
default void mute(boolean mute) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
default void error(@NotNull String errInfo) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
default void call(@NotNull String data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
default void match(@NotNull String data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
default void matchInvokeResult(boolean invokeResult, @NotNull String msg) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
default void cancelMatch(boolean cancelStatus) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
default void invokeCallData(@NotNull String invokeData) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
default void joinVehicleTeamInvokeSuccess() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
default void joinVehicleTeamInvokeError(String msg) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
default void callWindowStatus(boolean status) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
default void hideUserWindowError(@NotNull String errorMsg) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
default void userWindowStatus(boolean status) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
default void inviteJoinVehicleTeam(boolean status) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.zhidao.carchattingprovider
|
||||
|
||||
|
||||
interface ICallProviderResponse : ICallResponse {
|
||||
|
||||
override fun hangUp(hangUp: Boolean, type: Int) {
|
||||
super.hangUp(hangUp, type)
|
||||
}
|
||||
|
||||
override fun refuse(refuse: Boolean, type: Int) {
|
||||
super.refuse(refuse, type)
|
||||
}
|
||||
|
||||
override fun canCall(canCall: Boolean) {
|
||||
super.canCall(canCall)
|
||||
}
|
||||
|
||||
override fun callInvokeError(msg: String) {
|
||||
super.callInvokeError(msg)
|
||||
}
|
||||
|
||||
override fun isFriend(friend: Boolean) {
|
||||
super.isFriend(friend)
|
||||
}
|
||||
|
||||
override fun addFriend(addFriend: Boolean) {
|
||||
super.addFriend(addFriend)
|
||||
}
|
||||
|
||||
override fun invisibleUser(visible: Boolean) {
|
||||
super.invisibleUser(visible)
|
||||
}
|
||||
|
||||
override fun isOnLine(onLine: Boolean, errorMsg: String?) {
|
||||
super.isOnLine(onLine, errorMsg)
|
||||
}
|
||||
|
||||
override fun userInfoCallBack(userInfo: String?, errorMsg: String?) {
|
||||
super.userInfoCallBack(userInfo, errorMsg)
|
||||
}
|
||||
|
||||
override fun callWindowStatus(status: Boolean) {
|
||||
super.callWindowStatus(status)
|
||||
}
|
||||
|
||||
override fun userWindowStatus(status: Boolean) {
|
||||
super.userWindowStatus(status)
|
||||
}
|
||||
|
||||
override fun hideUserWindowError(errorMsg: String) {
|
||||
super.hideUserWindowError(errorMsg)
|
||||
}
|
||||
|
||||
override fun inviteJoinVehicleTeam(status: Boolean) {
|
||||
super.inviteJoinVehicleTeam(status)
|
||||
}
|
||||
|
||||
override fun joinVehicleTeamInvokeSuccess() {
|
||||
super.joinVehicleTeamInvokeSuccess()
|
||||
}
|
||||
|
||||
override fun joinVehicleTeamInvokeError(msg:String) {
|
||||
super.joinVehicleTeamInvokeError(msg)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.zhidao.carchattingprovider
|
||||
|
||||
interface ICallResponse {
|
||||
|
||||
fun hangUp(hangUp: Boolean, type: Int) {
|
||||
}
|
||||
|
||||
fun refuse(refuse: Boolean, type: Int){
|
||||
}
|
||||
|
||||
fun mute(mute: Boolean) {
|
||||
}
|
||||
|
||||
fun addFriend(addFriend: Boolean) {
|
||||
}
|
||||
|
||||
fun invisibleUser(visible: Boolean) {
|
||||
}
|
||||
|
||||
fun error(errInfo: String) {
|
||||
}
|
||||
|
||||
fun call(data: String) {
|
||||
}
|
||||
|
||||
fun callInvokeError(msg: String) {
|
||||
}
|
||||
|
||||
fun match(data: String) {
|
||||
}
|
||||
|
||||
fun matchInvokeResult(invokeResult: Boolean, msg: String) {
|
||||
}
|
||||
|
||||
fun cancelMatch(cancelStatus: Boolean) {
|
||||
}
|
||||
|
||||
fun invokeCallData(invokeData: String) {
|
||||
}
|
||||
|
||||
fun joinVehicleTeamInvokeSuccess(){
|
||||
}
|
||||
|
||||
fun joinVehicleTeamInvokeError(msg:String){
|
||||
}
|
||||
|
||||
fun canCall(canCall: Boolean) {
|
||||
}
|
||||
|
||||
fun isFriend(friend: Boolean) {
|
||||
}
|
||||
|
||||
fun isOnLine(onLine: Boolean, errorMsg: String? = null) {
|
||||
}
|
||||
|
||||
fun userInfoCallBack(userInfo: String? = null, errorMsg: String? = null) {
|
||||
}
|
||||
|
||||
fun callWindowStatus(status: Boolean) {
|
||||
}
|
||||
|
||||
fun userWindowStatus(status: Boolean) {
|
||||
}
|
||||
|
||||
fun hideUserWindowError(errorMsg: String) {
|
||||
}
|
||||
|
||||
fun inviteJoinVehicleTeam(status: Boolean) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.zhidao.carchattingprovider
|
||||
|
||||
import android.content.Context
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import com.alibaba.android.arouter.facade.template.IProvider
|
||||
|
||||
interface ICarsChattingProvider : IProvider {
|
||||
|
||||
fun addFriend(flag: String, context: Context, friendSn: String, response: ICallProviderResponse)
|
||||
|
||||
fun isFriend(flag: String, context: Context, friendSn: String, response: ICallProviderResponse)
|
||||
|
||||
fun canCall(flag: String, context: Context, response: ICallProviderResponse)
|
||||
|
||||
fun isOnLine(flag: String, context: Context, sn: String, response: ICallProviderResponse)
|
||||
|
||||
fun getUserInfo(flag: String, context: Context, sn: String, response: ICallProviderResponse)
|
||||
|
||||
fun call(params: Map<String, String>)
|
||||
|
||||
fun invisibleUser(flag: String, context: Context, response: ICallProviderResponse)
|
||||
|
||||
fun registerCallWindowStatusListener(
|
||||
flag: String,
|
||||
context: Context,
|
||||
response: ICallProviderResponse
|
||||
)
|
||||
|
||||
fun unRegisterCallWindowStatusListener(flag: String, context: Context)
|
||||
|
||||
fun showUserWindow(flag: String, mogoDriverInfo: MogoDriverInfo, context: Context)
|
||||
|
||||
fun hideUserWindow(flag: String, context: Context, response: ICallProviderResponse? = null)
|
||||
|
||||
fun registerUserWindowStatusListener(
|
||||
flag: String,
|
||||
context: Context,
|
||||
response: ICallProviderResponse
|
||||
)
|
||||
|
||||
fun unRegisterUserWindowStatusListener(flag: String, context: Context)
|
||||
|
||||
fun initVehicleTeamContainer(flag: String, containerId: Int, activity: FragmentActivity)
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
package com.zhidao.carchattingprovider;
|
||||
|
||||
public class MogoDriverInfo {
|
||||
|
||||
private static final int GENDER_MALE = 0;
|
||||
private static final int GENDER_FEMALE = 1;
|
||||
|
||||
private String userName;
|
||||
private String userHead;
|
||||
private String gender;
|
||||
private int age;
|
||||
private String locationInfo;
|
||||
private String carTypeName;
|
||||
private String sn;
|
||||
private double lat = 0.0f;
|
||||
private double lon = 0.0f;
|
||||
|
||||
public MogoDriverInfo() {
|
||||
}
|
||||
|
||||
public static int getGenderMale() {
|
||||
return GENDER_MALE;
|
||||
}
|
||||
|
||||
public static int getGenderFemale() {
|
||||
return GENDER_FEMALE;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getUserHead() {
|
||||
return userHead;
|
||||
}
|
||||
|
||||
public void setUserHead(String userHead) {
|
||||
this.userHead = userHead;
|
||||
}
|
||||
|
||||
public String getGender() {
|
||||
return gender;
|
||||
}
|
||||
|
||||
public void setGender(String gender) {
|
||||
this.gender = gender;
|
||||
}
|
||||
|
||||
public int getAge() {
|
||||
return age;
|
||||
}
|
||||
|
||||
public void setAge(int age) {
|
||||
this.age = age;
|
||||
}
|
||||
|
||||
public String getLocationInfo() {
|
||||
return locationInfo;
|
||||
}
|
||||
|
||||
public void setLocationInfo(String locationInfo) {
|
||||
this.locationInfo = locationInfo;
|
||||
}
|
||||
|
||||
public String getCarTypeName() {
|
||||
return carTypeName;
|
||||
}
|
||||
|
||||
public void setCarTypeName(String carTypeName) {
|
||||
this.carTypeName = carTypeName;
|
||||
}
|
||||
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
|
||||
public void setSn(String sn) {
|
||||
if(sn == null || sn.isEmpty()){
|
||||
return;
|
||||
}
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
public double getLat() {
|
||||
return lat;
|
||||
}
|
||||
|
||||
public void setLat(double lat) {
|
||||
if (lat == 0.0) {
|
||||
return;
|
||||
}
|
||||
this.lat = lat;
|
||||
}
|
||||
|
||||
public double getLon() {
|
||||
return lon;
|
||||
}
|
||||
|
||||
public void setLon(double lon) {
|
||||
if (lon == 0.0) {
|
||||
return;
|
||||
}
|
||||
this.lon = lon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MogoDriverInfo{" +
|
||||
"userName='" + userName + '\'' +
|
||||
", userHead='" + userHead + '\'' +
|
||||
", gender='" + gender + '\'' +
|
||||
", age=" + age +
|
||||
", locationInfo='" + locationInfo + '\'' +
|
||||
", carTypeName='" + carTypeName + '\'' +
|
||||
", sn='" + sn + '\'' +
|
||||
", lat=" + lat +
|
||||
", lon=" + lon +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user