diff --git a/go.mod b/go.mod index 21b814c..6929e01 100644 --- a/go.mod +++ b/go.mod @@ -3,3 +3,5 @@ module e.coding.net/rta/public/saasapi go 1.23.4 require google.golang.org/protobuf v1.36.5 + +require github.com/google/go-cmp v0.6.0 // indirect diff --git a/go.sum b/go.sum index 980e15b..b84e442 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,4 @@ -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= diff --git a/proto/saascmd/cmd.pb.go b/proto/saascmd/cmd.pb.go new file mode 100644 index 0000000..37be98d --- /dev/null +++ b/proto/saascmd/cmd.pb.go @@ -0,0 +1,527 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v4.24.4 +// source: cmd.proto + +package saascmd + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// UserIdType 用户 ID 类型 +type UserIdType int32 + +const ( + UserIdType_DeviceId UserIdType = 0 // 设备号 + UserIdType_OpenId UserIdType = 1 // OpenId +) + +// Enum value maps for UserIdType. +var ( + UserIdType_name = map[int32]string{ + 0: "DeviceId", + 1: "OpenId", + } + UserIdType_value = map[string]int32{ + "DeviceId": 0, + "OpenId": 1, + } +) + +func (x UserIdType) Enum() *UserIdType { + p := new(UserIdType) + *p = x + return p +} + +func (x UserIdType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (UserIdType) Descriptor() protoreflect.EnumDescriptor { + return file_cmd_proto_enumTypes[0].Descriptor() +} + +func (UserIdType) Type() protoreflect.EnumType { + return &file_cmd_proto_enumTypes[0] +} + +func (x UserIdType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use UserIdType.Descriptor instead. +func (UserIdType) EnumDescriptor() ([]byte, []int) { + return file_cmd_proto_rawDescGZIP(), []int{0} +} + +// Cmds 批量命令 +type Cmds struct { + state protoimpl.MessageState `protogen:"open.v1"` + UseridType UserIdType `protobuf:"varint,1,opt,name=userid_type,json=useridType,proto3,enum=saascmd.UserIdType" json:"userid_type,omitempty"` // 用户ID类型 + Appid string `protobuf:"bytes,2,opt,name=appid,proto3" json:"appid,omitempty"` // 小程序/小游戏/公众号/视频号的appid + Cmd []*Cmd `protobuf:"bytes,3,rep,name=cmd,proto3" json:"cmd,omitempty"` // 批量写入命令 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Cmds) Reset() { + *x = Cmds{} + mi := &file_cmd_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Cmds) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Cmds) ProtoMessage() {} + +func (x *Cmds) ProtoReflect() protoreflect.Message { + mi := &file_cmd_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Cmds.ProtoReflect.Descriptor instead. +func (*Cmds) Descriptor() ([]byte, []int) { + return file_cmd_proto_rawDescGZIP(), []int{0} +} + +func (x *Cmds) GetUseridType() UserIdType { + if x != nil { + return x.UseridType + } + return UserIdType_DeviceId +} + +func (x *Cmds) GetAppid() string { + if x != nil { + return x.Appid + } + return "" +} + +func (x *Cmds) GetCmd() []*Cmd { + if x != nil { + return x.Cmd + } + return nil +} + +// Cmd 上传命令 +type Cmd struct { + state protoimpl.MessageState `protogen:"open.v1"` + Userid string `protobuf:"bytes,1,opt,name=userid,proto3" json:"userid,omitempty"` // 用户ID + WriteBytes *WriteBytes `protobuf:"bytes,2,opt,name=write_bytes,json=writeBytes,proto3" json:"write_bytes,omitempty"` // byte区域 + WriteUint32S *WriteUint32S `protobuf:"bytes,3,opt,name=write_uint32s,json=writeUint32s,proto3" json:"write_uint32s,omitempty"` // uint32区域 + WriteFlagsWithExpire *WriteFlagsWithExpire `protobuf:"bytes,4,opt,name=write_flags_with_expire,json=writeFlagsWithExpire,proto3" json:"write_flags_with_expire,omitempty"` // 标志位区域 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Cmd) Reset() { + *x = Cmd{} + mi := &file_cmd_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Cmd) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Cmd) ProtoMessage() {} + +func (x *Cmd) ProtoReflect() protoreflect.Message { + mi := &file_cmd_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Cmd.ProtoReflect.Descriptor instead. +func (*Cmd) Descriptor() ([]byte, []int) { + return file_cmd_proto_rawDescGZIP(), []int{1} +} + +func (x *Cmd) GetUserid() string { + if x != nil { + return x.Userid + } + return "" +} + +func (x *Cmd) GetWriteBytes() *WriteBytes { + if x != nil { + return x.WriteBytes + } + return nil +} + +func (x *Cmd) GetWriteUint32S() *WriteUint32S { + if x != nil { + return x.WriteUint32S + } + return nil +} + +func (x *Cmd) GetWriteFlagsWithExpire() *WriteFlagsWithExpire { + if x != nil { + return x.WriteFlagsWithExpire + } + return nil +} + +// WriteBytes 写入byte +type WriteBytes struct { + state protoimpl.MessageState `protogen:"open.v1"` + WriteBytes []byte `protobuf:"bytes,1,opt,name=write_bytes,json=writeBytes,proto3" json:"write_bytes,omitempty"` // 写入的byte + WriteIndex_1 uint64 `protobuf:"varint,2,opt,name=write_index_1,json=writeIndex1,proto3" json:"write_index_1,omitempty"` // 写入byte的索引值(0..63) + WriteIndex_2 uint64 `protobuf:"varint,3,opt,name=write_index_2,json=writeIndex2,proto3" json:"write_index_2,omitempty"` // 写入byte的索引值(64..127) + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *WriteBytes) Reset() { + *x = WriteBytes{} + mi := &file_cmd_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *WriteBytes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WriteBytes) ProtoMessage() {} + +func (x *WriteBytes) ProtoReflect() protoreflect.Message { + mi := &file_cmd_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WriteBytes.ProtoReflect.Descriptor instead. +func (*WriteBytes) Descriptor() ([]byte, []int) { + return file_cmd_proto_rawDescGZIP(), []int{2} +} + +func (x *WriteBytes) GetWriteBytes() []byte { + if x != nil { + return x.WriteBytes + } + return nil +} + +func (x *WriteBytes) GetWriteIndex_1() uint64 { + if x != nil { + return x.WriteIndex_1 + } + return 0 +} + +func (x *WriteBytes) GetWriteIndex_2() uint64 { + if x != nil { + return x.WriteIndex_2 + } + return 0 +} + +// WriteUint32s 写入uint32 +type WriteUint32S struct { + state protoimpl.MessageState `protogen:"open.v1"` + WriteUint32S []uint32 `protobuf:"varint,1,rep,packed,name=write_uint32s,json=writeUint32s,proto3" json:"write_uint32s,omitempty"` // 写入的uint32 + WriteIndex_1 uint64 `protobuf:"varint,2,opt,name=write_index_1,json=writeIndex1,proto3" json:"write_index_1,omitempty"` // 写入uint32的索引值(0..63) + WriteIndex_2 uint64 `protobuf:"varint,3,opt,name=write_index_2,json=writeIndex2,proto3" json:"write_index_2,omitempty"` // 写入uint32的索引值(64..127) + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *WriteUint32S) Reset() { + *x = WriteUint32S{} + mi := &file_cmd_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *WriteUint32S) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WriteUint32S) ProtoMessage() {} + +func (x *WriteUint32S) ProtoReflect() protoreflect.Message { + mi := &file_cmd_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WriteUint32S.ProtoReflect.Descriptor instead. +func (*WriteUint32S) Descriptor() ([]byte, []int) { + return file_cmd_proto_rawDescGZIP(), []int{3} +} + +func (x *WriteUint32S) GetWriteUint32S() []uint32 { + if x != nil { + return x.WriteUint32S + } + return nil +} + +func (x *WriteUint32S) GetWriteIndex_1() uint64 { + if x != nil { + return x.WriteIndex_1 + } + return 0 +} + +func (x *WriteUint32S) GetWriteIndex_2() uint64 { + if x != nil { + return x.WriteIndex_2 + } + return 0 +} + +// WriteFlagsWithExpire 写入标志位 +type WriteFlagsWithExpire struct { + state protoimpl.MessageState `protogen:"open.v1"` + WriteFlagsWithExpire []*FlagWithExpire `protobuf:"bytes,1,rep,name=write_flags_with_expire,json=writeFlagsWithExpire,proto3" json:"write_flags_with_expire,omitempty"` // 写入的标志位 + WriteIndex_1 uint64 `protobuf:"varint,2,opt,name=write_index_1,json=writeIndex1,proto3" json:"write_index_1,omitempty"` // 写入标志位的索引值 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *WriteFlagsWithExpire) Reset() { + *x = WriteFlagsWithExpire{} + mi := &file_cmd_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *WriteFlagsWithExpire) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WriteFlagsWithExpire) ProtoMessage() {} + +func (x *WriteFlagsWithExpire) ProtoReflect() protoreflect.Message { + mi := &file_cmd_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WriteFlagsWithExpire.ProtoReflect.Descriptor instead. +func (*WriteFlagsWithExpire) Descriptor() ([]byte, []int) { + return file_cmd_proto_rawDescGZIP(), []int{4} +} + +func (x *WriteFlagsWithExpire) GetWriteFlagsWithExpire() []*FlagWithExpire { + if x != nil { + return x.WriteFlagsWithExpire + } + return nil +} + +func (x *WriteFlagsWithExpire) GetWriteIndex_1() uint64 { + if x != nil { + return x.WriteIndex_1 + } + return 0 +} + +// FlagWithExpire 标志位 +type FlagWithExpire struct { + state protoimpl.MessageState `protogen:"open.v1"` + Flag bool `protobuf:"varint,1,opt,name=flag,proto3" json:"flag,omitempty"` // 标志位 + Expire uint32 `protobuf:"varint,2,opt,name=expire,proto3" json:"expire,omitempty"` // 过期时间 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FlagWithExpire) Reset() { + *x = FlagWithExpire{} + mi := &file_cmd_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FlagWithExpire) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FlagWithExpire) ProtoMessage() {} + +func (x *FlagWithExpire) ProtoReflect() protoreflect.Message { + mi := &file_cmd_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FlagWithExpire.ProtoReflect.Descriptor instead. +func (*FlagWithExpire) Descriptor() ([]byte, []int) { + return file_cmd_proto_rawDescGZIP(), []int{5} +} + +func (x *FlagWithExpire) GetFlag() bool { + if x != nil { + return x.Flag + } + return false +} + +func (x *FlagWithExpire) GetExpire() uint32 { + if x != nil { + return x.Expire + } + return 0 +} + +var File_cmd_proto protoreflect.FileDescriptor + +const file_cmd_proto_rawDesc = "" + + "\n" + + "\tcmd.proto\x12\asaascmd\"r\n" + + "\x04Cmds\x124\n" + + "\vuserid_type\x18\x01 \x01(\x0e2\x13.saascmd.UserIdTypeR\n" + + "useridType\x12\x14\n" + + "\x05appid\x18\x02 \x01(\tR\x05appid\x12\x1e\n" + + "\x03cmd\x18\x03 \x03(\v2\f.saascmd.CmdR\x03cmd\"\xe5\x01\n" + + "\x03Cmd\x12\x16\n" + + "\x06userid\x18\x01 \x01(\tR\x06userid\x124\n" + + "\vwrite_bytes\x18\x02 \x01(\v2\x13.saascmd.WriteBytesR\n" + + "writeBytes\x12:\n" + + "\rwrite_uint32s\x18\x03 \x01(\v2\x15.saascmd.WriteUint32sR\fwriteUint32s\x12T\n" + + "\x17write_flags_with_expire\x18\x04 \x01(\v2\x1d.saascmd.WriteFlagsWithExpireR\x14writeFlagsWithExpire\"u\n" + + "\n" + + "WriteBytes\x12\x1f\n" + + "\vwrite_bytes\x18\x01 \x01(\fR\n" + + "writeBytes\x12\"\n" + + "\rwrite_index_1\x18\x02 \x01(\x04R\vwriteIndex1\x12\"\n" + + "\rwrite_index_2\x18\x03 \x01(\x04R\vwriteIndex2\"{\n" + + "\fWriteUint32s\x12#\n" + + "\rwrite_uint32s\x18\x01 \x03(\rR\fwriteUint32s\x12\"\n" + + "\rwrite_index_1\x18\x02 \x01(\x04R\vwriteIndex1\x12\"\n" + + "\rwrite_index_2\x18\x03 \x01(\x04R\vwriteIndex2\"\x8a\x01\n" + + "\x14WriteFlagsWithExpire\x12N\n" + + "\x17write_flags_with_expire\x18\x01 \x03(\v2\x17.saascmd.FlagWithExpireR\x14writeFlagsWithExpire\x12\"\n" + + "\rwrite_index_1\x18\x02 \x01(\x04R\vwriteIndex1\"<\n" + + "\x0eFlagWithExpire\x12\x12\n" + + "\x04flag\x18\x01 \x01(\bR\x04flag\x12\x16\n" + + "\x06expire\x18\x02 \x01(\rR\x06expire*&\n" + + "\n" + + "UserIdType\x12\f\n" + + "\bDeviceId\x10\x00\x12\n" + + "\n" + + "\x06OpenId\x10\x01B\vZ\t./saascmdb\x06proto3" + +var ( + file_cmd_proto_rawDescOnce sync.Once + file_cmd_proto_rawDescData []byte +) + +func file_cmd_proto_rawDescGZIP() []byte { + file_cmd_proto_rawDescOnce.Do(func() { + file_cmd_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_cmd_proto_rawDesc), len(file_cmd_proto_rawDesc))) + }) + return file_cmd_proto_rawDescData +} + +var file_cmd_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_cmd_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_cmd_proto_goTypes = []any{ + (UserIdType)(0), // 0: saascmd.UserIdType + (*Cmds)(nil), // 1: saascmd.Cmds + (*Cmd)(nil), // 2: saascmd.Cmd + (*WriteBytes)(nil), // 3: saascmd.WriteBytes + (*WriteUint32S)(nil), // 4: saascmd.WriteUint32s + (*WriteFlagsWithExpire)(nil), // 5: saascmd.WriteFlagsWithExpire + (*FlagWithExpire)(nil), // 6: saascmd.FlagWithExpire +} +var file_cmd_proto_depIdxs = []int32{ + 0, // 0: saascmd.Cmds.userid_type:type_name -> saascmd.UserIdType + 2, // 1: saascmd.Cmds.cmd:type_name -> saascmd.Cmd + 3, // 2: saascmd.Cmd.write_bytes:type_name -> saascmd.WriteBytes + 4, // 3: saascmd.Cmd.write_uint32s:type_name -> saascmd.WriteUint32s + 5, // 4: saascmd.Cmd.write_flags_with_expire:type_name -> saascmd.WriteFlagsWithExpire + 6, // 5: saascmd.WriteFlagsWithExpire.write_flags_with_expire:type_name -> saascmd.FlagWithExpire + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_cmd_proto_init() } +func file_cmd_proto_init() { + if File_cmd_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_cmd_proto_rawDesc), len(file_cmd_proto_rawDesc)), + NumEnums: 1, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cmd_proto_goTypes, + DependencyIndexes: file_cmd_proto_depIdxs, + EnumInfos: file_cmd_proto_enumTypes, + MessageInfos: file_cmd_proto_msgTypes, + }.Build() + File_cmd_proto = out.File + file_cmd_proto_goTypes = nil + file_cmd_proto_depIdxs = nil +} diff --git a/proto/saascmd/cmd.proto b/proto/saascmd/cmd.proto new file mode 100644 index 0000000..0011d58 --- /dev/null +++ b/proto/saascmd/cmd.proto @@ -0,0 +1,100 @@ +syntax = "proto3"; + +package saascmd; + +option go_package = "./saascmd"; + +// Cmds 批量命令 +message Cmds { + UserIdType userid_type = 1; // 用户ID类型 + string appid = 2; // 小程序/小游戏/公众号/视频号的appid + repeated Cmd cmd = 3; // 批量写入命令 +} + +// Cmd 上传命令 +message Cmd { + string userid = 1; // 用户ID + WriteBytes write_bytes = 2; // byte区域 + WriteUint32s write_uint32s = 3; // uint32区域 + WriteFlagsWithExpire write_flags_with_expire = 4; // 标志位区域 +} + +// WriteBytes 写入byte +message WriteBytes { + bytes write_bytes = 1; // 写入的byte + uint64 write_index_1 = 2; // 写入byte的索引值(0..63) + uint64 write_index_2 = 3; // 写入byte的索引值(64..127) +} + +// WriteUint32s 写入uint32 +message WriteUint32s { + repeated uint32 write_uint32s = 1; // 写入的uint32 + uint64 write_index_1 = 2; // 写入uint32的索引值(0..63) + uint64 write_index_2 = 3; // 写入uint32的索引值(64..127) +} + +// WriteFlagsWithExpire 写入标志位 +message WriteFlagsWithExpire { + repeated FlagWithExpire write_flags_with_expire = 1; // 写入的标志位 + uint64 write_index_1 = 2; // 写入标志位的索引值 +} + +// FlagWithExpire 标志位 +message FlagWithExpire { + bool flag = 1; // 标志位 + uint32 expire = 2; // 过期时间 +} + +// UserIdType 用户 ID 类型 +enum UserIdType { + DeviceId = 0; // 设备号 + OpenId = 1; // OpenId +} + +/* +//肯德基 +Cmds { + userid_type = OpenId, + appid = "appid_kfc", + [cmd{ + userid = "kfc_openid", + write_bytes{ + write_bytes = [0x01, 0x01, 0x99], + write_index_1 = 0B1011, //写入byte 区域的 0,2,3位置 + write_index_2 = 0, + }, + write_uint32s{ + write_uint32s = [4, 5, 6], + write_index_1 = 0B0111, //写入uint32 区域的 0,1,2位置 + }, + write_flags_with_expire{ + write_flags_with_expire = [true, 1753165024], //置true,过期时间为 2025-07-22 14:17:04 + write_index_1 = 1<<6, //写入标志位 区域的 6 位置 + } + }] +} + + + +//必胜客 +Cmds { + userid_type = OpenId, + appid = "appid_pizza", + [Cmd{ + userid = "pizza_openid", + write_bytes{ + write_bytes = [0x01], + write_index_1 = 1 << 49, //写入byte 区域的 49位置 + write_index_2 = 0, + }, + write_uint32s{ + write_uint32s = [33], + write_index_1 = 1<< 10, //写入uint32 区域的 10位置 + }, + write_flags_with_expire{ + write_flags_with_expire = [true, 1753165024], //置true,过期时间为 2025-07-22 14:17:04 + write_index_1 = 1<< 2, //写入标志位 区域的 2位置 + } + }] +} +*/ \ No newline at end of file diff --git a/proto/saascmd/makeproto.sh b/proto/saascmd/makeproto.sh new file mode 100755 index 0000000..6fae893 --- /dev/null +++ b/proto/saascmd/makeproto.sh @@ -0,0 +1 @@ +protoc --proto_path=. *.proto --go_out=. --go_opt=paths=source_relative \ No newline at end of file diff --git a/proto/xcmd/makeproto.sh b/proto/xcmd/makeproto.sh deleted file mode 100755 index 5ed0e2b..0000000 --- a/proto/xcmd/makeproto.sh +++ /dev/null @@ -1 +0,0 @@ -protoc --proto_path=. *.proto --go_out=. --go-grpc_out=. --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative \ No newline at end of file diff --git a/proto/xcmd/upload.pb.go b/proto/xcmd/upload.pb.go deleted file mode 100644 index 6dfaac8..0000000 --- a/proto/xcmd/upload.pb.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.5 -// protoc v4.24.4 -// source: upload.proto - -package xcmd - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -var File_upload_proto protoreflect.FileDescriptor - -var file_upload_proto_rawDesc = string([]byte{ - 0x0a, 0x0c, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, - 0x78, 0x63, 0x6d, 0x64, 0x42, 0x08, 0x5a, 0x06, 0x2e, 0x2f, 0x78, 0x63, 0x6d, 0x64, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -}) - -var file_upload_proto_goTypes = []any{} -var file_upload_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_upload_proto_init() } -func file_upload_proto_init() { - if File_upload_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_upload_proto_rawDesc), len(file_upload_proto_rawDesc)), - NumEnums: 0, - NumMessages: 0, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_upload_proto_goTypes, - DependencyIndexes: file_upload_proto_depIdxs, - }.Build() - File_upload_proto = out.File - file_upload_proto_goTypes = nil - file_upload_proto_depIdxs = nil -} diff --git a/proto/xcmd/upload.proto b/proto/xcmd/upload.proto deleted file mode 100644 index a9aae23..0000000 --- a/proto/xcmd/upload.proto +++ /dev/null @@ -1,7 +0,0 @@ -syntax = "proto3"; - -package xcmd; - -option go_package = "./xcmd"; - - diff --git a/vendor/modules.txt b/vendor/modules.txt index 256a767..4340a2c 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,3 +1,5 @@ +# github.com/google/go-cmp v0.6.0 +## explicit; go 1.13 # google.golang.org/protobuf v1.36.5 ## explicit; go 1.21 google.golang.org/protobuf/encoding/prototext