diff --git a/README.md b/README.md index 2378e220..0e061367 100644 --- a/README.md +++ b/README.md @@ -67,3 +67,4 @@ qq-android协议的golang实现 移植于mirai - [x] 群成员禁言/解除禁言 - [x] T出群成员 - [x] 戳一戳群友 +- [x] 获取陌生人信息 diff --git a/binary/jce/structs.go b/binary/jce/structs.go index 280dc9f5..77905475 100644 --- a/binary/jce/structs.go +++ b/binary/jce/structs.go @@ -317,6 +317,27 @@ type ( Email string `jceId:"5"` Remark string `jceId:"6"` } + + SummaryCardReq struct { + IJceStruct + Uin int64 `jceId:"0"` + ComeFrom int32 `jceId:"1"` + QzoneFeedTimestamp int64 `jceId:"2"` + IsFriend byte `jceId:"3"` + GroupCode int64 `jceId:"4"` + GroupUin int64 `jceId:"5"` + //Seed []byte`jceId:"6"` + //SearchName string`jceId:"7"` + GetControl int64 `jceId:"8"` + AddFriendSource int32 `jceId:"9"` + SecureSig []byte `jceId:"10"` + TinyId int64 `jceId:"15"` + LikeSource int64 `jceId:"16"` + ReqMedalWallInfo byte `jceId:"18"` + Req0x5ebFieldId []int64 `jceId:"19"` + ReqNearbyGodInfo byte `jceId:"20"` + ReqExtendCard byte `jceId:"22"` + } ) func (pkt *RequestPacket) ToBytes() []byte { @@ -382,6 +403,12 @@ func (pkt *FriendListRequest) ToBytes() []byte { return w.Bytes() } +func (pkt *SummaryCardReq) ToBytes() []byte { + w := NewJceWriter() + w.WriteJceStructRaw(pkt) + return w.Bytes() +} + func (pkt *FriendInfo) ReadFrom(r *JceReader) { pkt.FriendUin = r.ReadInt64(0) pkt.GroupId = r.ReadByte(1) diff --git a/client/builders.go b/client/builders.go index 2cc3700a..7bad83b0 100644 --- a/client/builders.go +++ b/client/builders.go @@ -3,8 +3,11 @@ package client import ( "crypto/md5" "encoding/hex" + "fmt" + "github.com/Mrs4s/MiraiGo/client/pb/qweb" "math/rand" "strconv" + "time" "github.com/golang/protobuf/proto" @@ -251,6 +254,38 @@ func (c *QQClient) buildFriendGroupListRequestPacket(friendStartIndex, friendLis return seq, packet } +// SummaryCard.ReqSummaryCard +func (c *QQClient) buildSummaryCardRequestPacket(target int64) (uint16, []byte) { + seq := c.nextSeq() + req := &jce.SummaryCardReq{ + Uin: target, + ComeFrom: 31, + GetControl: 69181, + AddFriendSource: 3001, + SecureSig: []byte{0x00}, + ReqMedalWallInfo: 0, + Req0x5ebFieldId: []int64{27225, 27224, 42122, 42121, 27236, 27238, 42167, 42172, 40324, 42284, 42326, 42325, 42356, 42363, 42361, 42367, 42377, 42425}, + ReqNearbyGodInfo: 1, + ReqExtendCard: 1, + } + head := jce.NewJceWriter() + head.WriteInt32(2, 0) + buf := &jce.RequestDataVersion3{Map: map[string][]byte{ + "ReqHead": packRequestDataV3(head.Bytes()), + "ReqSummaryCard": packRequestDataV3(req.ToBytes()), + }} + pkt := &jce.RequestPacket{ + IVersion: 3, + SServantName: "SummaryCardServantObj", + SFuncName: "ReqSummaryCard", + SBuffer: buf.ToBytes(), + Context: make(map[string]string), + Status: make(map[string]string), + } + packet := packets.BuildUniPacket(c.Uin, seq, "SummaryCard.ReqSummaryCard", 1, c.OutGoingPacketSessionId, []byte{}, c.sigInfo.d2Key, pkt.ToBytes()) + return seq, packet +} + // friendlist.GetTroopListReqV2 func (c *QQClient) buildGroupListRequestPacket(vecCookie []byte) (uint16, []byte) { seq := c.nextSeq() @@ -312,6 +347,21 @@ func (c *QQClient) buildGroupMemberListRequestPacket(groupUin, groupCode, nextUi return seq, packet } +// group_member_card.get_group_member_card_info +func (c *QQClient) buildGroupMemberInfoRequestPacket(groupCode, uin int64) (uint16, []byte) { + seq := c.nextSeq() + req := &pb.GroupMemberReqBody{ + GroupCode: groupCode, + Uin: uin, + NewClient: true, + ClientType: 1, + RichCardNameVer: 1, + } + payload, _ := proto.Marshal(req) + packet := packets.BuildUniPacket(c.Uin, seq, "group_member_card.get_group_member_card_info", 1, c.OutGoingPacketSessionId, EmptyBytes, c.sigInfo.d2Key, payload) + return seq, packet +} + // MessageSvc.PbGetMsg func (c *QQClient) buildGetMessageRequestPacket(flag msg.SyncFlag, msgTime int64) (uint16, []byte) { seq := c.nextSeq() @@ -955,7 +1005,7 @@ func (c *QQClient) buildGroupAdminSetPacket(groupCode, member int64, flag bool) return seq, packet } -// OidbSvc.0x88d_7 +// OidbSvc.0x88d_0 func (c *QQClient) buildGroupInfoRequestPacket(groupCode int64) (uint16, []byte) { seq := c.nextSeq() body := &oidb.D88DReqBody{ @@ -1096,6 +1146,32 @@ func (c *QQClient) buildGroupFileDownloadReqPacket(groupCode int64, fileId strin return seq, packet } +// OidbSvc.0xe07_0 +func (c *QQClient) buildImageOcrRequestPacket(url, md5 string, size, weight, height int32) (uint16, []byte) { + seq := c.nextSeq() + body := &oidb.DE07ReqBody{ + Version: 1, + Entrance: 3, + OcrReqBody: &oidb.OCRReqBody{ + ImageUrl: url, + OriginMd5: md5, + AfterCompressMd5: md5, + AfterCompressFileSize: size, + AfterCompressWeight: weight, + AfterCompressHeight: height, + IsCut: false, + }, + } + b, _ := proto.Marshal(body) + req := &oidb.OIDBSSOPkg{ + Command: 3591, + Bodybuffer: b, + } + payload, _ := proto.Marshal(req) + packet := packets.BuildUniPacket(c.Uin, seq, "OidbSvc.0xe07_0", 1, c.OutGoingPacketSessionId, EmptyBytes, c.sigInfo.d2Key, payload) + return seq, packet +} + // PttCenterSvr.ShortVideoDownReq func (c *QQClient) buildPttShortVideoDownReqPacket(uuid, md5 []byte) (uint16, []byte) { seq := c.nextSeq() @@ -1120,3 +1196,23 @@ func (c *QQClient) buildPttShortVideoDownReqPacket(uuid, md5 []byte) (uint16, [] packet := packets.BuildUniPacket(c.Uin, seq, "PttCenterSvr.ShortVideoDownReq", 1, c.OutGoingPacketSessionId, EmptyBytes, c.sigInfo.d2Key, payload) return seq, packet } + +// LightAppSvc.mini_app_info.GetAppInfoById +func (c *QQClient) buildAppInfoRequestPacket(id string) (uint16, []byte) { + seq := c.nextSeq() + req := &qweb.GetAppInfoByIdReq{ + AppId: id, + NeedVersionInfo: 1, + } + b, _ := proto.Marshal(req) + body := &qweb.QWebReq{ + Seq: 1, + Qua: "V1_AND_SQ_8.4.8_1492_YYB_D", + DeviceInfo: fmt.Sprintf("i=865166025905020&imsi=460002478794049&mac=02:00:00:00:00:00&m=%v&o=7.1.2&a=25&sc=1&sd=0&p=900*1600&f=nubia&mm=3479&cf=2407&cc=4&aid=086bbf84a7d5fbb3&qimei=865166023450458&sharpP=1&n=wifi", string(SystemDeviceInfo.Model)), + BusiBuff: b, + TraceId: fmt.Sprintf("%v_%v_%v", c.Uin, time.Now().Format("0102150405"), rand.Int63()), + } + payload, _ := proto.Marshal(body) + packet := packets.BuildUniPacket(c.Uin, seq, "LightAppSvc.mini_app_info.GetAppInfoById", 1, c.OutGoingPacketSessionId, EmptyBytes, c.sigInfo.d2Key, payload) + return seq, packet +} diff --git a/client/client.go b/client/client.go index 48b1569a..d29e5de9 100644 --- a/client/client.go +++ b/client/client.go @@ -75,6 +75,7 @@ type QQClient struct { requestPacketRequestId int32 groupSeq int32 friendSeq int32 + heartbeatEnabled bool groupDataTransSeq int32 highwayApplyUpSeq int32 eventHandlers *eventHandlers @@ -117,30 +118,34 @@ func NewClientMd5(uin int64, passwordMd5 [16]byte) *QQClient { RandomKey: make([]byte, 16), OutGoingPacketSessionId: []byte{0x02, 0xB0, 0x5B, 0x8B}, decoders: map[string]func(*QQClient, uint16, []byte) (interface{}, error){ - "wtlogin.login": decodeLoginResponse, - "StatSvc.register": decodeClientRegisterResponse, - "StatSvc.ReqMSFOffline": decodeMSFOfflinePacket, - "MessageSvc.PushNotify": decodeSvcNotify, - "OnlinePush.PbPushGroupMsg": decodeGroupMessagePacket, - "OnlinePush.ReqPush": decodeOnlinePushReqPacket, - "OnlinePush.PbPushTransMsg": decodeOnlinePushTransPacket, - "ConfigPushSvc.PushReq": decodePushReqPacket, - "MessageSvc.PbGetMsg": decodeMessageSvcPacket, - "MessageSvc.PbSendMsg": decodeMsgSendResponse, - "MessageSvc.PushForceOffline": decodeForceOfflinePacket, - "friendlist.getFriendGroupList": decodeFriendGroupListResponse, - "friendlist.GetTroopListReqV2": decodeGroupListResponse, - "friendlist.GetTroopMemberListReq": decodeGroupMemberListResponse, - "ImgStore.GroupPicUp": decodeGroupImageStoreResponse, - "PttStore.GroupPttUp": decodeGroupPttStoreResponse, - "LongConn.OffPicUp": decodeOffPicUpResponse, - "ProfileService.Pb.ReqSystemMsgNew.Group": decodeSystemMsgGroupPacket, - "ProfileService.Pb.ReqSystemMsgNew.Friend": decodeSystemMsgFriendPacket, - "MultiMsg.ApplyUp": decodeMultiApplyUpResponse, - "MultiMsg.ApplyDown": decodeMultiApplyDownResponse, - "OidbSvc.0x6d6_2": decodeOIDB6d6Response, - "OidbSvc.0x88d_0": decodeGroupInfoResponse, - "PttCenterSvr.ShortVideoDownReq": decodePttShortVideoDownResponse, + "wtlogin.login": decodeLoginResponse, // 登录操作包 + "StatSvc.register": decodeClientRegisterResponse, // 客户端注册包 + "StatSvc.ReqMSFOffline": decodeMSFOfflinePacket, // 强制离线 + "MessageSvc.PushNotify": decodeSvcNotify, // 好友消息通知包 + "OnlinePush.PbPushGroupMsg": decodeGroupMessagePacket, // 群消息通知包 + "OnlinePush.ReqPush": decodeOnlinePushReqPacket, // 群组相关事件包 + "OnlinePush.PbPushTransMsg": decodeOnlinePushTransPacket, // QQ相关事件包 + "ConfigPushSvc.PushReq": decodePushReqPacket, // 配置文件推送包 + "MessageSvc.PbGetMsg": decodeMessageSvcPacket, // 除群组以外消息拉取包 + "MessageSvc.PbSendMsg": decodeMsgSendResponse, // 消息发送包 + "MessageSvc.PushForceOffline": decodeForceOfflinePacket, // 强制离线 + "friendlist.getFriendGroupList": decodeFriendGroupListResponse, // 获取好友列表包 + "friendlist.GetTroopListReqV2": decodeGroupListResponse, // 获取群组列表包 + "friendlist.GetTroopMemberListReq": decodeGroupMemberListResponse, // 获取群成员列表包 + "group_member_card.get_group_member_card_info": decodeGroupMemberInfoResponse, // 获取群成员资料包 + "ImgStore.GroupPicUp": decodeGroupImageStoreResponse, // 请求群组图片上传包 + "PttStore.GroupPttUp": decodeGroupPttStoreResponse, // 请求群组语音上传包 + "LongConn.OffPicUp": decodeOffPicUpResponse, // 查询好友图片包 + "ProfileService.Pb.ReqSystemMsgNew.Group": decodeSystemMsgGroupPacket, // 获取群组成员变动事件包 + "ProfileService.Pb.ReqSystemMsgNew.Friend": decodeSystemMsgFriendPacket, // 获取好友变动事件包 + "MultiMsg.ApplyUp": decodeMultiApplyUpResponse, // 长消息/合并转发请求上传包 + "MultiMsg.ApplyDown": decodeMultiApplyDownResponse, // 长消息/合并转发请求下载包 + "OidbSvc.0x6d6_2": decodeOIDB6d6Response, // 群文件操作包 + "OidbSvc.0x88d_0": decodeGroupInfoResponse, // 获取群资料包 + "OidbSvc.0xe07_0": decodeImageOcrResponse, // 图片OCR请求包 + "SummaryCard.ReqSummaryCard": decodeSummaryCardResponse, // 获取用户卡片资料包 + "PttCenterSvr.ShortVideoDownReq": decodePttShortVideoDownResponse, // 短视频下载请求包 + "LightAppSvc.mini_app_info.GetAppInfoById": decodeAppInfoResponse, // 获取小程序资料包 }, sigInfo: &loginSigInfo{}, requestPacketRequestId: 1921334513, @@ -193,7 +198,9 @@ func (c *QQClient) Login() (*LoginResponse, error) { if l.Success { c.lastLostMsg = "" c.registerClient() - c.startHeartbeat() + if !c.heartbeatEnabled { + c.startHeartbeat() + } } return &l, nil } @@ -246,6 +253,14 @@ func (c *QQClient) GetGroupHonorInfo(groupCode int64, honorType HonorType) (*Gro return &ret, nil } +func (c *QQClient) GetSummaryInfo(target int64) (*SummaryCardInfo, error) { + rsp, err := c.sendAndWait(c.buildSummaryCardRequestPacket(target)) + if err != nil { + return nil, err + } + return rsp.(*SummaryCardInfo), nil +} + // SubmitCaptcha send captcha to server func (c *QQClient) SubmitCaptcha(result string, sign []byte) (*LoginResponse, error) { seq, packet := c.buildCaptchaPacket(result, sign) @@ -256,7 +271,9 @@ func (c *QQClient) SubmitCaptcha(result string, sign []byte) (*LoginResponse, er l := rsp.(LoginResponse) if l.Success { c.registerClient() - c.startHeartbeat() + if !c.heartbeatEnabled { + c.startHeartbeat() + } } return &l, nil } @@ -583,7 +600,7 @@ func (c *QQClient) UploadGroupImage(groupCode int64, img []byte) (*message.Group } return nil, errors.New("upload failed") ok: - return message.NewGroupImage(binary.CalculateImageResourceId(h[:]), h[:], rsp.FileId), nil + return message.NewGroupImage(binary.CalculateImageResourceId(h[:]), h[:], rsp.FileId, int32(len(img)), rsp.Width, rsp.Height), nil } func (c *QQClient) UploadPrivateImage(target int64, img []byte) (*message.FriendImageElement, error) { @@ -608,6 +625,24 @@ func (c *QQClient) uploadPrivateImage(target int64, img []byte, count int) (*mes return e, nil } +func (c *QQClient) ImageOcr(img interface{}) (*OcrResponse, error) { + switch e := img.(type) { + case *message.GroupImageElement: + rsp, err := c.sendAndWait(c.buildImageOcrRequestPacket(e.Url, strings.ToUpper(hex.EncodeToString(e.Md5)), e.Size, e.Width, e.Height)) + if err != nil { + return nil, err + } + return rsp.(*OcrResponse), nil + case *message.ImageElement: + rsp, err := c.sendAndWait(c.buildImageOcrRequestPacket(e.Url, strings.ToUpper(hex.EncodeToString(e.Md5)), e.Size, e.Width, e.Height)) + if err != nil { + return nil, err + } + return rsp.(*OcrResponse), nil + } + return nil, errors.New("image error") +} + func (c *QQClient) UploadGroupPtt(groupCode int64, voice []byte) (*message.GroupVoiceElement, error) { h := md5.Sum(voice) seq, pkt := c.buildGroupPttStorePacket(groupCode, h[:], int32(len(voice)), 0, int32(len(voice))) @@ -654,7 +689,7 @@ func (c *QQClient) QueryGroupImage(groupCode int64, hash []byte, size int32) (*m return nil, errors.New(rsp.Message) } if rsp.IsExists { - return message.NewGroupImage(binary.CalculateImageResourceId(hash), hash, rsp.FileId), nil + return message.NewGroupImage(binary.CalculateImageResourceId(hash), hash, rsp.FileId, size, rsp.Width, rsp.Height), nil } return nil, errors.New("image not exists") } @@ -831,6 +866,14 @@ func (c *QQClient) getCSRFToken() int { return 2147483647 & accu } +func (c *QQClient) getMemberInfo(groupCode, memberUin int64) (*GroupMemberInfo, error) { + info, err := c.sendAndWait(c.buildGroupMemberInfoRequestPacket(groupCode, memberUin)) + if err != nil { + return nil, err + } + return info.(*GroupMemberInfo), nil +} + func (c *QQClient) editMemberCard(groupCode, memberUin int64, card string) { _, _ = c.sendAndWait(c.buildEditGroupTagPacket(groupCode, memberUin, card)) } @@ -885,7 +928,7 @@ func (c *QQClient) connect() error { if c.currServerIndex == len(c.servers) { c.currServerIndex = 0 } - if err != nil { + if err != nil || conn == nil { c.retryTimes++ if c.retryTimes > len(c.servers) { return errors.New("network error") @@ -894,6 +937,7 @@ func (c *QQClient) connect() error { if err = c.connect(); err != nil { return err } + return nil } c.retryTimes = 0 c.ConnectTime = time.Now() @@ -965,12 +1009,11 @@ func (c *QQClient) sendAndWait(seq uint16, pkt []byte) (interface{}, error) { case <-time.After(time.Second * 30): retry++ if retry < 2 { - c.Error("packet %v timed out. retry.", seq) _ = c.send(pkt) continue } c.handlers.Delete(seq) - c.Error("packet timed out, seq: %v", seq) + //c.Error("packet timed out, seq: %v", seq) //println("Packet Timed out") return nil, errors.New("timeout") } @@ -1033,7 +1076,7 @@ func (c *QQClient) netLoop() { } rsp, err := decoder(c, pkt.SequenceId, payload) if err != nil { - c.Error("decode pkt %v error: %v", pkt.CommandName, err) + //c.Error("decode pkt %v error: %v", pkt.CommandName, err) //log.Println("decode", pkt.CommandName, "error:", err) } if f, ok := c.handlers.Load(pkt.SequenceId); ok { @@ -1051,6 +1094,7 @@ func (c *QQClient) netLoop() { } func (c *QQClient) startHeartbeat() { + c.heartbeatEnabled = true time.AfterFunc(30*time.Second, c.doHeartbeat) } @@ -1059,7 +1103,11 @@ func (c *QQClient) doHeartbeat() { seq := c.nextSeq() sso := packets.BuildSsoPacket(seq, uint32(SystemDeviceInfo.Protocol), "Heartbeat.Alive", SystemDeviceInfo.IMEI, []byte{}, c.OutGoingPacketSessionId, []byte{}, c.ksid) packet := packets.BuildLoginPacket(c.Uin, 0, []byte{}, sso, []byte{}) - _, _ = c.sendAndWait(seq, packet) + _, err := c.sendAndWait(seq, packet) + if err != nil { + _ = c.Conn.Close() + } time.AfterFunc(30*time.Second, c.doHeartbeat) } + c.heartbeatEnabled = false } diff --git a/client/decoders.go b/client/decoders.go index 6d5d569a..3458c177 100644 --- a/client/decoders.go +++ b/client/decoders.go @@ -6,6 +6,7 @@ import ( "fmt" "github.com/Mrs4s/MiraiGo/client/pb/notify" "github.com/Mrs4s/MiraiGo/client/pb/pttcenter" + "github.com/Mrs4s/MiraiGo/client/pb/qweb" "log" "net" "strconv" @@ -331,6 +332,25 @@ func decodeSvcNotify(c *QQClient, _ uint16, _ []byte) (interface{}, error) { return nil, err } +func decodeSummaryCardResponse(c *QQClient, _ uint16, payload []byte) (interface{}, error) { + request := &jce.RequestPacket{} + request.ReadFrom(jce.NewJceReader(payload)) + data := &jce.RequestDataVersion2{} + data.ReadFrom(jce.NewJceReader(request.SBuffer)) + rsp := jce.NewJceReader(data.Map["RespSummaryCard"]["SummaryCard.RespSummaryCard"][1:]) + return &SummaryCardInfo{ + Sex: rsp.ReadByte(1), + Age: rsp.ReadByte(2), + Nickname: rsp.ReadString(3), + Level: rsp.ReadInt32(5), + City: rsp.ReadString(7), + Sign: rsp.ReadString(8), + Mobile: rsp.ReadString(11), + Uin: rsp.ReadInt64(23), + LoginDays: rsp.ReadInt64(36), + }, nil +} + func decodeFriendGroupListResponse(_ *QQClient, _ uint16, payload []byte) (interface{}, error) { request := &jce.RequestPacket{} request.ReadFrom(jce.NewJceReader(payload)) @@ -448,6 +468,37 @@ func decodeGroupMemberListResponse(_ *QQClient, _ uint16, payload []byte) (inter }, nil } +func decodeGroupMemberInfoResponse(c *QQClient, _ uint16, payload []byte) (interface{}, error) { + rsp := pb.GroupMemberRspBody{} + if err := proto.Unmarshal(payload, &rsp); err != nil { + return nil, err + } + if rsp.MemInfo.Nick == nil && rsp.MemInfo.Age == 0 { + return nil, ErrMemberNotFound + } + group := c.FindGroup(rsp.GroupCode) + return &GroupMemberInfo{ + Group: group, + Uin: rsp.MemInfo.Uin, + Nickname: string(rsp.MemInfo.Nick), + CardName: string(rsp.MemInfo.Card), + Level: uint16(rsp.MemInfo.Level), + JoinTime: rsp.MemInfo.Join, + LastSpeakTime: rsp.MemInfo.LastSpeak, + SpecialTitle: string(rsp.MemInfo.SpecialTitle), + SpecialTitleExpireTime: int64(rsp.MemInfo.SpecialTitleExpireTime), + Permission: func() MemberPermission { + if rsp.MemInfo.Uin == group.OwnerUin { + return Owner + } + if rsp.MemInfo.Role == 1 { + return Administrator + } + return Member + }(), + }, nil +} + func decodeGroupImageStoreResponse(_ *QQClient, _ uint16, payload []byte) (interface{}, error) { pkt := pb.D388RespBody{} err := proto.Unmarshal(payload, &pkt) @@ -462,6 +513,9 @@ func decodeGroupImageStoreResponse(_ *QQClient, _ uint16, payload []byte) (inter }, nil } if rsp.BoolFileExit { + if rsp.MsgImgInfo != nil { + return imageUploadResponse{IsExists: true, FileId: rsp.FileId, Width: rsp.MsgImgInfo.FileWidth, Height: rsp.MsgImgInfo.FileHeight}, nil + } return imageUploadResponse{IsExists: true, FileId: rsp.Fid}, nil } return imageUploadResponse{ @@ -955,6 +1009,39 @@ func decodeOIDB6d6Response(c *QQClient, _ uint16, payload []byte) (interface{}, return fmt.Sprintf("http://%s/ftn_handler/%s/", ip, url), nil } +func decodeImageOcrResponse(_ *QQClient, _ uint16, payload []byte) (interface{}, error) { + pkg := oidb.OIDBSSOPkg{} + rsp := oidb.DE07RspBody{} + if err := proto.Unmarshal(payload, &pkg); err != nil { + return nil, err + } + if err := proto.Unmarshal(pkg.Bodybuffer, &rsp); err != nil { + return nil, err + } + if rsp.Wording != "" { + return nil, errors.New(rsp.Wording) + } + var texts []*TextDetection + for _, text := range rsp.OcrRspBody.TextDetections { + var points []*Coordinate + for _, c := range text.Polygon.Coordinates { + points = append(points, &Coordinate{ + X: c.X, + Y: c.Y, + }) + } + texts = append(texts, &TextDetection{ + Text: text.DetectedText, + Confidence: text.Confidence, + Coordinates: points, + }) + } + return &OcrResponse{ + Texts: texts, + Language: rsp.OcrRspBody.Language, + }, nil +} + func decodePttShortVideoDownResponse(c *QQClient, _ uint16, payload []byte) (interface{}, error) { rsp := pttcenter.ShortVideoRspBody{} if err := proto.Unmarshal(payload, &rsp); err != nil { @@ -965,3 +1052,18 @@ func decodePttShortVideoDownResponse(c *QQClient, _ uint16, payload []byte) (int } return rsp.PttShortVideoDownloadRsp.DownloadAddr.Host[0] + rsp.PttShortVideoDownloadRsp.DownloadAddr.UrlArgs, nil } + +func decodeAppInfoResponse(c *QQClient, _ uint16, payload []byte) (interface{}, error) { + pkg := qweb.QWebRsp{} + rsp := qweb.GetAppInfoByIdRsp{} + if err := proto.Unmarshal(payload, &pkg); err != nil { + return nil, err + } + if pkg.RetCode != 0 { + return nil, errors.New(pkg.ErrMsg) + } + if err := proto.Unmarshal(pkg.BusiBuff, &rsp); err != nil { + return nil, err + } + return rsp.AppInfo, nil +} diff --git a/client/entities.go b/client/entities.go index b8a91d7c..b4333066 100644 --- a/client/entities.go +++ b/client/entities.go @@ -8,7 +8,8 @@ import ( ) var ( - ErrAlreadyOnline = errors.New("already online") + ErrAlreadyOnline = errors.New("already online") + ErrMemberNotFound = errors.New("member not found") ) type ( @@ -42,6 +43,18 @@ type ( //msgSeqList *utils.Cache } + SummaryCardInfo struct { + Uin int64 + Sex byte + Age uint8 + Nickname string + Level int32 + City string + Sign string + Mobile string + LoginDays int64 + } + FriendListResponse struct { TotalCount int32 List []*FriendInfo @@ -170,6 +183,22 @@ type ( Friend *FriendInfo } + OcrResponse struct { + Texts []*TextDetection `json:"texts"` + Language string `json:"language"` + } + + TextDetection struct { + Text string `json:"text"` + Confidence int32 `json:"confidence"` + Coordinates []*Coordinate `json:"coordinates"` + } + + Coordinate struct { + X int32 `json:"x"` + Y int32 `json:"y"` + } + groupMemberListResponse struct { NextUin int64 list []*GroupMemberInfo @@ -181,6 +210,8 @@ type ( IsExists bool FileId int64 + Width int32 + Height int32 ResourceId string UploadKey []byte diff --git a/client/global.go b/client/global.go index beef55d0..b5cf93a2 100644 --- a/client/global.go +++ b/client/global.go @@ -300,7 +300,16 @@ func (c *QQClient) parseGroupMessage(m *msg.Message) *message.GroupMessage { } else { mem := group.FindMember(m.Head.FromUin) if mem == nil { - return nil + info, _ := c.getMemberInfo(group.Code, m.Head.FromUin) + if info == nil { + return nil + } + group.Members = append(group.Members, mem) + mem = info + go c.dispatchNewMemberEvent(&MemberJoinGroupEvent{ + Group: group, + Member: info, + }) } sender = &message.Sender{ Uin: mem.Uin, diff --git a/client/highway.go b/client/highway.go index 7f5ba5b1..9e794aa0 100644 --- a/client/highway.go +++ b/client/highway.go @@ -93,6 +93,10 @@ func (c *QQClient) uploadGroupHeadPortrait(groupCode int64, img []byte) error { req, err := http.NewRequest("POST", url, bytes.NewReader(img)) req.Header["User-Agent"] = []string{"Dalvik/2.1.0 (Linux; U; Android 7.1.2; PCRT00 Build/N2G48H)"} req.Header["Content-Type"] = []string{"multipart/form-data;boundary=****"} - _, err = http.DefaultClient.Do(req) - return err -} \ No newline at end of file + rsp, err := http.DefaultClient.Do(req) + if err != nil { + return err + } + rsp.Body.Close() + return nil +} diff --git a/client/pb/data.pb.go b/client/pb/data.pb.go index 1a70390c..ac95674b 100644 --- a/client/pb/data.pb.go +++ b/client/pb/data.pb.go @@ -2794,6 +2794,487 @@ func (x *Sub44GroupSyncMsg) GetProcessFlag() int32 { return 0 } +type GroupMemberReqBody struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupCode int64 `protobuf:"varint,1,opt,name=groupCode,proto3" json:"groupCode,omitempty"` + Uin int64 `protobuf:"varint,2,opt,name=uin,proto3" json:"uin,omitempty"` + NewClient bool `protobuf:"varint,3,opt,name=newClient,proto3" json:"newClient,omitempty"` + ClientType int32 `protobuf:"varint,4,opt,name=clientType,proto3" json:"clientType,omitempty"` + RichCardNameVer int32 `protobuf:"varint,5,opt,name=richCardNameVer,proto3" json:"richCardNameVer,omitempty"` +} + +func (x *GroupMemberReqBody) Reset() { + *x = GroupMemberReqBody{} + if protoimpl.UnsafeEnabled { + mi := &file_data_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupMemberReqBody) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupMemberReqBody) ProtoMessage() {} + +func (x *GroupMemberReqBody) ProtoReflect() protoreflect.Message { + mi := &file_data_proto_msgTypes[27] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupMemberReqBody.ProtoReflect.Descriptor instead. +func (*GroupMemberReqBody) Descriptor() ([]byte, []int) { + return file_data_proto_rawDescGZIP(), []int{27} +} + +func (x *GroupMemberReqBody) GetGroupCode() int64 { + if x != nil { + return x.GroupCode + } + return 0 +} + +func (x *GroupMemberReqBody) GetUin() int64 { + if x != nil { + return x.Uin + } + return 0 +} + +func (x *GroupMemberReqBody) GetNewClient() bool { + if x != nil { + return x.NewClient + } + return false +} + +func (x *GroupMemberReqBody) GetClientType() int32 { + if x != nil { + return x.ClientType + } + return 0 +} + +func (x *GroupMemberReqBody) GetRichCardNameVer() int32 { + if x != nil { + return x.RichCardNameVer + } + return 0 +} + +type GroupMemberRspBody struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupCode int64 `protobuf:"varint,1,opt,name=groupCode,proto3" json:"groupCode,omitempty"` + SelfRole int32 `protobuf:"varint,2,opt,name=selfRole,proto3" json:"selfRole,omitempty"` + MemInfo *GroupMemberInfo `protobuf:"bytes,3,opt,name=memInfo,proto3" json:"memInfo,omitempty"` + BoolSelfLocationShared bool `protobuf:"varint,4,opt,name=boolSelfLocationShared,proto3" json:"boolSelfLocationShared,omitempty"` + GroupType int32 `protobuf:"varint,5,opt,name=groupType,proto3" json:"groupType,omitempty"` +} + +func (x *GroupMemberRspBody) Reset() { + *x = GroupMemberRspBody{} + if protoimpl.UnsafeEnabled { + mi := &file_data_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupMemberRspBody) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupMemberRspBody) ProtoMessage() {} + +func (x *GroupMemberRspBody) ProtoReflect() protoreflect.Message { + mi := &file_data_proto_msgTypes[28] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupMemberRspBody.ProtoReflect.Descriptor instead. +func (*GroupMemberRspBody) Descriptor() ([]byte, []int) { + return file_data_proto_rawDescGZIP(), []int{28} +} + +func (x *GroupMemberRspBody) GetGroupCode() int64 { + if x != nil { + return x.GroupCode + } + return 0 +} + +func (x *GroupMemberRspBody) GetSelfRole() int32 { + if x != nil { + return x.SelfRole + } + return 0 +} + +func (x *GroupMemberRspBody) GetMemInfo() *GroupMemberInfo { + if x != nil { + return x.MemInfo + } + return nil +} + +func (x *GroupMemberRspBody) GetBoolSelfLocationShared() bool { + if x != nil { + return x.BoolSelfLocationShared + } + return false +} + +func (x *GroupMemberRspBody) GetGroupType() int32 { + if x != nil { + return x.GroupType + } + return 0 +} + +type GroupMemberInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uin int64 `protobuf:"varint,1,opt,name=uin,proto3" json:"uin,omitempty"` + Result int32 `protobuf:"varint,2,opt,name=result,proto3" json:"result,omitempty"` + Errmsg []byte `protobuf:"bytes,3,opt,name=errmsg,proto3" json:"errmsg,omitempty"` + IsFriend bool `protobuf:"varint,4,opt,name=IsFriend,proto3" json:"IsFriend,omitempty"` + Remark []byte `protobuf:"bytes,5,opt,name=remark,proto3" json:"remark,omitempty"` + IsConcerned bool `protobuf:"varint,6,opt,name=IsConcerned,proto3" json:"IsConcerned,omitempty"` + Credit int32 `protobuf:"varint,7,opt,name=credit,proto3" json:"credit,omitempty"` + Card []byte `protobuf:"bytes,8,opt,name=card,proto3" json:"card,omitempty"` + Sex int32 `protobuf:"varint,9,opt,name=sex,proto3" json:"sex,omitempty"` + Location []byte `protobuf:"bytes,10,opt,name=location,proto3" json:"location,omitempty"` + Nick []byte `protobuf:"bytes,11,opt,name=nick,proto3" json:"nick,omitempty"` + Age int32 `protobuf:"varint,12,opt,name=age,proto3" json:"age,omitempty"` + Lev []byte `protobuf:"bytes,13,opt,name=lev,proto3" json:"lev,omitempty"` + Join int64 `protobuf:"varint,14,opt,name=join,proto3" json:"join,omitempty"` + LastSpeak int64 `protobuf:"varint,15,opt,name=lastSpeak,proto3" json:"lastSpeak,omitempty"` + //repeated CustomEntry customEnties = 16; + //repeated GBarInfo gbarConcerned = 17; + GbarTitle []byte `protobuf:"bytes,18,opt,name=gbarTitle,proto3" json:"gbarTitle,omitempty"` + GbarUrl []byte `protobuf:"bytes,19,opt,name=gbarUrl,proto3" json:"gbarUrl,omitempty"` + GbarCnt int32 `protobuf:"varint,20,opt,name=gbarCnt,proto3" json:"gbarCnt,omitempty"` + IsAllowModCard bool `protobuf:"varint,21,opt,name=isAllowModCard,proto3" json:"isAllowModCard,omitempty"` + IsVip bool `protobuf:"varint,22,opt,name=isVip,proto3" json:"isVip,omitempty"` + IsYearVip bool `protobuf:"varint,23,opt,name=isYearVip,proto3" json:"isYearVip,omitempty"` + IsSuperVip bool `protobuf:"varint,24,opt,name=isSuperVip,proto3" json:"isSuperVip,omitempty"` + IsSuperQq bool `protobuf:"varint,25,opt,name=isSuperQq,proto3" json:"isSuperQq,omitempty"` + VipLev int32 `protobuf:"varint,26,opt,name=vipLev,proto3" json:"vipLev,omitempty"` + Role int32 `protobuf:"varint,27,opt,name=role,proto3" json:"role,omitempty"` + LocationShared bool `protobuf:"varint,28,opt,name=locationShared,proto3" json:"locationShared,omitempty"` + Int64Distance int64 `protobuf:"varint,29,opt,name=int64Distance,proto3" json:"int64Distance,omitempty"` + ConcernType int32 `protobuf:"varint,30,opt,name=concernType,proto3" json:"concernType,omitempty"` + SpecialTitle []byte `protobuf:"bytes,31,opt,name=specialTitle,proto3" json:"specialTitle,omitempty"` + SpecialTitleExpireTime int32 `protobuf:"varint,32,opt,name=specialTitleExpireTime,proto3" json:"specialTitleExpireTime,omitempty"` + //FlowersEntry flowerEntry = 33; + //TeamEntry teamEntry = 34; + PhoneNum []byte `protobuf:"bytes,35,opt,name=phoneNum,proto3" json:"phoneNum,omitempty"` + Job []byte `protobuf:"bytes,36,opt,name=job,proto3" json:"job,omitempty"` + MedalId int32 `protobuf:"varint,37,opt,name=medalId,proto3" json:"medalId,omitempty"` + Level int32 `protobuf:"varint,39,opt,name=level,proto3" json:"level,omitempty"` + Honor string `protobuf:"bytes,41,opt,name=honor,proto3" json:"honor,omitempty"` +} + +func (x *GroupMemberInfo) Reset() { + *x = GroupMemberInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_data_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupMemberInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupMemberInfo) ProtoMessage() {} + +func (x *GroupMemberInfo) ProtoReflect() protoreflect.Message { + mi := &file_data_proto_msgTypes[29] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupMemberInfo.ProtoReflect.Descriptor instead. +func (*GroupMemberInfo) Descriptor() ([]byte, []int) { + return file_data_proto_rawDescGZIP(), []int{29} +} + +func (x *GroupMemberInfo) GetUin() int64 { + if x != nil { + return x.Uin + } + return 0 +} + +func (x *GroupMemberInfo) GetResult() int32 { + if x != nil { + return x.Result + } + return 0 +} + +func (x *GroupMemberInfo) GetErrmsg() []byte { + if x != nil { + return x.Errmsg + } + return nil +} + +func (x *GroupMemberInfo) GetIsFriend() bool { + if x != nil { + return x.IsFriend + } + return false +} + +func (x *GroupMemberInfo) GetRemark() []byte { + if x != nil { + return x.Remark + } + return nil +} + +func (x *GroupMemberInfo) GetIsConcerned() bool { + if x != nil { + return x.IsConcerned + } + return false +} + +func (x *GroupMemberInfo) GetCredit() int32 { + if x != nil { + return x.Credit + } + return 0 +} + +func (x *GroupMemberInfo) GetCard() []byte { + if x != nil { + return x.Card + } + return nil +} + +func (x *GroupMemberInfo) GetSex() int32 { + if x != nil { + return x.Sex + } + return 0 +} + +func (x *GroupMemberInfo) GetLocation() []byte { + if x != nil { + return x.Location + } + return nil +} + +func (x *GroupMemberInfo) GetNick() []byte { + if x != nil { + return x.Nick + } + return nil +} + +func (x *GroupMemberInfo) GetAge() int32 { + if x != nil { + return x.Age + } + return 0 +} + +func (x *GroupMemberInfo) GetLev() []byte { + if x != nil { + return x.Lev + } + return nil +} + +func (x *GroupMemberInfo) GetJoin() int64 { + if x != nil { + return x.Join + } + return 0 +} + +func (x *GroupMemberInfo) GetLastSpeak() int64 { + if x != nil { + return x.LastSpeak + } + return 0 +} + +func (x *GroupMemberInfo) GetGbarTitle() []byte { + if x != nil { + return x.GbarTitle + } + return nil +} + +func (x *GroupMemberInfo) GetGbarUrl() []byte { + if x != nil { + return x.GbarUrl + } + return nil +} + +func (x *GroupMemberInfo) GetGbarCnt() int32 { + if x != nil { + return x.GbarCnt + } + return 0 +} + +func (x *GroupMemberInfo) GetIsAllowModCard() bool { + if x != nil { + return x.IsAllowModCard + } + return false +} + +func (x *GroupMemberInfo) GetIsVip() bool { + if x != nil { + return x.IsVip + } + return false +} + +func (x *GroupMemberInfo) GetIsYearVip() bool { + if x != nil { + return x.IsYearVip + } + return false +} + +func (x *GroupMemberInfo) GetIsSuperVip() bool { + if x != nil { + return x.IsSuperVip + } + return false +} + +func (x *GroupMemberInfo) GetIsSuperQq() bool { + if x != nil { + return x.IsSuperQq + } + return false +} + +func (x *GroupMemberInfo) GetVipLev() int32 { + if x != nil { + return x.VipLev + } + return 0 +} + +func (x *GroupMemberInfo) GetRole() int32 { + if x != nil { + return x.Role + } + return 0 +} + +func (x *GroupMemberInfo) GetLocationShared() bool { + if x != nil { + return x.LocationShared + } + return false +} + +func (x *GroupMemberInfo) GetInt64Distance() int64 { + if x != nil { + return x.Int64Distance + } + return 0 +} + +func (x *GroupMemberInfo) GetConcernType() int32 { + if x != nil { + return x.ConcernType + } + return 0 +} + +func (x *GroupMemberInfo) GetSpecialTitle() []byte { + if x != nil { + return x.SpecialTitle + } + return nil +} + +func (x *GroupMemberInfo) GetSpecialTitleExpireTime() int32 { + if x != nil { + return x.SpecialTitleExpireTime + } + return 0 +} + +func (x *GroupMemberInfo) GetPhoneNum() []byte { + if x != nil { + return x.PhoneNum + } + return nil +} + +func (x *GroupMemberInfo) GetJob() []byte { + if x != nil { + return x.Job + } + return nil +} + +func (x *GroupMemberInfo) GetMedalId() int32 { + if x != nil { + return x.MedalId + } + return 0 +} + +func (x *GroupMemberInfo) GetLevel() int32 { + if x != nil { + return x.Level + } + return 0 +} + +func (x *GroupMemberInfo) GetHonor() string { + if x != nil { + return x.Honor + } + return "" +} + var File_data_proto protoreflect.FileDescriptor var file_data_proto_rawDesc = []byte{ @@ -3231,8 +3712,93 @@ var file_data_proto_rawDesc = []byte{ 0x78, 0x74, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x4e, 0x75, 0x6d, 0x18, 0x12, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x65, 0x78, 0x74, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x4e, 0x75, 0x6d, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x46, 0x6c, 0x61, 0x67, 0x18, 0x13, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x46, 0x6c, 0x61, 0x67, 0x42, - 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x28, 0x05, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x46, 0x6c, 0x61, 0x67, 0x22, + 0xac, 0x01, 0x0a, 0x12, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x43, + 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, + 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x03, 0x75, 0x69, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x65, 0x77, 0x43, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x6e, 0x65, 0x77, 0x43, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x79, + 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x72, 0x69, 0x63, 0x68, 0x43, 0x61, 0x72, 0x64, + 0x4e, 0x61, 0x6d, 0x65, 0x56, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x72, + 0x69, 0x63, 0x68, 0x43, 0x61, 0x72, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x56, 0x65, 0x72, 0x22, 0xd0, + 0x01, 0x0a, 0x12, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x73, + 0x70, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x6f, + 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x43, + 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x66, 0x52, 0x6f, 0x6c, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x65, 0x6c, 0x66, 0x52, 0x6f, 0x6c, 0x65, 0x12, + 0x2a, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x10, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x36, 0x0a, 0x16, 0x62, + 0x6f, 0x6f, 0x6c, 0x53, 0x65, 0x6c, 0x66, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, + 0x68, 0x61, 0x72, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x62, 0x6f, 0x6f, + 0x6c, 0x53, 0x65, 0x6c, 0x66, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x68, 0x61, + 0x72, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x54, 0x79, 0x70, 0x65, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x54, 0x79, 0x70, + 0x65, 0x22, 0xc5, 0x07, 0x0a, 0x0f, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, + 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, + 0x16, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x6d, 0x73, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x06, 0x65, 0x72, 0x72, 0x6d, 0x73, 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x49, 0x73, 0x46, 0x72, 0x69, + 0x65, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x49, 0x73, 0x46, 0x72, 0x69, + 0x65, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x20, 0x0a, 0x0b, 0x49, + 0x73, 0x43, 0x6f, 0x6e, 0x63, 0x65, 0x72, 0x6e, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x0b, 0x49, 0x73, 0x43, 0x6f, 0x6e, 0x63, 0x65, 0x72, 0x6e, 0x65, 0x64, 0x12, 0x16, 0x0a, + 0x06, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, + 0x72, 0x65, 0x64, 0x69, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x61, 0x72, 0x64, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x04, 0x63, 0x61, 0x72, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x65, 0x78, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x73, 0x65, 0x78, 0x12, 0x1a, 0x0a, 0x08, 0x6c, + 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6c, + 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x69, 0x63, 0x6b, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x6e, 0x69, 0x63, 0x6b, 0x12, 0x10, 0x0a, 0x03, 0x61, + 0x67, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x61, 0x67, 0x65, 0x12, 0x10, 0x0a, + 0x03, 0x6c, 0x65, 0x76, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6c, 0x65, 0x76, 0x12, + 0x12, 0x0a, 0x04, 0x6a, 0x6f, 0x69, 0x6e, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x6a, + 0x6f, 0x69, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x70, 0x65, 0x61, 0x6b, + 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x70, 0x65, 0x61, + 0x6b, 0x12, 0x1c, 0x0a, 0x09, 0x67, 0x62, 0x61, 0x72, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x12, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x67, 0x62, 0x61, 0x72, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, + 0x18, 0x0a, 0x07, 0x67, 0x62, 0x61, 0x72, 0x55, 0x72, 0x6c, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x07, 0x67, 0x62, 0x61, 0x72, 0x55, 0x72, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x62, 0x61, + 0x72, 0x43, 0x6e, 0x74, 0x18, 0x14, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x62, 0x61, 0x72, + 0x43, 0x6e, 0x74, 0x12, 0x26, 0x0a, 0x0e, 0x69, 0x73, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x4d, 0x6f, + 0x64, 0x43, 0x61, 0x72, 0x64, 0x18, 0x15, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x69, 0x73, 0x41, + 0x6c, 0x6c, 0x6f, 0x77, 0x4d, 0x6f, 0x64, 0x43, 0x61, 0x72, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x69, + 0x73, 0x56, 0x69, 0x70, 0x18, 0x16, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x56, 0x69, + 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x73, 0x59, 0x65, 0x61, 0x72, 0x56, 0x69, 0x70, 0x18, 0x17, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x59, 0x65, 0x61, 0x72, 0x56, 0x69, 0x70, 0x12, + 0x1e, 0x0a, 0x0a, 0x69, 0x73, 0x53, 0x75, 0x70, 0x65, 0x72, 0x56, 0x69, 0x70, 0x18, 0x18, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, 0x53, 0x75, 0x70, 0x65, 0x72, 0x56, 0x69, 0x70, 0x12, + 0x1c, 0x0a, 0x09, 0x69, 0x73, 0x53, 0x75, 0x70, 0x65, 0x72, 0x51, 0x71, 0x18, 0x19, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x53, 0x75, 0x70, 0x65, 0x72, 0x51, 0x71, 0x12, 0x16, 0x0a, + 0x06, 0x76, 0x69, 0x70, 0x4c, 0x65, 0x76, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x76, + 0x69, 0x70, 0x4c, 0x65, 0x76, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x1b, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x6c, 0x6f, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x18, 0x1c, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0e, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x68, 0x61, 0x72, 0x65, + 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x44, 0x69, 0x73, 0x74, 0x61, 0x6e, + 0x63, 0x65, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x44, + 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x63, 0x65, + 0x72, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x63, 0x6f, + 0x6e, 0x63, 0x65, 0x72, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x73, 0x70, 0x65, + 0x63, 0x69, 0x61, 0x6c, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x0c, 0x73, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x36, 0x0a, + 0x16, 0x73, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x45, 0x78, 0x70, + 0x69, 0x72, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x20, 0x20, 0x01, 0x28, 0x05, 0x52, 0x16, 0x73, + 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x45, 0x78, 0x70, 0x69, 0x72, + 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, + 0x6d, 0x18, 0x23, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, + 0x6d, 0x12, 0x10, 0x0a, 0x03, 0x6a, 0x6f, 0x62, 0x18, 0x24, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, + 0x6a, 0x6f, 0x62, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x64, 0x61, 0x6c, 0x49, 0x64, 0x18, 0x25, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6d, 0x65, 0x64, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x14, 0x0a, + 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x27, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, + 0x76, 0x65, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x68, 0x6f, 0x6e, 0x6f, 0x72, 0x18, 0x29, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x68, 0x6f, 0x6e, 0x6f, 0x72, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, + 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3247,7 +3813,7 @@ func file_data_proto_rawDescGZIP() []byte { return file_data_proto_rawDescData } -var file_data_proto_msgTypes = make([]protoimpl.MessageInfo, 27) +var file_data_proto_msgTypes = make([]protoimpl.MessageInfo, 30) var file_data_proto_goTypes = []interface{}{ (*DeviceInfo)(nil), // 0: DeviceInfo (*RequestBody)(nil), // 1: RequestBody @@ -3276,6 +3842,9 @@ var file_data_proto_goTypes = []interface{}{ (*Sub44)(nil), // 24: Sub44 (*Sub44FriendSyncMsg)(nil), // 25: Sub44FriendSyncMsg (*Sub44GroupSyncMsg)(nil), // 26: Sub44GroupSyncMsg + (*GroupMemberReqBody)(nil), // 27: GroupMemberReqBody + (*GroupMemberRspBody)(nil), // 28: GroupMemberRspBody + (*GroupMemberInfo)(nil), // 29: GroupMemberInfo } var file_data_proto_depIdxs = []int32{ 2, // 0: RequestBody.rpt_config_list:type_name -> ConfigSeq @@ -3295,11 +3864,12 @@ var file_data_proto_depIdxs = []int32{ 23, // 14: SubB3.msgAddFrdNotify:type_name -> SubB3AddFrdNotify 25, // 15: Sub44.friendSyncMsg:type_name -> Sub44FriendSyncMsg 26, // 16: Sub44.groupSyncMsg:type_name -> Sub44GroupSyncMsg - 17, // [17:17] is the sub-list for method output_type - 17, // [17:17] is the sub-list for method input_type - 17, // [17:17] is the sub-list for extension type_name - 17, // [17:17] is the sub-list for extension extendee - 0, // [0:17] is the sub-list for field type_name + 29, // 17: GroupMemberRspBody.memInfo:type_name -> GroupMemberInfo + 18, // [18:18] is the sub-list for method output_type + 18, // [18:18] is the sub-list for method input_type + 18, // [18:18] is the sub-list for extension type_name + 18, // [18:18] is the sub-list for extension extendee + 0, // [0:18] is the sub-list for field type_name } func init() { file_data_proto_init() } @@ -3632,6 +4202,42 @@ func file_data_proto_init() { return nil } } + file_data_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupMemberReqBody); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupMemberRspBody); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupMemberInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -3639,7 +4245,7 @@ func file_data_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_data_proto_rawDesc, NumEnums: 0, - NumMessages: 27, + NumMessages: 30, NumExtensions: 0, NumServices: 0, }, diff --git a/client/pb/data.proto b/client/pb/data.proto index ac62c085..ae2a9898 100644 --- a/client/pb/data.proto +++ b/client/pb/data.proto @@ -4,305 +4,366 @@ option go_package = ".;pb"; message DeviceInfo { - string bootloader = 1; - string procVersion = 2; - string codename = 3; - string incremental = 4; - string fingerprint = 5; - string bootId = 6; - string androidId = 7; - string baseBand = 8; - string innerVersion = 9; + string bootloader = 1; + string procVersion = 2; + string codename = 3; + string incremental = 4; + string fingerprint = 5; + string bootId = 6; + string androidId = 7; + string baseBand = 8; + string innerVersion = 9; } message RequestBody { - repeated ConfigSeq rpt_config_list = 1; + repeated ConfigSeq rpt_config_list = 1; } message ConfigSeq { - int32 type = 1; - int32 version = 2; + int32 type = 1; + int32 version = 2; } message D50ReqBody { - int64 appid = 1; - int32 maxPkgSize = 2; - int32 startTime = 3; - int32 startIndex = 4; - int32 reqNum = 5; - repeated int64 uinList = 6; - int32 reqMusicSwitch = 91001; - int32 reqMutualmarkAlienation = 101001; - int32 reqMutualmarkScore = 141001; - int32 reqKsingSwitch = 151001; - int32 reqMutualmarkLbsshare = 181001; + int64 appid = 1; + int32 maxPkgSize = 2; + int32 startTime = 3; + int32 startIndex = 4; + int32 reqNum = 5; + repeated int64 uinList = 6; + int32 reqMusicSwitch = 91001; + int32 reqMutualmarkAlienation = 101001; + int32 reqMutualmarkScore = 141001; + int32 reqKsingSwitch = 151001; + int32 reqMutualmarkLbsshare = 181001; } message D388ReqBody { - int32 netType = 1; - int32 subcmd = 2; - repeated TryUpImgReq msgTryUpImgReq = 3; - repeated TryUpPttReq msgTryUpPttReq = 5; - repeated GetPttUrlReq msgGetPttReq = 6; - int32 commandId = 7; - bytes extension = 1001; + int32 netType = 1; + int32 subcmd = 2; + repeated TryUpImgReq msgTryUpImgReq = 3; + repeated TryUpPttReq msgTryUpPttReq = 5; + repeated GetPttUrlReq msgGetPttReq = 6; + int32 commandId = 7; + bytes extension = 1001; } message D388RespBody { - int32 clientIp = 1; - int32 subCmd = 2; - repeated TryUpImgResp msgTryUpImgRsp = 3; - repeated TryUpPttResp msgTryUpPttRsp = 5; - repeated GetPttUrlRsp msgGetPttUrlRsp = 6; + int32 clientIp = 1; + int32 subCmd = 2; + repeated TryUpImgResp msgTryUpImgRsp = 3; + repeated TryUpPttResp msgTryUpPttRsp = 5; + repeated GetPttUrlRsp msgGetPttUrlRsp = 6; } message GetPttUrlReq { - int64 groupCode = 1; - int64 dstUin = 2; - int64 fileId = 3; - bytes fileMd5 = 4; - int32 reqTerm = 5; - int32 reqPlatformType = 6; - int32 innerIp = 7; - int32 buType = 8; - bytes buildVer = 9; - //int64 fileId = 10; - bytes fileKey = 11; - int32 codec = 12; - int32 buId = 13; - int32 reqTransferType = 14; - int32 isAuto = 15; + int64 groupCode = 1; + int64 dstUin = 2; + int64 fileId = 3; + bytes fileMd5 = 4; + int32 reqTerm = 5; + int32 reqPlatformType = 6; + int32 innerIp = 7; + int32 buType = 8; + bytes buildVer = 9; + //int64 fileId = 10; + bytes fileKey = 11; + int32 codec = 12; + int32 buId = 13; + int32 reqTransferType = 14; + int32 isAuto = 15; } message GetPttUrlRsp { - int64 fileId = 1; - bytes fileMd5 = 2; - int32 result = 3; - bytes failMsg = 4; - bytes bytesDownUrl = 5; - repeated int32 uint32DownIp = 6; - repeated int32 uint32DownPort = 7; - bytes downDomain = 8; - bytes downPara = 9; - //int64 fileId = 10; - int32 transferType = 11; - int32 allowRetry = 12; - //repeated IPv6Info msgDownIp6 = 26; - bytes clientIp6 = 27; - string strDomain = 28; + int64 fileId = 1; + bytes fileMd5 = 2; + int32 result = 3; + bytes failMsg = 4; + bytes bytesDownUrl = 5; + repeated int32 uint32DownIp = 6; + repeated int32 uint32DownPort = 7; + bytes downDomain = 8; + bytes downPara = 9; + //int64 fileId = 10; + int32 transferType = 11; + int32 allowRetry = 12; + //repeated IPv6Info msgDownIp6 = 26; + bytes clientIp6 = 27; + string strDomain = 28; } message ReqDataHighwayHead { - DataHighwayHead msgBasehead = 1; - SegHead msgSeghead = 2; - bytes reqExtendinfo = 3; - int64 timestamp = 4; - //LoginSigHead? msgLoginSigHead = 5; + DataHighwayHead msgBasehead = 1; + SegHead msgSeghead = 2; + bytes reqExtendinfo = 3; + int64 timestamp = 4; + //LoginSigHead? msgLoginSigHead = 5; } message RspDataHighwayHead { - DataHighwayHead msgBasehead = 1; - SegHead msgSeghead = 2; - int32 errorCode = 3; - int32 allowRetry = 4; - int32 cachecost = 5; - int32 htcost = 6; - bytes rspExtendinfo = 7; - int64 timestamp = 8; - int64 range = 9; - int32 isReset = 10; + DataHighwayHead msgBasehead = 1; + SegHead msgSeghead = 2; + int32 errorCode = 3; + int32 allowRetry = 4; + int32 cachecost = 5; + int32 htcost = 6; + bytes rspExtendinfo = 7; + int64 timestamp = 8; + int64 range = 9; + int32 isReset = 10; } message DataHighwayHead { - int32 version = 1; - string uin = 2; - string command = 3; - int32 seq = 4; - int32 retryTimes = 5; - int32 appid = 6; - int32 dataflag = 7; - int32 commandId = 8; - string buildVer = 9; - int32 localeId = 10; + int32 version = 1; + string uin = 2; + string command = 3; + int32 seq = 4; + int32 retryTimes = 5; + int32 appid = 6; + int32 dataflag = 7; + int32 commandId = 8; + string buildVer = 9; + int32 localeId = 10; } message SegHead { - int32 serviceid = 1; - int64 filesize = 2; - int64 dataoffset = 3; - int32 datalength = 4; - int32 rtcode = 5; - bytes serviceticket = 6; - int32 flag = 7; - bytes md5 = 8; - bytes fileMd5 = 9; - int32 cacheAddr = 10; - int32 queryTimes = 11; - int32 updateCacheip = 12; + int32 serviceid = 1; + int64 filesize = 2; + int64 dataoffset = 3; + int32 datalength = 4; + int32 rtcode = 5; + bytes serviceticket = 6; + int32 flag = 7; + bytes md5 = 8; + bytes fileMd5 = 9; + int32 cacheAddr = 10; + int32 queryTimes = 11; + int32 updateCacheip = 12; } message TryUpImgReq { - int64 groupCode = 1; - int64 srcUin = 2; - int64 fileId = 3; - bytes fileMd5 = 4; - int64 fileSize = 5; - string fileName = 6; - int32 srcTerm = 7; - int32 platformType = 8; - int32 buType = 9; - int32 picWidth = 10; - int32 picHeight = 11; - int32 picType = 12; - string buildVer = 13; - int32 innerIp = 14; - int32 appPicType = 15; - int32 originalPic = 16; - bytes fileIndex = 17; - int64 dstUin = 18; - int32 srvUpload = 19; - bytes transferUrl = 20; + int64 groupCode = 1; + int64 srcUin = 2; + int64 fileId = 3; + bytes fileMd5 = 4; + int64 fileSize = 5; + string fileName = 6; + int32 srcTerm = 7; + int32 platformType = 8; + int32 buType = 9; + int32 picWidth = 10; + int32 picHeight = 11; + int32 picType = 12; + string buildVer = 13; + int32 innerIp = 14; + int32 appPicType = 15; + int32 originalPic = 16; + bytes fileIndex = 17; + int64 dstUin = 18; + int32 srvUpload = 19; + bytes transferUrl = 20; } message TryUpImgResp { - int64 fileId = 1; - int32 result = 2; - string failMsg = 3; - bool boolFileExit = 4; - ImgInfo msgImgInfo = 5; - repeated int32 uint32UpIp = 6; - repeated int32 uint32UpPort = 7; - bytes upUkey = 8; - int64 fid = 9; + int64 fileId = 1; + int32 result = 2; + string failMsg = 3; + bool boolFileExit = 4; + ImgInfo msgImgInfo = 5; + repeated int32 uint32UpIp = 6; + repeated int32 uint32UpPort = 7; + bytes upUkey = 8; + int64 fid = 9; } message TryUpPttReq { - int64 groupCode = 1; - int64 srcUin = 2; - int64 fileId = 3; - bytes fileMd5 = 4; - int64 fileSize = 5; - bytes fileName = 6; - int32 srcTerm = 7; - int32 platformType = 8; - int32 buType = 9; - string buildVer = 10; - int32 innerIp = 11; - int32 voiceLength = 12; - bool boolNewUpChan = 13; - int32 codec = 14; - int32 voiceType = 15; - int32 buId = 16; + int64 groupCode = 1; + int64 srcUin = 2; + int64 fileId = 3; + bytes fileMd5 = 4; + int64 fileSize = 5; + bytes fileName = 6; + int32 srcTerm = 7; + int32 platformType = 8; + int32 buType = 9; + string buildVer = 10; + int32 innerIp = 11; + int32 voiceLength = 12; + bool boolNewUpChan = 13; + int32 codec = 14; + int32 voiceType = 15; + int32 buId = 16; } message TryUpPttResp { - int64 fileId = 1; - int32 result = 2; - string failMsg = 3; - bool boolFileExit = 4; - repeated int32 uint32UpIp = 5; - repeated int32 uint32UpPort = 6; - bytes upUkey = 7; - // int64 fileid = 8; // - int64 upOffset = 9; - int64 blockSize = 10; - bytes fileKey = 11; - int32 channelType = 12; - // List? msgUpIp6 = 26; - // bytes clientIp6 = 27; + int64 fileId = 1; + int32 result = 2; + string failMsg = 3; + bool boolFileExit = 4; + repeated int32 uint32UpIp = 5; + repeated int32 uint32UpPort = 6; + bytes upUkey = 7; + // int64 fileid = 8; // + int64 upOffset = 9; + int64 blockSize = 10; + bytes fileKey = 11; + int32 channelType = 12; + // List? msgUpIp6 = 26; + // bytes clientIp6 = 27; } message ImgInfo { - bytes fileMd5 = 1; - int32 fileType = 2; - int64 fileSize = 3; - int32 fileWidth = 4; - int32 fileHeight = 5; + bytes fileMd5 = 1; + int32 fileType = 2; + int64 fileSize = 3; + int32 fileWidth = 4; + int32 fileHeight = 5; } message DeleteMessageRequest { - repeated MessageItem items = 1; + repeated MessageItem items = 1; } message MessageItem { - int64 fromUin = 1; - int64 toUin = 2; - int32 msgType = 3; - int32 msgSeq = 4; - int64 msgUid = 5; - bytes sig = 7; + int64 fromUin = 1; + int64 toUin = 2; + int32 msgType = 3; + int32 msgSeq = 4; + int64 msgUid = 5; + bytes sig = 7; } message SubD4 { - int64 uin = 1; + int64 uin = 1; } message Sub8A { - repeated Sub8AMsgInfo msg_info = 1; - int32 appId = 2; - int32 instId = 3; - int32 longMessageFlag = 4; - bytes reserved = 5; + repeated Sub8AMsgInfo msg_info = 1; + int32 appId = 2; + int32 instId = 3; + int32 longMessageFlag = 4; + bytes reserved = 5; } message Sub8AMsgInfo { - int64 fromUin = 1; - int64 toUin = 2; - int32 msgSeq= 3; - int64 msgUid = 4; - int64 msgTime = 5; - int32 msgRandom = 6; - int32 pkgNum = 7; - int32 pkgIndex = 8; - int32 devSeq = 9; + int64 fromUin = 1; + int64 toUin = 2; + int32 msgSeq = 3; + int64 msgUid = 4; + int64 msgTime = 5; + int32 msgRandom = 6; + int32 pkgNum = 7; + int32 pkgIndex = 8; + int32 devSeq = 9; } message SubB3 { - int32 type = 1; - SubB3AddFrdNotify msgAddFrdNotify = 2; + int32 type = 1; + SubB3AddFrdNotify msgAddFrdNotify = 2; } message SubB3AddFrdNotify { - int64 uin = 1; - string nick = 5; + int64 uin = 1; + string nick = 5; } message Sub44 { - Sub44FriendSyncMsg friendSyncMsg = 1; - Sub44GroupSyncMsg groupSyncMsg = 2; + Sub44FriendSyncMsg friendSyncMsg = 1; + Sub44GroupSyncMsg groupSyncMsg = 2; } message Sub44FriendSyncMsg { - int64 uin = 1; - int64 fUin = 2; - int32 processType = 3; - int32 time = 4; - int32 processFlag = 5; - int32 sourceId = 6; - int32 sourceSubId = 7; - repeated string strWording = 8; + int64 uin = 1; + int64 fUin = 2; + int32 processType = 3; + int32 time = 4; + int32 processFlag = 5; + int32 sourceId = 6; + int32 sourceSubId = 7; + repeated string strWording = 8; } message Sub44GroupSyncMsg { - int32 msgType = 1; - int64 msgSeq = 2; - int64 grpCode = 3; - int64 gaCode = 4; - int64 optUin1 = 5; - int64 optUin2 = 6; - bytes msgBuf = 7; - bytes authKey = 8; - int32 msgStatus = 9; - int64 actionUin = 10; - int64 actionTime = 11; - int32 curMaxMemCount = 12; - int32 nextMaxMemCount = 13; - int32 curMemCount = 14; - int32 reqSrcId = 15; - int32 reqSrcSubId = 16; - int32 inviterRole = 17; - int32 extAdminNum = 18; - int32 processFlag = 19; -} \ No newline at end of file + int32 msgType = 1; + int64 msgSeq = 2; + int64 grpCode = 3; + int64 gaCode = 4; + int64 optUin1 = 5; + int64 optUin2 = 6; + bytes msgBuf = 7; + bytes authKey = 8; + int32 msgStatus = 9; + int64 actionUin = 10; + int64 actionTime = 11; + int32 curMaxMemCount = 12; + int32 nextMaxMemCount = 13; + int32 curMemCount = 14; + int32 reqSrcId = 15; + int32 reqSrcSubId = 16; + int32 inviterRole = 17; + int32 extAdminNum = 18; + int32 processFlag = 19; +} + +message GroupMemberReqBody { + int64 groupCode = 1; + int64 uin = 2; + bool newClient = 3; + int32 clientType = 4; + int32 richCardNameVer = 5; +} + +message GroupMemberRspBody { + int64 groupCode = 1; + int32 selfRole = 2; + GroupMemberInfo memInfo = 3; + bool boolSelfLocationShared = 4; + int32 groupType = 5; +} + +message GroupMemberInfo { + int64 uin = 1; + int32 result = 2; + bytes errmsg = 3; + bool IsFriend = 4; + bytes remark = 5; + bool IsConcerned = 6; + int32 credit = 7; + bytes card = 8; + int32 sex = 9; + bytes location = 10; + bytes nick = 11; + int32 age = 12; + bytes lev = 13; + int64 join = 14; + int64 lastSpeak = 15; + //repeated CustomEntry customEnties = 16; + //repeated GBarInfo gbarConcerned = 17; + bytes gbarTitle = 18; + bytes gbarUrl = 19; + int32 gbarCnt = 20; + bool isAllowModCard = 21; + bool isVip = 22; + bool isYearVip = 23; + bool isSuperVip = 24; + bool isSuperQq = 25; + int32 vipLev = 26; + int32 role = 27; + bool locationShared = 28; + int64 int64Distance = 29; + int32 concernType = 30; + bytes specialTitle = 31; + int32 specialTitleExpireTime = 32; + //FlowersEntry flowerEntry = 33; + //TeamEntry teamEntry = 34; + bytes phoneNum = 35; + bytes job = 36; + int32 medalId = 37; + + int32 level = 39; + + string honor = 41; +} + diff --git a/client/pb/oidb/oidb0xe07.pb.go b/client/pb/oidb/oidb0xe07.pb.go new file mode 100644 index 00000000..6adca386 --- /dev/null +++ b/client/pb/oidb/oidb0xe07.pb.go @@ -0,0 +1,861 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.11.4 +// source: oidb0xe07.proto + +package oidb + +import ( + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +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) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type DE07ReqBody struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + Client int32 `protobuf:"varint,2,opt,name=client,proto3" json:"client,omitempty"` + Entrance int32 `protobuf:"varint,3,opt,name=entrance,proto3" json:"entrance,omitempty"` + OcrReqBody *OCRReqBody `protobuf:"bytes,10,opt,name=ocrReqBody,proto3" json:"ocrReqBody,omitempty"` +} + +func (x *DE07ReqBody) Reset() { + *x = DE07ReqBody{} + if protoimpl.UnsafeEnabled { + mi := &file_oidb0xe07_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DE07ReqBody) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DE07ReqBody) ProtoMessage() {} + +func (x *DE07ReqBody) ProtoReflect() protoreflect.Message { + mi := &file_oidb0xe07_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DE07ReqBody.ProtoReflect.Descriptor instead. +func (*DE07ReqBody) Descriptor() ([]byte, []int) { + return file_oidb0xe07_proto_rawDescGZIP(), []int{0} +} + +func (x *DE07ReqBody) GetVersion() int32 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *DE07ReqBody) GetClient() int32 { + if x != nil { + return x.Client + } + return 0 +} + +func (x *DE07ReqBody) GetEntrance() int32 { + if x != nil { + return x.Entrance + } + return 0 +} + +func (x *DE07ReqBody) GetOcrReqBody() *OCRReqBody { + if x != nil { + return x.OcrReqBody + } + return nil +} + +type OCRReqBody struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ImageUrl string `protobuf:"bytes,1,opt,name=imageUrl,proto3" json:"imageUrl,omitempty"` + LanguageType string `protobuf:"bytes,2,opt,name=languageType,proto3" json:"languageType,omitempty"` + Scene string `protobuf:"bytes,3,opt,name=scene,proto3" json:"scene,omitempty"` + OriginMd5 string `protobuf:"bytes,10,opt,name=originMd5,proto3" json:"originMd5,omitempty"` + AfterCompressMd5 string `protobuf:"bytes,11,opt,name=afterCompressMd5,proto3" json:"afterCompressMd5,omitempty"` + AfterCompressFileSize int32 `protobuf:"varint,12,opt,name=afterCompressFileSize,proto3" json:"afterCompressFileSize,omitempty"` + AfterCompressWeight int32 `protobuf:"varint,13,opt,name=afterCompressWeight,proto3" json:"afterCompressWeight,omitempty"` + AfterCompressHeight int32 `protobuf:"varint,14,opt,name=afterCompressHeight,proto3" json:"afterCompressHeight,omitempty"` + IsCut bool `protobuf:"varint,15,opt,name=isCut,proto3" json:"isCut,omitempty"` +} + +func (x *OCRReqBody) Reset() { + *x = OCRReqBody{} + if protoimpl.UnsafeEnabled { + mi := &file_oidb0xe07_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OCRReqBody) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OCRReqBody) ProtoMessage() {} + +func (x *OCRReqBody) ProtoReflect() protoreflect.Message { + mi := &file_oidb0xe07_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OCRReqBody.ProtoReflect.Descriptor instead. +func (*OCRReqBody) Descriptor() ([]byte, []int) { + return file_oidb0xe07_proto_rawDescGZIP(), []int{1} +} + +func (x *OCRReqBody) GetImageUrl() string { + if x != nil { + return x.ImageUrl + } + return "" +} + +func (x *OCRReqBody) GetLanguageType() string { + if x != nil { + return x.LanguageType + } + return "" +} + +func (x *OCRReqBody) GetScene() string { + if x != nil { + return x.Scene + } + return "" +} + +func (x *OCRReqBody) GetOriginMd5() string { + if x != nil { + return x.OriginMd5 + } + return "" +} + +func (x *OCRReqBody) GetAfterCompressMd5() string { + if x != nil { + return x.AfterCompressMd5 + } + return "" +} + +func (x *OCRReqBody) GetAfterCompressFileSize() int32 { + if x != nil { + return x.AfterCompressFileSize + } + return 0 +} + +func (x *OCRReqBody) GetAfterCompressWeight() int32 { + if x != nil { + return x.AfterCompressWeight + } + return 0 +} + +func (x *OCRReqBody) GetAfterCompressHeight() int32 { + if x != nil { + return x.AfterCompressHeight + } + return 0 +} + +func (x *OCRReqBody) GetIsCut() bool { + if x != nil { + return x.IsCut + } + return false +} + +type DE07RspBody struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RetCode int32 `protobuf:"varint,1,opt,name=retCode,proto3" json:"retCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg,proto3" json:"errMsg,omitempty"` + Wording string `protobuf:"bytes,3,opt,name=wording,proto3" json:"wording,omitempty"` + OcrRspBody *OCRRspBody `protobuf:"bytes,10,opt,name=ocrRspBody,proto3" json:"ocrRspBody,omitempty"` +} + +func (x *DE07RspBody) Reset() { + *x = DE07RspBody{} + if protoimpl.UnsafeEnabled { + mi := &file_oidb0xe07_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DE07RspBody) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DE07RspBody) ProtoMessage() {} + +func (x *DE07RspBody) ProtoReflect() protoreflect.Message { + mi := &file_oidb0xe07_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DE07RspBody.ProtoReflect.Descriptor instead. +func (*DE07RspBody) Descriptor() ([]byte, []int) { + return file_oidb0xe07_proto_rawDescGZIP(), []int{2} +} + +func (x *DE07RspBody) GetRetCode() int32 { + if x != nil { + return x.RetCode + } + return 0 +} + +func (x *DE07RspBody) GetErrMsg() string { + if x != nil { + return x.ErrMsg + } + return "" +} + +func (x *DE07RspBody) GetWording() string { + if x != nil { + return x.Wording + } + return "" +} + +func (x *DE07RspBody) GetOcrRspBody() *OCRRspBody { + if x != nil { + return x.OcrRspBody + } + return nil +} + +type TextDetection struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DetectedText string `protobuf:"bytes,1,opt,name=detectedText,proto3" json:"detectedText,omitempty"` + Confidence int32 `protobuf:"varint,2,opt,name=confidence,proto3" json:"confidence,omitempty"` + Polygon *Polygon `protobuf:"bytes,3,opt,name=polygon,proto3" json:"polygon,omitempty"` + AdvancedInfo string `protobuf:"bytes,4,opt,name=advancedInfo,proto3" json:"advancedInfo,omitempty"` +} + +func (x *TextDetection) Reset() { + *x = TextDetection{} + if protoimpl.UnsafeEnabled { + mi := &file_oidb0xe07_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TextDetection) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TextDetection) ProtoMessage() {} + +func (x *TextDetection) ProtoReflect() protoreflect.Message { + mi := &file_oidb0xe07_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TextDetection.ProtoReflect.Descriptor instead. +func (*TextDetection) Descriptor() ([]byte, []int) { + return file_oidb0xe07_proto_rawDescGZIP(), []int{3} +} + +func (x *TextDetection) GetDetectedText() string { + if x != nil { + return x.DetectedText + } + return "" +} + +func (x *TextDetection) GetConfidence() int32 { + if x != nil { + return x.Confidence + } + return 0 +} + +func (x *TextDetection) GetPolygon() *Polygon { + if x != nil { + return x.Polygon + } + return nil +} + +func (x *TextDetection) GetAdvancedInfo() string { + if x != nil { + return x.AdvancedInfo + } + return "" +} + +type Polygon struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Coordinates []*Coordinate `protobuf:"bytes,1,rep,name=coordinates,proto3" json:"coordinates,omitempty"` +} + +func (x *Polygon) Reset() { + *x = Polygon{} + if protoimpl.UnsafeEnabled { + mi := &file_oidb0xe07_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Polygon) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Polygon) ProtoMessage() {} + +func (x *Polygon) ProtoReflect() protoreflect.Message { + mi := &file_oidb0xe07_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Polygon.ProtoReflect.Descriptor instead. +func (*Polygon) Descriptor() ([]byte, []int) { + return file_oidb0xe07_proto_rawDescGZIP(), []int{4} +} + +func (x *Polygon) GetCoordinates() []*Coordinate { + if x != nil { + return x.Coordinates + } + return nil +} + +type Coordinate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + X int32 `protobuf:"varint,1,opt,name=X,proto3" json:"X,omitempty"` + Y int32 `protobuf:"varint,2,opt,name=Y,proto3" json:"Y,omitempty"` +} + +func (x *Coordinate) Reset() { + *x = Coordinate{} + if protoimpl.UnsafeEnabled { + mi := &file_oidb0xe07_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Coordinate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Coordinate) ProtoMessage() {} + +func (x *Coordinate) ProtoReflect() protoreflect.Message { + mi := &file_oidb0xe07_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Coordinate.ProtoReflect.Descriptor instead. +func (*Coordinate) Descriptor() ([]byte, []int) { + return file_oidb0xe07_proto_rawDescGZIP(), []int{5} +} + +func (x *Coordinate) GetX() int32 { + if x != nil { + return x.X + } + return 0 +} + +func (x *Coordinate) GetY() int32 { + if x != nil { + return x.Y + } + return 0 +} + +type Language struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Language string `protobuf:"bytes,1,opt,name=language,proto3" json:"language,omitempty"` + LanguageDesc string `protobuf:"bytes,2,opt,name=languageDesc,proto3" json:"languageDesc,omitempty"` +} + +func (x *Language) Reset() { + *x = Language{} + if protoimpl.UnsafeEnabled { + mi := &file_oidb0xe07_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Language) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Language) ProtoMessage() {} + +func (x *Language) ProtoReflect() protoreflect.Message { + mi := &file_oidb0xe07_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Language.ProtoReflect.Descriptor instead. +func (*Language) Descriptor() ([]byte, []int) { + return file_oidb0xe07_proto_rawDescGZIP(), []int{6} +} + +func (x *Language) GetLanguage() string { + if x != nil { + return x.Language + } + return "" +} + +func (x *Language) GetLanguageDesc() string { + if x != nil { + return x.LanguageDesc + } + return "" +} + +type OCRRspBody struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TextDetections []*TextDetection `protobuf:"bytes,1,rep,name=textDetections,proto3" json:"textDetections,omitempty"` + Language string `protobuf:"bytes,2,opt,name=language,proto3" json:"language,omitempty"` + RequestId string `protobuf:"bytes,3,opt,name=requestId,proto3" json:"requestId,omitempty"` + OcrLanguageList []string `protobuf:"bytes,101,rep,name=ocrLanguageList,proto3" json:"ocrLanguageList,omitempty"` + DstTranslateLanguageList []string `protobuf:"bytes,102,rep,name=dstTranslateLanguageList,proto3" json:"dstTranslateLanguageList,omitempty"` + LanguageList []*Language `protobuf:"bytes,103,rep,name=languageList,proto3" json:"languageList,omitempty"` + AfterCompressWeight int32 `protobuf:"varint,111,opt,name=afterCompressWeight,proto3" json:"afterCompressWeight,omitempty"` + AfterCompressHeight int32 `protobuf:"varint,112,opt,name=afterCompressHeight,proto3" json:"afterCompressHeight,omitempty"` +} + +func (x *OCRRspBody) Reset() { + *x = OCRRspBody{} + if protoimpl.UnsafeEnabled { + mi := &file_oidb0xe07_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OCRRspBody) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OCRRspBody) ProtoMessage() {} + +func (x *OCRRspBody) ProtoReflect() protoreflect.Message { + mi := &file_oidb0xe07_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OCRRspBody.ProtoReflect.Descriptor instead. +func (*OCRRspBody) Descriptor() ([]byte, []int) { + return file_oidb0xe07_proto_rawDescGZIP(), []int{7} +} + +func (x *OCRRspBody) GetTextDetections() []*TextDetection { + if x != nil { + return x.TextDetections + } + return nil +} + +func (x *OCRRspBody) GetLanguage() string { + if x != nil { + return x.Language + } + return "" +} + +func (x *OCRRspBody) GetRequestId() string { + if x != nil { + return x.RequestId + } + return "" +} + +func (x *OCRRspBody) GetOcrLanguageList() []string { + if x != nil { + return x.OcrLanguageList + } + return nil +} + +func (x *OCRRspBody) GetDstTranslateLanguageList() []string { + if x != nil { + return x.DstTranslateLanguageList + } + return nil +} + +func (x *OCRRspBody) GetLanguageList() []*Language { + if x != nil { + return x.LanguageList + } + return nil +} + +func (x *OCRRspBody) GetAfterCompressWeight() int32 { + if x != nil { + return x.AfterCompressWeight + } + return 0 +} + +func (x *OCRRspBody) GetAfterCompressHeight() int32 { + if x != nil { + return x.AfterCompressHeight + } + return 0 +} + +var File_oidb0xe07_proto protoreflect.FileDescriptor + +var file_oidb0xe07_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x6f, 0x69, 0x64, 0x62, 0x30, 0x78, 0x65, 0x30, 0x37, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0x88, 0x01, 0x0a, 0x0b, 0x44, 0x45, 0x30, 0x37, 0x52, 0x65, 0x71, 0x42, 0x6f, 0x64, + 0x79, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x63, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6e, 0x63, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6e, 0x63, 0x65, 0x12, + 0x2b, 0x0a, 0x0a, 0x6f, 0x63, 0x72, 0x52, 0x65, 0x71, 0x42, 0x6f, 0x64, 0x79, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x4f, 0x43, 0x52, 0x52, 0x65, 0x71, 0x42, 0x6f, 0x64, 0x79, + 0x52, 0x0a, 0x6f, 0x63, 0x72, 0x52, 0x65, 0x71, 0x42, 0x6f, 0x64, 0x79, 0x22, 0xdc, 0x02, 0x0a, + 0x0a, 0x4f, 0x43, 0x52, 0x52, 0x65, 0x71, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x69, + 0x6d, 0x61, 0x67, 0x65, 0x55, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, + 0x6d, 0x61, 0x67, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x22, 0x0a, 0x0c, 0x6c, 0x61, 0x6e, 0x67, 0x75, + 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6c, + 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, + 0x63, 0x65, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x63, 0x65, 0x6e, + 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x4d, 0x64, 0x35, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x4d, 0x64, 0x35, 0x12, + 0x2a, 0x0a, 0x10, 0x61, 0x66, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, + 0x4d, 0x64, 0x35, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x61, 0x66, 0x74, 0x65, 0x72, + 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x4d, 0x64, 0x35, 0x12, 0x34, 0x0a, 0x15, 0x61, + 0x66, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x46, 0x69, 0x6c, 0x65, + 0x53, 0x69, 0x7a, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x15, 0x61, 0x66, 0x74, 0x65, + 0x72, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x69, 0x7a, + 0x65, 0x12, 0x30, 0x0a, 0x13, 0x61, 0x66, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, + 0x73, 0x73, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x13, + 0x61, 0x66, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x57, 0x65, 0x69, + 0x67, 0x68, 0x74, 0x12, 0x30, 0x0a, 0x13, 0x61, 0x66, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6d, 0x70, + 0x72, 0x65, 0x73, 0x73, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x13, 0x61, 0x66, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x48, + 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x43, 0x75, 0x74, 0x18, 0x0f, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x43, 0x75, 0x74, 0x22, 0x86, 0x01, 0x0a, 0x0b, + 0x44, 0x45, 0x30, 0x37, 0x52, 0x73, 0x70, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x72, + 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x65, + 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x18, 0x0a, + 0x07, 0x77, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x77, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x2b, 0x0a, 0x0a, 0x6f, 0x63, 0x72, 0x52, 0x73, + 0x70, 0x42, 0x6f, 0x64, 0x79, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x4f, 0x43, + 0x52, 0x52, 0x73, 0x70, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x0a, 0x6f, 0x63, 0x72, 0x52, 0x73, 0x70, + 0x42, 0x6f, 0x64, 0x79, 0x22, 0x9b, 0x01, 0x0a, 0x0d, 0x54, 0x65, 0x78, 0x74, 0x44, 0x65, 0x74, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x0c, 0x64, 0x65, 0x74, 0x65, 0x63, 0x74, + 0x65, 0x64, 0x54, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x65, + 0x74, 0x65, 0x63, 0x74, 0x65, 0x64, 0x54, 0x65, 0x78, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x22, 0x0a, 0x07, 0x70, 0x6f, + 0x6c, 0x79, 0x67, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x50, 0x6f, + 0x6c, 0x79, 0x67, 0x6f, 0x6e, 0x52, 0x07, 0x70, 0x6f, 0x6c, 0x79, 0x67, 0x6f, 0x6e, 0x12, 0x22, + 0x0a, 0x0c, 0x61, 0x64, 0x76, 0x61, 0x6e, 0x63, 0x65, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x64, 0x76, 0x61, 0x6e, 0x63, 0x65, 0x64, 0x49, 0x6e, + 0x66, 0x6f, 0x22, 0x38, 0x0a, 0x07, 0x50, 0x6f, 0x6c, 0x79, 0x67, 0x6f, 0x6e, 0x12, 0x2d, 0x0a, + 0x0b, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x52, + 0x0b, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x73, 0x22, 0x28, 0x0a, 0x0a, + 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x12, 0x0c, 0x0a, 0x01, 0x58, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x01, 0x58, 0x12, 0x0c, 0x0a, 0x01, 0x59, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x01, 0x59, 0x22, 0x4a, 0x0a, 0x08, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, + 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x12, 0x22, + 0x0a, 0x0c, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x44, 0x65, 0x73, 0x63, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x44, 0x65, + 0x73, 0x63, 0x22, 0xf7, 0x02, 0x0a, 0x0a, 0x4f, 0x43, 0x52, 0x52, 0x73, 0x70, 0x42, 0x6f, 0x64, + 0x79, 0x12, 0x36, 0x0a, 0x0e, 0x74, 0x65, 0x78, 0x74, 0x44, 0x65, 0x74, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x54, 0x65, 0x78, 0x74, + 0x44, 0x65, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x74, 0x65, 0x78, 0x74, 0x44, + 0x65, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x61, 0x6e, + 0x67, 0x75, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, + 0x67, 0x75, 0x61, 0x67, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x6f, 0x63, 0x72, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, + 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x65, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x6f, 0x63, + 0x72, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x3a, 0x0a, + 0x18, 0x64, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x6c, 0x61, 0x74, 0x65, 0x4c, 0x61, 0x6e, + 0x67, 0x75, 0x61, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x66, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x18, 0x64, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x6c, 0x61, 0x74, 0x65, 0x4c, 0x61, 0x6e, + 0x67, 0x75, 0x61, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x0c, 0x6c, 0x61, 0x6e, + 0x67, 0x75, 0x61, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x67, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x09, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x52, 0x0c, 0x6c, 0x61, 0x6e, 0x67, + 0x75, 0x61, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x30, 0x0a, 0x13, 0x61, 0x66, 0x74, 0x65, + 0x72, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, + 0x6f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x13, 0x61, 0x66, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6d, 0x70, + 0x72, 0x65, 0x73, 0x73, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x30, 0x0a, 0x13, 0x61, 0x66, + 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x48, 0x65, 0x69, 0x67, 0x68, + 0x74, 0x18, 0x70, 0x20, 0x01, 0x28, 0x05, 0x52, 0x13, 0x61, 0x66, 0x74, 0x65, 0x72, 0x43, 0x6f, + 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x42, 0x08, 0x5a, 0x06, + 0x2e, 0x3b, 0x6f, 0x69, 0x64, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_oidb0xe07_proto_rawDescOnce sync.Once + file_oidb0xe07_proto_rawDescData = file_oidb0xe07_proto_rawDesc +) + +func file_oidb0xe07_proto_rawDescGZIP() []byte { + file_oidb0xe07_proto_rawDescOnce.Do(func() { + file_oidb0xe07_proto_rawDescData = protoimpl.X.CompressGZIP(file_oidb0xe07_proto_rawDescData) + }) + return file_oidb0xe07_proto_rawDescData +} + +var file_oidb0xe07_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_oidb0xe07_proto_goTypes = []interface{}{ + (*DE07ReqBody)(nil), // 0: DE07ReqBody + (*OCRReqBody)(nil), // 1: OCRReqBody + (*DE07RspBody)(nil), // 2: DE07RspBody + (*TextDetection)(nil), // 3: TextDetection + (*Polygon)(nil), // 4: Polygon + (*Coordinate)(nil), // 5: Coordinate + (*Language)(nil), // 6: Language + (*OCRRspBody)(nil), // 7: OCRRspBody +} +var file_oidb0xe07_proto_depIdxs = []int32{ + 1, // 0: DE07ReqBody.ocrReqBody:type_name -> OCRReqBody + 7, // 1: DE07RspBody.ocrRspBody:type_name -> OCRRspBody + 4, // 2: TextDetection.polygon:type_name -> Polygon + 5, // 3: Polygon.coordinates:type_name -> Coordinate + 3, // 4: OCRRspBody.textDetections:type_name -> TextDetection + 6, // 5: OCRRspBody.languageList:type_name -> Language + 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_oidb0xe07_proto_init() } +func file_oidb0xe07_proto_init() { + if File_oidb0xe07_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_oidb0xe07_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DE07ReqBody); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oidb0xe07_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OCRReqBody); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oidb0xe07_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DE07RspBody); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oidb0xe07_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TextDetection); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oidb0xe07_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Polygon); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oidb0xe07_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Coordinate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oidb0xe07_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Language); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_oidb0xe07_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OCRRspBody); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_oidb0xe07_proto_rawDesc, + NumEnums: 0, + NumMessages: 8, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_oidb0xe07_proto_goTypes, + DependencyIndexes: file_oidb0xe07_proto_depIdxs, + MessageInfos: file_oidb0xe07_proto_msgTypes, + }.Build() + File_oidb0xe07_proto = out.File + file_oidb0xe07_proto_rawDesc = nil + file_oidb0xe07_proto_goTypes = nil + file_oidb0xe07_proto_depIdxs = nil +} diff --git a/client/pb/oidb/oidb0xe07.proto b/client/pb/oidb/oidb0xe07.proto new file mode 100644 index 00000000..bc764ca1 --- /dev/null +++ b/client/pb/oidb/oidb0xe07.proto @@ -0,0 +1,61 @@ +syntax = "proto3"; + +option go_package = ".;oidb"; + +message DE07ReqBody { + int32 version = 1; + int32 client = 2; + int32 entrance = 3; + OCRReqBody ocrReqBody = 10; +} + +message OCRReqBody { + string imageUrl = 1; + string languageType = 2; + string scene = 3; + string originMd5 = 10; + string afterCompressMd5 = 11; + int32 afterCompressFileSize = 12; + int32 afterCompressWeight = 13; + int32 afterCompressHeight = 14; + bool isCut = 15; +} + +message DE07RspBody { + int32 retCode = 1; + string errMsg = 2; + string wording = 3; + OCRRspBody ocrRspBody = 10; +} + +message TextDetection { + string detectedText = 1; + int32 confidence = 2; + Polygon polygon = 3; + string advancedInfo = 4; +} + +message Polygon { + repeated Coordinate coordinates = 1; +} + +message Coordinate { + int32 X = 1; + int32 Y = 2; +} + +message Language { + string language = 1; + string languageDesc = 2; +} + +message OCRRspBody { + repeated TextDetection textDetections = 1; + string language = 2; + string requestId = 3; + repeated string ocrLanguageList = 101; + repeated string dstTranslateLanguageList = 102; + repeated Language languageList = 103; + int32 afterCompressWeight = 111; + int32 afterCompressHeight = 112; +} diff --git a/client/pb/qweb/app.pb.go b/client/pb/qweb/app.pb.go new file mode 100644 index 00000000..c08065cc --- /dev/null +++ b/client/pb/qweb/app.pb.go @@ -0,0 +1,587 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.11.4 +// source: app.proto + +package qweb + +import ( + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +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) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type GetAppInfoByIdReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + //CommonExt ExtInfo = 1; + AppId string `protobuf:"bytes,2,opt,name=appId,proto3" json:"appId,omitempty"` + NeedVersionInfo int32 `protobuf:"varint,3,opt,name=needVersionInfo,proto3" json:"needVersionInfo,omitempty"` +} + +func (x *GetAppInfoByIdReq) Reset() { + *x = GetAppInfoByIdReq{} + if protoimpl.UnsafeEnabled { + mi := &file_app_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAppInfoByIdReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAppInfoByIdReq) ProtoMessage() {} + +func (x *GetAppInfoByIdReq) ProtoReflect() protoreflect.Message { + mi := &file_app_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAppInfoByIdReq.ProtoReflect.Descriptor instead. +func (*GetAppInfoByIdReq) Descriptor() ([]byte, []int) { + return file_app_proto_rawDescGZIP(), []int{0} +} + +func (x *GetAppInfoByIdReq) GetAppId() string { + if x != nil { + return x.AppId + } + return "" +} + +func (x *GetAppInfoByIdReq) GetNeedVersionInfo() int32 { + if x != nil { + return x.NeedVersionInfo + } + return 0 +} + +type GetAppInfoByIdRsp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AppInfo *ApiAppInfo `protobuf:"bytes,2,opt,name=appInfo,proto3" json:"appInfo,omitempty"` +} + +func (x *GetAppInfoByIdRsp) Reset() { + *x = GetAppInfoByIdRsp{} + if protoimpl.UnsafeEnabled { + mi := &file_app_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAppInfoByIdRsp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAppInfoByIdRsp) ProtoMessage() {} + +func (x *GetAppInfoByIdRsp) ProtoReflect() protoreflect.Message { + mi := &file_app_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAppInfoByIdRsp.ProtoReflect.Descriptor instead. +func (*GetAppInfoByIdRsp) Descriptor() ([]byte, []int) { + return file_app_proto_rawDescGZIP(), []int{1} +} + +func (x *GetAppInfoByIdRsp) GetAppInfo() *ApiAppInfo { + if x != nil { + return x.AppInfo + } + return nil +} + +type ApiAppInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AppId string `protobuf:"bytes,1,opt,name=appId,proto3" json:"appId,omitempty"` + AppName string `protobuf:"bytes,2,opt,name=appName,proto3" json:"appName,omitempty"` + Icon string `protobuf:"bytes,3,opt,name=icon,proto3" json:"icon,omitempty"` + DownloadUrl string `protobuf:"bytes,4,opt,name=downloadUrl,proto3" json:"downloadUrl,omitempty"` + Version string `protobuf:"bytes,5,opt,name=version,proto3" json:"version,omitempty"` + Desc string `protobuf:"bytes,6,opt,name=desc,proto3" json:"desc,omitempty"` + // pub accts = 7; + Type int32 `protobuf:"varint,8,opt,name=type,proto3" json:"type,omitempty"` + BaseLibMiniVersion string `protobuf:"bytes,9,opt,name=baseLibMiniVersion,proto3" json:"baseLibMiniVersion,omitempty"` + SubPkgs []*AppSubPkgInfo `protobuf:"bytes,10,rep,name=subPkgs,proto3" json:"subPkgs,omitempty"` + // first = 11; + Domain *DomainConfig `protobuf:"bytes,12,opt,name=domain,proto3" json:"domain,omitempty"` +} + +func (x *ApiAppInfo) Reset() { + *x = ApiAppInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_app_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ApiAppInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApiAppInfo) ProtoMessage() {} + +func (x *ApiAppInfo) ProtoReflect() protoreflect.Message { + mi := &file_app_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ApiAppInfo.ProtoReflect.Descriptor instead. +func (*ApiAppInfo) Descriptor() ([]byte, []int) { + return file_app_proto_rawDescGZIP(), []int{2} +} + +func (x *ApiAppInfo) GetAppId() string { + if x != nil { + return x.AppId + } + return "" +} + +func (x *ApiAppInfo) GetAppName() string { + if x != nil { + return x.AppName + } + return "" +} + +func (x *ApiAppInfo) GetIcon() string { + if x != nil { + return x.Icon + } + return "" +} + +func (x *ApiAppInfo) GetDownloadUrl() string { + if x != nil { + return x.DownloadUrl + } + return "" +} + +func (x *ApiAppInfo) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *ApiAppInfo) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *ApiAppInfo) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +func (x *ApiAppInfo) GetBaseLibMiniVersion() string { + if x != nil { + return x.BaseLibMiniVersion + } + return "" +} + +func (x *ApiAppInfo) GetSubPkgs() []*AppSubPkgInfo { + if x != nil { + return x.SubPkgs + } + return nil +} + +func (x *ApiAppInfo) GetDomain() *DomainConfig { + if x != nil { + return x.Domain + } + return nil +} + +type AppSubPkgInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SubPkgName string `protobuf:"bytes,1,opt,name=subPkgName,proto3" json:"subPkgName,omitempty"` + DownloadUrl string `protobuf:"bytes,2,opt,name=downloadUrl,proto3" json:"downloadUrl,omitempty"` + Independent int32 `protobuf:"varint,3,opt,name=independent,proto3" json:"independent,omitempty"` + FileSize int32 `protobuf:"varint,4,opt,name=fileSize,proto3" json:"fileSize,omitempty"` +} + +func (x *AppSubPkgInfo) Reset() { + *x = AppSubPkgInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_app_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AppSubPkgInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AppSubPkgInfo) ProtoMessage() {} + +func (x *AppSubPkgInfo) ProtoReflect() protoreflect.Message { + mi := &file_app_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AppSubPkgInfo.ProtoReflect.Descriptor instead. +func (*AppSubPkgInfo) Descriptor() ([]byte, []int) { + return file_app_proto_rawDescGZIP(), []int{3} +} + +func (x *AppSubPkgInfo) GetSubPkgName() string { + if x != nil { + return x.SubPkgName + } + return "" +} + +func (x *AppSubPkgInfo) GetDownloadUrl() string { + if x != nil { + return x.DownloadUrl + } + return "" +} + +func (x *AppSubPkgInfo) GetIndependent() int32 { + if x != nil { + return x.Independent + } + return 0 +} + +func (x *AppSubPkgInfo) GetFileSize() int32 { + if x != nil { + return x.FileSize + } + return 0 +} + +type DomainConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RequestDomain []string `protobuf:"bytes,1,rep,name=requestDomain,proto3" json:"requestDomain,omitempty"` + SocketDomain []string `protobuf:"bytes,2,rep,name=socketDomain,proto3" json:"socketDomain,omitempty"` + UploadFileDomain []string `protobuf:"bytes,3,rep,name=uploadFileDomain,proto3" json:"uploadFileDomain,omitempty"` + DownloadFileDomain []string `protobuf:"bytes,4,rep,name=downloadFileDomain,proto3" json:"downloadFileDomain,omitempty"` + BusinessDomain []string `protobuf:"bytes,5,rep,name=businessDomain,proto3" json:"businessDomain,omitempty"` + UdpIpList []string `protobuf:"bytes,6,rep,name=udpIpList,proto3" json:"udpIpList,omitempty"` +} + +func (x *DomainConfig) Reset() { + *x = DomainConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_app_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DomainConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DomainConfig) ProtoMessage() {} + +func (x *DomainConfig) ProtoReflect() protoreflect.Message { + mi := &file_app_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DomainConfig.ProtoReflect.Descriptor instead. +func (*DomainConfig) Descriptor() ([]byte, []int) { + return file_app_proto_rawDescGZIP(), []int{4} +} + +func (x *DomainConfig) GetRequestDomain() []string { + if x != nil { + return x.RequestDomain + } + return nil +} + +func (x *DomainConfig) GetSocketDomain() []string { + if x != nil { + return x.SocketDomain + } + return nil +} + +func (x *DomainConfig) GetUploadFileDomain() []string { + if x != nil { + return x.UploadFileDomain + } + return nil +} + +func (x *DomainConfig) GetDownloadFileDomain() []string { + if x != nil { + return x.DownloadFileDomain + } + return nil +} + +func (x *DomainConfig) GetBusinessDomain() []string { + if x != nil { + return x.BusinessDomain + } + return nil +} + +func (x *DomainConfig) GetUdpIpList() []string { + if x != nil { + return x.UdpIpList + } + return nil +} + +var File_app_proto protoreflect.FileDescriptor + +var file_app_proto_rawDesc = []byte{ + 0x0a, 0x09, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x53, 0x0a, 0x11, 0x47, + 0x65, 0x74, 0x41, 0x70, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, + 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x6e, 0x65, 0x65, 0x64, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0f, 0x6e, 0x65, 0x65, 0x64, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, + 0x22, 0x3a, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x79, + 0x49, 0x64, 0x52, 0x73, 0x70, 0x12, 0x25, 0x0a, 0x07, 0x61, 0x70, 0x70, 0x49, 0x6e, 0x66, 0x6f, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x41, 0x70, 0x69, 0x41, 0x70, 0x70, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x61, 0x70, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0xb5, 0x02, 0x0a, + 0x0a, 0x41, 0x70, 0x69, 0x41, 0x70, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x61, + 0x70, 0x70, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, + 0x64, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x61, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x69, + 0x63, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x12, + 0x20, 0x0a, 0x0b, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x55, 0x72, 0x6c, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x55, 0x72, + 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x64, + 0x65, 0x73, 0x63, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, + 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x12, 0x2e, 0x0a, 0x12, 0x62, 0x61, 0x73, 0x65, 0x4c, 0x69, 0x62, 0x4d, 0x69, + 0x6e, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x12, 0x62, 0x61, 0x73, 0x65, 0x4c, 0x69, 0x62, 0x4d, 0x69, 0x6e, 0x69, 0x56, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x50, 0x6b, 0x67, 0x73, 0x18, 0x0a, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x41, 0x70, 0x70, 0x53, 0x75, 0x62, 0x50, 0x6b, 0x67, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x73, 0x75, 0x62, 0x50, 0x6b, 0x67, 0x73, 0x12, 0x25, 0x0a, + 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, + 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06, 0x64, 0x6f, + 0x6d, 0x61, 0x69, 0x6e, 0x22, 0x8f, 0x01, 0x0a, 0x0d, 0x41, 0x70, 0x70, 0x53, 0x75, 0x62, 0x50, + 0x6b, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x75, 0x62, 0x50, 0x6b, 0x67, + 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x75, 0x62, 0x50, + 0x6b, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, + 0x61, 0x64, 0x55, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x6f, 0x77, + 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x55, 0x72, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x69, 0x6e, 0x64, 0x65, + 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x69, + 0x6e, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, + 0x6c, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x66, 0x69, + 0x6c, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0xfa, 0x01, 0x0a, 0x0c, 0x44, 0x6f, 0x6d, 0x61, 0x69, + 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x24, 0x0a, 0x0d, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x22, 0x0a, + 0x0c, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x44, 0x6f, 0x6d, 0x61, 0x69, + 0x6e, 0x12, 0x2a, 0x0a, 0x10, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x44, + 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x75, 0x70, 0x6c, + 0x6f, 0x61, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x2e, 0x0a, + 0x12, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x6f, 0x6d, + 0x61, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x12, 0x64, 0x6f, 0x77, 0x6e, 0x6c, + 0x6f, 0x61, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x26, 0x0a, + 0x0e, 0x62, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, + 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x62, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x44, + 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x64, 0x70, 0x49, 0x70, 0x4c, 0x69, + 0x73, 0x74, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x75, 0x64, 0x70, 0x49, 0x70, 0x4c, + 0x69, 0x73, 0x74, 0x42, 0x08, 0x5a, 0x06, 0x2e, 0x3b, 0x71, 0x77, 0x65, 0x62, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_app_proto_rawDescOnce sync.Once + file_app_proto_rawDescData = file_app_proto_rawDesc +) + +func file_app_proto_rawDescGZIP() []byte { + file_app_proto_rawDescOnce.Do(func() { + file_app_proto_rawDescData = protoimpl.X.CompressGZIP(file_app_proto_rawDescData) + }) + return file_app_proto_rawDescData +} + +var file_app_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_app_proto_goTypes = []interface{}{ + (*GetAppInfoByIdReq)(nil), // 0: GetAppInfoByIdReq + (*GetAppInfoByIdRsp)(nil), // 1: GetAppInfoByIdRsp + (*ApiAppInfo)(nil), // 2: ApiAppInfo + (*AppSubPkgInfo)(nil), // 3: AppSubPkgInfo + (*DomainConfig)(nil), // 4: DomainConfig +} +var file_app_proto_depIdxs = []int32{ + 2, // 0: GetAppInfoByIdRsp.appInfo:type_name -> ApiAppInfo + 3, // 1: ApiAppInfo.subPkgs:type_name -> AppSubPkgInfo + 4, // 2: ApiAppInfo.domain:type_name -> DomainConfig + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_app_proto_init() } +func file_app_proto_init() { + if File_app_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_app_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAppInfoByIdReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_app_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAppInfoByIdRsp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_app_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ApiAppInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_app_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AppSubPkgInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_app_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DomainConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_app_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_app_proto_goTypes, + DependencyIndexes: file_app_proto_depIdxs, + MessageInfos: file_app_proto_msgTypes, + }.Build() + File_app_proto = out.File + file_app_proto_rawDesc = nil + file_app_proto_goTypes = nil + file_app_proto_depIdxs = nil +} diff --git a/client/pb/qweb/app.proto b/client/pb/qweb/app.proto new file mode 100644 index 00000000..799e3d1f --- /dev/null +++ b/client/pb/qweb/app.proto @@ -0,0 +1,44 @@ +syntax = "proto3"; + +option go_package = ".;qweb"; + +message GetAppInfoByIdReq { + //CommonExt ExtInfo = 1; + string appId = 2; + int32 needVersionInfo = 3; +} + +message GetAppInfoByIdRsp { + ApiAppInfo appInfo = 2; +} + +message ApiAppInfo { + string appId = 1; + string appName = 2; + string icon = 3; + string downloadUrl = 4; + string version = 5; + string desc = 6; + // pub accts = 7; + int32 type = 8; + string baseLibMiniVersion = 9; + repeated AppSubPkgInfo subPkgs = 10; + // first = 11; + DomainConfig domain = 12; +} + +message AppSubPkgInfo { + string subPkgName = 1; + string downloadUrl = 2; + int32 independent = 3; + int32 fileSize = 4; +} + +message DomainConfig { + repeated string requestDomain = 1; + repeated string socketDomain = 2; + repeated string uploadFileDomain = 3; + repeated string downloadFileDomain = 4; + repeated string businessDomain = 5; + repeated string udpIpList = 6; +} \ No newline at end of file diff --git a/client/pb/qweb/protocol.pb.go b/client/pb/qweb/protocol.pb.go new file mode 100644 index 00000000..c1e16b23 --- /dev/null +++ b/client/pb/qweb/protocol.pb.go @@ -0,0 +1,275 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.11.4 +// source: protocol.proto + +package qweb + +import ( + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +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) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type QWebReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Seq int64 `protobuf:"varint,1,opt,name=seq,proto3" json:"seq,omitempty"` + Qua string `protobuf:"bytes,2,opt,name=qua,proto3" json:"qua,omitempty"` + DeviceInfo string `protobuf:"bytes,3,opt,name=deviceInfo,proto3" json:"deviceInfo,omitempty"` + BusiBuff []byte `protobuf:"bytes,4,opt,name=busiBuff,proto3" json:"busiBuff,omitempty"` + TraceId string `protobuf:"bytes,5,opt,name=traceId,proto3" json:"traceId,omitempty"` +} + +func (x *QWebReq) Reset() { + *x = QWebReq{} + if protoimpl.UnsafeEnabled { + mi := &file_protocol_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QWebReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QWebReq) ProtoMessage() {} + +func (x *QWebReq) ProtoReflect() protoreflect.Message { + mi := &file_protocol_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QWebReq.ProtoReflect.Descriptor instead. +func (*QWebReq) Descriptor() ([]byte, []int) { + return file_protocol_proto_rawDescGZIP(), []int{0} +} + +func (x *QWebReq) GetSeq() int64 { + if x != nil { + return x.Seq + } + return 0 +} + +func (x *QWebReq) GetQua() string { + if x != nil { + return x.Qua + } + return "" +} + +func (x *QWebReq) GetDeviceInfo() string { + if x != nil { + return x.DeviceInfo + } + return "" +} + +func (x *QWebReq) GetBusiBuff() []byte { + if x != nil { + return x.BusiBuff + } + return nil +} + +func (x *QWebReq) GetTraceId() string { + if x != nil { + return x.TraceId + } + return "" +} + +type QWebRsp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Seq int64 `protobuf:"varint,1,opt,name=seq,proto3" json:"seq,omitempty"` + RetCode int64 `protobuf:"varint,2,opt,name=retCode,proto3" json:"retCode,omitempty"` + ErrMsg string `protobuf:"bytes,3,opt,name=errMsg,proto3" json:"errMsg,omitempty"` + BusiBuff []byte `protobuf:"bytes,4,opt,name=busiBuff,proto3" json:"busiBuff,omitempty"` +} + +func (x *QWebRsp) Reset() { + *x = QWebRsp{} + if protoimpl.UnsafeEnabled { + mi := &file_protocol_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QWebRsp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QWebRsp) ProtoMessage() {} + +func (x *QWebRsp) ProtoReflect() protoreflect.Message { + mi := &file_protocol_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QWebRsp.ProtoReflect.Descriptor instead. +func (*QWebRsp) Descriptor() ([]byte, []int) { + return file_protocol_proto_rawDescGZIP(), []int{1} +} + +func (x *QWebRsp) GetSeq() int64 { + if x != nil { + return x.Seq + } + return 0 +} + +func (x *QWebRsp) GetRetCode() int64 { + if x != nil { + return x.RetCode + } + return 0 +} + +func (x *QWebRsp) GetErrMsg() string { + if x != nil { + return x.ErrMsg + } + return "" +} + +func (x *QWebRsp) GetBusiBuff() []byte { + if x != nil { + return x.BusiBuff + } + return nil +} + +var File_protocol_proto protoreflect.FileDescriptor + +var file_protocol_proto_rawDesc = []byte{ + 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x83, 0x01, 0x0a, 0x07, 0x51, 0x57, 0x65, 0x62, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, + 0x73, 0x65, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x73, 0x65, 0x71, 0x12, 0x10, + 0x0a, 0x03, 0x71, 0x75, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x71, 0x75, 0x61, + 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x75, 0x73, 0x69, 0x42, 0x75, 0x66, 0x66, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x08, 0x62, 0x75, 0x73, 0x69, 0x42, 0x75, 0x66, 0x66, 0x12, 0x18, 0x0a, 0x07, + 0x74, 0x72, 0x61, 0x63, 0x65, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, + 0x72, 0x61, 0x63, 0x65, 0x49, 0x64, 0x22, 0x69, 0x0a, 0x07, 0x51, 0x57, 0x65, 0x62, 0x52, 0x73, + 0x70, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x65, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, + 0x73, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x72, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, + 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, + 0x72, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x75, 0x73, 0x69, 0x42, 0x75, 0x66, + 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x62, 0x75, 0x73, 0x69, 0x42, 0x75, 0x66, + 0x66, 0x42, 0x08, 0x5a, 0x06, 0x2e, 0x3b, 0x71, 0x77, 0x65, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_protocol_proto_rawDescOnce sync.Once + file_protocol_proto_rawDescData = file_protocol_proto_rawDesc +) + +func file_protocol_proto_rawDescGZIP() []byte { + file_protocol_proto_rawDescOnce.Do(func() { + file_protocol_proto_rawDescData = protoimpl.X.CompressGZIP(file_protocol_proto_rawDescData) + }) + return file_protocol_proto_rawDescData +} + +var file_protocol_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_protocol_proto_goTypes = []interface{}{ + (*QWebReq)(nil), // 0: QWebReq + (*QWebRsp)(nil), // 1: QWebRsp +} +var file_protocol_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_protocol_proto_init() } +func file_protocol_proto_init() { + if File_protocol_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_protocol_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QWebReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protocol_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QWebRsp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_protocol_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_protocol_proto_goTypes, + DependencyIndexes: file_protocol_proto_depIdxs, + MessageInfos: file_protocol_proto_msgTypes, + }.Build() + File_protocol_proto = out.File + file_protocol_proto_rawDesc = nil + file_protocol_proto_goTypes = nil + file_protocol_proto_depIdxs = nil +} diff --git a/client/pb/qweb/protocol.proto b/client/pb/qweb/protocol.proto new file mode 100644 index 00000000..41adb96d --- /dev/null +++ b/client/pb/qweb/protocol.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +option go_package = ".;qweb"; + +message QWebReq { + int64 seq = 1; + string qua = 2; + string deviceInfo = 3; + bytes busiBuff = 4; + string traceId = 5; +} + +message QWebRsp { + int64 seq = 1; + int64 retCode = 2; + string errMsg = 3; + bytes busiBuff = 4; +} \ No newline at end of file diff --git a/message/elements.go b/message/elements.go index f6f4f110..a6466e0a 100644 --- a/message/elements.go +++ b/message/elements.go @@ -2,6 +2,7 @@ package message import ( "fmt" + "github.com/Mrs4s/MiraiGo/binary" "github.com/Mrs4s/MiraiGo/client/pb/msg" "strconv" "strings" @@ -14,6 +15,8 @@ type TextElement struct { type ImageElement struct { Filename string Size int32 + Width int32 + Height int32 Url string Md5 []byte Data []byte @@ -22,6 +25,9 @@ type ImageElement struct { type GroupImageElement struct { ImageId string FileId int64 + Size int32 + Width int32 + Height int32 Md5 []byte Url string } @@ -119,12 +125,15 @@ func NewImage(data []byte) *ImageElement { } } -func NewGroupImage(id string, md5 []byte, fid int64) *GroupImageElement { +func NewGroupImage(id string, md5 []byte, fid int64, size, width, height int32) *GroupImageElement { return &GroupImageElement{ ImageId: id, FileId: fid, Md5: md5, - Url: "http://gchat.qpic.cn/gchatpic_new/1/0-0-" + strings.ReplaceAll(id[1:36], "-", "") + "/0?term=2", + Size: size, + Width: width, + Height: height, + Url: "http://gchat.qpic.cn/gchatpic_new/1/0-0-" + strings.ReplaceAll(binary.CalculateImageResourceId(md5)[1:37], "-", "") + "/0?term=2", } } diff --git a/message/message.go b/message/message.go index 702c274c..e4f2ed1e 100644 --- a/message/message.go +++ b/message/message.go @@ -294,6 +294,7 @@ func ToProtoElems(elems []IMessageElement, generalFlags bool) (r []*msg.Elem) { CustomFace: &msg.CustomFace{ FilePath: e.Filename, Md5: e.Md5, + Size: e.Size, Flag: make([]byte, 4), OldData: imgOld, }, @@ -306,6 +307,7 @@ func ToProtoElems(elems []IMessageElement, generalFlags bool) (r []*msg.Elem) { Origin: 1, FileId: int32(e.FileId), FilePath: e.ImageId, + Size: e.Size, Md5: e.Md5[:], Flag: make([]byte, 4), //OldData: imgOld, @@ -522,6 +524,8 @@ func ParseMessageElems(elems []*msg.Elem) []IMessageElement { res = append(res, &ImageElement{ Filename: elem.CustomFace.FilePath, Size: elem.CustomFace.Size, + Width: elem.CustomFace.Width, + Height: elem.CustomFace.Height, Url: func() string { if elem.CustomFace.OrigUrl == "" { return "http://gchat.qpic.cn/gchatpic_new/0/0-0-" + strings.ReplaceAll(binary.CalculateImageResourceId(elem.CustomFace.Md5)[1:37], "-", "") + "/0?term=2"