feature:完成通过数据库配置图床列表

This commit is contained in:
hackycy
2020-06-17 13:35:49 +08:00
parent 1a41e037f5
commit 6ef14fc5f6
6 changed files with 141 additions and 22 deletions

29
lib/utils/sql.dart Normal file
View File

@@ -0,0 +1,29 @@
import './db_provider.dart';
import '../model/base.dart';
class Sql extends BaseModel {
final String tableName;
Sql.setTable(this.tableName) : super(DbProvider.db);
// sdf
Future<List> get() async {
return await this.query(tableName);
}
String getTableName() {
return tableName;
}
Future<int> delete(String value, String key) async {
return await this
.db
.delete(tableName, where: '$key = ?', whereArgs: [value]);
}
Future<int> deleteAll() async {
return await this.db.delete(tableName);
}
}