wurong
4 months ago
29 changed files with 1919 additions and 548 deletions
@ -1,10 +1,7 @@
|
||||
org.gradle.jvmargs=-Xmx1536M |
||||
#org.gradle.jvmargs=-Xmx4096m |
||||
#org.gradle.jvmargs=-Xmx1536M |
||||
org.gradle.jvmargs=-Xmx4096m |
||||
android.useAndroidX=true |
||||
android.enableJetifier=true |
||||
MobSDK.mobEnv=x |
||||
MobSDK.spEdition=FP |
||||
android.injected.testOnly=false |
||||
#org.gradle.jvmargs=-Xmx1536M --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED |
||||
|
||||
|
||||
android.injected.testOnly=false |
@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME |
||||
distributionPath=wrapper/dists |
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip |
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip |
||||
zipStoreBase=GRADLE_USER_HOME |
||||
zipStorePath=wrapper/dists |
||||
|
@ -0,0 +1,72 @@
|
||||
import 'dart:typed_data'; |
||||
|
||||
|
||||
|
||||
/** |
||||
* |
||||
* 需要按照格式严格封装 |
||||
* |
||||
* |
||||
* 4个字节 放全部信息长度 头+body |
||||
* 2字节 header长度 |
||||
* 2字节 默认填1 |
||||
* 4字节 登录1,消息5 |
||||
* 4字节 默认填1 |
||||
* 不限制长度body 但是不要超过2048-16 |
||||
* 需要严格控制每条消息发送不超过 2048 |
||||
*/ |
||||
|
||||
|
||||
class Proto { |
||||
static const int HEADER_LENGTH = 16; // 假设头部长度为16字节 |
||||
static const int VERSION = 1; |
||||
|
||||
int operation; |
||||
int seqId; |
||||
Uint8List body; |
||||
|
||||
Proto(this.operation, this.seqId, this.body); |
||||
|
||||
Uint8List toBytes() { |
||||
final buffer = BytesBuilder(); |
||||
buffer.add(_intToBytes(HEADER_LENGTH + body.length, 4)); |
||||
buffer.add(_shortToBytes(HEADER_LENGTH, 2)); |
||||
buffer.add(_shortToBytes(VERSION, 2)); |
||||
buffer.add(_intToBytes(operation, 4)); |
||||
buffer.add(_intToBytes(seqId, 4)); |
||||
buffer.add(body); |
||||
return buffer.toBytes(); |
||||
} |
||||
|
||||
|
||||
static Proto fromBytes(Uint8List data) { |
||||
final buffer = ByteData.sublistView(data); |
||||
int offset = 0; |
||||
|
||||
int packetLen = buffer.getInt32(offset, Endian.big); |
||||
offset += 4; |
||||
int headerLen = buffer.getInt16(offset, Endian.big); |
||||
offset += 2; |
||||
int version = buffer.getInt16(offset, Endian.big); |
||||
offset += 2; |
||||
int operation = buffer.getInt32(offset, Endian.big); |
||||
offset += 4; |
||||
int seqId = buffer.getInt32(offset, Endian.big); |
||||
offset += 4; |
||||
Uint8List body = data.sublist(offset); |
||||
|
||||
return Proto(operation, seqId, body); |
||||
} |
||||
|
||||
List<int> _intToBytes(int value, int length) { |
||||
final bytes = ByteData(length); |
||||
bytes.setInt32(0, value, Endian.big); |
||||
return bytes.buffer.asUint8List(); |
||||
} |
||||
|
||||
List<int> _shortToBytes(int value, int length) { |
||||
final bytes = ByteData(length); |
||||
bytes.setInt16(0, value, Endian.big); |
||||
return bytes.buffer.asUint8List(); |
||||
} |
||||
} |
@ -0,0 +1,110 @@
|
||||
|
||||
|
||||
|
||||
import 'dart:convert'; |
||||
import 'dart:io'; |
||||
|
||||
import 'package:flutter/foundation.dart'; |
||||
import 'package:huixiang/im/Proto.dart'; |
||||
import 'package:huixiang/im/database/message.dart'; |
||||
import 'package:huixiang/im/out/auth.pb.dart'; |
||||
import 'package:huixiang/im/out/message.pb.dart'; |
||||
import 'package:huixiang/main.dart'; |
||||
import 'package:shared_preferences/shared_preferences.dart'; |
||||
|
||||
class SocketClient { |
||||
|
||||
Socket _socket; |
||||
SharedPreferences shared; |
||||
|
||||
connect() async { |
||||
shared = await SharedPreferences.getInstance(); |
||||
|
||||
await Socket.connect('192.168.10.129', 9090).then((value) { |
||||
debugPrint("socket-connect"); |
||||
_socket = value; |
||||
_socket.listen((data) { |
||||
print(data); |
||||
print("socket-listen"); |
||||
Proto proto = Proto.fromBytes(data); |
||||
MsgData data1 = MsgData.fromBuffer(proto.body); |
||||
print('收到来自:${data1.from},消息内容: ${utf8.decode(data1.data)} '); |
||||
|
||||
hxDatabase.insert(createMessage(userId, utf8.decode(data1.data), msgType: data1.type.value, userId: data1.from)); |
||||
|
||||
callbacks.forEach((callback) { |
||||
callback.call(data1); |
||||
}); |
||||
|
||||
}, onError: (Object error, StackTrace stackTrace) { |
||||
debugPrint("socket-error: $error, stackTrace: ${stackTrace}"); |
||||
}); |
||||
|
||||
authRequest(shared.getString("token")); |
||||
|
||||
}).catchError((error) { |
||||
debugPrint("socket-connect-error: $error"); |
||||
}); |
||||
} |
||||
|
||||
List<Function> callbacks = []; |
||||
|
||||
addCallback(Function callback) { |
||||
callbacks.add(callback); |
||||
} |
||||
|
||||
removeCallback(Function callback) { |
||||
callbacks.remove(callback); |
||||
} |
||||
|
||||
dispose() { |
||||
_socket.close(); |
||||
} |
||||
|
||||
authRequest(String token) { |
||||
if (!checkSocket()) { |
||||
return; |
||||
} |
||||
final authReq = AuthReq() |
||||
..uid = userId |
||||
..token = token; |
||||
final authReqBytes = authReq.writeToBuffer(); |
||||
final proto = Proto(1, 1, authReqBytes); // 假设 operation 和 seqId 为 1 |
||||
final protoBytes = proto.toBytes(); |
||||
_socket.add(protoBytes); |
||||
} |
||||
|
||||
Future<Message> sendMessage(String toId, String content) async { |
||||
Map message = createMessage(toId, content, userId: userId); |
||||
int id = await hxDatabase.insert(message).catchError((error) { |
||||
debugPrint("insertMessage: $error"); |
||||
}); |
||||
if (!checkSocket()) { |
||||
hxDatabase.update({"id": id, "state": 3}).catchError((error) { |
||||
debugPrint("insertMessage: $error"); |
||||
}); |
||||
message["id"] = id; |
||||
message["state"] = 3; |
||||
return Message.fromJson(message); |
||||
} |
||||
message["id"] = id; |
||||
Uint8List data = utf8.encode(content); |
||||
MsgData msgData = MsgData(to: toId, from: userId, type: MsgType.SINGLE_TEXT, data: data); |
||||
final proto2 = Proto(5, 1, msgData.writeToBuffer()); |
||||
_socket.add(proto2.toBytes()); |
||||
debugPrint("sendMessage: ${message["id"]}"); |
||||
return Message.fromJson(message); |
||||
} |
||||
|
||||
checkSocket() { |
||||
if (_socket == null) { |
||||
connect(); |
||||
return false; |
||||
} |
||||
return true; |
||||
} |
||||
|
||||
get userId => shared.getString("userId"); |
||||
|
||||
|
||||
} |
@ -0,0 +1,123 @@
|
||||
|
||||
import 'package:flutter/cupertino.dart'; |
||||
import 'package:huixiang/im/database/message.dart'; |
||||
import 'package:huixiang/im/database/migration.dart'; |
||||
import 'package:sqflite/sqflite.dart'; |
||||
|
||||
|
||||
class HxDatabase { |
||||
|
||||
Database db; |
||||
|
||||
void open() async { |
||||
|
||||
// _migrations.add(Migration(1, 2, (Database database) async { |
||||
// database.execute('ALTER TABLE `Message` ADD COLUMN `replyId` VARCHAR(20) DEFAULT NULL AFTER `toId`'); |
||||
// })); |
||||
|
||||
await openDatabase( |
||||
'hx.db', |
||||
version: 2, |
||||
onCreate: (Database db, int version) async { |
||||
db.execute('CREATE TABLE IF NOT EXISTS `Message` (`id` INTEGER, `fromId` VARCHAR(20), `toId` VARCHAR(20), `replyId` VARCHAR(20), `content` TEXT, `attach` TEXT, `msgType` INTEGER, `time` VARCHAR(20), `state` INTEGER, `isDelete` INTEGER, PRIMARY KEY (`id`))'); |
||||
}, |
||||
onConfigure: (database) async { |
||||
await database.execute('PRAGMA foreign_keys = ON'); |
||||
}, |
||||
onUpgrade: (database, startVersion, endVersion) async { |
||||
await runMigrations(database, startVersion, endVersion, _migrations); |
||||
}, |
||||
onOpen: (Database db) { |
||||
this.db = db; |
||||
} |
||||
); |
||||
} |
||||
|
||||
void close() { |
||||
db.close(); |
||||
} |
||||
|
||||
Future<List<Message>> queryList(userId) { |
||||
if (db == null) { |
||||
return Future.value(<Message>[]); |
||||
} |
||||
String sql = 'SELECT * FROM Message WHERE toId = ? OR fromId = ? GROUP BY toId,fromId ORDER BY time DESC'; |
||||
return db.rawQuery(sql, [userId, userId]).then((value) { |
||||
return value.map((e) { |
||||
debugPrint("Message: ${e}"); |
||||
return Message.fromJson(e); |
||||
}).toList(); |
||||
}, onError: (error) { |
||||
debugPrint("Messageerror: $error"); |
||||
}); |
||||
} |
||||
|
||||
Future<List<Message>> queryUList(userId) { |
||||
if (db == null) { |
||||
return Future.value(<Message>[]); |
||||
} |
||||
String sql = 'SELECT * FROM Message WHERE toId = ? OR fromId = ? ORDER BY time DESC'; |
||||
return db.rawQuery(sql, [userId, userId]).then((value) { |
||||
return value.map((e) => Message.fromJson(e)).toList(); |
||||
}, onError: (error) { |
||||
debugPrint("Messageerror: $error"); |
||||
}); |
||||
} |
||||
|
||||
Future<List<Map>> queryListAll() { |
||||
if (db == null) { |
||||
return Future.value(); |
||||
} |
||||
String sql = 'SELECT * FROM Message ORDER BY time DESC'; |
||||
return db.rawQuery(sql); |
||||
} |
||||
|
||||
Future<int> deleteAll() async { |
||||
return db.delete("Message"); |
||||
} |
||||
|
||||
update(Map<dynamic, dynamic> message) { |
||||
|
||||
} |
||||
|
||||
Future<int> insert(Map message) async { |
||||
if (db == null) { |
||||
return Future.value(0); |
||||
} |
||||
debugPrint("Messageinsert: ${message}"); |
||||
return db.insert("Message", message); |
||||
} |
||||
|
||||
final List<Migration> _migrations = []; |
||||
|
||||
addMigrations(List<Migration> migrations) { |
||||
_migrations.addAll(migrations); |
||||
return this; |
||||
} |
||||
|
||||
Future<void> runMigrations( |
||||
final Database migrationDatabase, |
||||
final int startVersion, |
||||
final int endVersion, |
||||
final List<Migration> migrations, |
||||
) async { |
||||
final relevantMigrations = migrations |
||||
.where((migration) => migration.startVersion >= startVersion) |
||||
.toList() |
||||
..sort( |
||||
(first, second) => first.startVersion.compareTo(second.startVersion)); |
||||
|
||||
if (relevantMigrations.isEmpty || |
||||
relevantMigrations.last.endVersion != endVersion) { |
||||
throw StateError( |
||||
'There is no migration supplied to update the database to the current version.' |
||||
' Aborting the migration.', |
||||
); |
||||
} |
||||
|
||||
for (final migration in relevantMigrations) { |
||||
await migration.migrate(migrationDatabase); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,146 @@
|
||||
// // GENERATED CODE - DO NOT MODIFY BY HAND |
||||
// |
||||
// part of 'hx_database.dart'; |
||||
// |
||||
// // ************************************************************************** |
||||
// // FloorGenerator |
||||
// // ************************************************************************** |
||||
// |
||||
// // ignore: avoid_classes_with_only_static_members |
||||
// import 'package:floor/floor.dart'; |
||||
// |
||||
// class $FloorHxDatabase { |
||||
// /// Creates a database builder for a persistent database. |
||||
// /// Once a database is built, you should keep a reference to it and re-use it. |
||||
// static _$HxDatabaseBuilder databaseBuilder(String name) => |
||||
// _$HxDatabaseBuilder(name); |
||||
// |
||||
// /// Creates a database builder for an in memory database. |
||||
// /// Information stored in an in memory database disappears when the process is killed. |
||||
// /// Once a database is built, you should keep a reference to it and re-use it. |
||||
// static _$HxDatabaseBuilder inMemoryDatabaseBuilder() => |
||||
// _$HxDatabaseBuilder(null); |
||||
// } |
||||
// |
||||
// class _$HxDatabaseBuilder { |
||||
// _$HxDatabaseBuilder(this.name); |
||||
// |
||||
// final String name; |
||||
// |
||||
// final List<Migration> _migrations = []; |
||||
// |
||||
// Callback _callback; |
||||
// |
||||
// /// Adds migrations to the builder. |
||||
// _$HxDatabaseBuilder addMigrations(List<Migration> migrations) { |
||||
// _migrations.addAll(migrations); |
||||
// return this; |
||||
// } |
||||
// |
||||
// /// Adds a database [Callback] to the builder. |
||||
// _$HxDatabaseBuilder addCallback(Callback callback) { |
||||
// _callback = callback; |
||||
// return this; |
||||
// } |
||||
// |
||||
// /// Creates the database and initializes it. |
||||
// Future<HxDatabase> build() async { |
||||
// final path = name != null |
||||
// ? await sqfliteDatabaseFactory.getDatabasePath(name) |
||||
// : ':memory:'; |
||||
// final database = _$HxDatabase(); |
||||
// database.database = await database.open( |
||||
// path, |
||||
// _migrations, |
||||
// _callback, |
||||
// ); |
||||
// return database; |
||||
// } |
||||
// } |
||||
// |
||||
// class _$HxDatabase extends HxDatabase { |
||||
// _$HxDatabase([StreamController<String> listener]) { |
||||
// changeListener = listener ?? StreamController<String>.broadcast(); |
||||
// } |
||||
// |
||||
// MessageDao _messageDaoInstance; |
||||
// |
||||
// Future<sqflite.Database> open( |
||||
// String path, |
||||
// List<Migration> migrations, [ |
||||
// Callback callback, |
||||
// ]) async { |
||||
// final databaseOptions = sqflite.OpenDatabaseOptions( |
||||
// version: 1, |
||||
// onConfigure: (database) async { |
||||
// await database.execute('PRAGMA foreign_keys = ON'); |
||||
// await callback?.onConfigure?.call(database); |
||||
// }, |
||||
// onOpen: (database) async { |
||||
// await callback?.onOpen?.call(database); |
||||
// }, |
||||
// onUpgrade: (database, startVersion, endVersion) async { |
||||
// await MigrationAdapter.runMigrations( |
||||
// database, startVersion, endVersion, migrations); |
||||
// |
||||
// await callback?.onUpgrade?.call(database, startVersion, endVersion); |
||||
// }, |
||||
// onCreate: (database, version) async { |
||||
// await database.execute( |
||||
// 'CREATE TABLE IF NOT EXISTS `Message` (`id` INTEGER, `fromId` INTEGER, `toId` INTEGER, `content` TEXT, `attach` TEXT, `msgType` INTEGER, `time` INTEGER, `state` INTEGER, `isDelete` INTEGER, PRIMARY KEY (`id`))'); |
||||
// |
||||
// await callback?.onCreate?.call(database, version); |
||||
// }, |
||||
// ); |
||||
// return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); |
||||
// } |
||||
// |
||||
// @override |
||||
// MessageDao get messageDao { |
||||
// return _messageDaoInstance ??= _$MessageDao(database, changeListener); |
||||
// } |
||||
// } |
||||
// |
||||
// class _$MessageDao extends MessageDao { |
||||
// _$MessageDao( |
||||
// this.database, |
||||
// this.changeListener, |
||||
// ) : _queryAdapter = QueryAdapter(database, changeListener), |
||||
// _messageInsertionAdapter = InsertionAdapter( |
||||
// database, |
||||
// 'Message', |
||||
// (Message item) => item.toJson(), |
||||
// changeListener); |
||||
// |
||||
// final sqflite.DatabaseExecutor database; |
||||
// |
||||
// final StreamController<String> changeListener; |
||||
// |
||||
// final QueryAdapter _queryAdapter; |
||||
// |
||||
// final InsertionAdapter<Message> _messageInsertionAdapter; |
||||
// |
||||
// @override |
||||
// Stream<List<Message>> findMessageByToId(int toId) { |
||||
// return _queryAdapter.queryListStream( |
||||
// 'SELECT * FROM Message WHERE toId = ?1', |
||||
// mapper: (Map<String, Object> row) => Message.fromJson(row), |
||||
// arguments: [toId], |
||||
// queryableName: 'Message', |
||||
// isView: false); |
||||
// } |
||||
// |
||||
// @override |
||||
// Future<List<Message>> findMessageByGroup(int userId) { |
||||
// debugPrint("findMessageByGroup: $userId"); |
||||
// return _queryAdapter.queryList( |
||||
// 'SELECT * FROM Message WHERE toId = ?1 OR fromId = ?2 GROUP BY toId,fromId ORDER BY time DESC', |
||||
// mapper: (Map<String, Object> row) => Message.fromJson(row), |
||||
// arguments: [userId, userId]); |
||||
// } |
||||
// |
||||
// @override |
||||
// Future<void> insertMessage(Message message) async { |
||||
// await _messageInsertionAdapter.insert(message, OnConflictStrategy.abort); |
||||
// } |
||||
// } |
@ -0,0 +1,63 @@
|
||||
|
||||
class Message { |
||||
int id; |
||||
|
||||
String fromId; |
||||
|
||||
String toId; |
||||
|
||||
String replyId; |
||||
|
||||
String content; |
||||
|
||||
String attach; |
||||
|
||||
int msgType; |
||||
|
||||
String time; |
||||
|
||||
int state; |
||||
|
||||
int isDelete; |
||||
|
||||
Message(this.id, this.fromId, this.toId, this.replyId, this.content, this.attach, this.msgType, this.time, this.state, this.isDelete); |
||||
|
||||
factory Message.fromJson(Map<String, dynamic> json) => Message( |
||||
json["id"], |
||||
json["fromId"], |
||||
json["toId"], |
||||
json["replyId"], |
||||
json["content"], |
||||
json["attach"], |
||||
json["msgType"], |
||||
json["time"], |
||||
json["state"], |
||||
json["isDelete"]); |
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{ |
||||
"id": id, |
||||
"fromId": fromId, |
||||
"toId": toId, |
||||
"replyId": replyId, |
||||
"content": content, |
||||
"attach": attach, |
||||
"msgType": msgType, |
||||
"time": time, |
||||
"state": state, |
||||
"isDelete": isDelete == null ? 0 : isDelete |
||||
}; |
||||
} |
||||
|
||||
createMessage(var toId, String content, {String attach, int msgType, userId, replyId}) { |
||||
return <String, dynamic>{ |
||||
"fromId": userId, |
||||
"toId": toId, |
||||
"replyId": replyId, |
||||
"content": content, |
||||
"attach": attach, |
||||
"msgType": msgType ?? 0, |
||||
"time": "${DateTime.now().millisecondsSinceEpoch}", |
||||
"state": 0, |
||||
"isDelete": 0 |
||||
}; |
||||
} |
@ -0,0 +1,17 @@
|
||||
// import 'package:floor/floor.dart'; |
||||
// import 'package:huixiang/im/database/message.dart'; |
||||
// |
||||
// |
||||
// @dao |
||||
// abstract class MessageDao { |
||||
// |
||||
// @Query('SELECT * FROM Message WHERE toId = :toId') |
||||
// Stream<List<Message>> findMessageByToId(int toId); |
||||
// |
||||
// @insert |
||||
// Future<void> insertMessage(Message message); |
||||
// |
||||
// @Query('SELECT * FROM Message WHERE toId = :userId OR fromId = :userId GROUP BY toId,fromId ORDER BY time DESC') |
||||
// Future<List<Message>> findMessageByGroup(int userId); |
||||
// |
||||
// } |
@ -0,0 +1,41 @@
|
||||
import 'package:sqflite/sqflite.dart' as sqflite; |
||||
|
||||
/// Base class for a database migration. |
||||
/// |
||||
/// Each migration can move between 2 versions that are defined by |
||||
/// [startVersion] and [endVersion]. |
||||
class Migration { |
||||
/// The start version of the database. |
||||
final int startVersion; |
||||
|
||||
/// The start version of the database. |
||||
final int endVersion; |
||||
|
||||
/// Function that performs the migration. |
||||
final Future<void> Function(sqflite.Database database) migrate; |
||||
|
||||
/// Creates a new migration between [startVersion] and [endVersion]. |
||||
/// [migrate] will be called by the database and performs the actual |
||||
/// migration. |
||||
Migration(this.startVersion, this.endVersion, this.migrate) |
||||
: assert(startVersion > 0), |
||||
assert(startVersion < endVersion); |
||||
|
||||
@override |
||||
bool operator ==(Object other) => |
||||
identical(this, other) || |
||||
other is Migration && |
||||
runtimeType == other.runtimeType && |
||||
startVersion == other.startVersion && |
||||
endVersion == other.endVersion && |
||||
migrate == other.migrate; |
||||
|
||||
@override |
||||
int get hashCode => |
||||
startVersion.hashCode ^ endVersion.hashCode ^ migrate.hashCode; |
||||
|
||||
@override |
||||
String toString() { |
||||
return 'Migration{startVersion: $startVersion, endVersion: $endVersion, migrate: $migrate}'; |
||||
} |
||||
} |
@ -0,0 +1,160 @@
|
||||
// |
||||
// Generated code. Do not modify. |
||||
// source: auth.proto |
||||
// |
||||
// @dart = 2.12 |
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references |
||||
// ignore_for_file: constant_identifier_names, library_prefixes |
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields |
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import |
||||
|
||||
import 'dart:core' as $core; |
||||
|
||||
import 'package:protobuf/protobuf.dart' as $pb; |
||||
|
||||
class AuthReq extends $pb.GeneratedMessage { |
||||
factory AuthReq({ |
||||
$core.String? uid, |
||||
$core.String? token, |
||||
}) { |
||||
final $result = create(); |
||||
if (uid != null) { |
||||
$result.uid = uid; |
||||
} |
||||
if (token != null) { |
||||
$result.token = token; |
||||
} |
||||
return $result; |
||||
} |
||||
AuthReq._() : super(); |
||||
factory AuthReq.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); |
||||
factory AuthReq.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); |
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'AuthReq', createEmptyInstance: create) |
||||
..aOS(1, _omitFieldNames ? '' : 'uid') |
||||
..aOS(2, _omitFieldNames ? '' : 'token') |
||||
..hasRequiredFields = false |
||||
; |
||||
|
||||
@$core.Deprecated( |
||||
'Using this can add significant overhead to your binary. ' |
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' |
||||
'Will be removed in next major version') |
||||
AuthReq clone() => AuthReq()..mergeFromMessage(this); |
||||
@$core.Deprecated( |
||||
'Using this can add significant overhead to your binary. ' |
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' |
||||
'Will be removed in next major version') |
||||
AuthReq copyWith(void Function(AuthReq) updates) => super.copyWith((message) => updates(message as AuthReq)) as AuthReq; |
||||
|
||||
$pb.BuilderInfo get info_ => _i; |
||||
|
||||
@$core.pragma('dart2js:noInline') |
||||
static AuthReq create() => AuthReq._(); |
||||
AuthReq createEmptyInstance() => create(); |
||||
static $pb.PbList<AuthReq> createRepeated() => $pb.PbList<AuthReq>(); |
||||
@$core.pragma('dart2js:noInline') |
||||
static AuthReq getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<AuthReq>(create); |
||||
static AuthReq? _defaultInstance; |
||||
|
||||
@$pb.TagNumber(1) |
||||
$core.String get uid => $_getSZ(0); |
||||
@$pb.TagNumber(1) |
||||
set uid($core.String v) { $_setString(0, v); } |
||||
@$pb.TagNumber(1) |
||||
$core.bool hasUid() => $_has(0); |
||||
@$pb.TagNumber(1) |
||||
void clearUid() => clearField(1); |
||||
|
||||
@$pb.TagNumber(2) |
||||
$core.String get token => $_getSZ(1); |
||||
@$pb.TagNumber(2) |
||||
set token($core.String v) { $_setString(1, v); } |
||||
@$pb.TagNumber(2) |
||||
$core.bool hasToken() => $_has(1); |
||||
@$pb.TagNumber(2) |
||||
void clearToken() => clearField(2); |
||||
} |
||||
|
||||
class AuthResp extends $pb.GeneratedMessage { |
||||
factory AuthResp({ |
||||
$core.String? uid, |
||||
$core.int? code, |
||||
$core.String? message, |
||||
}) { |
||||
final $result = create(); |
||||
if (uid != null) { |
||||
$result.uid = uid; |
||||
} |
||||
if (code != null) { |
||||
$result.code = code; |
||||
} |
||||
if (message != null) { |
||||
$result.message = message; |
||||
} |
||||
return $result; |
||||
} |
||||
AuthResp._() : super(); |
||||
factory AuthResp.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); |
||||
factory AuthResp.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); |
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'AuthResp', createEmptyInstance: create) |
||||
..aOS(1, _omitFieldNames ? '' : 'uid') |
||||
..a<$core.int>(2, _omitFieldNames ? '' : 'code', $pb.PbFieldType.OU3) |
||||
..aOS(3, _omitFieldNames ? '' : 'message') |
||||
..hasRequiredFields = false |
||||
; |
||||
|
||||
@$core.Deprecated( |
||||
'Using this can add significant overhead to your binary. ' |
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' |
||||
'Will be removed in next major version') |
||||
AuthResp clone() => AuthResp()..mergeFromMessage(this); |
||||
@$core.Deprecated( |
||||
'Using this can add significant overhead to your binary. ' |
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' |
||||
'Will be removed in next major version') |
||||
AuthResp copyWith(void Function(AuthResp) updates) => super.copyWith((message) => updates(message as AuthResp)) as AuthResp; |
||||
|
||||
$pb.BuilderInfo get info_ => _i; |
||||
|
||||
@$core.pragma('dart2js:noInline') |
||||
static AuthResp create() => AuthResp._(); |
||||
AuthResp createEmptyInstance() => create(); |
||||
static $pb.PbList<AuthResp> createRepeated() => $pb.PbList<AuthResp>(); |
||||
@$core.pragma('dart2js:noInline') |
||||
static AuthResp getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<AuthResp>(create); |
||||
static AuthResp? _defaultInstance; |
||||
|
||||
@$pb.TagNumber(1) |
||||
$core.String get uid => $_getSZ(0); |
||||
@$pb.TagNumber(1) |
||||
set uid($core.String v) { $_setString(0, v); } |
||||
@$pb.TagNumber(1) |
||||
$core.bool hasUid() => $_has(0); |
||||
@$pb.TagNumber(1) |
||||
void clearUid() => clearField(1); |
||||
|
||||
@$pb.TagNumber(2) |
||||
$core.int get code => $_getIZ(1); |
||||
@$pb.TagNumber(2) |
||||
set code($core.int v) { $_setUnsignedInt32(1, v); } |
||||
@$pb.TagNumber(2) |
||||
$core.bool hasCode() => $_has(1); |
||||
@$pb.TagNumber(2) |
||||
void clearCode() => clearField(2); |
||||
|
||||
@$pb.TagNumber(3) |
||||
$core.String get message => $_getSZ(2); |
||||
@$pb.TagNumber(3) |
||||
set message($core.String v) { $_setString(2, v); } |
||||
@$pb.TagNumber(3) |
||||
$core.bool hasMessage() => $_has(2); |
||||
@$pb.TagNumber(3) |
||||
void clearMessage() => clearField(3); |
||||
} |
||||
|
||||
|
||||
const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names'); |
||||
const _omitMessageNames = $core.bool.fromEnvironment('protobuf.omit_message_names'); |
@ -0,0 +1,11 @@
|
||||
// |
||||
// Generated code. Do not modify. |
||||
// source: auth.proto |
||||
// |
||||
// @dart = 2.12 |
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references |
||||
// ignore_for_file: constant_identifier_names, library_prefixes |
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields |
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import |
||||
|
@ -0,0 +1,43 @@
|
||||
// |
||||
// Generated code. Do not modify. |
||||
// source: auth.proto |
||||
// |
||||
// @dart = 2.12 |
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references |
||||
// ignore_for_file: constant_identifier_names, library_prefixes |
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields |
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import |
||||
|
||||
import 'dart:convert' as $convert; |
||||
import 'dart:core' as $core; |
||||
import 'dart:typed_data' as $typed_data; |
||||
|
||||
@$core.Deprecated('Use authReqDescriptor instead') |
||||
const AuthReq$json = { |
||||
'1': 'AuthReq', |
||||
'2': [ |
||||
{'1': 'uid', '3': 1, '4': 1, '5': 9, '10': 'uid'}, |
||||
{'1': 'token', '3': 2, '4': 1, '5': 9, '10': 'token'}, |
||||
], |
||||
}; |
||||
|
||||
/// Descriptor for `AuthReq`. Decode as a `google.protobuf.DescriptorProto`. |
||||
final $typed_data.Uint8List authReqDescriptor = $convert.base64Decode( |
||||
'CgdBdXRoUmVxEhAKA3VpZBgBIAEoCVIDdWlkEhQKBXRva2VuGAIgASgJUgV0b2tlbg=='); |
||||
|
||||
@$core.Deprecated('Use authRespDescriptor instead') |
||||
const AuthResp$json = { |
||||
'1': 'AuthResp', |
||||
'2': [ |
||||
{'1': 'uid', '3': 1, '4': 1, '5': 9, '10': 'uid'}, |
||||
{'1': 'code', '3': 2, '4': 1, '5': 13, '10': 'code'}, |
||||
{'1': 'message', '3': 3, '4': 1, '5': 9, '10': 'message'}, |
||||
], |
||||
}; |
||||
|
||||
/// Descriptor for `AuthResp`. Decode as a `google.protobuf.DescriptorProto`. |
||||
final $typed_data.Uint8List authRespDescriptor = $convert.base64Decode( |
||||
'CghBdXRoUmVzcBIQCgN1aWQYASABKAlSA3VpZBISCgRjb2RlGAIgASgNUgRjb2RlEhgKB21lc3' |
||||
'NhZ2UYAyABKAlSB21lc3NhZ2U='); |
||||
|
@ -0,0 +1,14 @@
|
||||
// |
||||
// Generated code. Do not modify. |
||||
// source: auth.proto |
||||
// |
||||
// @dart = 2.12 |
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references |
||||
// ignore_for_file: constant_identifier_names |
||||
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes |
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields |
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import |
||||
|
||||
export 'auth.pb.dart'; |
||||
|
@ -0,0 +1,272 @@
|
||||
// |
||||
// Generated code. Do not modify. |
||||
// source: message.proto |
||||
// |
||||
// @dart = 2.12 |
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references |
||||
// ignore_for_file: constant_identifier_names, library_prefixes |
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields |
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import |
||||
|
||||
import 'dart:core' as $core; |
||||
|
||||
import 'package:protobuf/protobuf.dart' as $pb; |
||||
|
||||
import 'message.pbenum.dart'; |
||||
|
||||
export 'message.pbenum.dart'; |
||||
|
||||
class MsgData extends $pb.GeneratedMessage { |
||||
factory MsgData({ |
||||
$core.String? to, |
||||
$core.String? from, |
||||
$core.int? ctime, |
||||
MsgType? type, |
||||
$core.List<$core.int>? data, |
||||
}) { |
||||
final $result = create(); |
||||
if (to != null) { |
||||
$result.to = to; |
||||
} |
||||
if (from != null) { |
||||
$result.from = from; |
||||
} |
||||
if (ctime != null) { |
||||
$result.ctime = ctime; |
||||
} |
||||
if (type != null) { |
||||
$result.type = type; |
||||
} |
||||
if (data != null) { |
||||
$result.data = data; |
||||
} |
||||
return $result; |
||||
} |
||||
MsgData._() : super(); |
||||
factory MsgData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); |
||||
factory MsgData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); |
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'MsgData', createEmptyInstance: create) |
||||
..aOS(1, _omitFieldNames ? '' : 'to') |
||||
..aOS(2, _omitFieldNames ? '' : 'from') |
||||
..a<$core.int>(3, _omitFieldNames ? '' : 'ctime', $pb.PbFieldType.OU3) |
||||
..e<MsgType>(4, _omitFieldNames ? '' : 'type', $pb.PbFieldType.OE, defaultOrMaker: MsgType.SINGLE_TEXT, valueOf: MsgType.valueOf, enumValues: MsgType.values) |
||||
..a<$core.List<$core.int>>(5, _omitFieldNames ? '' : 'data', $pb.PbFieldType.OY) |
||||
..hasRequiredFields = false |
||||
; |
||||
|
||||
@$core.Deprecated( |
||||
'Using this can add significant overhead to your binary. ' |
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' |
||||
'Will be removed in next major version') |
||||
MsgData clone() => MsgData()..mergeFromMessage(this); |
||||
@$core.Deprecated( |
||||
'Using this can add significant overhead to your binary. ' |
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' |
||||
'Will be removed in next major version') |
||||
MsgData copyWith(void Function(MsgData) updates) => super.copyWith((message) => updates(message as MsgData)) as MsgData; |
||||
|
||||
$pb.BuilderInfo get info_ => _i; |
||||
|
||||
@$core.pragma('dart2js:noInline') |
||||
static MsgData create() => MsgData._(); |
||||
MsgData createEmptyInstance() => create(); |
||||
static $pb.PbList<MsgData> createRepeated() => $pb.PbList<MsgData>(); |
||||
@$core.pragma('dart2js:noInline') |
||||
static MsgData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<MsgData>(create); |
||||
static MsgData? _defaultInstance; |
||||
|
||||
@$pb.TagNumber(1) |
||||
$core.String get to => $_getSZ(0); |
||||
@$pb.TagNumber(1) |
||||
set to($core.String v) { $_setString(0, v); } |
||||
@$pb.TagNumber(1) |
||||
$core.bool hasTo() => $_has(0); |
||||
@$pb.TagNumber(1) |
||||
void clearTo() => clearField(1); |
||||
|
||||
@$pb.TagNumber(2) |
||||
$core.String get from => $_getSZ(1); |
||||
@$pb.TagNumber(2) |
||||
set from($core.String v) { $_setString(1, v); } |
||||
@$pb.TagNumber(2) |
||||
$core.bool hasFrom() => $_has(1); |
||||
@$pb.TagNumber(2) |
||||
void clearFrom() => clearField(2); |
||||
|
||||
@$pb.TagNumber(3) |
||||
$core.int get ctime => $_getIZ(2); |
||||
@$pb.TagNumber(3) |
||||
set ctime($core.int v) { $_setUnsignedInt32(2, v); } |
||||
@$pb.TagNumber(3) |
||||
$core.bool hasCtime() => $_has(2); |
||||
@$pb.TagNumber(3) |
||||
void clearCtime() => clearField(3); |
||||
|
||||
@$pb.TagNumber(4) |
||||
MsgType get type => $_getN(3); |
||||
@$pb.TagNumber(4) |
||||
set type(MsgType v) { setField(4, v); } |
||||
@$pb.TagNumber(4) |
||||
$core.bool hasType() => $_has(3); |
||||
@$pb.TagNumber(4) |
||||
void clearType() => clearField(4); |
||||
|
||||
@$pb.TagNumber(5) |
||||
$core.List<$core.int> get data => $_getN(4); |
||||
@$pb.TagNumber(5) |
||||
set data($core.List<$core.int> v) { $_setBytes(4, v); } |
||||
@$pb.TagNumber(5) |
||||
$core.bool hasData() => $_has(4); |
||||
@$pb.TagNumber(5) |
||||
void clearData() => clearField(5); |
||||
} |
||||
|
||||
class MsgNotify extends $pb.GeneratedMessage { |
||||
factory MsgNotify({ |
||||
$core.int? seq, |
||||
}) { |
||||
final $result = create(); |
||||
if (seq != null) { |
||||
$result.seq = seq; |
||||
} |
||||
return $result; |
||||
} |
||||
MsgNotify._() : super(); |
||||
factory MsgNotify.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); |
||||
factory MsgNotify.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); |
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'MsgNotify', createEmptyInstance: create) |
||||
..a<$core.int>(1, _omitFieldNames ? '' : 'seq', $pb.PbFieldType.OU3) |
||||
..hasRequiredFields = false |
||||
; |
||||
|
||||
@$core.Deprecated( |
||||
'Using this can add significant overhead to your binary. ' |
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' |
||||
'Will be removed in next major version') |
||||
MsgNotify clone() => MsgNotify()..mergeFromMessage(this); |
||||
@$core.Deprecated( |
||||
'Using this can add significant overhead to your binary. ' |
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' |
||||
'Will be removed in next major version') |
||||
MsgNotify copyWith(void Function(MsgNotify) updates) => super.copyWith((message) => updates(message as MsgNotify)) as MsgNotify; |
||||
|
||||
$pb.BuilderInfo get info_ => _i; |
||||
|
||||
@$core.pragma('dart2js:noInline') |
||||
static MsgNotify create() => MsgNotify._(); |
||||
MsgNotify createEmptyInstance() => create(); |
||||
static $pb.PbList<MsgNotify> createRepeated() => $pb.PbList<MsgNotify>(); |
||||
@$core.pragma('dart2js:noInline') |
||||
static MsgNotify getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<MsgNotify>(create); |
||||
static MsgNotify? _defaultInstance; |
||||
|
||||
@$pb.TagNumber(1) |
||||
$core.int get seq => $_getIZ(0); |
||||
@$pb.TagNumber(1) |
||||
set seq($core.int v) { $_setUnsignedInt32(0, v); } |
||||
@$pb.TagNumber(1) |
||||
$core.bool hasSeq() => $_has(0); |
||||
@$pb.TagNumber(1) |
||||
void clearSeq() => clearField(1); |
||||
} |
||||
|
||||
class MsgSync extends $pb.GeneratedMessage { |
||||
factory MsgSync({ |
||||
$core.int? seq, |
||||
}) { |
||||
final $result = create(); |
||||
if (seq != null) { |
||||
$result.seq = seq; |
||||
} |
||||
return $result; |
||||
} |
||||
MsgSync._() : super(); |
||||
factory MsgSync.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); |
||||
factory MsgSync.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); |
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'MsgSync', createEmptyInstance: create) |
||||
..a<$core.int>(1, _omitFieldNames ? '' : 'seq', $pb.PbFieldType.OU3) |
||||
..hasRequiredFields = false |
||||
; |
||||
|
||||
@$core.Deprecated( |
||||
'Using this can add significant overhead to your binary. ' |
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' |
||||
'Will be removed in next major version') |
||||
MsgSync clone() => MsgSync()..mergeFromMessage(this); |
||||
@$core.Deprecated( |
||||
'Using this can add significant overhead to your binary. ' |
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' |
||||
'Will be removed in next major version') |
||||
MsgSync copyWith(void Function(MsgSync) updates) => super.copyWith((message) => updates(message as MsgSync)) as MsgSync; |
||||
|
||||
$pb.BuilderInfo get info_ => _i; |
||||
|
||||
@$core.pragma('dart2js:noInline') |
||||
static MsgSync create() => MsgSync._(); |
||||
MsgSync createEmptyInstance() => create(); |
||||
static $pb.PbList<MsgSync> createRepeated() => $pb.PbList<MsgSync>(); |
||||
@$core.pragma('dart2js:noInline') |
||||
static MsgSync getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<MsgSync>(create); |
||||
static MsgSync? _defaultInstance; |
||||
|
||||
@$pb.TagNumber(1) |
||||
$core.int get seq => $_getIZ(0); |
||||
@$pb.TagNumber(1) |
||||
set seq($core.int v) { $_setUnsignedInt32(0, v); } |
||||
@$pb.TagNumber(1) |
||||
$core.bool hasSeq() => $_has(0); |
||||
@$pb.TagNumber(1) |
||||
void clearSeq() => clearField(1); |
||||
} |
||||
|
||||
class MsgSyncData extends $pb.GeneratedMessage { |
||||
factory MsgSyncData({ |
||||
$core.Iterable<MsgData>? messages, |
||||
}) { |
||||
final $result = create(); |
||||
if (messages != null) { |
||||
$result.messages.addAll(messages); |
||||
} |
||||
return $result; |
||||
} |
||||
MsgSyncData._() : super(); |
||||
factory MsgSyncData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); |
||||
factory MsgSyncData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); |
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'MsgSyncData', createEmptyInstance: create) |
||||
..pc<MsgData>(1, _omitFieldNames ? '' : 'messages', $pb.PbFieldType.PM, subBuilder: MsgData.create) |
||||
..hasRequiredFields = false |
||||
; |
||||
|
||||
@$core.Deprecated( |
||||
'Using this can add significant overhead to your binary. ' |
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' |
||||
'Will be removed in next major version') |
||||
MsgSyncData clone() => MsgSyncData()..mergeFromMessage(this); |
||||
@$core.Deprecated( |
||||
'Using this can add significant overhead to your binary. ' |
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' |
||||
'Will be removed in next major version') |
||||
MsgSyncData copyWith(void Function(MsgSyncData) updates) => super.copyWith((message) => updates(message as MsgSyncData)) as MsgSyncData; |
||||
|
||||
$pb.BuilderInfo get info_ => _i; |
||||
|
||||
@$core.pragma('dart2js:noInline') |
||||
static MsgSyncData create() => MsgSyncData._(); |
||||
MsgSyncData createEmptyInstance() => create(); |
||||
static $pb.PbList<MsgSyncData> createRepeated() => $pb.PbList<MsgSyncData>(); |
||||
@$core.pragma('dart2js:noInline') |
||||
static MsgSyncData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<MsgSyncData>(create); |
||||
static MsgSyncData? _defaultInstance; |
||||
|
||||
@$pb.TagNumber(1) |
||||
$core.List<MsgData> get messages => $_getList(0); |
||||
} |
||||
|
||||
|
||||
const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names'); |
||||
const _omitMessageNames = $core.bool.fromEnvironment('protobuf.omit_message_names'); |
@ -0,0 +1,36 @@
|
||||
// |
||||
// Generated code. Do not modify. |
||||
// source: message.proto |
||||
// |
||||
// @dart = 2.12 |
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references |
||||
// ignore_for_file: constant_identifier_names, library_prefixes |
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields |
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import |
||||
|
||||
import 'dart:core' as $core; |
||||
|
||||
import 'package:protobuf/protobuf.dart' as $pb; |
||||
|
||||
class MsgType extends $pb.ProtobufEnum { |
||||
static const MsgType SINGLE_TEXT = MsgType._(0, _omitEnumNames ? '' : 'SINGLE_TEXT'); |
||||
static const MsgType SINGLE_AUDIO = MsgType._(1, _omitEnumNames ? '' : 'SINGLE_AUDIO'); |
||||
static const MsgType GROUP_TEXT = MsgType._(2, _omitEnumNames ? '' : 'GROUP_TEXT'); |
||||
static const MsgType GROUP_AUDIO = MsgType._(3, _omitEnumNames ? '' : 'GROUP_AUDIO'); |
||||
|
||||
static const $core.List<MsgType> values = <MsgType> [ |
||||
SINGLE_TEXT, |
||||
SINGLE_AUDIO, |
||||
GROUP_TEXT, |
||||
GROUP_AUDIO, |
||||
]; |
||||
|
||||
static final $core.Map<$core.int, MsgType> _byValue = $pb.ProtobufEnum.initByValue(values); |
||||
static MsgType? valueOf($core.int value) => _byValue[value]; |
||||
|
||||
const MsgType._($core.int v, $core.String n) : super(v, n); |
||||
} |
||||
|
||||
|
||||
const _omitEnumNames = $core.bool.fromEnvironment('protobuf.omit_enum_names'); |
@ -0,0 +1,85 @@
|
||||
// |
||||
// Generated code. Do not modify. |
||||
// source: message.proto |
||||
// |
||||
// @dart = 2.12 |
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references |
||||
// ignore_for_file: constant_identifier_names, library_prefixes |
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields |
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import |
||||
|
||||
import 'dart:convert' as $convert; |
||||
import 'dart:core' as $core; |
||||
import 'dart:typed_data' as $typed_data; |
||||
|
||||
@$core.Deprecated('Use msgTypeDescriptor instead') |
||||
const MsgType$json = { |
||||
'1': 'MsgType', |
||||
'2': [ |
||||
{'1': 'SINGLE_TEXT', '2': 0}, |
||||
{'1': 'SINGLE_AUDIO', '2': 1}, |
||||
{'1': 'GROUP_TEXT', '2': 2}, |
||||
{'1': 'GROUP_AUDIO', '2': 3}, |
||||
], |
||||
}; |
||||
|
||||
/// Descriptor for `MsgType`. Decode as a `google.protobuf.EnumDescriptorProto`. |
||||
final $typed_data.Uint8List msgTypeDescriptor = $convert.base64Decode( |
||||
'CgdNc2dUeXBlEg8KC1NJTkdMRV9URVhUEAASEAoMU0lOR0xFX0FVRElPEAESDgoKR1JPVVBfVE' |
||||
'VYVBACEg8KC0dST1VQX0FVRElPEAM='); |
||||
|
||||
@$core.Deprecated('Use msgDataDescriptor instead') |
||||
const MsgData$json = { |
||||
'1': 'MsgData', |
||||
'2': [ |
||||
{'1': 'to', '3': 1, '4': 1, '5': 9, '10': 'to'}, |
||||
{'1': 'from', '3': 2, '4': 1, '5': 9, '10': 'from'}, |
||||
{'1': 'ctime', '3': 3, '4': 1, '5': 13, '10': 'ctime'}, |
||||
{'1': 'type', '3': 4, '4': 1, '5': 14, '6': '.MsgType', '10': 'type'}, |
||||
{'1': 'data', '3': 5, '4': 1, '5': 12, '10': 'data'}, |
||||
], |
||||
}; |
||||
|
||||
/// Descriptor for `MsgData`. Decode as a `google.protobuf.DescriptorProto`. |
||||
final $typed_data.Uint8List msgDataDescriptor = $convert.base64Decode( |
||||
'CgdNc2dEYXRhEg4KAnRvGAEgASgJUgJ0bxISCgRmcm9tGAIgASgJUgRmcm9tEhQKBWN0aW1lGA' |
||||
'MgASgNUgVjdGltZRIcCgR0eXBlGAQgASgOMgguTXNnVHlwZVIEdHlwZRISCgRkYXRhGAUgASgM' |
||||
'UgRkYXRh'); |
||||
|
||||
@$core.Deprecated('Use msgNotifyDescriptor instead') |
||||
const MsgNotify$json = { |
||||
'1': 'MsgNotify', |
||||
'2': [ |
||||
{'1': 'seq', '3': 1, '4': 1, '5': 13, '10': 'seq'}, |
||||
], |
||||
}; |
||||
|
||||
/// Descriptor for `MsgNotify`. Decode as a `google.protobuf.DescriptorProto`. |
||||
final $typed_data.Uint8List msgNotifyDescriptor = $convert.base64Decode( |
||||
'CglNc2dOb3RpZnkSEAoDc2VxGAEgASgNUgNzZXE='); |
||||
|
||||
@$core.Deprecated('Use msgSyncDescriptor instead') |
||||
const MsgSync$json = { |
||||
'1': 'MsgSync', |
||||
'2': [ |
||||
{'1': 'seq', '3': 1, '4': 1, '5': 13, '10': 'seq'}, |
||||
], |
||||
}; |
||||
|
||||
/// Descriptor for `MsgSync`. Decode as a `google.protobuf.DescriptorProto`. |
||||
final $typed_data.Uint8List msgSyncDescriptor = $convert.base64Decode( |
||||
'CgdNc2dTeW5jEhAKA3NlcRgBIAEoDVIDc2Vx'); |
||||
|
||||
@$core.Deprecated('Use msgSyncDataDescriptor instead') |
||||
const MsgSyncData$json = { |
||||
'1': 'MsgSyncData', |
||||
'2': [ |
||||
{'1': 'messages', '3': 1, '4': 3, '5': 11, '6': '.MsgData', '10': 'messages'}, |
||||
], |
||||
}; |
||||
|
||||
/// Descriptor for `MsgSyncData`. Decode as a `google.protobuf.DescriptorProto`. |
||||
final $typed_data.Uint8List msgSyncDataDescriptor = $convert.base64Decode( |
||||
'CgtNc2dTeW5jRGF0YRIkCghtZXNzYWdlcxgBIAMoCzIILk1zZ0RhdGFSCG1lc3NhZ2Vz'); |
||||
|
@ -0,0 +1,14 @@
|
||||
// |
||||
// Generated code. Do not modify. |
||||
// source: message.proto |
||||
// |
||||
// @dart = 2.12 |
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references |
||||
// ignore_for_file: constant_identifier_names |
||||
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes |
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields |
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import |
||||
|
||||
export 'message.pb.dart'; |
||||
|
Loading…
Reference in new issue