[add] 添加云公告注册java文件
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
package com.mogo.eagle.core.function.notice;
|
||||
|
||||
/**
|
||||
* @author liujing
|
||||
* @description 云公告注册
|
||||
* @since: 10/27/21
|
||||
*/
|
||||
public class MoGoNoticeManager {
|
||||
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.mogo.eagle.core.function.notice
|
||||
|
||||
import android.content.Context
|
||||
import com.mogo.eagle.core.function.api.notice.IMoGoNoticeProvider
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
* @date 2021/9/18 11:44 上午
|
||||
* 处理云端下发通知、公告类的逻辑的接口
|
||||
*/
|
||||
class MoGoNoticeProvider : IMoGoNoticeProvider {
|
||||
private val TAG = "MoGoNoticeProvider"
|
||||
|
||||
override val functionName: String
|
||||
get() = TAG
|
||||
|
||||
override fun onDestroy() {
|
||||
|
||||
}
|
||||
|
||||
override fun init(context: Context) {}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.mogo.eagle.core.function.notice.receiver;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
/**
|
||||
* @author Jing
|
||||
* @description push云公告消息接收
|
||||
* @since: 10/27/21
|
||||
*/
|
||||
public class NoticeReceiver extends BroadcastReceiver {
|
||||
private Context mContext;
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
mContext = context;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.mogo.eagle.core.function.api.notice;
|
||||
|
||||
/**
|
||||
* @author Jing
|
||||
* @description 云公告监听者
|
||||
* @since: 10/27/21
|
||||
*/
|
||||
public interface IMoGoNoticeListener {
|
||||
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.mogo.eagle.core.function.api.notice
|
||||
|
||||
import com.mogo.eagle.core.function.api.base.IMoGoFunctionServerProvider
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
* @date 2021/9/18 11:25 上午
|
||||
* 处理云端下发通知、公告类的逻辑的接口
|
||||
*/
|
||||
interface IMoGoNoticeProvider : IMoGoFunctionServerProvider {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,9 +1,27 @@
|
||||
package com.mogo.eagle.core.function.call.notice;
|
||||
|
||||
import com.mogo.eagle.core.function.api.notice.IMoGoNoticeListener;
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
* @date 2021/9/18 11:48 上午
|
||||
* 云端公告、通知类的 调用者管理,这里对外及其他模块提供功能的调用,用啥写啥,不要过度设计,不允许直接将Provider暴露出去
|
||||
*/
|
||||
public class CallerNoticeManager {
|
||||
public class CallerNoticeManager extends CallerBase {
|
||||
private HashMap<String, IMoGoNoticeListener> mListeners = new HashMap<>();
|
||||
|
||||
/**
|
||||
* 添加监听者
|
||||
*/
|
||||
void addListener(String tag, IMoGoNoticeListener listener) {
|
||||
mListeners.put(tag, listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除监听者
|
||||
*/
|
||||
void removeListener(String tag) {
|
||||
mListeners.remove(tag);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user