新版改版:
模块化各个功能 改为okhttp网络请求 改为sqlite作为存储 预设QQ机器人API
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
package com.yutou.bili.databases;
|
||||
|
||||
import com.yutou.bili.bean.login.LoginCookie;
|
||||
import com.yutou.databases.SQLiteManager;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BiliBiliLoginDatabase extends SQLiteManager {
|
||||
LoginCookie cookie;
|
||||
private static BiliBiliLoginDatabase instance;
|
||||
|
||||
private BiliBiliLoginDatabase(Class<LoginCookie> tClass) {
|
||||
try {
|
||||
cookie = new LoginCookie();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
init();
|
||||
}
|
||||
|
||||
public static BiliBiliLoginDatabase getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new BiliBiliLoginDatabase(LoginCookie.class);
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
public BiliBiliLoginDatabase initData(LoginCookie cookie) {
|
||||
this.cookie = cookie;
|
||||
for (BuildSqlTable table : build.getTable()) {
|
||||
cookie.setTableName(table.getName());
|
||||
add(cookie);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<LoginCookie> get() {
|
||||
return super.get(cookie.getTableName(), LoginCookie.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected LoginCookie getDataBean() {
|
||||
return new LoginCookie();
|
||||
}
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
Reference in New Issue
Block a user