mirror of
https://gitee.com/farsunset/cim.git
synced 2025-06-28 21:31:32 +08:00
cim for flutter sdk
This commit is contained in:
parent
84786e6fdb
commit
bf9b2860df
117
cim-client-sdk/cim-flutter-sdk/cim-boot-client.dart
Normal file
117
cim-client-sdk/cim-flutter-sdk/cim-boot-client.dart
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
import 'dart:typed_data';
|
||||||
|
|
||||||
|
import '../protobuf/Message.pb.dart' as Message;
|
||||||
|
import '../protobuf/ReplyBody.pb.dart' as ReplyBody;
|
||||||
|
import '../protobuf/SentBody.pb.dart' as SentBody;
|
||||||
|
import 'package:fixnum/fixnum.dart';
|
||||||
|
|
||||||
|
late Socket socket;
|
||||||
|
|
||||||
|
const APP_VERSION = "1.0.0";
|
||||||
|
const APP_CHANNEL = "web";
|
||||||
|
const APP_PACKAGE = "com.farsunset.cim";
|
||||||
|
const SERVER_URL = "192.168.10.133";
|
||||||
|
const SERVER_PORT = 23456;
|
||||||
|
|
||||||
|
//PONG
|
||||||
|
const PONG_TYPE = 0;
|
||||||
|
//发送消息类型
|
||||||
|
const Message_TYPE = 2;
|
||||||
|
//强制下线类型
|
||||||
|
const ACTION_999 = 999;
|
||||||
|
//响应消息类型
|
||||||
|
const REPLY_BODY = 4;
|
||||||
|
//消息发送
|
||||||
|
const SEND_BODY = 3;
|
||||||
|
//PING
|
||||||
|
const PING_TYPE = 1;
|
||||||
|
|
||||||
|
const DATA_HEADER_LENGTH = 1;
|
||||||
|
|
||||||
|
void connect() async {
|
||||||
|
print('-------------开始连接----------------');
|
||||||
|
Socket.connect(SERVER_URL, SERVER_PORT).then((Socket sock) {
|
||||||
|
// socket = sock;
|
||||||
|
sock.listen(dataHandler,
|
||||||
|
onError: errorHandler, onDone: doneHandler, cancelOnError: false);
|
||||||
|
socket = sock;
|
||||||
|
sendLoginMsg();
|
||||||
|
}).catchError((e) {
|
||||||
|
print("Unable to connect: $e");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void dataHandler(Uint8List data) {
|
||||||
|
print(data[0]);
|
||||||
|
int l = (data[1] & 0xff);
|
||||||
|
int h = (data[2] & 0xff);
|
||||||
|
int length = (l | h << 8);
|
||||||
|
if (data[0] == PING_TYPE) {
|
||||||
|
sendPong();
|
||||||
|
} else if (data[0] == REPLY_BODY) {
|
||||||
|
var message = data.sublist(3, length + 3);
|
||||||
|
ReplyBody.Model info = new ReplyBody.Model();
|
||||||
|
info.mergeFromBuffer(message);
|
||||||
|
print(info.key);
|
||||||
|
print(info);
|
||||||
|
} else if (data[0] == Message_TYPE) {
|
||||||
|
var message = data.sublist(3, length + 3);
|
||||||
|
Message.Model model = new Message.Model();
|
||||||
|
model.mergeFromBuffer(message);
|
||||||
|
print(model.action);
|
||||||
|
print(model);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void errorHandler(error, StackTrace trace) {
|
||||||
|
print(error);
|
||||||
|
}
|
||||||
|
|
||||||
|
void doneHandler() {
|
||||||
|
print("-------------连接失败----------------");
|
||||||
|
}
|
||||||
|
|
||||||
|
//发送登录消息
|
||||||
|
void sendLoginMsg() async {
|
||||||
|
Map<String, String> map = {
|
||||||
|
"uid": "11111111112346121631126311",
|
||||||
|
"channel": APP_CHANNEL,
|
||||||
|
"appVersion": APP_VERSION,
|
||||||
|
"osVersion": "Android 10",
|
||||||
|
"packageName": APP_PACKAGE,
|
||||||
|
"deviceId": "121155155a61d6a1s6d1as6d1a6s1da",
|
||||||
|
"deviceName": "andoirdPhone",
|
||||||
|
"language": "Zh_cn",
|
||||||
|
};
|
||||||
|
int time = new DateTime.now().millisecondsSinceEpoch;
|
||||||
|
Int64 timeStamp = Int64.parseInt(time.toString());
|
||||||
|
var body = SentBody.Model(data: map);
|
||||||
|
body.key = "client_bind";
|
||||||
|
body.timestamp = timeStamp;
|
||||||
|
var data = body.writeToBuffer();
|
||||||
|
var protobuf = new Uint8List(data.length + 3);
|
||||||
|
protobuf[0] = 3;
|
||||||
|
protobuf[1] = (data.length & 0xff);
|
||||||
|
protobuf[2] = ((data.length >> 8) & 0xff);
|
||||||
|
protobuf.setRange(3, data.length + 3, data);
|
||||||
|
socket.add(protobuf);
|
||||||
|
await socket.flush();
|
||||||
|
}
|
||||||
|
|
||||||
|
//发送PONG响应
|
||||||
|
void sendPong() async {
|
||||||
|
var PONG = new Uint8List(7);
|
||||||
|
var PONG_BODY = new Uint8List(4);
|
||||||
|
PONG_BODY[0] = 80;
|
||||||
|
PONG_BODY[1] = 79;
|
||||||
|
PONG_BODY[2] = 78;
|
||||||
|
PONG_BODY[3] = 71;
|
||||||
|
PONG[0] = PONG_TYPE;
|
||||||
|
PONG[1] = (PONG_BODY.length & 0xff);
|
||||||
|
PONG[2] = ((PONG_BODY.length >> 8) & 0xff);
|
||||||
|
PONG.setRange(3, 6, PONG_BODY);
|
||||||
|
socket.add(PONG);
|
||||||
|
await socket.flush();
|
||||||
|
print("发送Pong");
|
||||||
|
}
|
171
cim-client-sdk/cim-flutter-sdk/protobuf/Message.pb.dart
Normal file
171
cim-client-sdk/cim-flutter-sdk/protobuf/Message.pb.dart
Normal file
@ -0,0 +1,171 @@
|
|||||||
|
///
|
||||||
|
// Generated code. Do not modify.
|
||||||
|
// source: Message.proto
|
||||||
|
//
|
||||||
|
// @dart = 2.12
|
||||||
|
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields
|
||||||
|
|
||||||
|
import 'dart:core' as $core;
|
||||||
|
|
||||||
|
import 'package:fixnum/fixnum.dart' as $fixnum;
|
||||||
|
import 'package:protobuf/protobuf.dart' as $pb;
|
||||||
|
|
||||||
|
class Model extends $pb.GeneratedMessage {
|
||||||
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Model', createEmptyInstance: create)
|
||||||
|
..aInt64(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'id')
|
||||||
|
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'action')
|
||||||
|
..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'content')
|
||||||
|
..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'sender')
|
||||||
|
..aOS(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'receiver')
|
||||||
|
..aOS(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'extra')
|
||||||
|
..aOS(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'title')
|
||||||
|
..aOS(8, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'format')
|
||||||
|
..aInt64(9, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'timestamp')
|
||||||
|
..hasRequiredFields = false
|
||||||
|
;
|
||||||
|
|
||||||
|
Model._() : super();
|
||||||
|
factory Model({
|
||||||
|
$fixnum.Int64? id,
|
||||||
|
$core.String? action,
|
||||||
|
$core.String? content,
|
||||||
|
$core.String? sender,
|
||||||
|
$core.String? receiver,
|
||||||
|
$core.String? extra,
|
||||||
|
$core.String? title,
|
||||||
|
$core.String? format,
|
||||||
|
$fixnum.Int64? timestamp,
|
||||||
|
}) {
|
||||||
|
final _result = create();
|
||||||
|
if (id != null) {
|
||||||
|
_result.id = id;
|
||||||
|
}
|
||||||
|
if (action != null) {
|
||||||
|
_result.action = action;
|
||||||
|
}
|
||||||
|
if (content != null) {
|
||||||
|
_result.content = content;
|
||||||
|
}
|
||||||
|
if (sender != null) {
|
||||||
|
_result.sender = sender;
|
||||||
|
}
|
||||||
|
if (receiver != null) {
|
||||||
|
_result.receiver = receiver;
|
||||||
|
}
|
||||||
|
if (extra != null) {
|
||||||
|
_result.extra = extra;
|
||||||
|
}
|
||||||
|
if (title != null) {
|
||||||
|
_result.title = title;
|
||||||
|
}
|
||||||
|
if (format != null) {
|
||||||
|
_result.format = format;
|
||||||
|
}
|
||||||
|
if (timestamp != null) {
|
||||||
|
_result.timestamp = timestamp;
|
||||||
|
}
|
||||||
|
return _result;
|
||||||
|
}
|
||||||
|
factory Model.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||||
|
factory Model.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||||
|
@$core.Deprecated(
|
||||||
|
'Using this can add significant overhead to your binary. '
|
||||||
|
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||||
|
'Will be removed in next major version')
|
||||||
|
Model clone() => Model()..mergeFromMessage(this);
|
||||||
|
@$core.Deprecated(
|
||||||
|
'Using this can add significant overhead to your binary. '
|
||||||
|
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||||
|
'Will be removed in next major version')
|
||||||
|
Model copyWith(void Function(Model) updates) => super.copyWith((message) => updates(message as Model)) as Model; // ignore: deprecated_member_use
|
||||||
|
$pb.BuilderInfo get info_ => _i;
|
||||||
|
@$core.pragma('dart2js:noInline')
|
||||||
|
static Model create() => Model._();
|
||||||
|
Model createEmptyInstance() => create();
|
||||||
|
static $pb.PbList<Model> createRepeated() => $pb.PbList<Model>();
|
||||||
|
@$core.pragma('dart2js:noInline')
|
||||||
|
static Model getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Model>(create);
|
||||||
|
static Model? _defaultInstance;
|
||||||
|
|
||||||
|
@$pb.TagNumber(1)
|
||||||
|
$fixnum.Int64 get id => $_getI64(0);
|
||||||
|
@$pb.TagNumber(1)
|
||||||
|
set id($fixnum.Int64 v) { $_setInt64(0, v); }
|
||||||
|
@$pb.TagNumber(1)
|
||||||
|
$core.bool hasId() => $_has(0);
|
||||||
|
@$pb.TagNumber(1)
|
||||||
|
void clearId() => clearField(1);
|
||||||
|
|
||||||
|
@$pb.TagNumber(2)
|
||||||
|
$core.String get action => $_getSZ(1);
|
||||||
|
@$pb.TagNumber(2)
|
||||||
|
set action($core.String v) { $_setString(1, v); }
|
||||||
|
@$pb.TagNumber(2)
|
||||||
|
$core.bool hasAction() => $_has(1);
|
||||||
|
@$pb.TagNumber(2)
|
||||||
|
void clearAction() => clearField(2);
|
||||||
|
|
||||||
|
@$pb.TagNumber(3)
|
||||||
|
$core.String get content => $_getSZ(2);
|
||||||
|
@$pb.TagNumber(3)
|
||||||
|
set content($core.String v) { $_setString(2, v); }
|
||||||
|
@$pb.TagNumber(3)
|
||||||
|
$core.bool hasContent() => $_has(2);
|
||||||
|
@$pb.TagNumber(3)
|
||||||
|
void clearContent() => clearField(3);
|
||||||
|
|
||||||
|
@$pb.TagNumber(4)
|
||||||
|
$core.String get sender => $_getSZ(3);
|
||||||
|
@$pb.TagNumber(4)
|
||||||
|
set sender($core.String v) { $_setString(3, v); }
|
||||||
|
@$pb.TagNumber(4)
|
||||||
|
$core.bool hasSender() => $_has(3);
|
||||||
|
@$pb.TagNumber(4)
|
||||||
|
void clearSender() => clearField(4);
|
||||||
|
|
||||||
|
@$pb.TagNumber(5)
|
||||||
|
$core.String get receiver => $_getSZ(4);
|
||||||
|
@$pb.TagNumber(5)
|
||||||
|
set receiver($core.String v) { $_setString(4, v); }
|
||||||
|
@$pb.TagNumber(5)
|
||||||
|
$core.bool hasReceiver() => $_has(4);
|
||||||
|
@$pb.TagNumber(5)
|
||||||
|
void clearReceiver() => clearField(5);
|
||||||
|
|
||||||
|
@$pb.TagNumber(6)
|
||||||
|
$core.String get extra => $_getSZ(5);
|
||||||
|
@$pb.TagNumber(6)
|
||||||
|
set extra($core.String v) { $_setString(5, v); }
|
||||||
|
@$pb.TagNumber(6)
|
||||||
|
$core.bool hasExtra() => $_has(5);
|
||||||
|
@$pb.TagNumber(6)
|
||||||
|
void clearExtra() => clearField(6);
|
||||||
|
|
||||||
|
@$pb.TagNumber(7)
|
||||||
|
$core.String get title => $_getSZ(6);
|
||||||
|
@$pb.TagNumber(7)
|
||||||
|
set title($core.String v) { $_setString(6, v); }
|
||||||
|
@$pb.TagNumber(7)
|
||||||
|
$core.bool hasTitle() => $_has(6);
|
||||||
|
@$pb.TagNumber(7)
|
||||||
|
void clearTitle() => clearField(7);
|
||||||
|
|
||||||
|
@$pb.TagNumber(8)
|
||||||
|
$core.String get format => $_getSZ(7);
|
||||||
|
@$pb.TagNumber(8)
|
||||||
|
set format($core.String v) { $_setString(7, v); }
|
||||||
|
@$pb.TagNumber(8)
|
||||||
|
$core.bool hasFormat() => $_has(7);
|
||||||
|
@$pb.TagNumber(8)
|
||||||
|
void clearFormat() => clearField(8);
|
||||||
|
|
||||||
|
@$pb.TagNumber(9)
|
||||||
|
$fixnum.Int64 get timestamp => $_getI64(8);
|
||||||
|
@$pb.TagNumber(9)
|
||||||
|
set timestamp($fixnum.Int64 v) { $_setInt64(8, v); }
|
||||||
|
@$pb.TagNumber(9)
|
||||||
|
$core.bool hasTimestamp() => $_has(8);
|
||||||
|
@$pb.TagNumber(9)
|
||||||
|
void clearTimestamp() => clearField(9);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,7 @@
|
|||||||
|
///
|
||||||
|
// Generated code. Do not modify.
|
||||||
|
// source: Message.proto
|
||||||
|
//
|
||||||
|
// @dart = 2.12
|
||||||
|
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields
|
||||||
|
|
28
cim-client-sdk/cim-flutter-sdk/protobuf/Message.pbjson.dart
Normal file
28
cim-client-sdk/cim-flutter-sdk/protobuf/Message.pbjson.dart
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
///
|
||||||
|
// Generated code. Do not modify.
|
||||||
|
// source: Message.proto
|
||||||
|
//
|
||||||
|
// @dart = 2.12
|
||||||
|
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package
|
||||||
|
|
||||||
|
import 'dart:core' as $core;
|
||||||
|
import 'dart:convert' as $convert;
|
||||||
|
import 'dart:typed_data' as $typed_data;
|
||||||
|
@$core.Deprecated('Use modelDescriptor instead')
|
||||||
|
const Model$json = const {
|
||||||
|
'1': 'Model',
|
||||||
|
'2': const [
|
||||||
|
const {'1': 'id', '3': 1, '4': 1, '5': 3, '10': 'id'},
|
||||||
|
const {'1': 'action', '3': 2, '4': 1, '5': 9, '10': 'action'},
|
||||||
|
const {'1': 'content', '3': 3, '4': 1, '5': 9, '10': 'content'},
|
||||||
|
const {'1': 'sender', '3': 4, '4': 1, '5': 9, '10': 'sender'},
|
||||||
|
const {'1': 'receiver', '3': 5, '4': 1, '5': 9, '10': 'receiver'},
|
||||||
|
const {'1': 'extra', '3': 6, '4': 1, '5': 9, '10': 'extra'},
|
||||||
|
const {'1': 'title', '3': 7, '4': 1, '5': 9, '10': 'title'},
|
||||||
|
const {'1': 'format', '3': 8, '4': 1, '5': 9, '10': 'format'},
|
||||||
|
const {'1': 'timestamp', '3': 9, '4': 1, '5': 3, '10': 'timestamp'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `Model`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List modelDescriptor = $convert.base64Decode('CgVNb2RlbBIOCgJpZBgBIAEoA1ICaWQSFgoGYWN0aW9uGAIgASgJUgZhY3Rpb24SGAoHY29udGVudBgDIAEoCVIHY29udGVudBIWCgZzZW5kZXIYBCABKAlSBnNlbmRlchIaCghyZWNlaXZlchgFIAEoCVIIcmVjZWl2ZXISFAoFZXh0cmEYBiABKAlSBWV4dHJhEhQKBXRpdGxlGAcgASgJUgV0aXRsZRIWCgZmb3JtYXQYCCABKAlSBmZvcm1hdBIcCgl0aW1lc3RhbXAYCSABKANSCXRpbWVzdGFtcA==');
|
@ -0,0 +1,9 @@
|
|||||||
|
///
|
||||||
|
// Generated code. Do not modify.
|
||||||
|
// source: Message.proto
|
||||||
|
//
|
||||||
|
// @dart = 2.12
|
||||||
|
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package
|
||||||
|
|
||||||
|
export 'Message.pb.dart';
|
||||||
|
|
13
cim-client-sdk/cim-flutter-sdk/protobuf/Message.proto
Normal file
13
cim-client-sdk/cim-flutter-sdk/protobuf/Message.proto
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
message Model {
|
||||||
|
int64 id = 1;
|
||||||
|
string action = 2;
|
||||||
|
string content = 3;
|
||||||
|
string sender = 4;
|
||||||
|
string receiver = 5;
|
||||||
|
string extra = 6;
|
||||||
|
string title = 7;
|
||||||
|
string format = 8;
|
||||||
|
int64 timestamp = 9;
|
||||||
|
}
|
||||||
|
|
109
cim-client-sdk/cim-flutter-sdk/protobuf/ReplyBody.pb.dart
Normal file
109
cim-client-sdk/cim-flutter-sdk/protobuf/ReplyBody.pb.dart
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
///
|
||||||
|
// Generated code. Do not modify.
|
||||||
|
// source: ReplyBody.proto
|
||||||
|
//
|
||||||
|
// @dart = 2.12
|
||||||
|
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields
|
||||||
|
|
||||||
|
import 'dart:core' as $core;
|
||||||
|
|
||||||
|
import 'package:fixnum/fixnum.dart' as $fixnum;
|
||||||
|
import 'package:protobuf/protobuf.dart' as $pb;
|
||||||
|
|
||||||
|
class Model extends $pb.GeneratedMessage {
|
||||||
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Model', createEmptyInstance: create)
|
||||||
|
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'key')
|
||||||
|
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'code')
|
||||||
|
..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'message')
|
||||||
|
..aInt64(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'timestamp')
|
||||||
|
..m<$core.String, $core.String>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'data', entryClassName: 'Model.DataEntry', keyFieldType: $pb.PbFieldType.OS, valueFieldType: $pb.PbFieldType.OS)
|
||||||
|
..hasRequiredFields = false
|
||||||
|
;
|
||||||
|
|
||||||
|
Model._() : super();
|
||||||
|
factory Model({
|
||||||
|
$core.String? key,
|
||||||
|
$core.String? code,
|
||||||
|
$core.String? message,
|
||||||
|
$fixnum.Int64? timestamp,
|
||||||
|
$core.Map<$core.String, $core.String>? data,
|
||||||
|
}) {
|
||||||
|
final _result = create();
|
||||||
|
if (key != null) {
|
||||||
|
_result.key = key;
|
||||||
|
}
|
||||||
|
if (code != null) {
|
||||||
|
_result.code = code;
|
||||||
|
}
|
||||||
|
if (message != null) {
|
||||||
|
_result.message = message;
|
||||||
|
}
|
||||||
|
if (timestamp != null) {
|
||||||
|
_result.timestamp = timestamp;
|
||||||
|
}
|
||||||
|
if (data != null) {
|
||||||
|
_result.data.addAll(data);
|
||||||
|
}
|
||||||
|
return _result;
|
||||||
|
}
|
||||||
|
factory Model.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||||
|
factory Model.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||||
|
@$core.Deprecated(
|
||||||
|
'Using this can add significant overhead to your binary. '
|
||||||
|
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||||
|
'Will be removed in next major version')
|
||||||
|
Model clone() => Model()..mergeFromMessage(this);
|
||||||
|
@$core.Deprecated(
|
||||||
|
'Using this can add significant overhead to your binary. '
|
||||||
|
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||||
|
'Will be removed in next major version')
|
||||||
|
Model copyWith(void Function(Model) updates) => super.copyWith((message) => updates(message as Model)) as Model; // ignore: deprecated_member_use
|
||||||
|
$pb.BuilderInfo get info_ => _i;
|
||||||
|
@$core.pragma('dart2js:noInline')
|
||||||
|
static Model create() => Model._();
|
||||||
|
Model createEmptyInstance() => create();
|
||||||
|
static $pb.PbList<Model> createRepeated() => $pb.PbList<Model>();
|
||||||
|
@$core.pragma('dart2js:noInline')
|
||||||
|
static Model getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Model>(create);
|
||||||
|
static Model? _defaultInstance;
|
||||||
|
|
||||||
|
@$pb.TagNumber(1)
|
||||||
|
$core.String get key => $_getSZ(0);
|
||||||
|
@$pb.TagNumber(1)
|
||||||
|
set key($core.String v) { $_setString(0, v); }
|
||||||
|
@$pb.TagNumber(1)
|
||||||
|
$core.bool hasKey() => $_has(0);
|
||||||
|
@$pb.TagNumber(1)
|
||||||
|
void clearKey() => clearField(1);
|
||||||
|
|
||||||
|
@$pb.TagNumber(2)
|
||||||
|
$core.String get code => $_getSZ(1);
|
||||||
|
@$pb.TagNumber(2)
|
||||||
|
set code($core.String v) { $_setString(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);
|
||||||
|
|
||||||
|
@$pb.TagNumber(4)
|
||||||
|
$fixnum.Int64 get timestamp => $_getI64(3);
|
||||||
|
@$pb.TagNumber(4)
|
||||||
|
set timestamp($fixnum.Int64 v) { $_setInt64(3, v); }
|
||||||
|
@$pb.TagNumber(4)
|
||||||
|
$core.bool hasTimestamp() => $_has(3);
|
||||||
|
@$pb.TagNumber(4)
|
||||||
|
void clearTimestamp() => clearField(4);
|
||||||
|
|
||||||
|
@$pb.TagNumber(5)
|
||||||
|
$core.Map<$core.String, $core.String> get data => $_getMap(4);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,7 @@
|
|||||||
|
///
|
||||||
|
// Generated code. Do not modify.
|
||||||
|
// source: ReplyBody.proto
|
||||||
|
//
|
||||||
|
// @dart = 2.12
|
||||||
|
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields
|
||||||
|
|
@ -0,0 +1,35 @@
|
|||||||
|
///
|
||||||
|
// Generated code. Do not modify.
|
||||||
|
// source: ReplyBody.proto
|
||||||
|
//
|
||||||
|
// @dart = 2.12
|
||||||
|
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package
|
||||||
|
|
||||||
|
import 'dart:core' as $core;
|
||||||
|
import 'dart:convert' as $convert;
|
||||||
|
import 'dart:typed_data' as $typed_data;
|
||||||
|
@$core.Deprecated('Use modelDescriptor instead')
|
||||||
|
const Model$json = const {
|
||||||
|
'1': 'Model',
|
||||||
|
'2': const [
|
||||||
|
const {'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'},
|
||||||
|
const {'1': 'code', '3': 2, '4': 1, '5': 9, '10': 'code'},
|
||||||
|
const {'1': 'message', '3': 3, '4': 1, '5': 9, '10': 'message'},
|
||||||
|
const {'1': 'timestamp', '3': 4, '4': 1, '5': 3, '10': 'timestamp'},
|
||||||
|
const {'1': 'data', '3': 5, '4': 3, '5': 11, '6': '.Model.DataEntry', '10': 'data'},
|
||||||
|
],
|
||||||
|
'3': const [Model_DataEntry$json],
|
||||||
|
};
|
||||||
|
|
||||||
|
@$core.Deprecated('Use modelDescriptor instead')
|
||||||
|
const Model_DataEntry$json = const {
|
||||||
|
'1': 'DataEntry',
|
||||||
|
'2': const [
|
||||||
|
const {'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'},
|
||||||
|
const {'1': 'value', '3': 2, '4': 1, '5': 9, '10': 'value'},
|
||||||
|
],
|
||||||
|
'7': const {'7': true},
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `Model`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List modelDescriptor = $convert.base64Decode('CgVNb2RlbBIQCgNrZXkYASABKAlSA2tleRISCgRjb2RlGAIgASgJUgRjb2RlEhgKB21lc3NhZ2UYAyABKAlSB21lc3NhZ2USHAoJdGltZXN0YW1wGAQgASgDUgl0aW1lc3RhbXASJAoEZGF0YRgFIAMoCzIQLk1vZGVsLkRhdGFFbnRyeVIEZGF0YRo3CglEYXRhRW50cnkSEAoDa2V5GAEgASgJUgNrZXkSFAoFdmFsdWUYAiABKAlSBXZhbHVlOgI4AQ==');
|
@ -0,0 +1,9 @@
|
|||||||
|
///
|
||||||
|
// Generated code. Do not modify.
|
||||||
|
// source: ReplyBody.proto
|
||||||
|
//
|
||||||
|
// @dart = 2.12
|
||||||
|
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package
|
||||||
|
|
||||||
|
export 'ReplyBody.pb.dart';
|
||||||
|
|
10
cim-client-sdk/cim-flutter-sdk/protobuf/ReplyBody.proto
Normal file
10
cim-client-sdk/cim-flutter-sdk/protobuf/ReplyBody.proto
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
message Model {
|
||||||
|
string key = 1;
|
||||||
|
string code = 2;
|
||||||
|
string message = 3;
|
||||||
|
int64 timestamp =4;
|
||||||
|
map<string,string> data =5;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
81
cim-client-sdk/cim-flutter-sdk/protobuf/SentBody.pb.dart
Normal file
81
cim-client-sdk/cim-flutter-sdk/protobuf/SentBody.pb.dart
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
///
|
||||||
|
// Generated code. Do not modify.
|
||||||
|
// source: SentBody.proto
|
||||||
|
//
|
||||||
|
// @dart = 2.12
|
||||||
|
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields
|
||||||
|
|
||||||
|
import 'dart:core' as $core;
|
||||||
|
|
||||||
|
import 'package:fixnum/fixnum.dart' as $fixnum;
|
||||||
|
import 'package:protobuf/protobuf.dart' as $pb;
|
||||||
|
|
||||||
|
class Model extends $pb.GeneratedMessage {
|
||||||
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Model', createEmptyInstance: create)
|
||||||
|
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'key')
|
||||||
|
..aInt64(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'timestamp')
|
||||||
|
..m<$core.String, $core.String>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'data', entryClassName: 'Model.DataEntry', keyFieldType: $pb.PbFieldType.OS, valueFieldType: $pb.PbFieldType.OS)
|
||||||
|
..hasRequiredFields = false
|
||||||
|
;
|
||||||
|
|
||||||
|
Model._() : super();
|
||||||
|
factory Model({
|
||||||
|
$core.String? key,
|
||||||
|
$fixnum.Int64? timestamp,
|
||||||
|
$core.Map<$core.String, $core.String>? data,
|
||||||
|
}) {
|
||||||
|
final _result = create();
|
||||||
|
if (key != null) {
|
||||||
|
_result.key = key;
|
||||||
|
}
|
||||||
|
if (timestamp != null) {
|
||||||
|
_result.timestamp = timestamp;
|
||||||
|
}
|
||||||
|
if (data != null) {
|
||||||
|
_result.data.addAll(data);
|
||||||
|
}
|
||||||
|
return _result;
|
||||||
|
}
|
||||||
|
factory Model.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||||
|
factory Model.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||||
|
@$core.Deprecated(
|
||||||
|
'Using this can add significant overhead to your binary. '
|
||||||
|
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||||
|
'Will be removed in next major version')
|
||||||
|
Model clone() => Model()..mergeFromMessage(this);
|
||||||
|
@$core.Deprecated(
|
||||||
|
'Using this can add significant overhead to your binary. '
|
||||||
|
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||||
|
'Will be removed in next major version')
|
||||||
|
Model copyWith(void Function(Model) updates) => super.copyWith((message) => updates(message as Model)) as Model; // ignore: deprecated_member_use
|
||||||
|
$pb.BuilderInfo get info_ => _i;
|
||||||
|
@$core.pragma('dart2js:noInline')
|
||||||
|
static Model create() => Model._();
|
||||||
|
Model createEmptyInstance() => create();
|
||||||
|
static $pb.PbList<Model> createRepeated() => $pb.PbList<Model>();
|
||||||
|
@$core.pragma('dart2js:noInline')
|
||||||
|
static Model getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Model>(create);
|
||||||
|
static Model? _defaultInstance;
|
||||||
|
|
||||||
|
@$pb.TagNumber(1)
|
||||||
|
$core.String get key => $_getSZ(0);
|
||||||
|
@$pb.TagNumber(1)
|
||||||
|
set key($core.String v) { $_setString(0, v); }
|
||||||
|
@$pb.TagNumber(1)
|
||||||
|
$core.bool hasKey() => $_has(0);
|
||||||
|
@$pb.TagNumber(1)
|
||||||
|
void clearKey() => clearField(1);
|
||||||
|
|
||||||
|
@$pb.TagNumber(2)
|
||||||
|
$fixnum.Int64 get timestamp => $_getI64(1);
|
||||||
|
@$pb.TagNumber(2)
|
||||||
|
set timestamp($fixnum.Int64 v) { $_setInt64(1, v); }
|
||||||
|
@$pb.TagNumber(2)
|
||||||
|
$core.bool hasTimestamp() => $_has(1);
|
||||||
|
@$pb.TagNumber(2)
|
||||||
|
void clearTimestamp() => clearField(2);
|
||||||
|
|
||||||
|
@$pb.TagNumber(3)
|
||||||
|
$core.Map<$core.String, $core.String> get data => $_getMap(2);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,7 @@
|
|||||||
|
///
|
||||||
|
// Generated code. Do not modify.
|
||||||
|
// source: SentBody.proto
|
||||||
|
//
|
||||||
|
// @dart = 2.12
|
||||||
|
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields
|
||||||
|
|
33
cim-client-sdk/cim-flutter-sdk/protobuf/SentBody.pbjson.dart
Normal file
33
cim-client-sdk/cim-flutter-sdk/protobuf/SentBody.pbjson.dart
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
///
|
||||||
|
// Generated code. Do not modify.
|
||||||
|
// source: SentBody.proto
|
||||||
|
//
|
||||||
|
// @dart = 2.12
|
||||||
|
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package
|
||||||
|
|
||||||
|
import 'dart:core' as $core;
|
||||||
|
import 'dart:convert' as $convert;
|
||||||
|
import 'dart:typed_data' as $typed_data;
|
||||||
|
@$core.Deprecated('Use modelDescriptor instead')
|
||||||
|
const Model$json = const {
|
||||||
|
'1': 'Model',
|
||||||
|
'2': const [
|
||||||
|
const {'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'},
|
||||||
|
const {'1': 'timestamp', '3': 2, '4': 1, '5': 3, '10': 'timestamp'},
|
||||||
|
const {'1': 'data', '3': 3, '4': 3, '5': 11, '6': '.Model.DataEntry', '10': 'data'},
|
||||||
|
],
|
||||||
|
'3': const [Model_DataEntry$json],
|
||||||
|
};
|
||||||
|
|
||||||
|
@$core.Deprecated('Use modelDescriptor instead')
|
||||||
|
const Model_DataEntry$json = const {
|
||||||
|
'1': 'DataEntry',
|
||||||
|
'2': const [
|
||||||
|
const {'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'},
|
||||||
|
const {'1': 'value', '3': 2, '4': 1, '5': 9, '10': 'value'},
|
||||||
|
],
|
||||||
|
'7': const {'7': true},
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `Model`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List modelDescriptor = $convert.base64Decode('CgVNb2RlbBIQCgNrZXkYASABKAlSA2tleRIcCgl0aW1lc3RhbXAYAiABKANSCXRpbWVzdGFtcBIkCgRkYXRhGAMgAygLMhAuTW9kZWwuRGF0YUVudHJ5UgRkYXRhGjcKCURhdGFFbnRyeRIQCgNrZXkYASABKAlSA2tleRIUCgV2YWx1ZRgCIAEoCVIFdmFsdWU6AjgB');
|
@ -0,0 +1,9 @@
|
|||||||
|
///
|
||||||
|
// Generated code. Do not modify.
|
||||||
|
// source: SentBody.proto
|
||||||
|
//
|
||||||
|
// @dart = 2.12
|
||||||
|
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package
|
||||||
|
|
||||||
|
export 'SentBody.pb.dart';
|
||||||
|
|
8
cim-client-sdk/cim-flutter-sdk/protobuf/SentBody.proto
Normal file
8
cim-client-sdk/cim-flutter-sdk/protobuf/SentBody.proto
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
message Model {
|
||||||
|
string key = 1;
|
||||||
|
int64 timestamp =2;
|
||||||
|
map<string,string> data =3;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user