merge
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package com.alibaba.android.arouter.routes;
|
||||
|
||||
import com.alibaba.android.arouter.facade.enums.RouteType;
|
||||
import com.alibaba.android.arouter.facade.model.RouteMeta;
|
||||
import com.alibaba.android.arouter.facade.template.IRouteGroup;
|
||||
import com.mogo.module.push.PushModuleProvider;
|
||||
import com.mogo.module.push.activity.PushMessageActivity;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* DO NOT EDIT THIS FILE!!! IT WAS GENERATED BY AROUTER. */
|
||||
public class ARouter$$Group$$push implements IRouteGroup {
|
||||
@Override
|
||||
public void loadInto(Map<String, RouteMeta> atlas) {
|
||||
atlas.put("/push/ui", RouteMeta.build(RouteType.PROVIDER, PushModuleProvider.class, "/push/ui", "push", null, -1, -2147483648));
|
||||
atlas.put("/push/ui/message", RouteMeta.build(RouteType.ACTIVITY, PushMessageActivity.class, "/push/ui/message", "push", null, -1, -2147483648));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.alibaba.android.arouter.routes;
|
||||
|
||||
import com.alibaba.android.arouter.facade.enums.RouteType;
|
||||
import com.alibaba.android.arouter.facade.model.RouteMeta;
|
||||
import com.alibaba.android.arouter.facade.template.IProviderGroup;
|
||||
import com.mogo.module.push.PushModuleProvider;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* DO NOT EDIT THIS FILE!!! IT WAS GENERATED BY AROUTER. */
|
||||
public class ARouter$$Providers$$mogomodulepush implements IProviderGroup {
|
||||
@Override
|
||||
public void loadInto(Map<String, RouteMeta> providers) {
|
||||
providers.put("com.mogo.service.module.IMogoModuleProvider", RouteMeta.build(RouteType.PROVIDER, PushModuleProvider.class, "/push/ui", "push", null, -1, -2147483648));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.alibaba.android.arouter.routes;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IRouteGroup;
|
||||
import com.alibaba.android.arouter.facade.template.IRouteRoot;
|
||||
import java.lang.Class;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* DO NOT EDIT THIS FILE!!! IT WAS GENERATED BY AROUTER. */
|
||||
public class ARouter$$Root$$mogomodulepush implements IRouteRoot {
|
||||
@Override
|
||||
public void loadInto(Map<String, Class<? extends IRouteGroup>> routes) {
|
||||
routes.put("push", ARouter$$Group$$push.class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,220 @@
|
||||
package com.mogo.module.push.dao;
|
||||
|
||||
import android.database.Cursor;
|
||||
import androidx.room.EntityDeletionOrUpdateAdapter;
|
||||
import androidx.room.EntityInsertionAdapter;
|
||||
import androidx.room.RoomDatabase;
|
||||
import androidx.room.RoomSQLiteQuery;
|
||||
import androidx.room.SharedSQLiteStatement;
|
||||
import androidx.room.util.CursorUtil;
|
||||
import androidx.room.util.DBUtil;
|
||||
import androidx.sqlite.db.SupportSQLiteStatement;
|
||||
import com.mogo.module.push.model.PushBean;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.lang.SuppressWarnings;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@SuppressWarnings({"unchecked", "deprecation"})
|
||||
public final class PushBeanDao_Impl implements PushBeanDao {
|
||||
private final RoomDatabase __db;
|
||||
|
||||
private final EntityInsertionAdapter<PushBean> __insertionAdapterOfPushBean;
|
||||
|
||||
private final EntityDeletionOrUpdateAdapter<PushBean> __deletionAdapterOfPushBean;
|
||||
|
||||
private final SharedSQLiteStatement __preparedStmtOfDeleteAll;
|
||||
|
||||
private final SharedSQLiteStatement __preparedStmtOfDeleteMin;
|
||||
|
||||
public PushBeanDao_Impl(RoomDatabase __db) {
|
||||
this.__db = __db;
|
||||
this.__insertionAdapterOfPushBean = new EntityInsertionAdapter<PushBean>(__db) {
|
||||
@Override
|
||||
public String createQuery() {
|
||||
return "INSERT OR REPLACE INTO `PushBean` (`icon`,`title`,`content`,`image`,`qr`,`scheme`,`timestamp`) VALUES (?,?,?,?,?,?,?)";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bind(SupportSQLiteStatement stmt, PushBean value) {
|
||||
if (value.getAppIcon() == null) {
|
||||
stmt.bindNull(1);
|
||||
} else {
|
||||
stmt.bindString(1, value.getAppIcon());
|
||||
}
|
||||
if (value.getTitle() == null) {
|
||||
stmt.bindNull(2);
|
||||
} else {
|
||||
stmt.bindString(2, value.getTitle());
|
||||
}
|
||||
if (value.getContent() == null) {
|
||||
stmt.bindNull(3);
|
||||
} else {
|
||||
stmt.bindString(3, value.getContent());
|
||||
}
|
||||
if (value.getImageUrl() == null) {
|
||||
stmt.bindNull(4);
|
||||
} else {
|
||||
stmt.bindString(4, value.getImageUrl());
|
||||
}
|
||||
if (value.getQRCode() == null) {
|
||||
stmt.bindNull(5);
|
||||
} else {
|
||||
stmt.bindString(5, value.getQRCode());
|
||||
}
|
||||
if (value.getMainSchema() == null) {
|
||||
stmt.bindNull(6);
|
||||
} else {
|
||||
stmt.bindString(6, value.getMainSchema());
|
||||
}
|
||||
stmt.bindLong(7, value.getTimestamp());
|
||||
}
|
||||
};
|
||||
this.__deletionAdapterOfPushBean = new EntityDeletionOrUpdateAdapter<PushBean>(__db) {
|
||||
@Override
|
||||
public String createQuery() {
|
||||
return "DELETE FROM `PushBean` WHERE `timestamp` = ?";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bind(SupportSQLiteStatement stmt, PushBean value) {
|
||||
stmt.bindLong(1, value.getTimestamp());
|
||||
}
|
||||
};
|
||||
this.__preparedStmtOfDeleteAll = new SharedSQLiteStatement(__db) {
|
||||
@Override
|
||||
public String createQuery() {
|
||||
final String _query = "DELETE FROM pushBean";
|
||||
return _query;
|
||||
}
|
||||
};
|
||||
this.__preparedStmtOfDeleteMin = new SharedSQLiteStatement(__db) {
|
||||
@Override
|
||||
public String createQuery() {
|
||||
final String _query = "DELETE FROM pushBean WHERE timestamp IN (SELECT MIN(timestamp) FROM pushBean)";
|
||||
return _query;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertAll(final PushBean... bean) {
|
||||
__db.assertNotSuspendingTransaction();
|
||||
__db.beginTransaction();
|
||||
try {
|
||||
__insertionAdapterOfPushBean.insert(bean);
|
||||
__db.setTransactionSuccessful();
|
||||
} finally {
|
||||
__db.endTransaction();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(final PushBean... bean) {
|
||||
__db.assertNotSuspendingTransaction();
|
||||
__db.beginTransaction();
|
||||
try {
|
||||
__deletionAdapterOfPushBean.handleMultiple(bean);
|
||||
__db.setTransactionSuccessful();
|
||||
} finally {
|
||||
__db.endTransaction();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll() {
|
||||
__db.assertNotSuspendingTransaction();
|
||||
final SupportSQLiteStatement _stmt = __preparedStmtOfDeleteAll.acquire();
|
||||
__db.beginTransaction();
|
||||
try {
|
||||
_stmt.executeUpdateDelete();
|
||||
__db.setTransactionSuccessful();
|
||||
} finally {
|
||||
__db.endTransaction();
|
||||
__preparedStmtOfDeleteAll.release(_stmt);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteMin() {
|
||||
__db.assertNotSuspendingTransaction();
|
||||
final SupportSQLiteStatement _stmt = __preparedStmtOfDeleteMin.acquire();
|
||||
__db.beginTransaction();
|
||||
try {
|
||||
_stmt.executeUpdateDelete();
|
||||
__db.setTransactionSuccessful();
|
||||
} finally {
|
||||
__db.endTransaction();
|
||||
__preparedStmtOfDeleteMin.release(_stmt);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PushBean> getAll() {
|
||||
final String _sql = "SELECT * FROM pushBean ORDER BY timestamp DESC";
|
||||
final RoomSQLiteQuery _statement = RoomSQLiteQuery.acquire(_sql, 0);
|
||||
__db.assertNotSuspendingTransaction();
|
||||
final Cursor _cursor = DBUtil.query(__db, _statement, false, null);
|
||||
try {
|
||||
final int _cursorIndexOfAppIcon = CursorUtil.getColumnIndexOrThrow(_cursor, "icon");
|
||||
final int _cursorIndexOfTitle = CursorUtil.getColumnIndexOrThrow(_cursor, "title");
|
||||
final int _cursorIndexOfContent = CursorUtil.getColumnIndexOrThrow(_cursor, "content");
|
||||
final int _cursorIndexOfImageUrl = CursorUtil.getColumnIndexOrThrow(_cursor, "image");
|
||||
final int _cursorIndexOfQRCode = CursorUtil.getColumnIndexOrThrow(_cursor, "qr");
|
||||
final int _cursorIndexOfMainSchema = CursorUtil.getColumnIndexOrThrow(_cursor, "scheme");
|
||||
final int _cursorIndexOfTimestamp = CursorUtil.getColumnIndexOrThrow(_cursor, "timestamp");
|
||||
final List<PushBean> _result = new ArrayList<PushBean>(_cursor.getCount());
|
||||
while(_cursor.moveToNext()) {
|
||||
final PushBean _item;
|
||||
_item = new PushBean();
|
||||
final String _tmpAppIcon;
|
||||
_tmpAppIcon = _cursor.getString(_cursorIndexOfAppIcon);
|
||||
_item.setAppIcon(_tmpAppIcon);
|
||||
final String _tmpTitle;
|
||||
_tmpTitle = _cursor.getString(_cursorIndexOfTitle);
|
||||
_item.setTitle(_tmpTitle);
|
||||
final String _tmpContent;
|
||||
_tmpContent = _cursor.getString(_cursorIndexOfContent);
|
||||
_item.setContent(_tmpContent);
|
||||
final String _tmpImageUrl;
|
||||
_tmpImageUrl = _cursor.getString(_cursorIndexOfImageUrl);
|
||||
_item.setImageUrl(_tmpImageUrl);
|
||||
final String _tmpQRCode;
|
||||
_tmpQRCode = _cursor.getString(_cursorIndexOfQRCode);
|
||||
_item.setQRCode(_tmpQRCode);
|
||||
final String _tmpMainSchema;
|
||||
_tmpMainSchema = _cursor.getString(_cursorIndexOfMainSchema);
|
||||
_item.setMainSchema(_tmpMainSchema);
|
||||
final long _tmpTimestamp;
|
||||
_tmpTimestamp = _cursor.getLong(_cursorIndexOfTimestamp);
|
||||
_item.setTimestamp(_tmpTimestamp);
|
||||
_result.add(_item);
|
||||
}
|
||||
return _result;
|
||||
} finally {
|
||||
_cursor.close();
|
||||
_statement.release();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAllCount() {
|
||||
final String _sql = "SELECT count(1) FROM pushBean";
|
||||
final RoomSQLiteQuery _statement = RoomSQLiteQuery.acquire(_sql, 0);
|
||||
__db.assertNotSuspendingTransaction();
|
||||
final Cursor _cursor = DBUtil.query(__db, _statement, false, null);
|
||||
try {
|
||||
final int _result;
|
||||
if(_cursor.moveToFirst()) {
|
||||
_result = _cursor.getInt(0);
|
||||
} else {
|
||||
_result = 0;
|
||||
}
|
||||
return _result;
|
||||
} finally {
|
||||
_cursor.close();
|
||||
_statement.release();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
package com.mogo.module.push.dao;
|
||||
|
||||
import androidx.room.DatabaseConfiguration;
|
||||
import androidx.room.InvalidationTracker;
|
||||
import androidx.room.RoomOpenHelper;
|
||||
import androidx.room.RoomOpenHelper.Delegate;
|
||||
import androidx.room.RoomOpenHelper.ValidationResult;
|
||||
import androidx.room.util.DBUtil;
|
||||
import androidx.room.util.TableInfo;
|
||||
import androidx.room.util.TableInfo.Column;
|
||||
import androidx.room.util.TableInfo.ForeignKey;
|
||||
import androidx.room.util.TableInfo.Index;
|
||||
import androidx.sqlite.db.SupportSQLiteDatabase;
|
||||
import androidx.sqlite.db.SupportSQLiteOpenHelper;
|
||||
import androidx.sqlite.db.SupportSQLiteOpenHelper.Callback;
|
||||
import androidx.sqlite.db.SupportSQLiteOpenHelper.Configuration;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.lang.SuppressWarnings;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
@SuppressWarnings({"unchecked", "deprecation"})
|
||||
public final class PushBeanDatabase_Impl extends PushBeanDatabase {
|
||||
private volatile PushBeanDao _pushBeanDao;
|
||||
|
||||
@Override
|
||||
protected SupportSQLiteOpenHelper createOpenHelper(DatabaseConfiguration configuration) {
|
||||
final SupportSQLiteOpenHelper.Callback _openCallback = new RoomOpenHelper(configuration, new RoomOpenHelper.Delegate(1) {
|
||||
@Override
|
||||
public void createAllTables(SupportSQLiteDatabase _db) {
|
||||
_db.execSQL("CREATE TABLE IF NOT EXISTS `PushBean` (`icon` TEXT NOT NULL, `title` TEXT NOT NULL, `content` TEXT NOT NULL, `image` TEXT NOT NULL, `qr` TEXT NOT NULL, `scheme` TEXT NOT NULL, `timestamp` INTEGER NOT NULL, PRIMARY KEY(`timestamp`))");
|
||||
_db.execSQL("CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)");
|
||||
_db.execSQL("INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'a297c98624a6b7df90797298fa47318d')");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropAllTables(SupportSQLiteDatabase _db) {
|
||||
_db.execSQL("DROP TABLE IF EXISTS `PushBean`");
|
||||
if (mCallbacks != null) {
|
||||
for (int _i = 0, _size = mCallbacks.size(); _i < _size; _i++) {
|
||||
mCallbacks.get(_i).onDestructiveMigration(_db);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(SupportSQLiteDatabase _db) {
|
||||
if (mCallbacks != null) {
|
||||
for (int _i = 0, _size = mCallbacks.size(); _i < _size; _i++) {
|
||||
mCallbacks.get(_i).onCreate(_db);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOpen(SupportSQLiteDatabase _db) {
|
||||
mDatabase = _db;
|
||||
internalInitInvalidationTracker(_db);
|
||||
if (mCallbacks != null) {
|
||||
for (int _i = 0, _size = mCallbacks.size(); _i < _size; _i++) {
|
||||
mCallbacks.get(_i).onOpen(_db);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPreMigrate(SupportSQLiteDatabase _db) {
|
||||
DBUtil.dropFtsSyncTriggers(_db);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostMigrate(SupportSQLiteDatabase _db) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RoomOpenHelper.ValidationResult onValidateSchema(SupportSQLiteDatabase _db) {
|
||||
final HashMap<String, TableInfo.Column> _columnsPushBean = new HashMap<String, TableInfo.Column>(7);
|
||||
_columnsPushBean.put("icon", new TableInfo.Column("icon", "TEXT", true, 0, null, TableInfo.CREATED_FROM_ENTITY));
|
||||
_columnsPushBean.put("title", new TableInfo.Column("title", "TEXT", true, 0, null, TableInfo.CREATED_FROM_ENTITY));
|
||||
_columnsPushBean.put("content", new TableInfo.Column("content", "TEXT", true, 0, null, TableInfo.CREATED_FROM_ENTITY));
|
||||
_columnsPushBean.put("image", new TableInfo.Column("image", "TEXT", true, 0, null, TableInfo.CREATED_FROM_ENTITY));
|
||||
_columnsPushBean.put("qr", new TableInfo.Column("qr", "TEXT", true, 0, null, TableInfo.CREATED_FROM_ENTITY));
|
||||
_columnsPushBean.put("scheme", new TableInfo.Column("scheme", "TEXT", true, 0, null, TableInfo.CREATED_FROM_ENTITY));
|
||||
_columnsPushBean.put("timestamp", new TableInfo.Column("timestamp", "INTEGER", true, 1, null, TableInfo.CREATED_FROM_ENTITY));
|
||||
final HashSet<TableInfo.ForeignKey> _foreignKeysPushBean = new HashSet<TableInfo.ForeignKey>(0);
|
||||
final HashSet<TableInfo.Index> _indicesPushBean = new HashSet<TableInfo.Index>(0);
|
||||
final TableInfo _infoPushBean = new TableInfo("PushBean", _columnsPushBean, _foreignKeysPushBean, _indicesPushBean);
|
||||
final TableInfo _existingPushBean = TableInfo.read(_db, "PushBean");
|
||||
if (! _infoPushBean.equals(_existingPushBean)) {
|
||||
return new RoomOpenHelper.ValidationResult(false, "PushBean(com.mogo.module.push.model.PushBean).\n"
|
||||
+ " Expected:\n" + _infoPushBean + "\n"
|
||||
+ " Found:\n" + _existingPushBean);
|
||||
}
|
||||
return new RoomOpenHelper.ValidationResult(true, null);
|
||||
}
|
||||
}, "a297c98624a6b7df90797298fa47318d", "adc16c11fc70d272f68d66133676a431");
|
||||
final SupportSQLiteOpenHelper.Configuration _sqliteConfig = SupportSQLiteOpenHelper.Configuration.builder(configuration.context)
|
||||
.name(configuration.name)
|
||||
.callback(_openCallback)
|
||||
.build();
|
||||
final SupportSQLiteOpenHelper _helper = configuration.sqliteOpenHelperFactory.create(_sqliteConfig);
|
||||
return _helper;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected InvalidationTracker createInvalidationTracker() {
|
||||
final HashMap<String, String> _shadowTablesMap = new HashMap<String, String>(0);
|
||||
HashMap<String, Set<String>> _viewTables = new HashMap<String, Set<String>>(0);
|
||||
return new InvalidationTracker(this, _shadowTablesMap, _viewTables, "PushBean");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearAllTables() {
|
||||
super.assertNotMainThread();
|
||||
final SupportSQLiteDatabase _db = super.getOpenHelper().getWritableDatabase();
|
||||
try {
|
||||
super.beginTransaction();
|
||||
_db.execSQL("DELETE FROM `PushBean`");
|
||||
super.setTransactionSuccessful();
|
||||
} finally {
|
||||
super.endTransaction();
|
||||
_db.query("PRAGMA wal_checkpoint(FULL)").close();
|
||||
if (!_db.inTransaction()) {
|
||||
_db.execSQL("VACUUM");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PushBeanDao pushBeanDao() {
|
||||
if (_pushBeanDao != null) {
|
||||
return _pushBeanDao;
|
||||
} else {
|
||||
synchronized(this) {
|
||||
if(_pushBeanDao == null) {
|
||||
_pushBeanDao = new PushBeanDao_Impl(this);
|
||||
}
|
||||
return _pushBeanDao;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user