mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 11:07:40 +08:00
添加群打卡接口 (看起来是这个包 (#273)
* group sign * group sign * rename pb file 0xeb7 * new proto impl
This commit is contained in:
parent
52148a8ddf
commit
1288c30775
@ -119,11 +119,11 @@ func getSSOAddress() ([]netip.AddrPort, error) {
|
||||
protocol := SystemDeviceInfo.Protocol.Version()
|
||||
key, _ := hex.DecodeString("F0441F5FF42DA58FDCF7949ABA62D411")
|
||||
payload := jce.NewJceWriter(). // see ServerConfig.d
|
||||
WriteInt64(0, 1).WriteInt64(0, 2).WriteByte(1, 3).
|
||||
WriteString("00000", 4).WriteInt32(100, 5).
|
||||
WriteInt32(int32(protocol.AppId), 6).WriteString(SystemDeviceInfo.IMEI, 7).
|
||||
WriteInt64(0, 8).WriteInt64(0, 9).WriteInt64(0, 10).
|
||||
WriteInt64(0, 11).WriteByte(0, 12).WriteInt64(0, 13).Bytes()
|
||||
WriteInt64(0, 1).WriteInt64(0, 2).WriteByte(1, 3).
|
||||
WriteString("00000", 4).WriteInt32(100, 5).
|
||||
WriteInt32(int32(protocol.AppId), 6).WriteString(SystemDeviceInfo.IMEI, 7).
|
||||
WriteInt64(0, 8).WriteInt64(0, 9).WriteInt64(0, 10).
|
||||
WriteInt64(0, 11).WriteByte(0, 12).WriteInt64(0, 13).Bytes()
|
||||
buf := &jce.RequestDataVersion3{
|
||||
Map: map[string][]byte{"HttpServerListReq": packUniRequestData(payload)},
|
||||
}
|
||||
|
170
client/pb/oidb/oidb0xeb7.pb.go
Normal file
170
client/pb/oidb/oidb0xeb7.pb.go
Normal file
@ -0,0 +1,170 @@
|
||||
// Code generated by protoc-gen-golite. DO NOT EDIT.
|
||||
// source: oidb0xeb7.proto
|
||||
|
||||
package oidb
|
||||
|
||||
import (
|
||||
proto "github.com/RomiChan/protobuf/proto"
|
||||
)
|
||||
|
||||
// DEB7 prefix
|
||||
type DEB7ReqBody struct {
|
||||
SignInStatusReq *StSignInStatusReq `protobuf:"bytes,1,opt"`
|
||||
SignInWriteReq *StSignInWriteReq `protobuf:"bytes,2,opt"`
|
||||
}
|
||||
|
||||
type DEB7Ret struct {
|
||||
Code proto.Option[uint32] `protobuf:"varint,1,opt"`
|
||||
Msg proto.Option[string] `protobuf:"bytes,2,opt"`
|
||||
}
|
||||
|
||||
type DEB7RspBody struct {
|
||||
SignInStatusRsp *StSignInStatusRsp `protobuf:"bytes,1,opt"`
|
||||
SignInWriteRsp *StSignInWriteRsp `protobuf:"bytes,2,opt"`
|
||||
}
|
||||
|
||||
type SignInStatusBase struct {
|
||||
Status proto.Option[uint32] `protobuf:"varint,1,opt"`
|
||||
CurrentTimeStamp proto.Option[int64] `protobuf:"varint,2,opt"`
|
||||
}
|
||||
|
||||
type SignInStatusDoneInfo struct {
|
||||
LeftTitleWrod proto.Option[string] `protobuf:"bytes,1,opt"`
|
||||
RightDescWord proto.Option[string] `protobuf:"bytes,2,opt"`
|
||||
BelowPortraitWords []string `protobuf:"bytes,3,rep"`
|
||||
RecordUrl proto.Option[string] `protobuf:"bytes,4,opt"`
|
||||
}
|
||||
|
||||
type SignInStatusGroupScore struct {
|
||||
GroupScoreWord proto.Option[string] `protobuf:"bytes,1,opt"`
|
||||
ScoreUrl proto.Option[string] `protobuf:"bytes,2,opt"`
|
||||
}
|
||||
|
||||
type SignInStatusNotInfo struct {
|
||||
ButtonWord proto.Option[string] `protobuf:"bytes,1,opt"`
|
||||
SignDescWordLeft proto.Option[string] `protobuf:"bytes,2,opt"`
|
||||
SignDescWordRight proto.Option[string] `protobuf:"bytes,3,opt"`
|
||||
}
|
||||
|
||||
type SignInStatusYesterdayFirst struct {
|
||||
YesterdayFirstUid proto.Option[string] `protobuf:"bytes,1,opt"`
|
||||
YesterdayWord proto.Option[string] `protobuf:"bytes,2,opt"`
|
||||
YesterdayNick proto.Option[string] `protobuf:"bytes,3,opt"`
|
||||
}
|
||||
|
||||
type StDaySignedInfo struct {
|
||||
Uid proto.Option[string] `protobuf:"bytes,1,opt"`
|
||||
UidGroupNick proto.Option[string] `protobuf:"bytes,2,opt"`
|
||||
SignedTimeStamp proto.Option[int64] `protobuf:"varint,3,opt"`
|
||||
SignInRank proto.Option[int32] `protobuf:"varint,4,opt"`
|
||||
}
|
||||
|
||||
type StDaySignedListReq struct {
|
||||
DayYmd proto.Option[string] `protobuf:"bytes,1,opt"`
|
||||
Uid proto.Option[string] `protobuf:"bytes,2,opt"`
|
||||
GroupId proto.Option[string] `protobuf:"bytes,3,opt"`
|
||||
Offset proto.Option[int32] `protobuf:"varint,4,opt"`
|
||||
Limit proto.Option[int32] `protobuf:"varint,5,opt"`
|
||||
}
|
||||
|
||||
type StDaySignedListRsp struct {
|
||||
Ret *DEB7Ret `protobuf:"bytes,1,opt"`
|
||||
Page []*StDaySignedPage `protobuf:"bytes,2,rep"`
|
||||
}
|
||||
|
||||
type StDaySignedPage struct {
|
||||
Infos []*StDaySignedInfo `protobuf:"bytes,1,rep"`
|
||||
Offset proto.Option[int32] `protobuf:"varint,2,opt"`
|
||||
Total proto.Option[int32] `protobuf:"varint,3,opt"`
|
||||
}
|
||||
|
||||
type StKingSignedInfo struct {
|
||||
Uid proto.Option[string] `protobuf:"bytes,1,opt"`
|
||||
GroupNick proto.Option[string] `protobuf:"bytes,2,opt"`
|
||||
SignedTimeStamp proto.Option[int64] `protobuf:"varint,3,opt"`
|
||||
SignedCount proto.Option[int32] `protobuf:"varint,4,opt"`
|
||||
}
|
||||
|
||||
type StKingSignedListReq struct {
|
||||
Uid proto.Option[string] `protobuf:"bytes,1,opt"`
|
||||
GroupId proto.Option[string] `protobuf:"bytes,2,opt"`
|
||||
}
|
||||
|
||||
type StKingSignedListRsp struct {
|
||||
Ret *DEB7Ret `protobuf:"bytes,1,opt"`
|
||||
YesterdayFirst *StKingSignedInfo `protobuf:"bytes,2,opt"`
|
||||
TopSignedTotal []*StKingSignedInfo `protobuf:"bytes,3,rep"`
|
||||
TopSignedContinue []*StKingSignedInfo `protobuf:"bytes,4,rep"`
|
||||
}
|
||||
|
||||
type StSignInRecordDaySigned struct {
|
||||
DaySignedRatio proto.Option[float32] `protobuf:"fixed32,1,opt"`
|
||||
DayTotalSignedUid proto.Option[int32] `protobuf:"varint,2,opt"`
|
||||
DaySignedPage *StDaySignedPage `protobuf:"bytes,3,opt"`
|
||||
DaySignedUrl proto.Option[string] `protobuf:"bytes,4,opt"`
|
||||
}
|
||||
|
||||
type StSignInRecordKing struct {
|
||||
YesterdayFirst *StKingSignedInfo `protobuf:"bytes,1,opt"`
|
||||
TopSignedTotal []*StKingSignedInfo `protobuf:"bytes,2,rep"`
|
||||
TopSignedContinue []*StKingSignedInfo `protobuf:"bytes,3,rep"`
|
||||
KingUrl proto.Option[string] `protobuf:"bytes,4,opt"`
|
||||
}
|
||||
|
||||
type StSignInRecordReq struct {
|
||||
DayYmd proto.Option[string] `protobuf:"bytes,1,opt"`
|
||||
Uid proto.Option[string] `protobuf:"bytes,2,opt"`
|
||||
GroupId proto.Option[string] `protobuf:"bytes,3,opt"`
|
||||
}
|
||||
|
||||
type StSignInRecordRsp struct {
|
||||
Ret *DEB7Ret `protobuf:"bytes,1,opt"`
|
||||
Base *SignInStatusBase `protobuf:"bytes,2,opt"`
|
||||
UserRecord *StSignInRecordUser `protobuf:"bytes,3,opt"`
|
||||
DaySigned *StSignInRecordDaySigned `protobuf:"bytes,4,opt"`
|
||||
KingRecord *StSignInRecordKing `protobuf:"bytes,5,opt"`
|
||||
Level *StViewGroupLevel `protobuf:"bytes,6,opt"`
|
||||
}
|
||||
|
||||
type StSignInRecordUser struct {
|
||||
TotalSignedDays proto.Option[int32] `protobuf:"varint,2,opt"`
|
||||
EarliestSignedTimeStamp proto.Option[int64] `protobuf:"varint,3,opt"`
|
||||
ContinueSignedDays proto.Option[int64] `protobuf:"varint,4,opt"`
|
||||
HistorySignedDays []string `protobuf:"bytes,5,rep"`
|
||||
GroupName proto.Option[string] `protobuf:"bytes,6,opt"`
|
||||
}
|
||||
|
||||
type StSignInStatusReq struct {
|
||||
Uid proto.Option[string] `protobuf:"bytes,1,opt"`
|
||||
GroupId proto.Option[string] `protobuf:"bytes,2,opt"`
|
||||
Scene proto.Option[uint32] `protobuf:"varint,3,opt"`
|
||||
ClientVersion proto.Option[string] `protobuf:"bytes,4,opt"`
|
||||
}
|
||||
|
||||
type StSignInStatusRsp struct {
|
||||
Ret *DEB7Ret `protobuf:"bytes,1,opt"`
|
||||
Base *SignInStatusBase `protobuf:"bytes,2,opt"`
|
||||
Yesterday *SignInStatusYesterdayFirst `protobuf:"bytes,3,opt"`
|
||||
NotInfo *SignInStatusNotInfo `protobuf:"bytes,4,opt"`
|
||||
DoneInfo *SignInStatusDoneInfo `protobuf:"bytes,5,opt"`
|
||||
GroupScore *SignInStatusGroupScore `protobuf:"bytes,6,opt"`
|
||||
MantleUrl proto.Option[string] `protobuf:"bytes,7,opt"`
|
||||
BackgroundUrl proto.Option[string] `protobuf:"bytes,8,opt"`
|
||||
}
|
||||
|
||||
type StSignInWriteReq struct {
|
||||
Uid proto.Option[string] `protobuf:"bytes,1,opt"`
|
||||
GroupId proto.Option[string] `protobuf:"bytes,2,opt"`
|
||||
ClientVersion proto.Option[string] `protobuf:"bytes,3,opt"`
|
||||
}
|
||||
|
||||
type StSignInWriteRsp struct {
|
||||
Ret *DEB7Ret `protobuf:"bytes,1,opt"`
|
||||
DoneInfo *SignInStatusDoneInfo `protobuf:"bytes,2,opt"`
|
||||
GroupScore *SignInStatusGroupScore `protobuf:"bytes,3,opt"`
|
||||
}
|
||||
|
||||
type StViewGroupLevel struct {
|
||||
Title proto.Option[string] `protobuf:"bytes,1,opt"`
|
||||
Url proto.Option[string] `protobuf:"bytes,2,opt"`
|
||||
}
|
165
client/pb/oidb/oidb0xeb7.proto
Normal file
165
client/pb/oidb/oidb0xeb7.proto
Normal file
@ -0,0 +1,165 @@
|
||||
syntax = "proto2";
|
||||
|
||||
option go_package = "github.com/Mrs4s/MiraiGo/client/pb/oidb";
|
||||
|
||||
// DEB7 prefix
|
||||
message DEB7ReqBody {
|
||||
optional StSignInStatusReq signInStatusReq = 1;
|
||||
optional StSignInWriteReq signInWriteReq = 2;
|
||||
}
|
||||
|
||||
message DEB7Ret {
|
||||
optional uint32 code = 1;
|
||||
optional string msg = 2;
|
||||
}
|
||||
|
||||
message DEB7RspBody {
|
||||
optional StSignInStatusRsp signInStatusRsp = 1;
|
||||
optional StSignInWriteRsp signInWriteRsp = 2;
|
||||
}
|
||||
|
||||
message SignInStatusBase {
|
||||
optional uint32 status = 1;
|
||||
optional int64 currentTimeStamp = 2;
|
||||
}
|
||||
|
||||
message SignInStatusDoneInfo {
|
||||
optional string leftTitleWrod = 1;
|
||||
optional string rightDescWord = 2;
|
||||
repeated string belowPortraitWords = 3;
|
||||
optional string recordUrl = 4;
|
||||
}
|
||||
|
||||
message SignInStatusGroupScore {
|
||||
optional string groupScoreWord = 1;
|
||||
optional string scoreUrl = 2;
|
||||
}
|
||||
|
||||
message SignInStatusNotInfo {
|
||||
optional string buttonWord = 1;
|
||||
optional string signDescWordLeft = 2;
|
||||
optional string signDescWordRight = 3;
|
||||
}
|
||||
|
||||
message SignInStatusYesterdayFirst {
|
||||
optional string yesterdayFirstUid = 1;
|
||||
optional string yesterdayWord = 2;
|
||||
optional string yesterdayNick = 3;
|
||||
}
|
||||
|
||||
message StDaySignedInfo {
|
||||
optional string uid = 1;
|
||||
optional string uidGroupNick = 2;
|
||||
optional int64 signedTimeStamp = 3;
|
||||
optional int32 signInRank = 4;
|
||||
}
|
||||
|
||||
message StDaySignedListReq {
|
||||
optional string dayYmd = 1;
|
||||
optional string uid = 2;
|
||||
optional string groupId = 3;
|
||||
optional int32 offset = 4;
|
||||
optional int32 limit = 5;
|
||||
}
|
||||
|
||||
message StDaySignedListRsp {
|
||||
optional DEB7Ret ret = 1;
|
||||
repeated StDaySignedPage page = 2;
|
||||
}
|
||||
|
||||
message StDaySignedPage {
|
||||
repeated StDaySignedInfo infos = 1;
|
||||
optional int32 offset = 2;
|
||||
optional int32 total = 3;
|
||||
}
|
||||
|
||||
message StKingSignedInfo {
|
||||
optional string uid = 1;
|
||||
optional string groupNick = 2;
|
||||
optional int64 signedTimeStamp = 3;
|
||||
optional int32 signedCount = 4;
|
||||
}
|
||||
|
||||
message StKingSignedListReq {
|
||||
optional string uid = 1;
|
||||
optional string groupId = 2;
|
||||
}
|
||||
|
||||
message StKingSignedListRsp {
|
||||
optional DEB7Ret ret = 1;
|
||||
optional StKingSignedInfo yesterdayFirst = 2;
|
||||
repeated StKingSignedInfo topSignedTotal = 3;
|
||||
repeated StKingSignedInfo topSignedContinue = 4;
|
||||
}
|
||||
|
||||
message StSignInRecordDaySigned {
|
||||
optional float daySignedRatio = 1;
|
||||
optional int32 dayTotalSignedUid = 2;
|
||||
optional StDaySignedPage daySignedPage = 3;
|
||||
optional string daySignedUrl = 4;
|
||||
}
|
||||
|
||||
message StSignInRecordKing {
|
||||
optional StKingSignedInfo yesterdayFirst = 1;
|
||||
repeated StKingSignedInfo topSignedTotal = 2;
|
||||
repeated StKingSignedInfo topSignedContinue = 3;
|
||||
optional string kingUrl = 4;
|
||||
}
|
||||
|
||||
message StSignInRecordReq {
|
||||
optional string dayYmd = 1;
|
||||
optional string uid = 2;
|
||||
optional string groupId = 3;
|
||||
}
|
||||
|
||||
message StSignInRecordRsp {
|
||||
optional DEB7Ret ret = 1;
|
||||
optional SignInStatusBase base = 2;
|
||||
optional StSignInRecordUser userRecord = 3;
|
||||
optional StSignInRecordDaySigned daySigned = 4;
|
||||
optional StSignInRecordKing kingRecord = 5;
|
||||
optional StViewGroupLevel level = 6;
|
||||
}
|
||||
|
||||
message StSignInRecordUser {
|
||||
optional int32 totalSignedDays = 2;
|
||||
optional int64 earliestSignedTimeStamp = 3;
|
||||
optional int64 continueSignedDays = 4;
|
||||
repeated string historySignedDays = 5;
|
||||
optional string groupName = 6;
|
||||
}
|
||||
|
||||
message StSignInStatusReq {
|
||||
optional string uid = 1;
|
||||
optional string groupId = 2;
|
||||
optional uint32 scene = 3;
|
||||
optional string clientVersion = 4;
|
||||
}
|
||||
|
||||
message StSignInStatusRsp {
|
||||
optional DEB7Ret ret = 1;
|
||||
optional SignInStatusBase base = 2;
|
||||
optional SignInStatusYesterdayFirst yesterday = 3;
|
||||
optional SignInStatusNotInfo notInfo = 4;
|
||||
optional SignInStatusDoneInfo doneInfo = 5;
|
||||
optional SignInStatusGroupScore groupScore = 6;
|
||||
optional string mantleUrl = 7;
|
||||
optional string backgroundUrl = 8;
|
||||
}
|
||||
|
||||
message StSignInWriteReq {
|
||||
optional string uid = 1;
|
||||
optional string groupId = 2;
|
||||
optional string clientVersion = 3;
|
||||
}
|
||||
|
||||
message StSignInWriteRsp {
|
||||
optional DEB7Ret ret = 1;
|
||||
optional SignInStatusDoneInfo doneInfo = 2;
|
||||
optional SignInStatusGroupScore groupScore = 3;
|
||||
}
|
||||
|
||||
message StViewGroupLevel {
|
||||
optional string title = 1;
|
||||
optional string url = 2;
|
||||
}
|
26
client/sign.go
Normal file
26
client/sign.go
Normal file
@ -0,0 +1,26 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"github.com/Mrs4s/MiraiGo/client/pb/oidb"
|
||||
"github.com/Mrs4s/MiraiGo/internal/proto"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// SendGroupSign 发送群聊打卡消息
|
||||
func (c *QQClient) SendGroupSign(target int64) {
|
||||
_, _ = c.sendAndWait(c.buildGroupSignPacket(target, 0))
|
||||
}
|
||||
|
||||
func (c *QQClient) buildGroupSignPacket(groupId int64, scene uint32) (uint16, []byte) {
|
||||
body := &oidb.DEB7ReqBody{
|
||||
SignInStatusReq: &oidb.StSignInStatusReq{
|
||||
Uid: proto.Some(strconv.Itoa(int(c.Uin))),
|
||||
GroupId: proto.Some(strconv.Itoa(int(groupId))),
|
||||
Scene: proto.Some(scene),
|
||||
ClientVersion: proto.Some("8.5.0.5025"),
|
||||
},
|
||||
}
|
||||
b, _ := proto.Marshal(body)
|
||||
payload := c.packOIDBPackage(3767, 0, b)
|
||||
return c.uniPacket("OidbSvc.0xeb7", payload)
|
||||
}
|
1
go.mod
1
go.mod
@ -19,5 +19,6 @@ require (
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/tidwall/match v1.1.1 // indirect
|
||||
github.com/tidwall/pretty v1.2.0 // indirect
|
||||
google.golang.org/protobuf v1.28.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
|
||||
)
|
||||
|
6
go.sum
6
go.sum
@ -7,6 +7,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/fumiama/imgsz v0.0.2 h1:fAkC0FnIscdKOXwAxlyw3EUba5NzxZdSxGaq3Uyfxak=
|
||||
github.com/fumiama/imgsz v0.0.2/go.mod h1:dR71mI3I2O5u6+PCpd47M9TZptzP+39tRBcbdIkoqM4=
|
||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/pierrec/lz4/v4 v4.1.11 h1:LVs17FAZJFOjgmJXl9Tf13WfLUvZq7/RjfEJrnwZ9OE=
|
||||
github.com/pierrec/lz4/v4 v4.1.11/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
@ -27,6 +29,10 @@ go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE=
|
||||
go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=
|
||||
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
|
||||
|
Loading…
x
Reference in New Issue
Block a user