From 000219e54b6656b8427d8ba379a712283fcc9731 Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Wed, 10 Aug 2022 15:17:49 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/bench/main_test.go | 47 +--- cmd/cmd.go | 2 +- cmd/robot/login.go | 2 +- cmd/robot/options.go | 4 +- cmd/robot/robot.go | 6 +- cmd/v2/lib/common/sec.go | 2 +- cmd/v2/model/login.go | 2 +- cmd/v2/service/pttService.go | 4 +- cmd/v2/ui/formview/friend_zan.go | 104 ++++++++ cmd/v2/ui/mainwindow.go | 5 +- cmd/v2/ui/protocol.go | 8 + modules/friend/api.go | 27 +- modules/friend/api_addblack.go | 13 +- modules/friend/api_agree.go | 10 +- modules/friend/api_apply.go | 12 +- modules/friend/api_applylist.go | 6 +- modules/friend/api_blacklist.go | 6 +- modules/friend/api_delblack.go | 6 +- modules/friend/api_list.go | 6 +- modules/friend/api_refuse.go | 6 +- modules/friend/api_search.go | 4 +- modules/friend/api_zan.go | 62 +++++ modules/friend/api_zanlist.go | 53 ++++ modules/friend/api_zanreceive.go | 58 ++++ pb/errorcode.pb.go | 157 +++++------ pb/friend_db.pb.go | 28 +- pb/friend_msg.pb.go | 443 ++++++++++++++++++++++++++++--- pb/user_msg.pb.go | 83 +++--- 28 files changed, 908 insertions(+), 258 deletions(-) create mode 100644 cmd/v2/ui/formview/friend_zan.go create mode 100644 modules/friend/api_zan.go create mode 100644 modules/friend/api_zanlist.go create mode 100644 modules/friend/api_zanreceive.go diff --git a/cmd/bench/main_test.go b/cmd/bench/main_test.go index 8d5049ea6..b3d2ed460 100644 --- a/cmd/bench/main_test.go +++ b/cmd/bench/main_test.go @@ -1,13 +1,8 @@ package bench import ( - "context" - "fmt" - "go_dreamfactory/sys/cache" "os" "testing" - - "github.com/go-redis/redis/v8" ) var LusScriptgetList = ` @@ -26,35 +21,18 @@ return data var res string func TestMain(m *testing.M) { - if err := cache.OnInit(nil, cache.Set_Redis_Addr([]string{ - // "10.0.0.9:6986", - "10.0.0.9:9001", "10.0.0.9:9002", "10.0.0.9:9003", "10.0.0.9:9004", "10.0.0.9:9005", "10.0.0.9:9006", - }), - cache.Set_Redis_Password(""), - // cache.Set_Redis_Password("li13451234"), - // cache.Set_Redis_DB(0), - cache.Set_Redis_IsCluster(true)); err != nil { - fmt.Printf("err:%v\n", err) - return - } - var err error - - res, err = cache.Redis().NewScript(LusScriptgetList).Result() - if err != nil { - fmt.Println("err:", err) - } defer os.Exit(m.Run()) } func BenchmarkRedis(b *testing.B) { - uid := "2_62ec8ab8828fb7bf67b220b6" - heroRedisKey := fmt.Sprintf("hero_%s%s", uid, "{herotest}") + // uid := "2_62ec8ab8828fb7bf67b220b6" + // heroRedisKey := fmt.Sprintf("hero_%s%s", uid, "{herotest}") var ( // ncpu = runtime.NumCPU() parallelisms = []int{4, 16, 64} dataSizes = []int{100, 1000, 10000} numKeys = 1024 - key = heroRedisKey + // key = heroRedisKey // keys = []string{ // "hero:0_62d6131a3a719b898a90b5fb-62d6131a3a719b898a90b5fe", // "hero:0_62d6131a3a719b898a90b5fb-62d6131a3a719b898a90b600", @@ -72,17 +50,7 @@ func BenchmarkRedis(b *testing.B) { return Target{ Get: func() { - ctx := context.Background() - keys, _ := cache.Redis().HGetAllToMapString(key) - // fmt.Println(keys) - for _, v := range keys { - cache.Redis().Pipelined(ctx, func(pipe redis.Pipeliner) error { - pipe.HGetAll(ctx, v).Result() - _, err := pipe.Exec(ctx) - // fmt.Println(v) - return err - }) - } + }, }, nil }, @@ -92,13 +60,6 @@ func BenchmarkRedis(b *testing.B) { Make: func(bench Benchmark) (Target, error) { return Target{ Get: func() { - - if _, err := cache.Redis().EvalSha(context.Background(), res, []string{key}).Result(); err != nil { - fmt.Println(err) - } else { - // fmt.Println(v) - } - }, }, nil }, diff --git a/cmd/cmd.go b/cmd/cmd.go index 68dfd101a..3b88a96d5 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -34,7 +34,7 @@ func init() { } var account = flag.String("account", "", "登录账号") -var sid = flag.Int32("sid", 0, "区服ID") +var sid = flag.String("sid", "0", "区服ID") var create = flag.Bool("create", false, "是否创建新账号") //false 不创建新账号 var role = flag.Bool("role", false, "创角") diff --git a/cmd/robot/login.go b/cmd/robot/login.go index 7264e407f..e19eb821f 100644 --- a/cmd/robot/login.go +++ b/cmd/robot/login.go @@ -17,7 +17,7 @@ import ( type LoginParam struct { Account string `json:"account"` - ServerId int32 `json:"serverId"` + ServerId string `json:"serverId"` TimeStamp int64 `json:"timestamp"` } diff --git a/cmd/robot/options.go b/cmd/robot/options.go index 878f3f424..c9abbd542 100644 --- a/cmd/robot/options.go +++ b/cmd/robot/options.go @@ -6,7 +6,7 @@ type Options struct { Account string //玩家账号 Create bool Secretkey string //秘钥串 - ServerId int32 //区服ID + ServerId string //区服ID Role bool //是否创角 } @@ -15,7 +15,7 @@ func DefaultOpts() *Options { WsUrl: "ws://localhost:7891/gateway", RegUrl: "http://localhost:8000/register", Create: false, - ServerId: 1, + ServerId: "1", } } diff --git a/cmd/robot/robot.go b/cmd/robot/robot.go index a79ea00a8..2f784078b 100644 --- a/cmd/robot/robot.go +++ b/cmd/robot/robot.go @@ -85,7 +85,7 @@ func (r *Robot) Run() { zlog.Infof("websocket %s ", r.opts.WsUrl) if r.opts.Create { //创建新用户 r.enable = true - r.AccountRegister(r.opts.Account, int32(r.opts.ServerId)) + r.AccountRegister(r.opts.Account, r.opts.ServerId) } else { if r.opts.Account == "" { zlog.Fatal("WARNNING: account is required !!!") @@ -277,7 +277,7 @@ func (r *Robot) loginCallback(rsp proto.Message) { r.handleReq() } else { //请求Http接口,模拟创建新账号 - r.AccountRegister(r.opts.Account, int32(r.opts.ServerId)) + r.AccountRegister(r.opts.Account, r.opts.ServerId) } } @@ -293,7 +293,7 @@ func (r *Robot) SendToClient(msg *pb.UserMessage, rsp proto.Message) error { } //注册账号 -func (r *Robot) AccountRegister(account string, sid int32) { +func (r *Robot) AccountRegister(account string, sid string) { if account == "" { zlog.Fatal("account value is empty") } diff --git a/cmd/v2/lib/common/sec.go b/cmd/v2/lib/common/sec.go index 5780c449c..ada5192bd 100644 --- a/cmd/v2/lib/common/sec.go +++ b/cmd/v2/lib/common/sec.go @@ -10,7 +10,7 @@ import ( "github.com/nacos-group/nacos-sdk-go/util" ) -func BuildSecStr(sid int32, account string) string { +func BuildSecStr(sid, account string) string { jsonByte, _ := jsoniter.Marshal(&model.LoginParam{ Account: account, ServerId: sid, diff --git a/cmd/v2/model/login.go b/cmd/v2/model/login.go index 36e4802c6..ef5e9d906 100644 --- a/cmd/v2/model/login.go +++ b/cmd/v2/model/login.go @@ -2,6 +2,6 @@ package model type LoginParam struct { Account string `json:"account"` - ServerId int32 `json:"serverId"` + ServerId string `json:"serverId"` TimeStamp int64 `json:"timestamp"` } diff --git a/cmd/v2/service/pttService.go b/cmd/v2/service/pttService.go index 75974010b..b089642a1 100644 --- a/cmd/v2/service/pttService.go +++ b/cmd/v2/service/pttService.go @@ -15,7 +15,7 @@ var ( ) type PttService interface { - Login(sid int32, account string) (code pb.ErrorCode, rsp *pb.UserLoginResp) + Login(sid, account string) (code pb.ErrorCode, rsp *pb.UserLoginResp) CreateRole(nickName string) (code pb.ErrorCode, rsp *pb.UserCreateResp) GetUser() *UserInfo SetUser(dbUser *pb.DBUser, dbUserExpand *pb.DBUserExpand) @@ -61,7 +61,7 @@ func (p *PttServiceImpl) SendToClient(mainType, subType string, rsp proto.Messag } // Login -func (p *PttServiceImpl) Login(sid int32, account string) (code pb.ErrorCode, rsp *pb.UserLoginResp) { +func (p *PttServiceImpl) Login(sid, account string) (code pb.ErrorCode, rsp *pb.UserLoginResp) { head := &pb.UserMessage{MainType: string(comm.ModuleUser), SubType: user.UserSubTypeLogin} head.Sec = common.BuildSecStr(sid, account) if err := p.connService.SendMsg(head, &pb.UserLoginReq{ diff --git a/cmd/v2/ui/formview/friend_zan.go b/cmd/v2/ui/formview/friend_zan.go new file mode 100644 index 000000000..40e40868a --- /dev/null +++ b/cmd/v2/ui/formview/friend_zan.go @@ -0,0 +1,104 @@ +package formview + +import ( + "go_dreamfactory/cmd/v2/model" + "go_dreamfactory/cmd/v2/service" + "go_dreamfactory/cmd/v2/service/observer" + "go_dreamfactory/comm" + "go_dreamfactory/modules/friend" + "go_dreamfactory/pb" + + "fyne.io/fyne/v2" + "fyne.io/fyne/v2/container" + "fyne.io/fyne/v2/theme" + "fyne.io/fyne/v2/widget" + "github.com/sirupsen/logrus" +) + +type FriendZanView struct { + FriendListBaseView +} + +func (this *FriendZanView) CreateView(t *model.TestCase) fyne.CanvasObject { + //init required + this.initFriendList() + + //点赞 + zanBtn := widget.NewButtonWithIcon("点赞", theme.ConfirmIcon(), func() { + + if err := service.GetPttService().SendToClient( + t.MainType, + t.SubType, + &pb.FriendZanReq{ + FriendId: this.selFriendIds[0], + }, + ); err != nil { + logrus.Error(err) + return + } + this.applyListBtnFun() + }) + + receiveBtn := widget.NewButtonWithIcon("获赞", theme.ConfirmIcon(), func() { + + if err := service.GetPttService().SendToClient( + t.MainType, + t.SubType, + &pb.FriendZanreceiveReq{ + FriendId: this.selFriendIds[0], + }, + ); err != nil { + logrus.Error(err) + return + } + this.applyListBtnFun() + }) + + // new zanlist btn + zanList := func() { + if err := service.GetPttService().SendToClient( + string(comm.ModuleFriend), + friend.FriendSubTypeZanList, + &pb.FriendListReq{}); err != nil { + logrus.Error(err) + } + this.friendData = model.NewFriendModelList() + } + zanListBtn := widget.NewButton("点赞列表", zanList) + + // create friend list view + this.createList() + + // layout + split := container.NewHSplit(this.dataList, container.NewVBox(zanListBtn, zanBtn, receiveBtn)) + split.Offset = 1 + + this.dataListener() + return split +} + +func (this *FriendZanView) dataListener() { + this.obs.AddListener(observer.EVENT_CASE_RSP, observer.Listener{ + OnNotify: func(d interface{}, args ...interface{}) { + data := d.(*pb.UserMessage) + if !(data.MainType == string(comm.ModuleFriend) && + data.SubType == friend.FriendSubTypeZanList) { + return + } + rsp := &pb.FriendZanlistResp{} + + if !comm.ProtoUnmarshal(data, rsp) { + logrus.Error("unmarshal err") + } + + for _, v := range rsp.List { + fm := &model.FriendModel{ + Uid: v.UserId, + Name: v.NickName, + } + this.friendData.DataList = append(this.friendData.DataList, fm) + } + this.reloadFriendData() + }, + }) +} diff --git a/cmd/v2/ui/mainwindow.go b/cmd/v2/ui/mainwindow.go index 90ef331da..c93bdcc11 100644 --- a/cmd/v2/ui/mainwindow.go +++ b/cmd/v2/ui/mainwindow.go @@ -15,7 +15,6 @@ import ( "github.com/BabySid/gobase" "github.com/Pallinder/go-randomdata" "github.com/sirupsen/logrus" - "github.com/spf13/cast" ) var ( @@ -189,7 +188,7 @@ func (ui *MainWindowImpl) createChooseServerWindow( } // createLoginWin -func (ui *MainWindowImpl) createLoginWin(sid int32, sname string) { +func (ui *MainWindowImpl) createLoginWin(sid, sname string) { //form account := widget.NewEntry() account.Text = "user8120" //default account @@ -302,7 +301,7 @@ func (ui *MainWindowImpl) NewWelcomeLabel(data string) { fyne.TextStyle{Bold: true}), container.NewCenter(container.NewHBox( widget.NewButton(common.BUTTON_LOGIN, func() { - ui.createLoginWin(cast.ToInt32(p[0]), p[1]) + ui.createLoginWin(p[0], p[1]) }), )), )) diff --git a/cmd/v2/ui/protocol.go b/cmd/v2/ui/protocol.go index 406b9eebe..ecea39aee 100644 --- a/cmd/v2/ui/protocol.go +++ b/cmd/v2/ui/protocol.go @@ -48,6 +48,7 @@ var ( ff(comm.ModuleFriend, friend.FriendSubTypeAddBlack): &formview.FriendAddBlackView{}, ff(comm.ModuleFriend, friend.FriendSubTypeDelBlack): &formview.FriendDelblackView{}, ff(comm.ModuleFriend, friend.FriendSubTypeSearch): &formview.FriendSearchView{}, + ff(comm.ModuleFriend, friend.FriendSubTypeZanList): &formview.FriendZanView{}, } ) @@ -86,6 +87,7 @@ var ( ff(comm.ModuleFriend, friend.FriendSubTypeAddBlack), ff(comm.ModuleFriend, friend.FriendSubTypeDelBlack), ff(comm.ModuleFriend, friend.FriendSubTypeSearch), + ff(comm.ModuleFriend, friend.FriendSubTypeZanList), }, } ) @@ -270,6 +272,12 @@ var ( Rsp: &pb.FriendSearchResp{}, Enabled: true, }, + ff(comm.ModuleFriend, friend.FriendSubTypeZanList):{ + Desc: "点赞好友", + MainType: string(comm.ModuleFriend), + SubType: friend.FriendSubTypeSearch, + Enabled: true, + }, } ) diff --git a/modules/friend/api.go b/modules/friend/api.go index e5c19fb69..5e8135c47 100644 --- a/modules/friend/api.go +++ b/modules/friend/api.go @@ -6,24 +6,27 @@ import ( ) const ( - FriendSubTypeList = "list" - FriendSubTypeApply = "apply" - FriendSubTypeApplyList = "applylist" - FriendSubTypeAddBlack = "addblack" - FriendSubTypeDelBlack = "delblack" - FriendSubTypeBlacklist = "blacklist" - FriendSubTypeAgree = "agree" - FriendSubTypeRefuse = "refuse" - FriendSubTypeSearch = "search" + FriendSubTypeList = "list" + FriendSubTypeApply = "apply" + FriendSubTypeApplyList = "applylist" + FriendSubTypeAddBlack = "addblack" + FriendSubTypeDelBlack = "delblack" + FriendSubTypeBlacklist = "blacklist" + FriendSubTypeAgree = "agree" + FriendSubTypeRefuse = "refuse" + FriendSubTypeSearch = "search" + FriendSubTypeZan = "zan" + FriendSubTypeZanreceive = "zanreceive" + FriendSubTypeZanList = "zanlist" ) type apiComp struct { modules.MCompGate - module *Friend + moduleFriend *Friend } func (this *apiComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { - this.MCompGate.Init(service, module, comp, options) - this.module = module.(*Friend) + _ = this.MCompGate.Init(service, module, comp, options) + this.moduleFriend = module.(*Friend) return } diff --git a/modules/friend/api_addblack.go b/modules/friend/api_addblack.go index f25ccbbae..6c74b5461 100644 --- a/modules/friend/api_addblack.go +++ b/modules/friend/api_addblack.go @@ -33,16 +33,19 @@ func (this *apiComp) Addblack(session comm.IUserSession, req *pb.FriendBlackAddR FriendId: req.FriendId, UserId: session.GetUserId(), } - session.SendMsg(string(this.module.GetType()), FriendSubTypeAddBlack, Resp) + if err = session.SendMsg(string(this.moduleFriend.GetType()), FriendSubTypeAddBlack, Resp); err != nil { + code = pb.ErrorCode_SystemError + return + } }() - self = this.module.modelFriend.GetFriend(session.GetUserId()) + self = this.moduleFriend.modelFriend.GetFriend(session.GetUserId()) if self == nil { code = pb.ErrorCode_FriendSelfNoData return } - target = this.module.modelFriend.GetFriend(req.FriendId) + target = this.moduleFriend.modelFriend.GetFriend(req.FriendId) if target == nil { code = pb.ErrorCode_FriendTargetNoData return @@ -67,7 +70,7 @@ func (this *apiComp) Addblack(session comm.IUserSession, req *pb.FriendBlackAddR } // 判断是否黑名单人数已满 - if len(self.BlackIds) >= this.module.getBlackMax() { + if len(self.BlackIds) >= this.moduleFriend.getBlackMax() { code = pb.ErrorCode_FriendBlackMax return } @@ -76,7 +79,7 @@ func (this *apiComp) Addblack(session comm.IUserSession, req *pb.FriendBlackAddR self.BlackIds = append(self.BlackIds, req.FriendId) //更新黑名单 - err = this.module.modelFriend.Change(self.Uid, map[string]interface{}{ + err = this.moduleFriend.modelFriend.Change(self.Uid, map[string]interface{}{ "blackIds": self.BlackIds, }) if err != nil { diff --git a/modules/friend/api_agree.go b/modules/friend/api_agree.go index 1f1a6a993..baf4c4591 100644 --- a/modules/friend/api_agree.go +++ b/modules/friend/api_agree.go @@ -33,7 +33,7 @@ func (this *apiComp) Agree(session comm.IUserSession, req *pb.FriendAgreeReq) (c Resp = &pb.FriendAgreeResp{ Num: optNum, } - err := session.SendMsg(string(this.module.GetType()), FriendSubTypeAgree, Resp) + err := session.SendMsg(string(this.moduleFriend.GetType()), FriendSubTypeAgree, Resp) if err != nil { code = pb.ErrorCode_SystemError return @@ -41,7 +41,7 @@ func (this *apiComp) Agree(session comm.IUserSession, req *pb.FriendAgreeReq) (c }() //获取玩家自己好友数据 - self = this.module.modelFriend.GetFriend(session.GetUserId()) + self = this.moduleFriend.modelFriend.GetFriend(session.GetUserId()) if self == nil { code = pb.ErrorCode_FriendSelfNoData return @@ -66,7 +66,7 @@ func (this *apiComp) Agree(session comm.IUserSession, req *pb.FriendAgreeReq) (c } //双向添加:将自己加入到申请人的好友列表中 - target = this.module.modelFriend.GetFriend(userId) + target = this.moduleFriend.modelFriend.GetFriend(userId) if target == nil { code = pb.ErrorCode_FriendTargetNoData return @@ -77,7 +77,7 @@ func (this *apiComp) Agree(session comm.IUserSession, req *pb.FriendAgreeReq) (c } target.FriendIds = append(target.FriendIds, self.Uid) } - err = this.module.modelFriend.Change(target.Uid, map[string]interface{}{ + err = this.moduleFriend.modelFriend.Change(target.Uid, map[string]interface{}{ "friendIds": target.FriendIds, }) if err != nil { @@ -90,7 +90,7 @@ func (this *apiComp) Agree(session comm.IUserSession, req *pb.FriendAgreeReq) (c } //更新 - err = this.module.modelFriend.Change(self.Uid, map[string]interface{}{ + err = this.moduleFriend.modelFriend.Change(self.Uid, map[string]interface{}{ "applyIds": self.ApplyIds, "friendIds": self.FriendIds, }) diff --git a/modules/friend/api_apply.go b/modules/friend/api_apply.go index 8fa1ad9df..067af6ab5 100644 --- a/modules/friend/api_apply.go +++ b/modules/friend/api_apply.go @@ -36,21 +36,21 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.FriendApplyReq) (c FriendId: req.FriendId, } } - if err := session.SendMsg(string(this.module.GetType()), FriendSubTypeApply, Resp); err != nil { + if err := session.SendMsg(string(this.moduleFriend.GetType()), FriendSubTypeApply, Resp); err != nil { code = pb.ErrorCode_SystemError return } }() //获取玩家自己好友数据 - self = this.module.modelFriend.GetFriend(session.GetUserId()) + self = this.moduleFriend.modelFriend.GetFriend(session.GetUserId()) if self == nil { code = pb.ErrorCode_FriendSelfNoData return } //获取好友数据 - target = this.module.modelFriend.GetFriend(req.FriendId) + target = this.moduleFriend.modelFriend.GetFriend(req.FriendId) if target == nil { code = pb.ErrorCode_FriendTargetNoData return @@ -63,13 +63,13 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.FriendApplyReq) (c } //判断是否超过最大好友数量 - if len(self.FriendIds) >= this.module.getFriendMax() { + if len(self.FriendIds) >= this.moduleFriend.getFriendMax() { code = pb.ErrorCode_FriendSelfMax return } //判断对方是否也超过最大好友数量 - if len(target.FriendIds) >= this.module.getFriendMax() { + if len(target.FriendIds) >= this.moduleFriend.getFriendMax() { code = pb.ErrorCode_FriendTargetMax return } @@ -104,7 +104,7 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.FriendApplyReq) (c } target.ApplyIds = append(target.ApplyIds, session.GetUserId()) - err = this.module.modelFriend.Change(req.FriendId, map[string]interface{}{ + err = this.moduleFriend.modelFriend.Change(req.FriendId, map[string]interface{}{ "applyIds": target.ApplyIds, }) if err != nil { diff --git a/modules/friend/api_applylist.go b/modules/friend/api_applylist.go index ccef69442..503e0ab48 100644 --- a/modules/friend/api_applylist.go +++ b/modules/friend/api_applylist.go @@ -25,19 +25,19 @@ func (this *apiComp) ApplyList(session comm.IUserSession, req *pb.FriendApplyLis List: list, } } - if err := session.SendMsg(string(this.module.GetType()), FriendSubTypeApplyList, Resp); err != nil { + if err := session.SendMsg(string(this.moduleFriend.GetType()), FriendSubTypeApplyList, Resp); err != nil { code = pb.ErrorCode_SystemError } }() - self = this.module.modelFriend.GetFriend(session.GetUserId()) + self = this.moduleFriend.modelFriend.GetFriend(session.GetUserId()) if self == nil { code = pb.ErrorCode_FriendSelfNoData return } for _, userId := range self.ApplyIds { - user := this.module.ModuleUser.GetUser(userId) + user := this.moduleFriend.ModuleUser.GetUser(userId) if user == nil { continue } diff --git a/modules/friend/api_blacklist.go b/modules/friend/api_blacklist.go index ad5aa0b80..8cac9b6b8 100644 --- a/modules/friend/api_blacklist.go +++ b/modules/friend/api_blacklist.go @@ -24,21 +24,21 @@ func (this *apiComp) Blacklist(session comm.IUserSession, req *pb.FriendBlackLis Friends: list, } - err := session.SendMsg(string(this.module.GetType()), FriendSubTypeBlacklist, Resp) + err := session.SendMsg(string(this.moduleFriend.GetType()), FriendSubTypeBlacklist, Resp) if err != nil { code = pb.ErrorCode_SystemError return } }() - self = this.module.modelFriend.GetFriend(session.GetUserId()) + self = this.moduleFriend.modelFriend.GetFriend(session.GetUserId()) if self == nil { code = pb.ErrorCode_FriendSelfNoData return } for _, userId := range self.BlackIds { - user := this.module.ModuleUser.GetUser(userId) + user := this.moduleFriend.ModuleUser.GetUser(userId) if user == nil { continue } diff --git a/modules/friend/api_delblack.go b/modules/friend/api_delblack.go index 5e6788707..8eaa4f46c 100644 --- a/modules/friend/api_delblack.go +++ b/modules/friend/api_delblack.go @@ -32,14 +32,14 @@ func (this *apiComp) Delblack(session comm.IUserSession, req *pb.FriendDelBlackR UserId: session.GetUserId(), } } - err := session.SendMsg(string(this.module.GetType()), FriendSubTypeDelBlack, Resp) + err := session.SendMsg(string(this.moduleFriend.GetType()), FriendSubTypeDelBlack, Resp) if err != nil { code = pb.ErrorCode_SystemError return } }() - self = this.module.modelFriend.GetFriend(session.GetUserId()) + self = this.moduleFriend.modelFriend.GetFriend(session.GetUserId()) if self == nil { code = pb.ErrorCode_FriendSelfNoData return @@ -48,7 +48,7 @@ func (this *apiComp) Delblack(session comm.IUserSession, req *pb.FriendDelBlackR //从黑名单列表中删除目标 self.BlackIds = utils.DeleteString(self.BlackIds, req.FriendId) //更新黑名单 - err = this.module.modelFriend.Change(self.Uid, map[string]interface{}{ + err = this.moduleFriend.modelFriend.Change(self.Uid, map[string]interface{}{ "blackIds": self.BlackIds, }) if err != nil { diff --git a/modules/friend/api_list.go b/modules/friend/api_list.go index eed150100..264d1d36e 100644 --- a/modules/friend/api_list.go +++ b/modules/friend/api_list.go @@ -23,21 +23,21 @@ func (this *apiComp) List(session comm.IUserSession, req *pb.FriendListReq) (cod Resp = &pb.FriendListResp{ List: list, } - err := session.SendMsg(string(this.module.GetType()), FriendSubTypeList, Resp) + err := session.SendMsg(string(this.moduleFriend.GetType()), FriendSubTypeList, Resp) if err != nil { code = pb.ErrorCode_SystemError return } }() - self = this.module.modelFriend.GetFriend(session.GetUserId()) + self = this.moduleFriend.modelFriend.GetFriend(session.GetUserId()) if self == nil { code = pb.ErrorCode_FriendSelfNoData return } for _, userId := range self.FriendIds { - user := this.module.ModuleUser.GetUser(userId) + user := this.moduleFriend.ModuleUser.GetUser(userId) if user == nil { continue } diff --git a/modules/friend/api_refuse.go b/modules/friend/api_refuse.go index 30ac15087..92f952dbd 100644 --- a/modules/friend/api_refuse.go +++ b/modules/friend/api_refuse.go @@ -32,7 +32,7 @@ func (this *apiComp) Refuse(session comm.IUserSession, req *pb.FriendRefuseReq) Num: optNum, } - err := session.SendMsg(string(this.module.GetType()), FriendSubTypeRefuse, Resp) + err := session.SendMsg(string(this.moduleFriend.GetType()), FriendSubTypeRefuse, Resp) if err != nil { code = pb.ErrorCode_SystemError return @@ -40,7 +40,7 @@ func (this *apiComp) Refuse(session comm.IUserSession, req *pb.FriendRefuseReq) }() //获取玩家自己好友数据 - self = this.module.modelFriend.GetFriend(session.GetUserId()) + self = this.moduleFriend.modelFriend.GetFriend(session.GetUserId()) if self == nil { code = pb.ErrorCode_FriendSelfNoData return @@ -61,7 +61,7 @@ func (this *apiComp) Refuse(session comm.IUserSession, req *pb.FriendRefuseReq) } //更新 if optNum > 0 { - err := this.module.modelFriend.Change(self.Uid, map[string]interface{}{ + err := this.moduleFriend.modelFriend.Change(self.Uid, map[string]interface{}{ "applyIds": self.ApplyIds, }) if err != nil { diff --git a/modules/friend/api_search.go b/modules/friend/api_search.go index de242de3b..bf40fa51c 100644 --- a/modules/friend/api_search.go +++ b/modules/friend/api_search.go @@ -31,12 +31,12 @@ func (this *apiComp) Search(session comm.IUserSession, req *pb.FriendSearchReq) Friend: friend, } } - if err := session.SendMsg(string(this.module.GetType()), FriendSubTypeSearch, Resp); err != nil { + if err := session.SendMsg(string(this.moduleFriend.GetType()), FriendSubTypeSearch, Resp); err != nil { code = pb.ErrorCode_SystemError } }() - user := this.module.modelFriend.Frined_FindCond(req.NickName) + user := this.moduleFriend.modelFriend.Frined_FindCond(req.NickName) if user != nil { friend = &pb.FriendBase{ UserId: user.Uid, diff --git a/modules/friend/api_zan.go b/modules/friend/api_zan.go new file mode 100644 index 000000000..5c0964230 --- /dev/null +++ b/modules/friend/api_zan.go @@ -0,0 +1,62 @@ +package friend + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/pb" + "go_dreamfactory/utils" + + "google.golang.org/protobuf/proto" +) + +// 点赞 + +func (this *apiComp) ZanCheck(session comm.IUserSession, req *pb.FriendZanReq) (code pb.ErrorCode) { + if req.FriendId == ""{ + code = pb.ErrorCode_ReqParameterError + } + return +} + +func (this *apiComp) Zan(session comm.IUserSession, req *pb.FriendZanReq) (code pb.ErrorCode, data proto.Message) { + if code = this.ZanCheck(session, req); code != pb.ErrorCode_Success { + return + } + + var ( + self *pb.DBFriend + err error + ) + + self = this.moduleFriend.modelFriend.GetFriend(session.GetUserId()) + if self == nil { + code = pb.ErrorCode_FriendSelfNoData + return + } + + // 好友是否被点赞 + if _, ok := utils.Find(self.ZanIds, req.FriendId); ok { + code = pb.ErrorCode_FriendZaned + return + } + + //设置被点赞玩家 + self.ZanIds = append(self.ZanIds, req.FriendId) + + if err = this.moduleFriend.modelFriend.Change(req.FriendId, map[string]interface{}{ + "zanIds": self.ZanIds, + }); err != nil { + code = pb.ErrorCode_DBError + return + } + + rsp := &pb.FriendZanResp{ + Flag: true, + } + + if err := session.SendMsg(string(this.moduleFriend.GetType()), FriendSubTypeZan, rsp); err != nil { + code = pb.ErrorCode_SystemError + return + } + + return +} diff --git a/modules/friend/api_zanlist.go b/modules/friend/api_zanlist.go new file mode 100644 index 000000000..2d5a26250 --- /dev/null +++ b/modules/friend/api_zanlist.go @@ -0,0 +1,53 @@ +package friend + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/pb" + + "google.golang.org/protobuf/proto" +) + +// 点赞列表 +func (this *apiComp) ZanlistCheck(session comm.IUserSession, req *pb.FriendZanlistReq) (code pb.ErrorCode) { + + return +} + +func (this *apiComp) Zanlist(session comm.IUserSession, req *pb.FriendZanlistReq) (code pb.ErrorCode, data proto.Message) { + if code = this.ZanlistCheck(session, req); code != pb.ErrorCode_Success { + return + } + + var ( + self *pb.DBFriend + list []*pb.FriendBase + ) + + self = this.moduleFriend.modelFriend.GetFriend(session.GetUserId()) + if self == nil { + code = pb.ErrorCode_FriendSelfNoData + return + } + + for _, v := range self.ZanIds { + user := this.moduleFriend.ModuleUser.GetUser(v) + if user == nil { + continue + } + + list = append(list, &pb.FriendBase{ + UserId: v, + NickName: user.Name, + }) + } + + rsp := &pb.FriendZanlistResp{ + List: list, + } + if err := session.SendMsg(string(this.moduleFriend.GetType()), FriendSubTypeZanList, rsp); err != nil { + code = pb.ErrorCode_SystemError + return + } + + return +} diff --git a/modules/friend/api_zanreceive.go b/modules/friend/api_zanreceive.go new file mode 100644 index 000000000..054d72070 --- /dev/null +++ b/modules/friend/api_zanreceive.go @@ -0,0 +1,58 @@ +package friend + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/pb" + "go_dreamfactory/utils" + + "google.golang.org/protobuf/proto" +) + +// 领取点赞奖励 + +func (this *apiComp) ZanreceiveCheck(session comm.IUserSession, req *pb.FriendZanreceiveReq) (code pb.ErrorCode) { + if req.FriendId == "" { + code = pb.ErrorCode_ReqParameterError + } + return +} + +func (this *apiComp) Zanreceive(session comm.IUserSession, req *pb.FriendZanreceiveReq) (code pb.ErrorCode, data proto.Message) { + if code = this.ZanreceiveCheck(session, req); code != pb.ErrorCode_Success { + return + } + + var ( + self *pb.DBFriend + err error + ) + + self = this.moduleFriend.modelFriend.GetFriend(session.GetUserId()) + if self == nil { + code = pb.ErrorCode_FriendSelfNoData + return + } + + // 是否已领取点赞 + if _, ok := utils.Find(self.ZanIds, req.FriendId); !ok { + code = pb.ErrorCode_FriendZanreceived + return + } + + utils.DeleteString(self.ZanIds, req.FriendId) + + if err = this.moduleFriend.modelFriend.Change(req.FriendId, map[string]interface{}{ + "zanIds": self.ZanIds, + }); err != nil { + code = pb.ErrorCode_DBError + return + } + + if err := session.SendMsg(string(this.moduleFriend.GetType()), FriendSubTypeZanreceive, + &pb.FriendZanreceiveResp{Flag: true}); err != nil { + code = pb.ErrorCode_SystemError + return + } + + return +} diff --git a/pb/errorcode.pb.go b/pb/errorcode.pb.go index df2c8a8a7..4b0019841 100644 --- a/pb/errorcode.pb.go +++ b/pb/errorcode.pb.go @@ -73,6 +73,8 @@ const ( ErrorCode_FriendApplyError ErrorCode = 1109 //申请失败 ErrorCode_FriendBlackMax ErrorCode = 1110 //黑名单最大数量 ErrorCode_FriendSearchNameEmpty ErrorCode = 1111 //查询昵称为空 + ErrorCode_FriendZaned ErrorCode = 1112 //已点赞 + ErrorCode_FriendZanreceived ErrorCode = 1113 //已领取点赞 // item ErrorCode_ItemsNoEnough ErrorCode = 1200 //背包物品不足 ErrorCode_ItemsNoFoundGird ErrorCode = 1201 //背包未找到物品格子 @@ -186,6 +188,8 @@ var ( 1109: "FriendApplyError", 1110: "FriendBlackMax", 1111: "FriendSearchNameEmpty", + 1112: "FriendZaned", + 1113: "FriendZanreceived", 1200: "ItemsNoEnough", 1201: "ItemsNoFoundGird", 1202: "ItemsGridNumUpper", @@ -289,6 +293,8 @@ var ( "FriendApplyError": 1109, "FriendBlackMax": 1110, "FriendSearchNameEmpty": 1111, + "FriendZaned": 1112, + "FriendZanreceived": 1113, "ItemsNoEnough": 1200, "ItemsNoFoundGird": 1201, "ItemsGridNumUpper": 1202, @@ -376,7 +382,7 @@ var File_errorcode_proto protoreflect.FileDescriptor var file_errorcode_proto_rawDesc = []byte{ 0x0a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2a, 0xdb, 0x10, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, + 0x6f, 0x2a, 0x85, 0x11, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x10, 0x0a, 0x12, 0x1b, 0x0a, 0x17, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, @@ -438,79 +444,82 @@ var file_errorcode_proto_rawDesc = []byte{ 0x10, 0xd5, 0x08, 0x12, 0x13, 0x0a, 0x0e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x4d, 0x61, 0x78, 0x10, 0xd6, 0x08, 0x12, 0x1a, 0x0a, 0x15, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x45, 0x6d, 0x70, 0x74, - 0x79, 0x10, 0xd7, 0x08, 0x12, 0x12, 0x0a, 0x0d, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x4e, 0x6f, 0x45, - 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0xb0, 0x09, 0x12, 0x15, 0x0a, 0x10, 0x49, 0x74, 0x65, 0x6d, - 0x73, 0x4e, 0x6f, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x47, 0x69, 0x72, 0x64, 0x10, 0xb1, 0x09, 0x12, - 0x16, 0x0a, 0x11, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x47, 0x72, 0x69, 0x64, 0x4e, 0x75, 0x6d, 0x55, - 0x70, 0x70, 0x65, 0x72, 0x10, 0xb2, 0x09, 0x12, 0x19, 0x0a, 0x14, 0x49, 0x74, 0x65, 0x6d, 0x73, - 0x47, 0x69, 0x72, 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x70, 0x70, 0x65, 0x72, 0x10, - 0xb3, 0x09, 0x12, 0x19, 0x0a, 0x14, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x55, 0x73, 0x65, 0x4e, 0x6f, - 0x74, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x10, 0xb4, 0x09, 0x12, 0x10, 0x0a, - 0x0b, 0x48, 0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x45, 0x78, 0x69, 0x73, 0x74, 0x10, 0x94, 0x0a, 0x12, - 0x11, 0x0a, 0x0c, 0x48, 0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, - 0x95, 0x0a, 0x12, 0x0e, 0x0a, 0x09, 0x48, 0x65, 0x72, 0x6f, 0x4d, 0x61, 0x78, 0x4c, 0x76, 0x10, - 0x96, 0x0a, 0x12, 0x12, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x49, 0x6e, 0x69, 0x74, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x10, 0x97, 0x0a, 0x12, 0x11, 0x0a, 0x0c, 0x48, 0x65, 0x72, 0x6f, 0x43, 0x6f, - 0x6c, 0x6f, 0x72, 0x45, 0x72, 0x72, 0x10, 0x98, 0x0a, 0x12, 0x13, 0x0a, 0x0e, 0x48, 0x65, 0x72, - 0x6f, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x55, 0x70, 0x45, 0x72, 0x72, 0x10, 0x99, 0x0a, 0x12, 0x14, - 0x0a, 0x0f, 0x48, 0x65, 0x72, 0x6f, 0x4d, 0x61, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x74, - 0x65, 0x10, 0x9a, 0x0a, 0x12, 0x13, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x52, 0x65, - 0x73, 0x6f, 0x6e, 0x61, 0x74, 0x65, 0x10, 0x9b, 0x0a, 0x12, 0x18, 0x0a, 0x13, 0x48, 0x65, 0x72, - 0x6f, 0x4e, 0x6f, 0x74, 0x4e, 0x65, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x74, 0x65, - 0x10, 0x9c, 0x0a, 0x12, 0x11, 0x0a, 0x0c, 0x48, 0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x45, 0x6e, 0x65, - 0x72, 0x67, 0x79, 0x10, 0x9d, 0x0a, 0x12, 0x0f, 0x0a, 0x0a, 0x48, 0x65, 0x72, 0x6f, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x10, 0x9e, 0x0a, 0x12, 0x14, 0x0a, 0x0f, 0x48, 0x65, 0x72, 0x6f, 0x45, - 0x71, 0x75, 0x69, 0x70, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x10, 0x9f, 0x0a, 0x12, 0x12, 0x0a, - 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x4d, 0x61, 0x78, 0x41, 0x77, 0x61, 0x6b, 0x65, 0x6e, 0x10, 0xa0, - 0x0a, 0x12, 0x0f, 0x0a, 0x0a, 0x48, 0x65, 0x72, 0x6f, 0x49, 0x73, 0x4c, 0x6f, 0x63, 0x6b, 0x10, - 0xa1, 0x0a, 0x12, 0x11, 0x0a, 0x0c, 0x48, 0x65, 0x72, 0x6f, 0x4d, 0x61, 0x78, 0x43, 0x6f, 0x75, - 0x6e, 0x74, 0x10, 0xa2, 0x0a, 0x12, 0x14, 0x0a, 0x0f, 0x48, 0x65, 0x72, 0x6f, 0x43, 0x6f, 0x73, - 0x74, 0x54, 0x79, 0x70, 0x65, 0x45, 0x72, 0x72, 0x10, 0xa3, 0x0a, 0x12, 0x10, 0x0a, 0x0b, 0x48, - 0x65, 0x72, 0x6f, 0x53, 0x74, 0x61, 0x72, 0x45, 0x72, 0x72, 0x10, 0xa4, 0x0a, 0x12, 0x10, 0x0a, - 0x0b, 0x48, 0x65, 0x72, 0x6f, 0x54, 0x79, 0x70, 0x65, 0x45, 0x72, 0x72, 0x10, 0xa5, 0x0a, 0x12, - 0x13, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x45, 0x78, 0x70, 0x54, 0x79, 0x70, 0x65, 0x45, 0x72, - 0x72, 0x10, 0xa6, 0x0a, 0x12, 0x12, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x41, 0x64, 0x64, 0x4d, - 0x61, 0x78, 0x45, 0x78, 0x70, 0x10, 0xa7, 0x0a, 0x12, 0x12, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, - 0x53, 0x74, 0x61, 0x72, 0x4c, 0x76, 0x45, 0x72, 0x72, 0x10, 0xa8, 0x0a, 0x12, 0x12, 0x0a, 0x0d, - 0x48, 0x65, 0x72, 0x6f, 0x4d, 0x61, 0x78, 0x53, 0x74, 0x61, 0x72, 0x4c, 0x76, 0x10, 0xa9, 0x0a, - 0x12, 0x19, 0x0a, 0x14, 0x44, 0x72, 0x61, 0x77, 0x43, 0x61, 0x72, 0x64, 0x54, 0x79, 0x70, 0x65, - 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xaa, 0x0a, 0x12, 0x13, 0x0a, 0x0e, 0x48, - 0x65, 0x72, 0x6f, 0x4d, 0x61, 0x78, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x4c, 0x76, 0x10, 0xab, 0x0a, - 0x12, 0x1e, 0x0a, 0x19, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x6e, 0x46, - 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x10, 0xf8, 0x0a, - 0x12, 0x1c, 0x0a, 0x17, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x76, 0x6c, - 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x61, 0x63, 0x68, 0x65, 0x64, 0x10, 0xf9, 0x0a, 0x12, 0x14, - 0x0a, 0x0f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x73, 0x57, 0x6f, 0x72, - 0x6e, 0x10, 0xfa, 0x0a, 0x12, 0x1b, 0x0a, 0x16, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, - 0x4e, 0x6f, 0x74, 0x46, 0x69, 0x6e, 0x64, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x10, 0xdc, - 0x0b, 0x12, 0x15, 0x0a, 0x10, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x49, 0x44, 0x46, - 0x61, 0x69, 0x6c, 0x65, 0x64, 0x10, 0xdd, 0x0b, 0x12, 0x15, 0x0a, 0x10, 0x4d, 0x61, 0x69, 0x6e, - 0x6c, 0x69, 0x6e, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xde, 0x0b, 0x12, - 0x18, 0x0a, 0x13, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x72, 0x65, 0x4e, 0x6f, - 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xdf, 0x0b, 0x12, 0x19, 0x0a, 0x14, 0x4d, 0x61, 0x69, - 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, - 0x64, 0x10, 0xe0, 0x0b, 0x12, 0x1b, 0x0a, 0x16, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, - 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x10, 0xe1, - 0x0b, 0x12, 0x0d, 0x0a, 0x08, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x6e, 0x69, 0x74, 0x10, 0xc0, 0x0c, - 0x12, 0x0e, 0x0a, 0x09, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x65, 0x74, 0x10, 0xc1, 0x0c, - 0x12, 0x0f, 0x0a, 0x0a, 0x54, 0x61, 0x73, 0x6b, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x10, 0xc2, - 0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, - 0x64, 0x10, 0xc3, 0x0c, 0x12, 0x13, 0x0a, 0x0e, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, - 0x76, 0x65, 0x49, 0x6e, 0x69, 0x74, 0x10, 0xc4, 0x0c, 0x12, 0x16, 0x0a, 0x11, 0x54, 0x61, 0x73, - 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4e, 0x6f, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xc5, - 0x0c, 0x12, 0x17, 0x0a, 0x12, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4e, - 0x6f, 0x65, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0xc6, 0x0c, 0x12, 0x13, 0x0a, 0x0e, 0x54, 0x61, - 0x73, 0x6b, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x10, 0xc7, 0x0c, 0x12, - 0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x10, - 0xc8, 0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x54, 0x61, 0x67, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x10, 0xc9, 0x0c, 0x12, 0x10, 0x0a, 0x0b, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x10, 0xca, 0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x4e, - 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xcb, 0x0c, 0x12, 0x17, 0x0a, 0x12, 0x53, 0x68, - 0x6f, 0x70, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x73, 0x53, 0x6f, 0x6c, 0x64, 0x4f, 0x75, 0x74, - 0x10, 0xa4, 0x0d, 0x12, 0x1c, 0x0a, 0x17, 0x53, 0x68, 0x6f, 0x70, 0x4e, 0x6f, 0x53, 0x75, 0x72, - 0x70, 0x6c, 0x75, 0x73, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x4e, 0x75, 0x6d, 0x10, 0xa5, - 0x0d, 0x12, 0x0c, 0x0a, 0x07, 0x4d, 0x61, 0x69, 0x6c, 0x45, 0x72, 0x72, 0x10, 0x88, 0x0e, 0x42, - 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x79, 0x10, 0xd7, 0x08, 0x12, 0x10, 0x0a, 0x0b, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5a, 0x61, + 0x6e, 0x65, 0x64, 0x10, 0xd8, 0x08, 0x12, 0x16, 0x0a, 0x11, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, + 0x5a, 0x61, 0x6e, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x10, 0xd9, 0x08, 0x12, 0x12, + 0x0a, 0x0d, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x4e, 0x6f, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, + 0xb0, 0x09, 0x12, 0x15, 0x0a, 0x10, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x4e, 0x6f, 0x46, 0x6f, 0x75, + 0x6e, 0x64, 0x47, 0x69, 0x72, 0x64, 0x10, 0xb1, 0x09, 0x12, 0x16, 0x0a, 0x11, 0x49, 0x74, 0x65, + 0x6d, 0x73, 0x47, 0x72, 0x69, 0x64, 0x4e, 0x75, 0x6d, 0x55, 0x70, 0x70, 0x65, 0x72, 0x10, 0xb2, + 0x09, 0x12, 0x19, 0x0a, 0x14, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x47, 0x69, 0x72, 0x64, 0x41, 0x6d, + 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x70, 0x70, 0x65, 0x72, 0x10, 0xb3, 0x09, 0x12, 0x19, 0x0a, 0x14, + 0x49, 0x74, 0x65, 0x6d, 0x73, 0x55, 0x73, 0x65, 0x4e, 0x6f, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6f, + 0x72, 0x74, 0x65, 0x64, 0x10, 0xb4, 0x09, 0x12, 0x10, 0x0a, 0x0b, 0x48, 0x65, 0x72, 0x6f, 0x4e, + 0x6f, 0x45, 0x78, 0x69, 0x73, 0x74, 0x10, 0x94, 0x0a, 0x12, 0x11, 0x0a, 0x0c, 0x48, 0x65, 0x72, + 0x6f, 0x4e, 0x6f, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0x95, 0x0a, 0x12, 0x0e, 0x0a, 0x09, + 0x48, 0x65, 0x72, 0x6f, 0x4d, 0x61, 0x78, 0x4c, 0x76, 0x10, 0x96, 0x0a, 0x12, 0x12, 0x0a, 0x0d, + 0x48, 0x65, 0x72, 0x6f, 0x49, 0x6e, 0x69, 0x74, 0x43, 0x72, 0x65, 0x61, 0x74, 0x10, 0x97, 0x0a, + 0x12, 0x11, 0x0a, 0x0c, 0x48, 0x65, 0x72, 0x6f, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x45, 0x72, 0x72, + 0x10, 0x98, 0x0a, 0x12, 0x13, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x53, 0x6b, 0x69, 0x6c, 0x6c, + 0x55, 0x70, 0x45, 0x72, 0x72, 0x10, 0x99, 0x0a, 0x12, 0x14, 0x0a, 0x0f, 0x48, 0x65, 0x72, 0x6f, + 0x4d, 0x61, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x74, 0x65, 0x10, 0x9a, 0x0a, 0x12, 0x13, + 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x74, 0x65, + 0x10, 0x9b, 0x0a, 0x12, 0x18, 0x0a, 0x13, 0x48, 0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x74, 0x4e, 0x65, + 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x74, 0x65, 0x10, 0x9c, 0x0a, 0x12, 0x11, 0x0a, + 0x0c, 0x48, 0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x10, 0x9d, 0x0a, + 0x12, 0x0f, 0x0a, 0x0a, 0x48, 0x65, 0x72, 0x6f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x10, 0x9e, + 0x0a, 0x12, 0x14, 0x0a, 0x0f, 0x48, 0x65, 0x72, 0x6f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x10, 0x9f, 0x0a, 0x12, 0x12, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x4d, + 0x61, 0x78, 0x41, 0x77, 0x61, 0x6b, 0x65, 0x6e, 0x10, 0xa0, 0x0a, 0x12, 0x0f, 0x0a, 0x0a, 0x48, + 0x65, 0x72, 0x6f, 0x49, 0x73, 0x4c, 0x6f, 0x63, 0x6b, 0x10, 0xa1, 0x0a, 0x12, 0x11, 0x0a, 0x0c, + 0x48, 0x65, 0x72, 0x6f, 0x4d, 0x61, 0x78, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x10, 0xa2, 0x0a, 0x12, + 0x14, 0x0a, 0x0f, 0x48, 0x65, 0x72, 0x6f, 0x43, 0x6f, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x45, + 0x72, 0x72, 0x10, 0xa3, 0x0a, 0x12, 0x10, 0x0a, 0x0b, 0x48, 0x65, 0x72, 0x6f, 0x53, 0x74, 0x61, + 0x72, 0x45, 0x72, 0x72, 0x10, 0xa4, 0x0a, 0x12, 0x10, 0x0a, 0x0b, 0x48, 0x65, 0x72, 0x6f, 0x54, + 0x79, 0x70, 0x65, 0x45, 0x72, 0x72, 0x10, 0xa5, 0x0a, 0x12, 0x13, 0x0a, 0x0e, 0x48, 0x65, 0x72, + 0x6f, 0x45, 0x78, 0x70, 0x54, 0x79, 0x70, 0x65, 0x45, 0x72, 0x72, 0x10, 0xa6, 0x0a, 0x12, 0x12, + 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x41, 0x64, 0x64, 0x4d, 0x61, 0x78, 0x45, 0x78, 0x70, 0x10, + 0xa7, 0x0a, 0x12, 0x12, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x53, 0x74, 0x61, 0x72, 0x4c, 0x76, + 0x45, 0x72, 0x72, 0x10, 0xa8, 0x0a, 0x12, 0x12, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x4d, 0x61, + 0x78, 0x53, 0x74, 0x61, 0x72, 0x4c, 0x76, 0x10, 0xa9, 0x0a, 0x12, 0x19, 0x0a, 0x14, 0x44, 0x72, + 0x61, 0x77, 0x43, 0x61, 0x72, 0x64, 0x54, 0x79, 0x70, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, + 0x6e, 0x64, 0x10, 0xaa, 0x0a, 0x12, 0x13, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x4d, 0x61, 0x78, + 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x4c, 0x76, 0x10, 0xab, 0x0a, 0x12, 0x1e, 0x0a, 0x19, 0x45, 0x71, + 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x6e, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x71, + 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x10, 0xf8, 0x0a, 0x12, 0x1c, 0x0a, 0x17, 0x45, 0x71, + 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x76, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, + 0x61, 0x63, 0x68, 0x65, 0x64, 0x10, 0xf9, 0x0a, 0x12, 0x14, 0x0a, 0x0f, 0x45, 0x71, 0x75, 0x69, + 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x73, 0x57, 0x6f, 0x72, 0x6e, 0x10, 0xfa, 0x0a, 0x12, 0x1b, + 0x0a, 0x16, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x69, 0x6e, + 0x64, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x10, 0xdc, 0x0b, 0x12, 0x15, 0x0a, 0x10, 0x4d, + 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x49, 0x44, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x10, + 0xdd, 0x0b, 0x12, 0x15, 0x0a, 0x10, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x4e, 0x6f, + 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xde, 0x0b, 0x12, 0x18, 0x0a, 0x13, 0x4d, 0x61, 0x69, + 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x72, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, + 0x10, 0xdf, 0x0b, 0x12, 0x19, 0x0a, 0x14, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x52, + 0x65, 0x70, 0x65, 0x61, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x10, 0xe0, 0x0b, 0x12, 0x1b, + 0x0a, 0x16, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, + 0x74, 0x65, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x10, 0xe1, 0x0b, 0x12, 0x0d, 0x0a, 0x08, 0x54, + 0x61, 0x73, 0x6b, 0x49, 0x6e, 0x69, 0x74, 0x10, 0xc0, 0x0c, 0x12, 0x0e, 0x0a, 0x09, 0x54, 0x61, + 0x73, 0x6b, 0x52, 0x65, 0x73, 0x65, 0x74, 0x10, 0xc1, 0x0c, 0x12, 0x0f, 0x0a, 0x0a, 0x54, 0x61, + 0x73, 0x6b, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x10, 0xc2, 0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54, + 0x61, 0x73, 0x6b, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x10, 0xc3, 0x0c, 0x12, 0x13, + 0x0a, 0x0e, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x69, 0x74, + 0x10, 0xc4, 0x0c, 0x12, 0x16, 0x0a, 0x11, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, + 0x65, 0x4e, 0x6f, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xc5, 0x0c, 0x12, 0x17, 0x0a, 0x12, 0x54, + 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4e, 0x6f, 0x65, 0x6e, 0x6f, 0x75, 0x67, + 0x68, 0x10, 0xc6, 0x0c, 0x12, 0x13, 0x0a, 0x0e, 0x54, 0x61, 0x73, 0x6b, 0x4e, 0x6f, 0x46, 0x69, + 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x10, 0xc7, 0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73, + 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x10, 0xc8, 0x0c, 0x12, 0x11, 0x0a, 0x0c, + 0x54, 0x61, 0x73, 0x6b, 0x54, 0x61, 0x67, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x10, 0xc9, 0x0c, 0x12, + 0x10, 0x0a, 0x0b, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x10, 0xca, + 0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, + 0x64, 0x10, 0xcb, 0x0c, 0x12, 0x17, 0x0a, 0x12, 0x53, 0x68, 0x6f, 0x70, 0x47, 0x6f, 0x6f, 0x64, + 0x73, 0x49, 0x73, 0x53, 0x6f, 0x6c, 0x64, 0x4f, 0x75, 0x74, 0x10, 0xa4, 0x0d, 0x12, 0x1c, 0x0a, + 0x17, 0x53, 0x68, 0x6f, 0x70, 0x4e, 0x6f, 0x53, 0x75, 0x72, 0x70, 0x6c, 0x75, 0x73, 0x52, 0x65, + 0x66, 0x72, 0x65, 0x73, 0x68, 0x4e, 0x75, 0x6d, 0x10, 0xa5, 0x0d, 0x12, 0x0c, 0x0a, 0x07, 0x4d, + 0x61, 0x69, 0x6c, 0x45, 0x72, 0x72, 0x10, 0x88, 0x0e, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, + 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pb/friend_db.pb.go b/pb/friend_db.pb.go index 6d7ff76f6..acd2c5e14 100644 --- a/pb/friend_db.pb.go +++ b/pb/friend_db.pb.go @@ -29,6 +29,7 @@ type DBFriend struct { FriendIds []string `protobuf:"bytes,2,rep,name=friendIds,proto3" json:"friendIds" bson:"friendIds"` //好友ID ApplyIds []string `protobuf:"bytes,3,rep,name=applyIds,proto3" json:"applyIds" bson:"applyIds"` //申请用户ID BlackIds []string `protobuf:"bytes,4,rep,name=blackIds,proto3" json:"blackIds" bson:"blackIds"` //黑名单ID + ZanIds []string `protobuf:"bytes,5,rep,name=zanIds,proto3" json:"zanIds" bson:"zanIds"` //点赞好友ID } func (x *DBFriend) Reset() { @@ -91,19 +92,28 @@ func (x *DBFriend) GetBlackIds() []string { return nil } +func (x *DBFriend) GetZanIds() []string { + if x != nil { + return x.ZanIds + } + return nil +} + var File_friend_friend_db_proto protoreflect.FileDescriptor var file_friend_friend_db_proto_rawDesc = []byte{ 0x0a, 0x16, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2f, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5f, - 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x72, 0x0a, 0x08, 0x44, 0x42, 0x46, 0x72, - 0x69, 0x65, 0x6e, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, - 0x49, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x66, 0x72, 0x69, 0x65, 0x6e, - 0x64, 0x49, 0x64, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x49, 0x64, 0x73, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x49, 0x64, 0x73, - 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x49, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x08, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x49, 0x64, 0x73, 0x42, 0x06, 0x5a, 0x04, - 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8a, 0x01, 0x0a, 0x08, 0x44, 0x42, 0x46, + 0x72, 0x69, 0x65, 0x6e, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x72, 0x69, 0x65, 0x6e, + 0x64, 0x49, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x66, 0x72, 0x69, 0x65, + 0x6e, 0x64, 0x49, 0x64, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x49, 0x64, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x49, 0x64, + 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x49, 0x64, 0x73, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x08, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x49, 0x64, 0x73, 0x12, 0x16, 0x0a, + 0x06, 0x7a, 0x61, 0x6e, 0x49, 0x64, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x7a, + 0x61, 0x6e, 0x49, 0x64, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pb/friend_msg.pb.go b/pb/friend_msg.pb.go index efee3d021..abec55ce8 100644 --- a/pb/friend_msg.pb.go +++ b/pb/friend_msg.pb.go @@ -1379,6 +1379,282 @@ func (x *FriendTotalResp) GetTotal() int32 { return 0 } +// 点赞列表 +type FriendZanlistReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *FriendZanlistReq) Reset() { + *x = FriendZanlistReq{} + if protoimpl.UnsafeEnabled { + mi := &file_friend_friend_msg_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FriendZanlistReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FriendZanlistReq) ProtoMessage() {} + +func (x *FriendZanlistReq) ProtoReflect() protoreflect.Message { + mi := &file_friend_friend_msg_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 FriendZanlistReq.ProtoReflect.Descriptor instead. +func (*FriendZanlistReq) Descriptor() ([]byte, []int) { + return file_friend_friend_msg_proto_rawDescGZIP(), []int{27} +} + +type FriendZanlistResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*FriendBase `protobuf:"bytes,1,rep,name=list,proto3" json:"list"` +} + +func (x *FriendZanlistResp) Reset() { + *x = FriendZanlistResp{} + if protoimpl.UnsafeEnabled { + mi := &file_friend_friend_msg_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FriendZanlistResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FriendZanlistResp) ProtoMessage() {} + +func (x *FriendZanlistResp) ProtoReflect() protoreflect.Message { + mi := &file_friend_friend_msg_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 FriendZanlistResp.ProtoReflect.Descriptor instead. +func (*FriendZanlistResp) Descriptor() ([]byte, []int) { + return file_friend_friend_msg_proto_rawDescGZIP(), []int{28} +} + +func (x *FriendZanlistResp) GetList() []*FriendBase { + if x != nil { + return x.List + } + return nil +} + +// 点赞 +type FriendZanReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId"` +} + +func (x *FriendZanReq) Reset() { + *x = FriendZanReq{} + if protoimpl.UnsafeEnabled { + mi := &file_friend_friend_msg_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FriendZanReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FriendZanReq) ProtoMessage() {} + +func (x *FriendZanReq) ProtoReflect() protoreflect.Message { + mi := &file_friend_friend_msg_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 FriendZanReq.ProtoReflect.Descriptor instead. +func (*FriendZanReq) Descriptor() ([]byte, []int) { + return file_friend_friend_msg_proto_rawDescGZIP(), []int{29} +} + +func (x *FriendZanReq) GetFriendId() string { + if x != nil { + return x.FriendId + } + return "" +} + +type FriendZanResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Flag bool `protobuf:"varint,1,opt,name=flag,proto3" json:"flag"` +} + +func (x *FriendZanResp) Reset() { + *x = FriendZanResp{} + if protoimpl.UnsafeEnabled { + mi := &file_friend_friend_msg_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FriendZanResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FriendZanResp) ProtoMessage() {} + +func (x *FriendZanResp) ProtoReflect() protoreflect.Message { + mi := &file_friend_friend_msg_proto_msgTypes[30] + 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 FriendZanResp.ProtoReflect.Descriptor instead. +func (*FriendZanResp) Descriptor() ([]byte, []int) { + return file_friend_friend_msg_proto_rawDescGZIP(), []int{30} +} + +func (x *FriendZanResp) GetFlag() bool { + if x != nil { + return x.Flag + } + return false +} + +//接收点赞 +type FriendZanreceiveReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId"` +} + +func (x *FriendZanreceiveReq) Reset() { + *x = FriendZanreceiveReq{} + if protoimpl.UnsafeEnabled { + mi := &file_friend_friend_msg_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FriendZanreceiveReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FriendZanreceiveReq) ProtoMessage() {} + +func (x *FriendZanreceiveReq) ProtoReflect() protoreflect.Message { + mi := &file_friend_friend_msg_proto_msgTypes[31] + 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 FriendZanreceiveReq.ProtoReflect.Descriptor instead. +func (*FriendZanreceiveReq) Descriptor() ([]byte, []int) { + return file_friend_friend_msg_proto_rawDescGZIP(), []int{31} +} + +func (x *FriendZanreceiveReq) GetFriendId() string { + if x != nil { + return x.FriendId + } + return "" +} + +type FriendZanreceiveResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Flag bool `protobuf:"varint,1,opt,name=flag,proto3" json:"flag"` +} + +func (x *FriendZanreceiveResp) Reset() { + *x = FriendZanreceiveResp{} + if protoimpl.UnsafeEnabled { + mi := &file_friend_friend_msg_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FriendZanreceiveResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FriendZanreceiveResp) ProtoMessage() {} + +func (x *FriendZanreceiveResp) ProtoReflect() protoreflect.Message { + mi := &file_friend_friend_msg_proto_msgTypes[32] + 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 FriendZanreceiveResp.ProtoReflect.Descriptor instead. +func (*FriendZanreceiveResp) Descriptor() ([]byte, []int) { + return file_friend_friend_msg_proto_rawDescGZIP(), []int{32} +} + +func (x *FriendZanreceiveResp) GetFlag() bool { + if x != nil { + return x.Flag + } + return false +} + var File_friend_friend_msg_proto protoreflect.FileDescriptor var file_friend_friend_msg_proto_rawDesc = []byte{ @@ -1479,8 +1755,24 @@ var file_friend_friend_msg_proto_rawDesc = []byte{ 0x74, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, - 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0x12, 0x0a, 0x10, 0x46, 0x72, 0x69, + 0x65, 0x6e, 0x64, 0x5a, 0x61, 0x6e, 0x6c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x22, 0x34, 0x0a, + 0x11, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5a, 0x61, 0x6e, 0x6c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x0b, 0x2e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x42, 0x61, 0x73, 0x65, 0x52, 0x04, 0x6c, + 0x69, 0x73, 0x74, 0x22, 0x2a, 0x0a, 0x0c, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5a, 0x61, 0x6e, + 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x22, + 0x23, 0x0a, 0x0d, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5a, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x12, 0x0a, 0x04, 0x66, 0x6c, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, + 0x66, 0x6c, 0x61, 0x67, 0x22, 0x31, 0x0a, 0x13, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5a, 0x61, + 0x6e, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x66, + 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, + 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x22, 0x2a, 0x0a, 0x14, 0x46, 0x72, 0x69, 0x65, 0x6e, + 0x64, 0x5a, 0x61, 0x6e, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x12, 0x0a, 0x04, 0x66, 0x6c, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x66, + 0x6c, 0x61, 0x67, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -1495,46 +1787,53 @@ func file_friend_friend_msg_proto_rawDescGZIP() []byte { return file_friend_friend_msg_proto_rawDescData } -var file_friend_friend_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 27) +var file_friend_friend_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 33) var file_friend_friend_msg_proto_goTypes = []interface{}{ - (*FriendBase)(nil), // 0: FriendBase - (*FriendListReq)(nil), // 1: FriendListReq - (*FriendListResp)(nil), // 2: FriendListResp - (*FriendApplyReq)(nil), // 3: FriendApplyReq - (*FriendApplyResp)(nil), // 4: FriendApplyResp - (*FriendDelReq)(nil), // 5: FriendDelReq - (*FriendDelResp)(nil), // 6: FriendDelResp - (*FriendAgreeReq)(nil), // 7: FriendAgreeReq - (*FriendAgreeResp)(nil), // 8: FriendAgreeResp - (*FriendRefuseReq)(nil), // 9: FriendRefuseReq - (*FriendRefuseResp)(nil), // 10: FriendRefuseResp - (*FriendApplyListReq)(nil), // 11: FriendApplyListReq - (*FriendApplyListResp)(nil), // 12: FriendApplyListResp - (*FriendSearchReq)(nil), // 13: FriendSearchReq - (*FriendSearchResp)(nil), // 14: FriendSearchResp - (*FriendBlackListReq)(nil), // 15: FriendBlackListReq - (*FriendBlackListResp)(nil), // 16: FriendBlackListResp - (*FriendBlackAddReq)(nil), // 17: FriendBlackAddReq - (*FriendBlackAddResp)(nil), // 18: FriendBlackAddResp - (*FriendDelBlackReq)(nil), // 19: FriendDelBlackReq - (*FriendDelBlackResp)(nil), // 20: FriendDelBlackResp - (*FriendReceiveReq)(nil), // 21: FriendReceiveReq - (*FriendReceiveResp)(nil), // 22: FriendReceiveResp - (*FriendGiveReq)(nil), // 23: FriendGiveReq - (*FriendGiveResp)(nil), // 24: FriendGiveResp - (*FriendTotalReq)(nil), // 25: FriendTotalReq - (*FriendTotalResp)(nil), // 26: FriendTotalResp + (*FriendBase)(nil), // 0: FriendBase + (*FriendListReq)(nil), // 1: FriendListReq + (*FriendListResp)(nil), // 2: FriendListResp + (*FriendApplyReq)(nil), // 3: FriendApplyReq + (*FriendApplyResp)(nil), // 4: FriendApplyResp + (*FriendDelReq)(nil), // 5: FriendDelReq + (*FriendDelResp)(nil), // 6: FriendDelResp + (*FriendAgreeReq)(nil), // 7: FriendAgreeReq + (*FriendAgreeResp)(nil), // 8: FriendAgreeResp + (*FriendRefuseReq)(nil), // 9: FriendRefuseReq + (*FriendRefuseResp)(nil), // 10: FriendRefuseResp + (*FriendApplyListReq)(nil), // 11: FriendApplyListReq + (*FriendApplyListResp)(nil), // 12: FriendApplyListResp + (*FriendSearchReq)(nil), // 13: FriendSearchReq + (*FriendSearchResp)(nil), // 14: FriendSearchResp + (*FriendBlackListReq)(nil), // 15: FriendBlackListReq + (*FriendBlackListResp)(nil), // 16: FriendBlackListResp + (*FriendBlackAddReq)(nil), // 17: FriendBlackAddReq + (*FriendBlackAddResp)(nil), // 18: FriendBlackAddResp + (*FriendDelBlackReq)(nil), // 19: FriendDelBlackReq + (*FriendDelBlackResp)(nil), // 20: FriendDelBlackResp + (*FriendReceiveReq)(nil), // 21: FriendReceiveReq + (*FriendReceiveResp)(nil), // 22: FriendReceiveResp + (*FriendGiveReq)(nil), // 23: FriendGiveReq + (*FriendGiveResp)(nil), // 24: FriendGiveResp + (*FriendTotalReq)(nil), // 25: FriendTotalReq + (*FriendTotalResp)(nil), // 26: FriendTotalResp + (*FriendZanlistReq)(nil), // 27: FriendZanlistReq + (*FriendZanlistResp)(nil), // 28: FriendZanlistResp + (*FriendZanReq)(nil), // 29: FriendZanReq + (*FriendZanResp)(nil), // 30: FriendZanResp + (*FriendZanreceiveReq)(nil), // 31: FriendZanreceiveReq + (*FriendZanreceiveResp)(nil), // 32: FriendZanreceiveResp } var file_friend_friend_msg_proto_depIdxs = []int32{ 0, // 0: FriendListResp.list:type_name -> FriendBase 0, // 1: FriendApplyListResp.list:type_name -> FriendBase 0, // 2: FriendSearchResp.friend:type_name -> FriendBase 0, // 3: FriendBlackListResp.friends:type_name -> FriendBase - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 0, // 4: FriendZanlistResp.list:type_name -> FriendBase + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_friend_friend_msg_proto_init() } @@ -1867,6 +2166,78 @@ func file_friend_friend_msg_proto_init() { return nil } } + file_friend_friend_msg_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FriendZanlistReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_friend_friend_msg_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FriendZanlistResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_friend_friend_msg_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FriendZanReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_friend_friend_msg_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FriendZanResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_friend_friend_msg_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FriendZanreceiveReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_friend_friend_msg_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FriendZanreceiveResp); 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{ @@ -1874,7 +2245,7 @@ func file_friend_friend_msg_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_friend_friend_msg_proto_rawDesc, NumEnums: 0, - NumMessages: 27, + NumMessages: 33, NumExtensions: 0, NumServices: 0, }, diff --git a/pb/user_msg.pb.go b/pb/user_msg.pb.go index b1fe33391..2d507ca79 100644 --- a/pb/user_msg.pb.go +++ b/pb/user_msg.pb.go @@ -1061,6 +1061,7 @@ type UserModifynameResp struct { Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid"` Count uint32 `protobuf:"varint,2,opt,name=count,proto3" json:"count"` //剩余修改次数 + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name"` } func (x *UserModifynameResp) Reset() { @@ -1109,6 +1110,13 @@ func (x *UserModifynameResp) GetCount() uint32 { return 0 } +func (x *UserModifynameResp) GetName() string { + if x != nil { + return x.Name + } + return "" +} + // 图鉴 type UserGetTujianReq struct { state protoimpl.MessageState @@ -1587,46 +1595,47 @@ var file_user_user_msg_proto_rawDesc = []byte{ 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x27, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3c, 0x0a, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x50, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x12, 0x0a, 0x10, 0x55, - 0x73, 0x65, 0x72, 0x47, 0x65, 0x74, 0x54, 0x75, 0x6a, 0x69, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x22, - 0x2d, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x47, 0x65, 0x74, 0x54, 0x75, 0x6a, 0x69, 0x61, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x69, 0x64, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x69, 0x64, 0x73, 0x22, 0x45, - 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x50, 0x75, 0x73, - 0x68, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x75, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x02, 0x6c, 0x76, 0x22, 0xe3, 0x01, 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x46, 0x69, - 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x72, 0x65, 0x69, 0x6e, - 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x70, 0x72, 0x65, - 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x19, 0x0a, 0x04, 0x68, 0x61, 0x69, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, - 0x48, 0x61, 0x69, 0x72, 0x52, 0x04, 0x68, 0x61, 0x69, 0x72, 0x12, 0x19, 0x0a, 0x04, 0x65, 0x79, - 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x45, 0x79, 0x65, 0x73, 0x52, - 0x04, 0x65, 0x79, 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x05, 0x6d, 0x6f, 0x75, 0x74, 0x68, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x4d, 0x6f, 0x75, 0x74, 0x68, 0x52, 0x05, 0x6d, 0x6f, - 0x75, 0x74, 0x68, 0x12, 0x19, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x05, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x2b, - 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x52, - 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x22, 0x5b, 0x0a, 0x0e, 0x55, - 0x73, 0x65, 0x72, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, - 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, - 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x06, 0x66, 0x69, 0x67, 0x75, 0x72, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, - 0x52, 0x06, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x22, 0x27, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, - 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x73, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, - 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x69, 0x67, - 0x6e, 0x22, 0x26, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x73, - 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, - 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, + 0x12, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x47, 0x65, 0x74, 0x54, 0x75, 0x6a, 0x69, 0x61, 0x6e, + 0x52, 0x65, 0x71, 0x22, 0x2d, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x47, 0x65, 0x74, 0x54, 0x75, + 0x6a, 0x69, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x68, 0x65, 0x72, 0x6f, + 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x69, + 0x64, 0x73, 0x22, 0x45, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x64, 0x50, 0x75, 0x73, 0x68, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78, 0x70, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x6c, 0x76, 0x22, 0xe3, 0x01, 0x0a, 0x0d, 0x55, 0x73, + 0x65, 0x72, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1e, 0x0a, 0x0a, 0x70, + 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0a, 0x70, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x04, 0x68, 0x61, 0x69, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x69, 0x72, 0x52, 0x04, 0x68, 0x61, 0x69, 0x72, 0x12, 0x19, + 0x0a, 0x04, 0x65, 0x79, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x45, + 0x79, 0x65, 0x73, 0x52, 0x04, 0x65, 0x79, 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x05, 0x6d, 0x6f, 0x75, + 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x4d, 0x6f, 0x75, 0x74, 0x68, + 0x52, 0x05, 0x6d, 0x6f, 0x75, 0x74, 0x68, 0x12, 0x19, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, + 0x64, 0x79, 0x12, 0x2b, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, + 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x22, + 0x5b, 0x0a, 0x0e, 0x55, 0x73, 0x65, 0x72, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x75, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x06, 0x66, + 0x69, 0x67, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x46, 0x69, + 0x67, 0x75, 0x72, 0x65, 0x52, 0x06, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x22, 0x27, 0x0a, 0x11, + 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x73, 0x69, 0x67, 0x6e, 0x52, 0x65, + 0x71, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x73, 0x69, 0x67, 0x6e, 0x22, 0x26, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, + 0x69, 0x66, 0x79, 0x73, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x42, 0x06, 0x5a, + 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( From 1670917a59f7e90808c0c3c39fa45b10e1f37f53 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Wed, 10 Aug 2022 15:24:47 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=89=A9=E5=B1=95?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=9B=BE=E9=89=B4=E6=95=B0=E6=8D=AE=E4=BF=9D?= =?UTF-8?q?=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/cmd.go | 10 +++++++++- modules/hero/hero_test.go | 27 ++++++++++++++++++++++++++- modules/hero/model_hero.go | 12 +++++++----- modules/hero/model_record.go | 4 +++- modules/user/model_expand.go | 5 +++-- 5 files changed, 48 insertions(+), 10 deletions(-) diff --git a/cmd/cmd.go b/cmd/cmd.go index 68dfd101a..2d1205845 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -3,10 +3,12 @@ package main import ( "fmt" "go_dreamfactory/cmd/robot" + "go_dreamfactory/pb" "os" "github.com/sirupsen/logrus" flag "github.com/spf13/pflag" + "go.mongodb.org/mongo-driver/bson/primitive" "github.com/spf13/cobra" ) @@ -38,8 +40,14 @@ var sid = flag.Int32("sid", 0, "区服ID") var create = flag.Bool("create", false, "是否创建新账号") //false 不创建新账号 var role = flag.Bool("role", false, "创角") +func CloneNewHero(hero *pb.DBHero) (newHero *pb.DBHero) { + newHero = &*hero + newHero.Id = primitive.NewObjectID().Hex() + + return +} func main() { - Execute() + //Execute() } var runCmd = &cobra.Command{ diff --git a/modules/hero/hero_test.go b/modules/hero/hero_test.go index 47fbb0140..8850efdf4 100644 --- a/modules/hero/hero_test.go +++ b/modules/hero/hero_test.go @@ -22,6 +22,7 @@ import ( "time" "github.com/golang/protobuf/ptypes" + "go.mongodb.org/mongo-driver/bson/primitive" ) var service core.IService @@ -55,8 +56,19 @@ func (this *TestService) InitSys() { } func TestMain(m *testing.M) { + sz := GetMap() + if len(sz) == 0 { + sz = make(map[int32]int32, 0) + } + + sz[2] = 2 + hero := &pb.DBHero{} + hero.Block = false + hero.Lv = 12 + new := CloneNewHero(hero) + fmt.Printf("%v", new) service = newService( - rpcx.SetConfPath("../../bin/conf/worker_2.yaml"), + rpcx.SetConfPath("../../bin/conf/worker_1.yaml"), ) service.OnInstallComp( //装备组件 s_gateComp, //此服务需要接受用户的消息 需要装备网关组件 @@ -73,7 +85,20 @@ func TestMain(m *testing.M) { time.Sleep(time.Second * 2) defer os.Exit(m.Run()) } + +func GetMap() map[int32]int32 { + return nil +} +func CloneNewHero(hero *pb.DBHero) (newHero *pb.DBHero) { + temp := *hero + newHero = &temp + newHero.Block = true + newHero.Lv = 100 + newHero.Id = primitive.NewObjectID().Hex() + return +} func Test_Modules(t *testing.T) { + data, _ := ptypes.MarshalAny(&pb.HeroListReq{}) reply := &pb.RPCMessageReply{} s_gateComp.ReceiveMsg(context.Background(), &pb.AgentMessage{UserId: "0_62c79d66acc7aa239b07c21e", MainType: "hero", SubType: "list", Message: data}, reply) diff --git a/modules/hero/model_hero.go b/modules/hero/model_hero.go index ea7ad2962..94284f9c8 100644 --- a/modules/hero/model_hero.go +++ b/modules/hero/model_hero.go @@ -102,7 +102,8 @@ func (this *ModelHero) createOneHero(uid string, heroCfgId string) (hero *pb.DBH // 克隆一个英雄 func (this *ModelHero) CloneNewHero(hero *pb.DBHero) (newHero *pb.DBHero) { - newHero = &*hero + temp := *hero + newHero = &temp newHero.Id = primitive.NewObjectID().Hex() this.AddList(newHero.Uid, newHero.Id, newHero) return @@ -115,11 +116,12 @@ func (this *ModelHero) initHeroOverlying(uid string, heroCfgId string, count int // 添加图鉴 go func(uid, heroCfgId string) { // 携程处理 图鉴数据 if result, err1 := this.moduleHero.ModuleUser.GetUserExpand(uid); err1 == nil { - sz := make(map[string]bool, 0) - for k := range result.GetTujian() { - sz[k] = true - } + if _, ok := result.GetTujian()[heroCfgId]; !ok { + sz := result.GetTujian() + if len(sz) == 0 { + sz = make(map[string]bool, 0) + } sz[heroCfgId] = true initUpdate := map[string]interface{}{ "tujian": sz, diff --git a/modules/hero/model_record.go b/modules/hero/model_record.go index a3afd9ee9..14f6904ae 100644 --- a/modules/hero/model_record.go +++ b/modules/hero/model_record.go @@ -4,6 +4,7 @@ import ( "go_dreamfactory/comm" "go_dreamfactory/lego/core" "go_dreamfactory/lego/sys/log" + "go_dreamfactory/lego/sys/redis" "go_dreamfactory/modules" "go_dreamfactory/pb" "time" @@ -33,9 +34,10 @@ func (this *ModelRecord) getUserSession(uid string) (cuser *pb.CacheUser) { //获取用户通过扩展表 func (this *ModelRecord) GetHeroRecord(uid string) (result *pb.DBHeroRecord, err error) { result = &pb.DBHeroRecord{} - if err = this.Get(uid, result); err != nil { + if err = this.Get(uid, result); err != nil && err != redis.RedisNil { return } + err = nil return result, err } diff --git a/modules/user/model_expand.go b/modules/user/model_expand.go index 0b4f0884d..87d3f01d8 100644 --- a/modules/user/model_expand.go +++ b/modules/user/model_expand.go @@ -4,6 +4,7 @@ import ( "go_dreamfactory/comm" "go_dreamfactory/lego/core" "go_dreamfactory/lego/sys/log" + "go_dreamfactory/lego/sys/redis" "go_dreamfactory/modules" "go_dreamfactory/pb" ) @@ -34,10 +35,10 @@ func (this *ModelExpand) getUserSession(uid string) (cuser *pb.CacheUser) { //获取用户通过扩展表 func (this *ModelExpand) GetUserExpand(uid string) (result *pb.DBUserExpand, err error) { result = &pb.DBUserExpand{} - if err = this.moduleUser.modelExpand.Get(uid, result); err != nil { + if err = this.moduleUser.modelExpand.Get(uid, result); err != nil && redis.RedisNil != err { return } - + err = nil return result, err } From e7b9aabd0889c8dd8da333c92b2c655dc309edde Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Wed, 10 Aug 2022 16:55:54 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E7=88=AC=E5=A1=94=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/json/game_pagodataskreward.json | 80 ++--- comm/const.go | 2 + modules/pagoda/api.go | 7 +- modules/pagoda/api_challenge.go | 6 +- modules/pagoda/api_getReward.go | 6 +- modules/pagoda/api_getlist.go | 21 +- modules/pagoda/model_pagoda.go | 31 +- pb/pagoda_db.pb.go | 176 +++++++++++ pb/pagoda_msg.pb.go | 457 ++++++++++++++++++++++++++++ 9 files changed, 684 insertions(+), 102 deletions(-) create mode 100644 pb/pagoda_db.pb.go create mode 100644 pb/pagoda_msg.pb.go diff --git a/bin/json/game_pagodataskreward.json b/bin/json/game_pagodataskreward.json index add5984ad..17989e44d 100644 --- a/bin/json/game_pagodataskreward.json +++ b/bin/json/game_pagodataskreward.json @@ -2,9 +2,7 @@ { "key": 1, "pagoda_type": 1, - "layer_num": [ - 10 - ], + "layer_num": 10, "reward": [ { "a": "attr", @@ -16,9 +14,7 @@ { "key": 2, "pagoda_type": 1, - "layer_num": [ - 20 - ], + "layer_num": 20, "reward": [ { "a": "attr", @@ -30,9 +26,7 @@ { "key": 3, "pagoda_type": 1, - "layer_num": [ - 30 - ], + "layer_num": 30, "reward": [ { "a": "attr", @@ -44,9 +38,7 @@ { "key": 4, "pagoda_type": 1, - "layer_num": [ - 40 - ], + "layer_num": 40, "reward": [ { "a": "attr", @@ -58,9 +50,7 @@ { "key": 5, "pagoda_type": 1, - "layer_num": [ - 50 - ], + "layer_num": 50, "reward": [ { "a": "attr", @@ -72,9 +62,7 @@ { "key": 6, "pagoda_type": 1, - "layer_num": [ - 60 - ], + "layer_num": 60, "reward": [ { "a": "attr", @@ -86,9 +74,7 @@ { "key": 7, "pagoda_type": 1, - "layer_num": [ - 70 - ], + "layer_num": 70, "reward": [ { "a": "attr", @@ -100,9 +86,7 @@ { "key": 8, "pagoda_type": 1, - "layer_num": [ - 80 - ], + "layer_num": 80, "reward": [ { "a": "attr", @@ -114,9 +98,7 @@ { "key": 9, "pagoda_type": 1, - "layer_num": [ - 90 - ], + "layer_num": 90, "reward": [ { "a": "attr", @@ -128,9 +110,7 @@ { "key": 10, "pagoda_type": 1, - "layer_num": [ - 100 - ], + "layer_num": 100, "reward": [ { "a": "attr", @@ -142,9 +122,7 @@ { "key": 11, "pagoda_type": 2, - "layer_num": [ - 5 - ], + "layer_num": 5, "reward": [ { "a": "attr", @@ -156,9 +134,7 @@ { "key": 12, "pagoda_type": 2, - "layer_num": [ - 10 - ], + "layer_num": 10, "reward": [ { "a": "attr", @@ -170,9 +146,7 @@ { "key": 13, "pagoda_type": 2, - "layer_num": [ - 15 - ], + "layer_num": 15, "reward": [ { "a": "attr", @@ -184,9 +158,7 @@ { "key": 14, "pagoda_type": 2, - "layer_num": [ - 20 - ], + "layer_num": 20, "reward": [ { "a": "attr", @@ -198,9 +170,7 @@ { "key": 15, "pagoda_type": 2, - "layer_num": [ - 25 - ], + "layer_num": 25, "reward": [ { "a": "attr", @@ -212,9 +182,7 @@ { "key": 16, "pagoda_type": 2, - "layer_num": [ - 30 - ], + "layer_num": 30, "reward": [ { "a": "attr", @@ -226,9 +194,7 @@ { "key": 17, "pagoda_type": 2, - "layer_num": [ - 35 - ], + "layer_num": 35, "reward": [ { "a": "attr", @@ -240,9 +206,7 @@ { "key": 18, "pagoda_type": 2, - "layer_num": [ - 40 - ], + "layer_num": 40, "reward": [ { "a": "attr", @@ -254,9 +218,7 @@ { "key": 19, "pagoda_type": 2, - "layer_num": [ - 45 - ], + "layer_num": 45, "reward": [ { "a": "attr", @@ -268,9 +230,7 @@ { "key": 20, "pagoda_type": 2, - "layer_num": [ - 50 - ], + "layer_num": 50, "reward": [ { "a": "attr", diff --git a/comm/const.go b/comm/const.go index 3fb3d00e9..64e6ec3f2 100644 --- a/comm/const.go +++ b/comm/const.go @@ -88,6 +88,8 @@ const ( TableEquipment = "equipment" ///聊天数据表 TableChat = "chat" + // 爬塔数据表 + TablePagoda = "pagoda" ) //RPC服务接口定义处 diff --git a/modules/pagoda/api.go b/modules/pagoda/api.go index f9cc0c835..e22631068 100644 --- a/modules/pagoda/api.go +++ b/modules/pagoda/api.go @@ -6,10 +6,9 @@ import ( ) const ( - MainlineGetListResp = "getlist" - MainlineChallengeResp = "challenge" - MainlineGetRewardResp = "getreward" - MainlineNewChapterPush = "newchapter" + PagodaGetListResp = "getlist" + PagodaChallengeResp = "challenge" + PagodaGetRewardResp = "getreward" ) type apiComp struct { diff --git a/modules/pagoda/api_challenge.go b/modules/pagoda/api_challenge.go index 500c74d76..003ffc5cf 100644 --- a/modules/pagoda/api_challenge.go +++ b/modules/pagoda/api_challenge.go @@ -8,8 +8,8 @@ import ( ) //参数校验 -func (this *apiComp) ChallengeCheck(session comm.IUserSession, req *pb.MainlineChallengeReq) (code pb.ErrorCode) { - if req.MainlineId == 0 { +func (this *apiComp) ChallengeCheck(session comm.IUserSession, req *pb.PagodaChallengeReq) (code pb.ErrorCode) { + if req.LevelID <= 0 { code = pb.ErrorCode_ReqParameterError return } @@ -17,7 +17,7 @@ func (this *apiComp) ChallengeCheck(session comm.IUserSession, req *pb.MainlineC } ///挑战主线关卡 -func (this *apiComp) Challenge(session comm.IUserSession, req *pb.MainlineChallengeReq) (code pb.ErrorCode, data proto.Message) { +func (this *apiComp) Challenge(session comm.IUserSession, req *pb.PagodaChallengeReq) (code pb.ErrorCode, data proto.Message) { code = this.ChallengeCheck(session, req) if code != pb.ErrorCode_Success { diff --git a/modules/pagoda/api_getReward.go b/modules/pagoda/api_getReward.go index 7fb941437..e2b3ffa55 100644 --- a/modules/pagoda/api_getReward.go +++ b/modules/pagoda/api_getReward.go @@ -8,15 +8,15 @@ import ( ) //参数校验 -func (this *apiComp) GetRewardCheck(session comm.IUserSession, req *pb.MainlineGetRewardReq) (code pb.ErrorCode) { - if req.ChapterObj == "" { +func (this *apiComp) GetRewardCheck(session comm.IUserSession, req *pb.PagodaGetRewardReq) (code pb.ErrorCode) { + if req.Id <= 0 { code = pb.ErrorCode_ReqParameterError } return } ///获取主线关卡信息 -func (this *apiComp) GetReward(session comm.IUserSession, req *pb.MainlineGetRewardReq) (code pb.ErrorCode, data proto.Message) { +func (this *apiComp) GetReward(session comm.IUserSession, req *pb.PagodaGetRewardReq) (code pb.ErrorCode, data proto.Message) { code = this.GetRewardCheck(session, req) if code != pb.ErrorCode_Success { diff --git a/modules/pagoda/api_getlist.go b/modules/pagoda/api_getlist.go index 2fca609d3..e3e11b036 100644 --- a/modules/pagoda/api_getlist.go +++ b/modules/pagoda/api_getlist.go @@ -9,15 +9,14 @@ import ( ) //参数校验 -func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.MainlineGetListReq) (code pb.ErrorCode) { +func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.PagodaGetListReq) (code pb.ErrorCode) { return } ///获取主线关卡信息 -func (this *apiComp) GetList(session comm.IUserSession, req *pb.MainlineGetListReq) (code pb.ErrorCode, data proto.Message) { - rsp := &pb.MainlineGetListResp{} - +func (this *apiComp) GetList(session comm.IUserSession, req *pb.PagodaGetListReq) (code pb.ErrorCode, data proto.Message) { + _data := &pb.DBPagoda{} code = this.GetListCheck(session, req) if code != pb.ErrorCode_Success { return // 参数校验失败直接返回 @@ -28,19 +27,17 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.MainlineGetListR code = pb.ErrorCode_DBError return } - if len(list) == 0 { // 如果数量为0 则默认创建一条数据 - _data := &pb.DBMainline{} + if list == nil { // redis没有数据 + _data.Id = primitive.NewObjectID().Hex() - _data.ChapterId = 1 // 默认第一章节 + _mData := make(map[string]interface{}, 0) _data.Uid = session.GetUserId() _mData[_data.Id] = _data - this.module.modelPagoda.addNewPagoda(session.GetUserId(), _mData) - list = append(list, _data) - } - rsp.Data = list - session.SendMsg(string(this.module.GetType()), MainlineGetListResp, &pb.MainlineGetListResp{Data: rsp.Data}) + } + + session.SendMsg(string(this.module.GetType()), PagodaGetListResp, &pb.PagodaGetListResp{Data: _data}) return } diff --git a/modules/pagoda/model_pagoda.go b/modules/pagoda/model_pagoda.go index 673a0904b..ef0516b96 100644 --- a/modules/pagoda/model_pagoda.go +++ b/modules/pagoda/model_pagoda.go @@ -1,32 +1,34 @@ package pagoda import ( + "go_dreamfactory/comm" "go_dreamfactory/lego/core" + "go_dreamfactory/lego/sys/redis" "go_dreamfactory/modules" "go_dreamfactory/pb" ) -const ( //Redis - TablePagoda core.SqlTable = "pagoda" -) - type ModelPagoda struct { modules.MCompModel module *Pagoda } func (this *ModelPagoda) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { + this.TableName = string(comm.TablePagoda) err = this.MCompModel.Init(service, module, comp, options) this.module = module.(*Pagoda) - this.TableName = string(TablePagoda) + return } // 获取爬塔信息 -func (this *ModelPagoda) getPagodaList(uid string) (storys []*pb.DBMainline, err error) { - storys = make([]*pb.DBMainline, 0) - err = this.GetList(uid, &storys) - return +func (this *ModelPagoda) getPagodaList(uid string) (result *pb.DBPagoda, err error) { + result = &pb.DBPagoda{} + if err = this.Get(uid, result); err != nil && redis.RedisNil != err { + return + } + err = nil + return result, err } // 修改爬塔数据信息 @@ -43,14 +45,3 @@ func (this *ModelPagoda) addNewPagoda(uId string, data map[string]interface{}) ( } return nil } - -// 获取指定塔数据 -func (this *ModelPagoda) getPagodaByObjId(uid, obj string) *pb.DBMainline { - data := &pb.DBMainline{} - err := this.GetListObj(uid, obj, data) - if err != nil { - this.module.Errorf("%v", err) - return nil - } - return data -} diff --git a/pb/pagoda_db.pb.go b/pb/pagoda_db.pb.go new file mode 100644 index 000000000..18b74c259 --- /dev/null +++ b/pb/pagoda_db.pb.go @@ -0,0 +1,176 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc v3.20.0 +// source: pagoda/pagoda_db.proto + +package pb + +import ( + 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) +) + +type DBPagoda struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID + Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid" bson:"uid"` //用户ID + PagodaId int32 `protobuf:"varint,3,opt,name=pagodaId,proto3" json:"pagodaId" bson:"chapterId"` //塔层 + Reward map[int32]bool `protobuf:"bytes,4,rep,name=reward,proto3" json:"reward" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // 是否领奖 +} + +func (x *DBPagoda) Reset() { + *x = DBPagoda{} + if protoimpl.UnsafeEnabled { + mi := &file_pagoda_pagoda_db_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DBPagoda) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DBPagoda) ProtoMessage() {} + +func (x *DBPagoda) ProtoReflect() protoreflect.Message { + mi := &file_pagoda_pagoda_db_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 DBPagoda.ProtoReflect.Descriptor instead. +func (*DBPagoda) Descriptor() ([]byte, []int) { + return file_pagoda_pagoda_db_proto_rawDescGZIP(), []int{0} +} + +func (x *DBPagoda) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *DBPagoda) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +func (x *DBPagoda) GetPagodaId() int32 { + if x != nil { + return x.PagodaId + } + return 0 +} + +func (x *DBPagoda) GetReward() map[int32]bool { + if x != nil { + return x.Reward + } + return nil +} + +var File_pagoda_pagoda_db_proto protoreflect.FileDescriptor + +var file_pagoda_pagoda_db_proto_rawDesc = []byte{ + 0x0a, 0x16, 0x70, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x2f, 0x70, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x5f, + 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb2, 0x01, 0x0a, 0x08, 0x44, 0x42, 0x50, + 0x61, 0x67, 0x6f, 0x64, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x6f, 0x64, + 0x61, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x6f, 0x64, + 0x61, 0x49, 0x64, 0x12, 0x2d, 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x44, 0x42, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x2e, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x1a, 0x39, 0x0a, 0x0b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, + 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_pagoda_pagoda_db_proto_rawDescOnce sync.Once + file_pagoda_pagoda_db_proto_rawDescData = file_pagoda_pagoda_db_proto_rawDesc +) + +func file_pagoda_pagoda_db_proto_rawDescGZIP() []byte { + file_pagoda_pagoda_db_proto_rawDescOnce.Do(func() { + file_pagoda_pagoda_db_proto_rawDescData = protoimpl.X.CompressGZIP(file_pagoda_pagoda_db_proto_rawDescData) + }) + return file_pagoda_pagoda_db_proto_rawDescData +} + +var file_pagoda_pagoda_db_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_pagoda_pagoda_db_proto_goTypes = []interface{}{ + (*DBPagoda)(nil), // 0: DBPagoda + nil, // 1: DBPagoda.RewardEntry +} +var file_pagoda_pagoda_db_proto_depIdxs = []int32{ + 1, // 0: DBPagoda.reward:type_name -> DBPagoda.RewardEntry + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_pagoda_pagoda_db_proto_init() } +func file_pagoda_pagoda_db_proto_init() { + if File_pagoda_pagoda_db_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_pagoda_pagoda_db_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DBPagoda); 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_pagoda_pagoda_db_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_pagoda_pagoda_db_proto_goTypes, + DependencyIndexes: file_pagoda_pagoda_db_proto_depIdxs, + MessageInfos: file_pagoda_pagoda_db_proto_msgTypes, + }.Build() + File_pagoda_pagoda_db_proto = out.File + file_pagoda_pagoda_db_proto_rawDesc = nil + file_pagoda_pagoda_db_proto_goTypes = nil + file_pagoda_pagoda_db_proto_depIdxs = nil +} diff --git a/pb/pagoda_msg.pb.go b/pb/pagoda_msg.pb.go new file mode 100644 index 000000000..140874f2e --- /dev/null +++ b/pb/pagoda_msg.pb.go @@ -0,0 +1,457 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc v3.20.0 +// source: pagoda/pagoda_msg.proto + +package pb + +import ( + 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) +) + +// 查询塔进度 +type PagodaGetListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *PagodaGetListReq) Reset() { + *x = PagodaGetListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_pagoda_pagoda_msg_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PagodaGetListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PagodaGetListReq) ProtoMessage() {} + +func (x *PagodaGetListReq) ProtoReflect() protoreflect.Message { + mi := &file_pagoda_pagoda_msg_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 PagodaGetListReq.ProtoReflect.Descriptor instead. +func (*PagodaGetListReq) Descriptor() ([]byte, []int) { + return file_pagoda_pagoda_msg_proto_rawDescGZIP(), []int{0} +} + +// 返回进度信息 +type PagodaGetListResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data *DBPagoda `protobuf:"bytes,1,opt,name=data,proto3" json:"data"` +} + +func (x *PagodaGetListResp) Reset() { + *x = PagodaGetListResp{} + if protoimpl.UnsafeEnabled { + mi := &file_pagoda_pagoda_msg_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PagodaGetListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PagodaGetListResp) ProtoMessage() {} + +func (x *PagodaGetListResp) ProtoReflect() protoreflect.Message { + mi := &file_pagoda_pagoda_msg_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 PagodaGetListResp.ProtoReflect.Descriptor instead. +func (*PagodaGetListResp) Descriptor() ([]byte, []int) { + return file_pagoda_pagoda_msg_proto_rawDescGZIP(), []int{1} +} + +func (x *PagodaGetListResp) GetData() *DBPagoda { + if x != nil { + return x.Data + } + return nil +} + +// 领取关卡宝箱 +type PagodaGetRewardReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id"` // 对应 task_reward 表中的id +} + +func (x *PagodaGetRewardReq) Reset() { + *x = PagodaGetRewardReq{} + if protoimpl.UnsafeEnabled { + mi := &file_pagoda_pagoda_msg_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PagodaGetRewardReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PagodaGetRewardReq) ProtoMessage() {} + +func (x *PagodaGetRewardReq) ProtoReflect() protoreflect.Message { + mi := &file_pagoda_pagoda_msg_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 PagodaGetRewardReq.ProtoReflect.Descriptor instead. +func (*PagodaGetRewardReq) Descriptor() ([]byte, []int) { + return file_pagoda_pagoda_msg_proto_rawDescGZIP(), []int{2} +} + +func (x *PagodaGetRewardReq) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +type PagodaGetRewardResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data *DBPagoda `protobuf:"bytes,1,opt,name=data,proto3" json:"data"` +} + +func (x *PagodaGetRewardResp) Reset() { + *x = PagodaGetRewardResp{} + if protoimpl.UnsafeEnabled { + mi := &file_pagoda_pagoda_msg_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PagodaGetRewardResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PagodaGetRewardResp) ProtoMessage() {} + +func (x *PagodaGetRewardResp) ProtoReflect() protoreflect.Message { + mi := &file_pagoda_pagoda_msg_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 PagodaGetRewardResp.ProtoReflect.Descriptor instead. +func (*PagodaGetRewardResp) Descriptor() ([]byte, []int) { + return file_pagoda_pagoda_msg_proto_rawDescGZIP(), []int{3} +} + +func (x *PagodaGetRewardResp) GetData() *DBPagoda { + if x != nil { + return x.Data + } + return nil +} + +// 挑战 +type PagodaChallengeReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LevelID int32 `protobuf:"varint,1,opt,name=levelID,proto3" json:"levelID"` // 挑战的关卡ID +} + +func (x *PagodaChallengeReq) Reset() { + *x = PagodaChallengeReq{} + if protoimpl.UnsafeEnabled { + mi := &file_pagoda_pagoda_msg_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PagodaChallengeReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PagodaChallengeReq) ProtoMessage() {} + +func (x *PagodaChallengeReq) ProtoReflect() protoreflect.Message { + mi := &file_pagoda_pagoda_msg_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 PagodaChallengeReq.ProtoReflect.Descriptor instead. +func (*PagodaChallengeReq) Descriptor() ([]byte, []int) { + return file_pagoda_pagoda_msg_proto_rawDescGZIP(), []int{4} +} + +func (x *PagodaChallengeReq) GetLevelID() int32 { + if x != nil { + return x.LevelID + } + return 0 +} + +type PagodaChallengeResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data *DBPagoda `protobuf:"bytes,1,opt,name=data,proto3" json:"data"` +} + +func (x *PagodaChallengeResp) Reset() { + *x = PagodaChallengeResp{} + if protoimpl.UnsafeEnabled { + mi := &file_pagoda_pagoda_msg_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PagodaChallengeResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PagodaChallengeResp) ProtoMessage() {} + +func (x *PagodaChallengeResp) ProtoReflect() protoreflect.Message { + mi := &file_pagoda_pagoda_msg_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 PagodaChallengeResp.ProtoReflect.Descriptor instead. +func (*PagodaChallengeResp) Descriptor() ([]byte, []int) { + return file_pagoda_pagoda_msg_proto_rawDescGZIP(), []int{5} +} + +func (x *PagodaChallengeResp) GetData() *DBPagoda { + if x != nil { + return x.Data + } + return nil +} + +var File_pagoda_pagoda_msg_proto protoreflect.FileDescriptor + +var file_pagoda_pagoda_msg_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x70, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x2f, 0x70, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x5f, + 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x70, 0x61, 0x67, 0x6f, 0x64, + 0x61, 0x2f, 0x70, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0x12, 0x0a, 0x10, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x47, 0x65, 0x74, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x71, 0x22, 0x32, 0x0a, 0x11, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x47, + 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x04, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x42, 0x50, 0x61, 0x67, + 0x6f, 0x64, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x24, 0x0a, 0x12, 0x50, 0x61, 0x67, + 0x6f, 0x64, 0x61, 0x47, 0x65, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, + 0x34, 0x0a, 0x13, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x47, 0x65, 0x74, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x42, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x52, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x2e, 0x0a, 0x12, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x43, + 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x6c, + 0x65, 0x76, 0x65, 0x6c, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6c, 0x65, + 0x76, 0x65, 0x6c, 0x49, 0x44, 0x22, 0x34, 0x0a, 0x13, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x43, + 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x42, 0x50, + 0x61, 0x67, 0x6f, 0x64, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x06, 0x5a, 0x04, 0x2e, + 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_pagoda_pagoda_msg_proto_rawDescOnce sync.Once + file_pagoda_pagoda_msg_proto_rawDescData = file_pagoda_pagoda_msg_proto_rawDesc +) + +func file_pagoda_pagoda_msg_proto_rawDescGZIP() []byte { + file_pagoda_pagoda_msg_proto_rawDescOnce.Do(func() { + file_pagoda_pagoda_msg_proto_rawDescData = protoimpl.X.CompressGZIP(file_pagoda_pagoda_msg_proto_rawDescData) + }) + return file_pagoda_pagoda_msg_proto_rawDescData +} + +var file_pagoda_pagoda_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_pagoda_pagoda_msg_proto_goTypes = []interface{}{ + (*PagodaGetListReq)(nil), // 0: PagodaGetListReq + (*PagodaGetListResp)(nil), // 1: PagodaGetListResp + (*PagodaGetRewardReq)(nil), // 2: PagodaGetRewardReq + (*PagodaGetRewardResp)(nil), // 3: PagodaGetRewardResp + (*PagodaChallengeReq)(nil), // 4: PagodaChallengeReq + (*PagodaChallengeResp)(nil), // 5: PagodaChallengeResp + (*DBPagoda)(nil), // 6: DBPagoda +} +var file_pagoda_pagoda_msg_proto_depIdxs = []int32{ + 6, // 0: PagodaGetListResp.data:type_name -> DBPagoda + 6, // 1: PagodaGetRewardResp.data:type_name -> DBPagoda + 6, // 2: PagodaChallengeResp.data:type_name -> DBPagoda + 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_pagoda_pagoda_msg_proto_init() } +func file_pagoda_pagoda_msg_proto_init() { + if File_pagoda_pagoda_msg_proto != nil { + return + } + file_pagoda_pagoda_db_proto_init() + if !protoimpl.UnsafeEnabled { + file_pagoda_pagoda_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PagodaGetListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pagoda_pagoda_msg_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PagodaGetListResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pagoda_pagoda_msg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PagodaGetRewardReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pagoda_pagoda_msg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PagodaGetRewardResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pagoda_pagoda_msg_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PagodaChallengeReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pagoda_pagoda_msg_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PagodaChallengeResp); 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_pagoda_pagoda_msg_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_pagoda_pagoda_msg_proto_goTypes, + DependencyIndexes: file_pagoda_pagoda_msg_proto_depIdxs, + MessageInfos: file_pagoda_pagoda_msg_proto_msgTypes, + }.Build() + File_pagoda_pagoda_msg_proto = out.File + file_pagoda_pagoda_msg_proto_rawDesc = nil + file_pagoda_pagoda_msg_proto_goTypes = nil + file_pagoda_pagoda_msg_proto_depIdxs = nil +}