添加测试接口

This commit is contained in:
wh_zcy 2022-08-11 18:06:17 +08:00
parent 0aba7a3fef
commit 206fa0f9bb
31 changed files with 1227 additions and 481 deletions

View File

@ -104,6 +104,7 @@ const (
APP_TESTCASE_FORM_TASKTAG = "任务类型" APP_TESTCASE_FORM_TASKTAG = "任务类型"
APP_TESTCASE_FORM_TASK_OID = "任务OID" APP_TESTCASE_FORM_TASK_OID = "任务OID"
APP_TESTCASE_FORM_NICKNAME = "昵称" APP_TESTCASE_FORM_NICKNAME = "昵称"
APP_TESTCASE_FORM_SIGN = "签名"
APP_TESTCASE_OPTIONS = "选填" APP_TESTCASE_OPTIONS = "选填"
AAP_TESTCASE_FORM_TASK_DAY = "日常任务" AAP_TESTCASE_FORM_TASK_DAY = "日常任务"
APP_TESTCASE_FORM_TASK_WEEK = "周常任务" APP_TESTCASE_FORM_TASK_WEEK = "周常任务"
@ -111,6 +112,8 @@ const (
APP_TESTCASE_FORM_BINGO = "命令" APP_TESTCASE_FORM_BINGO = "命令"
APP_TESTCASE_BTN_PUSH = "推送" APP_TESTCASE_BTN_PUSH = "推送"
APP_TESTCASE_FORM_LABEL_FID = "好友ID" APP_TESTCASE_FORM_LABEL_FID = "好友ID"
APP_TESTCASE_FORM_MAILID = "邮件ID"
APP_TESTCASE_FORM_ITEMTYPE = "道具类型"
//button //button
BUTTON_LOGIN = "登录" BUTTON_LOGIN = "登录"
@ -140,14 +143,21 @@ const (
DATETIME = "时钟" DATETIME = "时钟"
// userinfo // userinfo
USERINFO_BTN_COPY = "复制UID" USERINFO_BTN_COPY = "复制UID"
USERINFO_TITLE = "用户信息" USERINFO_BTN_REFRESH = "刷新"
USERINFO_UID = "UID" USERINFO_PANEL_TITLE = "用户信息"
USERINFO_ACC = "账号" USERINFO_UID = "UID"
USERINFO_NAME = "昵称" USERINFO_ACC = "账号"
USERINFO_LV = "等级" USERINFO_NAME = "昵称"
USERINFO_GOLD = "金币" USERINFO_TITLE = "头衔"
USERINFO_EXP = "经验" USERINFO_LV = "等级"
USERINFO_VIP = "贵宾" USERINFO_GOLD = "金币"
USERINFO_AVATAR = "头像" USERINFO_EXP = "经验"
USERINFO_VIP = "贵宾"
USERINFO_AVATAR = "头像"
USERINFO_FRIENDPOINT = "友情点"
USERINFO_SIGN = "签名"
USERINFO_MODINAME = "免费改名次数"
USERINFO_ACTIVE_DAY = "日活"
USERINFO_ACTIVE_WEEK = "周活"
) )

View File

@ -4,6 +4,7 @@ import "google.golang.org/protobuf/proto"
type TestCase struct { type TestCase struct {
Id string //用例ID 如果没有指定,会自动赋值uuid Id string //用例ID 如果没有指定,会自动赋值uuid
NavLabel string //菜单名称
Desc string //用例描述 Desc string //用例描述
MainType string //协议类型 L1 MainType string //协议类型 L1
SubType string //协议类型 L2 SubType string //协议类型 L2

View File

@ -5,10 +5,11 @@ const (
//用户详情 //用户详情
EVENT_USERINFO Event = "userinfo" EVENT_USERINFO Event = "userinfo"
//协议推送 //协议推送
EVENT_APP_MONI Event = "push" EVENT_APP_MONI Event = "push"
EVENT_USER_CHANGE = "chanage" // 用户数据变化
EVENT_USER_CHANGE Event = "chanage"
//测试用例响应事件 //测试用例响应事件
EVENT_REQ_RSP Event = "response" EVENT_REQ_RSP Event = "response"
// 清空 ui数据事件 // 清空 ui数据事件
EVENT_UI_CLEAN = "uiclean" EVENT_UI_CLEAN Event = "uiclean"
) )

View File

@ -104,17 +104,25 @@ func (a *appTester) makeNav(setNav func(testCase *model.TestCase)) fyne.CanvasOb
} }
if a.disEnabled(t) { if a.disEnabled(t) {
obj.(*widget.Label).TextStyle = fyne.TextStyle{Italic: true} obj.(*widget.Label).TextStyle = fyne.TextStyle{Italic: true}
if branch { if branch { //parent
obj.(*widget.Label).SetText(fmt.Sprintf("%s(dis)", t.MainType)) obj.(*widget.Label).SetText(fmt.Sprintf("%s(dis)", t.MainType))
} else { } else {
obj.(*widget.Label).SetText(fmt.Sprintf("%s(dis)", t.SubType)) obj.(*widget.Label).SetText(fmt.Sprintf("%s(dis)", t.SubType))
} }
} else { } else {
obj.(*widget.Label).TextStyle = fyne.TextStyle{} if branch { //parent
if branch { obj.(*widget.Label).TextStyle = fyne.TextStyle{Bold: true}
obj.(*widget.Label).SetText(t.MainType) if t.NavLabel != "" {
obj.(*widget.Label).SetText(t.NavLabel)
} else {
obj.(*widget.Label).SetText(t.MainType)
}
} else { } else {
obj.(*widget.Label).SetText(t.SubType) if t.NavLabel != "" {
obj.(*widget.Label).SetText(t.NavLabel)
} else {
obj.(*widget.Label).SetText(t.SubType)
}
} }
} }

View File

@ -6,6 +6,7 @@ import (
"fyne.io/fyne/v2/widget" "fyne.io/fyne/v2/widget"
) )
// 获取任务标签
func getTaskTagSelect() *widget.Select { func getTaskTagSelect() *widget.Select {
var tagSelect *widget.Select var tagSelect *widget.Select
tagSelect = widget.NewSelect([]string{ tagSelect = widget.NewSelect([]string{
@ -27,3 +28,26 @@ func getTaskTagSelect() *widget.Select {
tagSelect.SetSelectedIndex(0) tagSelect.SetSelectedIndex(0)
return tagSelect return tagSelect
} }
// 获取道具类型
func getItemTypeSelect() *widget.Select {
var tagSelect *widget.Select
tagSelect = widget.NewSelect([]string{
common.AAP_TESTCASE_FORM_TASK_DAY,
common.APP_TESTCASE_FORM_TASK_WEEK,
common.APP_TESTCASE_FORM_TASK_ACHIEVE}, func(s string) {
switch s {
case common.AAP_TESTCASE_FORM_TASK_DAY:
tagSelect.Selected = "1"
case common.APP_TESTCASE_FORM_TASK_WEEK:
tagSelect.Selected = "2"
case common.APP_TESTCASE_FORM_TASK_ACHIEVE:
tagSelect.Selected = "3"
default:
tagSelect.Selected = "0"
}
})
tagSelect.SetSelectedIndex(0)
return tagSelect
}

View File

@ -27,7 +27,7 @@ func (this *FriendZanView) CreateView(t *model.TestCase) fyne.CanvasObject {
if err := service.GetPttService().SendToClient( if err := service.GetPttService().SendToClient(
t.MainType, t.MainType,
t.SubType, "zanreceive",
&pb.FriendZanreceiveReq{ &pb.FriendZanreceiveReq{
FriendId: this.selFriendIds[0], FriendId: this.selFriendIds[0],
}, },

View File

@ -0,0 +1,24 @@
package formview
import (
"go_dreamfactory/cmd/v2/model"
"go_dreamfactory/cmd/v2/service"
"go_dreamfactory/pb"
"fyne.io/fyne/v2"
"github.com/sirupsen/logrus"
)
type ItemListView struct {
BaseformView
}
func (this *ItemListView) CreateView(t *model.TestCase) fyne.CanvasObject {
this.form.OnSubmit = func() {
if err := service.GetPttService().SendToClient(t.MainType, t.SubType, &pb.ItemsGetlistReq{}); err != nil {
logrus.Error(err)
}
}
return this.form
}

View File

@ -0,0 +1,15 @@
package formview
import (
"go_dreamfactory/cmd/v2/model"
"fyne.io/fyne/v2"
)
type ItemsSellView struct {
BaseformView
}
func (this *ItemsSellView) CreateView(t *model.TestCase) fyne.CanvasObject {
return this.form
}

View File

@ -0,0 +1,31 @@
package formview
import (
"go_dreamfactory/cmd/v2/lib/common"
"go_dreamfactory/cmd/v2/model"
"go_dreamfactory/cmd/v2/service"
"go_dreamfactory/pb"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/widget"
"github.com/sirupsen/logrus"
)
type MailAttachmentView struct {
BaseformView
}
func (this *MailAttachmentView) CreateView(t *model.TestCase) fyne.CanvasObject {
mailId := widget.NewEntry()
mailId.PlaceHolder = "邮件ID"
this.form.AppendItem(widget.NewFormItem(common.APP_TESTCASE_FORM_MAILID, mailId))
this.form.OnSubmit = func() {
if err := service.GetPttService().SendToClient(t.MainType, t.SubType, &pb.MailGetUserMailAttachmentReq{
ObjID: mailId.Text,
}); err != nil {
logrus.Error(err)
}
}
return this.form
}

View File

@ -0,0 +1,24 @@
package formview
import (
"go_dreamfactory/cmd/v2/model"
"go_dreamfactory/cmd/v2/service"
"go_dreamfactory/pb"
"fyne.io/fyne/v2"
"github.com/sirupsen/logrus"
)
type MailAttachmentAllView struct {
BaseformView
}
func (this *MailAttachmentAllView) CreateView(t *model.TestCase) fyne.CanvasObject {
this.form.OnSubmit = func() {
if err := service.GetPttService().SendToClient(t.MainType, t.SubType, &pb.MailGetAllMailAttachmentReq{}); err != nil {
logrus.Error(err)
}
}
return this.form
}

View File

@ -0,0 +1,31 @@
package formview
import (
"go_dreamfactory/cmd/v2/lib/common"
"go_dreamfactory/cmd/v2/model"
"go_dreamfactory/cmd/v2/service"
"go_dreamfactory/pb"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/widget"
"github.com/sirupsen/logrus"
)
type MailDelView struct {
BaseformView
}
func (this *MailDelView) CreateView(t *model.TestCase) fyne.CanvasObject {
mailId := widget.NewEntry()
mailId.PlaceHolder = "邮件ID"
this.form.AppendItem(widget.NewFormItem(common.APP_TESTCASE_FORM_MAILID, mailId))
this.form.OnSubmit = func() {
if err := service.GetPttService().SendToClient(t.MainType, t.SubType, &pb.MailDelMailReq{
ObjID: mailId.Text,
}); err != nil {
logrus.Error(err)
}
}
return this.form
}

View File

@ -0,0 +1,23 @@
package formview
import (
"go_dreamfactory/cmd/v2/model"
"go_dreamfactory/cmd/v2/service"
"go_dreamfactory/pb"
"fyne.io/fyne/v2"
"github.com/sirupsen/logrus"
)
type MailListView struct {
BaseformView
}
func (this *MailListView) CreateView(t *model.TestCase) fyne.CanvasObject {
this.form.OnSubmit = func() {
if err := service.GetPttService().SendToClient(t.MainType, t.SubType, &pb.MailGetListReq{}); err != nil {
logrus.Error(err)
}
}
return this.form
}

View File

@ -0,0 +1,31 @@
package formview
import (
"go_dreamfactory/cmd/v2/lib/common"
"go_dreamfactory/cmd/v2/model"
"go_dreamfactory/cmd/v2/service"
"go_dreamfactory/pb"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/widget"
"github.com/sirupsen/logrus"
)
type MailReadMailView struct {
BaseformView
}
func (this *MailReadMailView) CreateView(t *model.TestCase) fyne.CanvasObject {
mailId := widget.NewEntry()
mailId.PlaceHolder = "邮件ID"
this.form.AppendItem(widget.NewFormItem(common.APP_TESTCASE_FORM_MAILID, mailId))
this.form.OnSubmit = func() {
if err := service.GetPttService().SendToClient(t.MainType, t.SubType, &pb.MailReadMailReq{
ObjID: mailId.Text,
}); err != nil {
logrus.Error(err)
}
}
return this.form
}

View File

@ -0,0 +1,35 @@
package formview
import (
"go_dreamfactory/cmd/v2/lib/common"
"go_dreamfactory/cmd/v2/model"
"go_dreamfactory/cmd/v2/service"
"go_dreamfactory/pb"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/widget"
"github.com/sirupsen/logrus"
)
type UserSignView struct {
BaseformView
}
func (this *UserSignView) CreateView(t *model.TestCase) fyne.CanvasObject {
sign := widget.NewMultiLineEntry()
sign.PlaceHolder = "这个家伙很懒,什么都没有留下"
this.form.AppendItem(widget.NewFormItem(common.APP_TESTCASE_FORM_SIGN, sign))
this.form.OnSubmit = func() {
if err := service.GetPttService().SendToClient(
t.MainType,
t.SubType,
&pb.UserModifysignReq{Sign: sign.Text},
); err != nil {
logrus.Error(err)
return
}
}
return this.form
}

View File

@ -215,13 +215,14 @@ func (ui *MainWindowImpl) createLoginWin(sid, sname string) {
if err != nil { if err != nil {
logrus.WithField("appName", appName).Error(err) logrus.WithField("appName", appName).Error(err)
} }
// hide toolbar
ui.tb.toolbar.Hide()
// 必须在创建窗口之后调用 // 必须在创建窗口之后调用
ui.connService.ListenerPush() ui.connService.ListenerPush()
if code := ui.pttService.Login(sid, account.Text); code != pb.ErrorCode_Success { if code := ui.pttService.Login(sid, account.Text); code != pb.ErrorCode_Success {
err := fmt.Errorf("login err: %v[%d]", code, int32(code)) err := fmt.Errorf("login err: %v[%d]", code, int32(code))
dialog.ShowError(err, ui.w) dialog.ShowError(err, ui.w)
} else { } else {
//
ui.obs.AddListener(observer.EVENT_REQ_RSP, observer.Listener{ ui.obs.AddListener(observer.EVENT_REQ_RSP, observer.Listener{
OnNotify: func(data interface{}, args ...interface{}) { OnNotify: func(data interface{}, args ...interface{}) {
if data == nil { if data == nil {
@ -237,27 +238,24 @@ func (ui *MainWindowImpl) createLoginWin(sid, sname string) {
} }
ui.w.SetTitle(fmt.Sprintf("%s[%s]", sname, sid)) ui.w.SetTitle(fmt.Sprintf("%s[%s]", sname, sid))
//show mainwindow
// logrus.Debug(rsp)
ui.pttService.SetUser(rsp.Data, rsp.Ex) ui.pttService.SetUser(rsp.Data, rsp.Ex)
// isCreateRole // isCreateRole
if rsp.Data.Created { if rsp.Data.Created {
// ui.renderUserContainer() // set statusbar message
ui.sb.setMessage(common.LABEL_WELCOME + rsp.Data.Binduid) ui.sb.setMessage(common.LABEL_WELCOME + rsp.Data.Binduid)
// update userinfo
ui.obs.Notify(observer.EVENT_USERINFO, ui.pttService.GetUser()) ui.obs.Notify(observer.EVENT_USERINFO, ui.pttService.GetUser())
// show toolbar
ui.tb.toolbar.Show()
} else { } else {
// create role
ui.createRoleWindowPopUp() ui.createRoleWindowPopUp()
} }
} }
}, },
}) })
} }
} }
} }
}, ui.w) }, ui.w)
} }
@ -298,16 +296,10 @@ func (ui *MainWindowImpl) createRoleWindowPopUp() {
err := fmt.Errorf("login err: %v[%d]", code, int32(code)) err := fmt.Errorf("login err: %v[%d]", code, int32(code))
dialog.ShowError(err, ui.w) dialog.ShowError(err, ui.w)
} else { } else {
// if rsp.IsSucc {
user := ui.pttService.GetUser() user := ui.pttService.GetUser()
logrus.WithField("uid", user.DbUser.Uid).Debug("create role succ") logrus.WithField("uid", user.DbUser.Uid).Debug("create role succ")
ui.createWindowContainer()
appName, err := ui.at.openDefaultApp()
if err != nil {
logrus.WithField("appName", appName).Error(err)
}
ui.obs.Notify(observer.EVENT_USERINFO, ui.pttService.GetUser()) ui.obs.Notify(observer.EVENT_USERINFO, ui.pttService.GetUser())
// } ui.tb.toolbar.Show()
} }
} }
} }

View File

@ -30,6 +30,15 @@ var (
ff(comm.ModuleGM, "cmd"): &formview.BingoView{}, ff(comm.ModuleGM, "cmd"): &formview.BingoView{},
//user //user
ff(comm.ModuleUser, user.UserSubTypeModifyName): &formview.UserModifynameView{}, ff(comm.ModuleUser, user.UserSubTypeModifyName): &formview.UserModifynameView{},
ff(comm.ModuleUser, user.UserSubTypeModifySign): &formview.UserSignView{},
// items
ff(comm.ModuleItems, "getlist"): &formview.ItemListView{},
//mail
ff(comm.ModuleMail, "getlist"): &formview.MailListView{},
ff(comm.ModuleMail, "readmail"): &formview.MailReadMailView{},
ff(comm.ModuleMail, "delmail"): &formview.MailDelView{},
ff(comm.ModuleMail, "getusermailattachment"): &formview.MailAttachmentView{},
ff(comm.ModuleMail, "getallmailattachment"): &formview.MailAttachmentAllView{},
//task //task
ff(comm.ModuleTask, task.TaskSubTypeList): &formview.TaskListView{}, ff(comm.ModuleTask, task.TaskSubTypeList): &formview.TaskListView{},
ff(comm.ModuleTask, task.TaskSubTypeReceive): &formview.TaskReceiveView{}, ff(comm.ModuleTask, task.TaskSubTypeReceive): &formview.TaskReceiveView{},
@ -40,11 +49,9 @@ var (
ff(comm.ModuleHero, hero.StrengthenUplv): &formview.HeroStrengthenUplvView{}, ff(comm.ModuleHero, hero.StrengthenUplv): &formview.HeroStrengthenUplvView{},
ff(comm.ModuleHero, hero.StrengthenUpStar): &formview.HeroStrengthenUpStarView{}, ff(comm.ModuleHero, hero.StrengthenUpStar): &formview.HeroStrengthenUpStarView{},
//friend //friend
ff(comm.ModuleFriend, friend.FriendSubTypeList): &formview.FriendListView{}, ff(comm.ModuleFriend, friend.FriendSubTypeList): &formview.FriendListView{},
ff(comm.ModuleFriend, friend.FriendSubTypeApply): &formview.FriendApplyView{}, ff(comm.ModuleFriend, friend.FriendSubTypeApply): &formview.FriendApplyView{},
// ff(comm.ModuleFriend, friend.FriendSubTypeApplyList): &formview.FriendApplyListView{}, ff(comm.ModuleFriend, friend.FriendSubTypeAgree): &formview.FriendAgreeView{},
ff(comm.ModuleFriend, friend.FriendSubTypeAgree): &formview.FriendAgreeView{},
// ff(comm.ModuleFriend, friend.FriendSubTypeRefuse): &formview.FriendRefuseView{},
ff(comm.ModuleFriend, friend.FriendSubTypeBlacklist): &formview.FriendBlacklistView{}, ff(comm.ModuleFriend, friend.FriendSubTypeBlacklist): &formview.FriendBlacklistView{},
ff(comm.ModuleFriend, friend.FriendSubTypeAddBlack): &formview.FriendAddBlackView{}, ff(comm.ModuleFriend, friend.FriendSubTypeAddBlack): &formview.FriendAddBlackView{},
ff(comm.ModuleFriend, friend.FriendSubTypeDelBlack): &formview.FriendDelblackView{}, ff(comm.ModuleFriend, friend.FriendSubTypeDelBlack): &formview.FriendDelblackView{},
@ -62,10 +69,23 @@ var (
string(comm.ModuleHero), string(comm.ModuleHero),
string(comm.ModuleTask), string(comm.ModuleTask),
string(comm.ModuleFriend), string(comm.ModuleFriend),
string(comm.ModuleMail),
string(comm.ModuleItems),
}, },
"gm": {ff(comm.ModuleGM, "cmd")}, "gm": {ff(comm.ModuleGM, "cmd")},
"user": { "user": {
ff(comm.ModuleUser, user.UserSubTypeModifyName), ff(comm.ModuleUser, user.UserSubTypeModifyName),
ff(comm.ModuleUser, user.UserSubTypeModifySign),
},
"items": {
ff(comm.ModuleItems, "getlist"),
},
"mail": {
ff(comm.ModuleMail, "getlist"),
ff(comm.ModuleMail, "readmail"),
ff(comm.ModuleMail, "delmail"),
ff(comm.ModuleMail, "getusermailattachment"),
ff(comm.ModuleMail, "getallmailattachment"),
}, },
"hero": { "hero": {
ff(comm.ModuleHero, hero.HeroSubTypeList), ff(comm.ModuleHero, hero.HeroSubTypeList),
@ -98,6 +118,7 @@ var (
CaseNav = map[string]*model.TestCase{ CaseNav = map[string]*model.TestCase{
// gm // gm
"gm": { "gm": {
NavLabel: "GM",
MainType: string(comm.ModuleGM), MainType: string(comm.ModuleGM),
Enabled: true, Enabled: true,
}, },
@ -111,11 +132,13 @@ var (
}, },
// user // user
"user": { "user": {
NavLabel: "用户",
MainType: "user", MainType: "user",
Enabled: true, Enabled: true,
}, },
"user.modifyname": { "user.modifyname": {
Desc: "用户昵称修改", Desc: "用户昵称修改",
NavLabel: "修改昵称",
MainType: "user", MainType: "user",
SubType: "modifyname", SubType: "modifyname",
Req: &pb.UserModifynameReq{}, Req: &pb.UserModifynameReq{},
@ -126,12 +149,76 @@ var (
}, },
Enabled: true, Enabled: true,
}, },
ff(comm.ModuleUser, user.UserSubTypeModifySign): {
NavLabel: "修改签名",
Desc: "用户签名修改",
MainType: string(comm.ModuleUser),
SubType: user.UserSubTypeModifySign,
Enabled: true,
},
//items
string(comm.ModuleItems): {
NavLabel: "道具",
MainType: string(comm.ModuleItems),
Enabled: true,
},
ff(comm.ModuleItems, "getlist"): {
NavLabel: "道具列表",
Desc: "道具列表",
MainType: string(comm.ModuleItems),
SubType: "getlist",
Enabled: true,
},
//mail
string(comm.ModuleMail): {
NavLabel: "邮箱",
MainType: string(comm.ModuleMail),
Enabled: true,
},
ff(comm.ModuleMail, "getlist"): {
NavLabel: "邮件列表",
Desc: "邮件列表",
MainType: string(comm.ModuleMail),
SubType: "getlist",
Enabled: true,
},
ff(comm.ModuleMail, "readmail"): {
NavLabel: "读邮件",
Desc: "读取邮件",
MainType: string(comm.ModuleMail),
SubType: "readmail",
Enabled: true,
},
ff(comm.ModuleMail, "delmail"): {
NavLabel: "删除邮件",
Desc: "删除邮件",
MainType: string(comm.ModuleMail),
SubType: "delmail",
Enabled: true,
},
ff(comm.ModuleMail, "getusermailattachment"): {
NavLabel: "领取附件",
Desc: "领取附件",
MainType: string(comm.ModuleMail),
SubType: "getusermailattachment",
Enabled: true,
},
ff(comm.ModuleMail, "getallmailattachment"): {
NavLabel: "一键领取",
Desc: "领取所有附件",
MainType: string(comm.ModuleMail),
SubType: "getallmailattachment",
Enabled: true,
},
// task // task
"task": { "task": {
NavLabel: "任务",
MainType: "task", MainType: "task",
Enabled: true, Enabled: true,
}, },
"task.list": { "task.list": {
NavLabel: "任务列表",
Desc: "用户任务列表", Desc: "用户任务列表",
MainType: "task", MainType: "task",
SubType: "list", SubType: "list",
@ -140,12 +227,14 @@ var (
Enabled: true, Enabled: true,
}, },
"task.receive": { "task.receive": {
NavLabel: "任务领取",
Desc: "用户任务领取", Desc: "用户任务领取",
MainType: "task", MainType: "task",
SubType: "receive", SubType: "receive",
Enabled: true, Enabled: true,
}, },
ff(comm.ModuleTask, task.TaskSubTypeActiveList): { ff(comm.ModuleTask, task.TaskSubTypeActiveList): {
NavLabel: "活跃度",
Desc: "用户活跃度列表", Desc: "用户活跃度列表",
MainType: string(comm.ModuleTask), MainType: string(comm.ModuleTask),
SubType: task.TaskSubTypeActiveList, SubType: task.TaskSubTypeActiveList,
@ -154,6 +243,7 @@ var (
Enabled: true, Enabled: true,
}, },
ff(comm.ModuleTask, task.TaskSubTypeActiveReceive): { ff(comm.ModuleTask, task.TaskSubTypeActiveReceive): {
NavLabel: "活跃度领取",
Desc: "用户活跃度领取", Desc: "用户活跃度领取",
MainType: string(comm.ModuleTask), MainType: string(comm.ModuleTask),
SubType: task.TaskSubTypeActiveReceive, SubType: task.TaskSubTypeActiveReceive,
@ -163,10 +253,12 @@ var (
}, },
// hero // hero
string(comm.ModuleHero): { string(comm.ModuleHero): {
NavLabel: "英雄",
MainType: string(comm.ModuleHero), MainType: string(comm.ModuleHero),
Enabled: true, Enabled: true,
}, },
ff(comm.ModuleHero, hero.HeroSubTypeList): { ff(comm.ModuleHero, hero.HeroSubTypeList): {
NavLabel: "英雄列表",
Desc: "英雄列表", Desc: "英雄列表",
MainType: string(comm.ModuleHero), MainType: string(comm.ModuleHero),
SubType: hero.HeroSubTypeList, SubType: hero.HeroSubTypeList,
@ -181,6 +273,7 @@ var (
Enabled: true, Enabled: true,
}, },
ff(comm.ModuleHero, hero.StrengthenUplv): { ff(comm.ModuleHero, hero.StrengthenUplv): {
NavLabel: "英雄升级",
Desc: "英雄等级升级", Desc: "英雄等级升级",
MainType: string(comm.ModuleHero), MainType: string(comm.ModuleHero),
SubType: hero.StrengthenUplv, SubType: hero.StrengthenUplv,
@ -189,6 +282,7 @@ var (
Enabled: true, Enabled: true,
}, },
ff(comm.ModuleHero, hero.StrengthenUpStar): { ff(comm.ModuleHero, hero.StrengthenUpStar): {
NavLabel: "英雄升星",
Desc: "英雄星级升级", Desc: "英雄星级升级",
MainType: string(comm.ModuleHero), MainType: string(comm.ModuleHero),
SubType: hero.StrengthenUpStar, SubType: hero.StrengthenUpStar,
@ -198,10 +292,12 @@ var (
}, },
//friend //friend
string(comm.ModuleFriend): { string(comm.ModuleFriend): {
NavLabel: "好友",
MainType: string(comm.ModuleFriend), MainType: string(comm.ModuleFriend),
Enabled: true, Enabled: true,
}, },
ff(comm.ModuleFriend, friend.FriendSubTypeList): { ff(comm.ModuleFriend, friend.FriendSubTypeList): {
NavLabel: "好友列表",
Desc: "好友列表", Desc: "好友列表",
MainType: string(comm.ModuleFriend), MainType: string(comm.ModuleFriend),
SubType: friend.FriendSubTypeList, SubType: friend.FriendSubTypeList,
@ -210,6 +306,7 @@ var (
Enabled: true, Enabled: true,
}, },
ff(comm.ModuleFriend, friend.FriendSubTypeApply): { ff(comm.ModuleFriend, friend.FriendSubTypeApply): {
NavLabel: "好友申请",
Desc: "好友申请", Desc: "好友申请",
MainType: string(comm.ModuleFriend), MainType: string(comm.ModuleFriend),
SubType: friend.FriendSubTypeApply, SubType: friend.FriendSubTypeApply,
@ -226,6 +323,7 @@ var (
// Enabled: true, // Enabled: true,
// }, // },
ff(comm.ModuleFriend, friend.FriendSubTypeBlacklist): { ff(comm.ModuleFriend, friend.FriendSubTypeBlacklist): {
NavLabel: "黑名单",
Desc: "黑名单列表", Desc: "黑名单列表",
MainType: string(comm.ModuleFriend), MainType: string(comm.ModuleFriend),
SubType: friend.FriendSubTypeBlacklist, SubType: friend.FriendSubTypeBlacklist,
@ -234,6 +332,7 @@ var (
Enabled: true, Enabled: true,
}, },
ff(comm.ModuleFriend, friend.FriendSubTypeAddBlack): { ff(comm.ModuleFriend, friend.FriendSubTypeAddBlack): {
NavLabel: "加黑名单",
Desc: "添加黑名单", Desc: "添加黑名单",
MainType: string(comm.ModuleFriend), MainType: string(comm.ModuleFriend),
SubType: friend.FriendSubTypeAddBlack, SubType: friend.FriendSubTypeAddBlack,
@ -242,6 +341,7 @@ var (
Enabled: true, Enabled: true,
}, },
ff(comm.ModuleFriend, friend.FriendSubTypeDelBlack): { ff(comm.ModuleFriend, friend.FriendSubTypeDelBlack): {
NavLabel: "删黑名单",
Desc: "删除黑名单", Desc: "删除黑名单",
MainType: string(comm.ModuleFriend), MainType: string(comm.ModuleFriend),
SubType: friend.FriendSubTypeDelBlack, SubType: friend.FriendSubTypeDelBlack,
@ -250,6 +350,7 @@ var (
Enabled: true, Enabled: true,
}, },
ff(comm.ModuleFriend, friend.FriendSubTypeAgree): { ff(comm.ModuleFriend, friend.FriendSubTypeAgree): {
NavLabel: "好友审批",
Desc: "好友申请审批", Desc: "好友申请审批",
MainType: string(comm.ModuleFriend), MainType: string(comm.ModuleFriend),
SubType: friend.FriendSubTypeAgree, SubType: friend.FriendSubTypeAgree,
@ -257,15 +358,8 @@ var (
Rsp: &pb.FriendAgreeResp{}, Rsp: &pb.FriendAgreeResp{},
Enabled: true, Enabled: true,
}, },
// ff(comm.ModuleFriend, friend.FriendSubTypeRefuse): {
// Desc: "拒绝",
// MainType: string(comm.ModuleFriend),
// SubType: friend.FriendSubTypeRefuse,
// Req: &pb.FriendRefuseReq{},
// Rsp: &pb.FriendRefuseResp{},
// Enabled: true,
// },
ff(comm.ModuleFriend, friend.FriendSubTypeSearch): { ff(comm.ModuleFriend, friend.FriendSubTypeSearch): {
NavLabel: "好友搜索",
Desc: "搜索好友", Desc: "搜索好友",
MainType: string(comm.ModuleFriend), MainType: string(comm.ModuleFriend),
SubType: friend.FriendSubTypeSearch, SubType: friend.FriendSubTypeSearch,
@ -274,6 +368,7 @@ var (
Enabled: true, Enabled: true,
}, },
ff(comm.ModuleFriend, friend.FriendSubTypeZanList): { ff(comm.ModuleFriend, friend.FriendSubTypeZanList): {
NavLabel: "好友点赞",
Desc: "点赞好友", Desc: "点赞好友",
MainType: string(comm.ModuleFriend), MainType: string(comm.ModuleFriend),
SubType: friend.FriendSubTypeZanList, SubType: friend.FriendSubTypeZanList,

View File

@ -29,15 +29,18 @@ type toyUserInfo struct {
userInfo *service.UserInfo userInfo *service.UserInfo
data binding.ExternalStringList data binding.ExternalStringList
obs observer.Observer obs observer.Observer
copyBtn *widget.Button copyBtn *widget.Button
refreshBtn *widget.Button
} }
func (this *toyUserInfo) Init(obs observer.Observer) error { func (this *toyUserInfo) Init(obs observer.Observer) error {
this.obs = obs this.obs = obs
this.titleLabel = widget.NewLabel(common.USERINFO_TITLE) this.titleLabel = widget.NewLabel(common.USERINFO_PANEL_TITLE)
this.data = binding.BindStringList(&[]string{}) this.data = binding.BindStringList(&[]string{})
// 复制UID button
this.copyBtn = widget.NewButton(common.USERINFO_BTN_COPY, func() { this.copyBtn = widget.NewButton(common.USERINFO_BTN_COPY, func() {
if this.userInfo != nil && this.userInfo.DbUser != nil { if this.userInfo != nil && this.userInfo.DbUser != nil {
_ = clipboard.WriteAll(this.userInfo.DbUser.Uid) _ = clipboard.WriteAll(this.userInfo.DbUser.Uid)
@ -45,6 +48,18 @@ func (this *toyUserInfo) Init(obs observer.Observer) error {
}) })
this.copyBtn.Disable() this.copyBtn.Disable()
// 刷新
this.refreshBtn = widget.NewButton(common.USERINFO_BTN_REFRESH, func() {
if err := service.GetPttService().SendToClient(
string(comm.ModuleUser),
user.UserSubTypeInfo,
&pb.UserInfoReq{}); err != nil {
logrus.Error(err)
return
}
})
this.refreshBtn.Disable()
this.dataList = widget.NewListWithData(this.data, this.dataList = widget.NewListWithData(this.data,
func() fyne.CanvasObject { func() fyne.CanvasObject {
return widget.NewLabel("template") return widget.NewLabel("template")
@ -55,7 +70,7 @@ func (this *toyUserInfo) Init(obs observer.Observer) error {
) )
this.widget = widget.NewCard("", "", this.widget = widget.NewCard("", "",
container.NewBorder(container.NewHBox(this.titleLabel, layout.NewSpacer(), this.copyBtn), container.NewBorder(container.NewHBox(this.titleLabel, layout.NewSpacer(), this.refreshBtn, this.copyBtn),
nil, nil, nil, container.NewVScroll(this.dataList))) nil, nil, nil, container.NewVScroll(this.dataList)))
this.widget.Resize(fyne.NewSize(ToyWidth, 600)) this.widget.Resize(fyne.NewSize(ToyWidth, 600))
@ -71,19 +86,28 @@ func (this *toyUserInfo) dataListener() {
if this.copyBtn.Disabled() { if this.copyBtn.Disabled() {
this.copyBtn.Enable() this.copyBtn.Enable()
} }
if this.refreshBtn.Disabled() {
this.refreshBtn.Enable()
}
this.userInfo = d.(*service.UserInfo) this.userInfo = d.(*service.UserInfo)
if this.userInfo == nil { if this.userInfo == nil {
return return
} }
// _ = this.data.Append(fmt.Sprintf("%-3s\t: %s", common.USERINFO_UID, this.userInfo.DbUser.Uid)) // _ = this.data.Append(fmt.Sprintf("%-3s\t: %s", common.USERINFO_UID, this.userInfo.DbUser.Uid))
_ = this.data.Append(fmt.Sprintf("%-3s\t: %s", common.USERINFO_ACC, this.userInfo.DbUser.Binduid)) _ = this.data.Append(this.getAcc()) //0
_ = this.data.Append(fmt.Sprintf("%-3s\t: %s", common.USERINFO_NAME, this.userInfo.DbUser.Name)) _ = this.data.Append(this.getName()) //1
_ = this.data.Append(fmt.Sprintf("%-3s\t: %s", common.USERINFO_AVATAR, cast.ToString(this.userInfo.DbUser.Avatar))) _ = this.data.Append(this.getAvatar()) //2
_ = this.data.Append(fmt.Sprintf("%-3s\t: %s", common.USERINFO_VIP, cast.ToString(this.userInfo.DbUser.Vip))) _ = this.data.Append(this.getVip()) //3
_ = this.data.Append(fmt.Sprintf("%-3s\t: %s", common.USERINFO_LV, cast.ToString(this.userInfo.DbUser.Lv))) _ = this.data.Append(this.getLv()) //4
_ = this.data.Append(fmt.Sprintf("%-3s\t: %s", common.USERINFO_GOLD, cast.ToString(this.userInfo.DbUser.Gold))) _ = this.data.Append(this.getGold()) //5
_ = this.data.Append(fmt.Sprintf("%-3s\t: %s", common.USERINFO_EXP, cast.ToString(this.userInfo.DbUser.Exp))) _ = this.data.Append(this.getExp()) //6
_ = this.data.Append(this.getTitle()) //7
_ = this.data.Append(this.getActiveDay()) //8
_ = this.data.Append(this.getActiveWeek()) //9
_ = this.data.Append(this.getFriendPoint()) //10
_ = this.data.Append(this.getModiNameCount()) //11
_ = this.data.Append(this.getSign()) //12
}, },
}) })
@ -97,8 +121,29 @@ func (this *toyUserInfo) dataListener() {
if !comm.ProtoUnmarshal(data, rsp) { if !comm.ProtoUnmarshal(data, rsp) {
logrus.Error("unmarshal err") logrus.Error("unmarshal err")
} }
//TODO 改此协议 返回昵称 // updatename
// _=this.data.SetValue(1, fmt.Sprintf("%-3s\t: %s", common.USERINFO_NAME, rsp.Uid)) this.setProp(1, common.USERINFO_NAME, rsp.Name)
}
//update info
if data.MainType == string(comm.ModuleUser) &&
data.SubType == user.UserSubTypeInfo {
rsp := &pb.UserInfoResp{}
if !comm.ProtoUnmarshal(data, rsp) {
logrus.Error("unmarshal err")
return
}
this.setProp(2, common.USERINFO_AVATAR, rsp.Data.Avatar)
this.setProp(3, common.USERINFO_VIP, rsp.Data.Vip)
this.setProp(4, common.USERINFO_LV, rsp.Data.Lv)
this.setProp(5, common.USERINFO_GOLD, rsp.Data.Gold)
this.setProp(6, common.USERINFO_EXP, rsp.Data.Exp)
this.setProp(7, common.USERINFO_TITLE, rsp.Data.Title)
this.setProp(8, common.USERINFO_ACTIVE_DAY, rsp.Ex.Activeday)
this.setProp(9, common.USERINFO_ACTIVE_WEEK, rsp.Ex.Activeweek)
this.setProp(10, common.USERINFO_FRIENDPOINT, rsp.Ex.FriendPoint)
this.setProp(11, common.USERINFO_MODINAME, rsp.Ex.ModifynameCount)
this.setProp(12, common.USERINFO_SIGN, rsp.Ex.Sign)
} }
}, },
}) })
@ -113,16 +158,87 @@ func (this *toyUserInfo) dataListener() {
if !comm.ProtoUnmarshal(data.Msg, rsp) { if !comm.ProtoUnmarshal(data.Msg, rsp) {
logrus.Error("unmarshal err") logrus.Error("unmarshal err")
} }
_ = this.data.SetValue(5, fmt.Sprintf("%-3s\t: %s", common.USERINFO_GOLD, cast.ToString(rsp.Gold))) this.setProp(5, common.USERINFO_GOLD, rsp.Gold)
} }
// listener exp // listener exp
if data.Msg.MainType == string(comm.ModuleUser) && if data.Msg.MainType == string(comm.ModuleUser) &&
data.Msg.SubType == "" { data.Msg.SubType == "" {
//TODO change exp //TODO change exp
} }
//
logrus.WithField("key", "a").Debug(data.Msg.SubType)
}, },
}) })
} }
func (this *toyUserInfo) setProp(idx int, label string, val interface{}) {
if err := this.data.SetValue(idx, fmt.Sprintf("%-3s\t: %v", label, val)); err != nil {
logrus.WithFields(logrus.Fields{"idx": idx, "val": val}).Error(err)
}
}
func (this *toyUserInfo) getAcc() string {
return fmt.Sprintf("%-3s\t: %s", common.USERINFO_ACC, this.userInfo.DbUser.Binduid)
}
func (this *toyUserInfo) getName() string {
return fmt.Sprintf("%-3s\t: %s", common.USERINFO_NAME, this.userInfo.DbUser.Name)
}
func (this *toyUserInfo) getAvatar() string {
return fmt.Sprintf("%-3s\t: %s", common.USERINFO_AVATAR, this.userInfo.DbUser.Avatar)
}
func (this *toyUserInfo) getVip() string {
return fmt.Sprintf("%-3s\t: %s", common.USERINFO_VIP, cast.ToString(this.userInfo.DbUser.Vip))
}
func (this *toyUserInfo) getLv() string {
return fmt.Sprintf("%-3s\t: %s", common.USERINFO_LV, cast.ToString(this.userInfo.DbUser.Lv))
}
func (this *toyUserInfo) getGold() string {
return fmt.Sprintf("%-3s\t: %s", common.USERINFO_GOLD, cast.ToString(this.userInfo.DbUser.Gold))
}
func (this *toyUserInfo) getExp() string {
return fmt.Sprintf("%-3s\t: %s", common.USERINFO_EXP, cast.ToString(this.userInfo.DbUser.Exp))
}
func (this *toyUserInfo) getTitle() string {
return fmt.Sprintf("%-3s\t: %s", common.USERINFO_TITLE, cast.ToString(this.userInfo.DbUser.Exp))
}
func (this *toyUserInfo) getActiveDay() string {
if this.userInfo.DbUserExpand == nil {
return fmt.Sprintf("%-3s\t: %s", common.USERINFO_ACTIVE_DAY, cast.ToString(0))
}
return fmt.Sprintf("%-3s\t: %s", common.USERINFO_ACTIVE_DAY, cast.ToString(this.userInfo.DbUserExpand.Activeday))
}
func (this *toyUserInfo) getActiveWeek() string {
if this.userInfo.DbUserExpand == nil {
return fmt.Sprintf("%-3s\t: %s", common.USERINFO_ACTIVE_WEEK, cast.ToString(0))
}
return fmt.Sprintf("%-3s\t: %s", common.USERINFO_ACTIVE_WEEK, cast.ToString(this.userInfo.DbUserExpand.Activeweek))
}
func (this *toyUserInfo) getFriendPoint() string {
if this.userInfo.DbUserExpand == nil {
return fmt.Sprintf("%-3s\t: %s", common.USERINFO_FRIENDPOINT, cast.ToString(0))
}
return fmt.Sprintf("%-3s\t: %s", common.USERINFO_FRIENDPOINT, cast.ToString(this.userInfo.DbUserExpand.FriendPoint))
}
func (this *toyUserInfo) getModiNameCount() string {
if this.userInfo.DbUserExpand == nil {
return fmt.Sprintf("%-3s\t: %s", common.USERINFO_MODINAME, "")
}
return fmt.Sprintf("%-3s\t: %s", common.USERINFO_MODINAME, cast.ToString(this.userInfo.DbUserExpand.ModifynameCount))
}
func (this *toyUserInfo) getSign() string {
if this.userInfo.DbUserExpand == nil {
return fmt.Sprintf("%-3s\t: %s", common.USERINFO_SIGN, "")
}
return fmt.Sprintf("%-3s\t: %s", common.USERINFO_SIGN, cast.ToString(this.userInfo.DbUserExpand.Sign))
}

View File

@ -99,4 +99,10 @@ type (
// 清理玩家任务数据 // 清理玩家任务数据
CleanData(uid string) CleanData(uid string)
} }
//好友
IFriend interface {
// 重置点赞列表和每日友情点
ResetFriend(uid string)
}
) )

View File

@ -48,6 +48,27 @@ func (this *apiComp) Zan(session comm.IUserSession, req *pb.FriendZanReq) (code
return return
} }
//设置友情值
ue, err := this.moduleFriend.ModuleUser.GetUserExpand(session.GetUserId())
if err != nil {
code = pb.ErrorCode_DBError
return
}
// 今日送出的友情点是否达到上限
if ue.FriendPointOD >= int32(this.moduleFriend.getOutFriendPointMax()) {
code = pb.ErrorCode_FriendPointLimit
return
}
update := map[string]interface{}{
"friendPointOD": ue.FriendPointOD + 10,
}
if err := this.moduleFriend.ModuleUser.ChangeUserExpand(session.GetUserId(), update); err != nil {
code = pb.ErrorCode_DBError
return
}
//设置被点赞玩家 //设置被点赞玩家
target.ZanIds = append(target.ZanIds, selfId) target.ZanIds = append(target.ZanIds, selfId)

View File

@ -48,6 +48,28 @@ func (this *apiComp) Zanreceive(session comm.IUserSession, req *pb.FriendZanrece
return return
} }
//设置友情值
ue, err := this.moduleFriend.ModuleUser.GetUserExpand(session.GetUserId())
if err != nil {
code = pb.ErrorCode_DBError
return
}
// 今日获赠的友情点是否达到上限
if ue.FriendPointID >= int32(this.moduleFriend.getInFriendPointMax()) {
code = pb.ErrorCode_FriendPointLimit
return
}
update := map[string]interface{}{
"friendPoint": ue.FriendPoint + 10,
"friendPointID": ue.FriendPointID + 10,
}
if err := this.moduleFriend.ModuleUser.ChangeUserExpand(session.GetUserId(), update); err != nil {
code = pb.ErrorCode_DBError
return
}
if err := session.SendMsg(string(this.moduleFriend.GetType()), FriendSubTypeZanreceive, if err := session.SendMsg(string(this.moduleFriend.GetType()), FriendSubTypeZanreceive,
&pb.FriendZanreceiveResp{Flag: true}); err != nil { &pb.FriendZanreceiveResp{Flag: true}); err != nil {
code = pb.ErrorCode_SystemError code = pb.ErrorCode_SystemError

View File

@ -5,6 +5,7 @@ import (
"go_dreamfactory/modules" "go_dreamfactory/modules"
"go_dreamfactory/lego/core" "go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/log"
"github.com/spf13/cast" "github.com/spf13/cast"
) )
@ -52,3 +53,39 @@ func (this *Friend) getBlackMax() int {
} }
return 0 return 0
} }
// 每日最大送出友情点
func (this *Friend) getOutFriendPointMax() int {
if max := this.configure.GetGlobalConf("friend_maxsendnum"); max != "" {
return cast.ToInt(max)
}
return 0
}
// 每日最大获赠友情点
func (this *Friend) getInFriendPointMax() int {
if max := this.configure.GetGlobalConf("friend_maxsendnum"); max != "" {
return cast.ToInt(max)
}
return 0
}
func (this *Friend) ResetFriend(uid string) {
// 重置点赞列表
zanUpdate := map[string]interface{}{
"zanIds": []string{},
}
if err := this.modelFriend.Change(uid, zanUpdate); err != nil {
log.Error("resetZanFriend err", log.Field{Key: "err", Value: err})
}
// 重置今日友情点
update := map[string]interface{}{
"friendPointID": 0,
"friendPointOD": 0,
}
if err := this.ModuleUser.ChangeUserExpand(uid, update); err != nil {
log.Error("resetFriend err", log.Field{Key: "err", Value: err})
}
}

View File

@ -30,6 +30,7 @@ type ModuleBase struct {
ModuleHero comm.IHero //英雄模块 ModuleHero comm.IHero //英雄模块
ModuleEquipment comm.IEquipment //装备模块 ModuleEquipment comm.IEquipment //装备模块
ModuleTask comm.ITask //任务 ModuleTask comm.ITask //任务
ModuleFriend comm.IFriend //好友
} }
//重构模块配置对象 //重构模块配置对象
@ -78,6 +79,11 @@ func (this *ModuleBase) Start() (err error) {
return return
} }
this.ModuleTask = module.(comm.ITask) this.ModuleTask = module.(comm.ITask)
if module, err = this.service.GetModule(comm.ModuleFriend); err != nil {
return
}
this.ModuleFriend = module.(comm.IFriend)
return return
} }

View File

@ -22,6 +22,7 @@ const (
UserSubTypeModifyName = "modifyname" //修改名称 UserSubTypeModifyName = "modifyname" //修改名称
UserSubTypeFigure = "figure" //形象 UserSubTypeFigure = "figure" //形象
UserSubTypeModifySign = "modifysign" // 修改签名 UserSubTypeModifySign = "modifysign" // 修改签名
UserSubTypeInfo = "info" //用户信息
) )
type apiComp struct { type apiComp struct {

35
modules/user/api_info.go Normal file
View File

@ -0,0 +1,35 @@
package user
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"google.golang.org/protobuf/proto"
)
func (this *apiComp) InfoCheck(session comm.IUserSession, req *pb.UserInfoReq) (code pb.ErrorCode) {
return
}
func (this *apiComp) Info(session comm.IUserSession, req *pb.UserInfoReq) (code pb.ErrorCode, data proto.Message) {
if code = this.InfoCheck(session, req); code != pb.ErrorCode_Success {
return
}
dbUser := this.module.GetUser(session.GetUserId())
ue, err := this.module.GetUserExpand(session.GetUserId())
if err != nil {
code = pb.ErrorCode_DBError
}
rsp := &pb.UserInfoResp{
Data: dbUser,
Ex: ue,
}
if err := session.SendMsg(string(this.module.GetType()), UserSubTypeInfo, rsp); err != nil {
code = pb.ErrorCode_SystemError
}
return
}

View File

@ -111,6 +111,8 @@ func (this *apiComp) Login(session comm.IUserSession, req *pb.UserLoginReq) (cod
if utils.IsAfterWeek(user.Logintime) { if utils.IsAfterWeek(user.Logintime) {
this.module.ModuleTask.ResetTask(user.Uid, comm.TASK_WEEKLY) this.module.ModuleTask.ResetTask(user.Uid, comm.TASK_WEEKLY)
} }
// 清理点赞
this.module.ModuleFriend.ResetFriend(user.Uid)
} }
rsp.Data = user rsp.Data = user

View File

@ -69,6 +69,7 @@ func (this *apiComp) Modifyname(session comm.IUserSession, req *pb.UserModifynam
if err = session.SendMsg(string(this.module.GetType()), UserSubTypeModifyName, &pb.UserModifynameResp{ if err = session.SendMsg(string(this.module.GetType()), UserSubTypeModifyName, &pb.UserModifynameResp{
Uid: session.GetUserId(), Uid: session.GetUserId(),
Count: uint32(left), Count: uint32(left),
Name: req.Name,
}); err != nil { }); err != nil {
code = pb.ErrorCode_SystemError code = pb.ErrorCode_SystemError
} }

View File

@ -76,6 +76,7 @@ const (
ErrorCode_FriendZaned ErrorCode = 1112 //已点赞 ErrorCode_FriendZaned ErrorCode = 1112 //已点赞
ErrorCode_FriendZanreceived ErrorCode = 1113 //已领取点赞 ErrorCode_FriendZanreceived ErrorCode = 1113 //已领取点赞
ErrorCode_FriendZanSelf ErrorCode = 1114 //不能给自己点赞 ErrorCode_FriendZanSelf ErrorCode = 1114 //不能给自己点赞
ErrorCode_FriendPointLimit ErrorCode = 1115 //友情点上线
// item // item
ErrorCode_ItemsNoEnough ErrorCode = 1200 //背包物品不足 ErrorCode_ItemsNoEnough ErrorCode = 1200 //背包物品不足
ErrorCode_ItemsNoFoundGird ErrorCode = 1201 //背包未找到物品格子 ErrorCode_ItemsNoFoundGird ErrorCode = 1201 //背包未找到物品格子
@ -195,6 +196,7 @@ var (
1112: "FriendZaned", 1112: "FriendZaned",
1113: "FriendZanreceived", 1113: "FriendZanreceived",
1114: "FriendZanSelf", 1114: "FriendZanSelf",
1115: "FriendPointLimit",
1200: "ItemsNoEnough", 1200: "ItemsNoEnough",
1201: "ItemsNoFoundGird", 1201: "ItemsNoFoundGird",
1202: "ItemsGridNumUpper", 1202: "ItemsGridNumUpper",
@ -303,6 +305,7 @@ var (
"FriendZaned": 1112, "FriendZaned": 1112,
"FriendZanreceived": 1113, "FriendZanreceived": 1113,
"FriendZanSelf": 1114, "FriendZanSelf": 1114,
"FriendPointLimit": 1115,
"ItemsNoEnough": 1200, "ItemsNoEnough": 1200,
"ItemsNoFoundGird": 1201, "ItemsNoFoundGird": 1201,
"ItemsGridNumUpper": 1202, "ItemsGridNumUpper": 1202,
@ -392,7 +395,7 @@ var File_errorcode_proto protoreflect.FileDescriptor
var file_errorcode_proto_rawDesc = []byte{ var file_errorcode_proto_rawDesc = []byte{
0x0a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x0a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x2a, 0xc3, 0x11, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x6f, 0x2a, 0xda, 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, 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, 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, 0x1b, 0x0a, 0x17, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
@ -458,82 +461,83 @@ var file_errorcode_proto_rawDesc = []byte{
0x6e, 0x65, 0x64, 0x10, 0xd8, 0x08, 0x12, 0x16, 0x0a, 0x11, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 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, 0x5a, 0x61, 0x6e, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x10, 0xd9, 0x08, 0x12, 0x12,
0x0a, 0x0d, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5a, 0x61, 0x6e, 0x53, 0x65, 0x6c, 0x66, 0x10, 0x0a, 0x0d, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5a, 0x61, 0x6e, 0x53, 0x65, 0x6c, 0x66, 0x10,
0xda, 0x08, 0x12, 0x12, 0x0a, 0x0d, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x4e, 0x6f, 0x45, 0x6e, 0x6f, 0xda, 0x08, 0x12, 0x15, 0x0a, 0x10, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x50, 0x6f, 0x69, 0x6e,
0x75, 0x67, 0x68, 0x10, 0xb0, 0x09, 0x12, 0x15, 0x0a, 0x10, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x4e, 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x10, 0xdb, 0x08, 0x12, 0x12, 0x0a, 0x0d, 0x49, 0x74, 0x65,
0x6f, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x47, 0x69, 0x72, 0x64, 0x10, 0xb1, 0x09, 0x12, 0x16, 0x0a, 0x6d, 0x73, 0x4e, 0x6f, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0xb0, 0x09, 0x12, 0x15, 0x0a,
0x11, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x47, 0x72, 0x69, 0x64, 0x4e, 0x75, 0x6d, 0x55, 0x70, 0x70, 0x10, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x4e, 0x6f, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x47, 0x69, 0x72,
0x65, 0x72, 0x10, 0xb2, 0x09, 0x12, 0x19, 0x0a, 0x14, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x47, 0x69, 0x64, 0x10, 0xb1, 0x09, 0x12, 0x16, 0x0a, 0x11, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x47, 0x72, 0x69,
0x72, 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x70, 0x70, 0x65, 0x72, 0x10, 0xb3, 0x09, 0x64, 0x4e, 0x75, 0x6d, 0x55, 0x70, 0x70, 0x65, 0x72, 0x10, 0xb2, 0x09, 0x12, 0x19, 0x0a, 0x14,
0x12, 0x19, 0x0a, 0x14, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x55, 0x73, 0x65, 0x4e, 0x6f, 0x74, 0x53, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x47, 0x69, 0x72, 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x55,
0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x10, 0xb4, 0x09, 0x12, 0x10, 0x0a, 0x0b, 0x48, 0x70, 0x70, 0x65, 0x72, 0x10, 0xb3, 0x09, 0x12, 0x19, 0x0a, 0x14, 0x49, 0x74, 0x65, 0x6d, 0x73,
0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x45, 0x78, 0x69, 0x73, 0x74, 0x10, 0x94, 0x0a, 0x12, 0x11, 0x0a, 0x55, 0x73, 0x65, 0x4e, 0x6f, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x10,
0x0c, 0x48, 0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0x95, 0x0a, 0xb4, 0x09, 0x12, 0x10, 0x0a, 0x0b, 0x48, 0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x45, 0x78, 0x69, 0x73,
0x12, 0x0e, 0x0a, 0x09, 0x48, 0x65, 0x72, 0x6f, 0x4d, 0x61, 0x78, 0x4c, 0x76, 0x10, 0x96, 0x0a, 0x74, 0x10, 0x94, 0x0a, 0x12, 0x11, 0x0a, 0x0c, 0x48, 0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x45, 0x6e,
0x12, 0x12, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x49, 0x6e, 0x69, 0x74, 0x43, 0x72, 0x65, 0x61, 0x6f, 0x75, 0x67, 0x68, 0x10, 0x95, 0x0a, 0x12, 0x0e, 0x0a, 0x09, 0x48, 0x65, 0x72, 0x6f, 0x4d,
0x74, 0x10, 0x97, 0x0a, 0x12, 0x11, 0x0a, 0x0c, 0x48, 0x65, 0x72, 0x6f, 0x43, 0x6f, 0x6c, 0x6f, 0x61, 0x78, 0x4c, 0x76, 0x10, 0x96, 0x0a, 0x12, 0x12, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x49,
0x72, 0x45, 0x72, 0x72, 0x10, 0x98, 0x0a, 0x12, 0x13, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x53, 0x6e, 0x69, 0x74, 0x43, 0x72, 0x65, 0x61, 0x74, 0x10, 0x97, 0x0a, 0x12, 0x11, 0x0a, 0x0c, 0x48,
0x6b, 0x69, 0x6c, 0x6c, 0x55, 0x70, 0x45, 0x72, 0x72, 0x10, 0x99, 0x0a, 0x12, 0x14, 0x0a, 0x0f, 0x65, 0x72, 0x6f, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x45, 0x72, 0x72, 0x10, 0x98, 0x0a, 0x12, 0x13,
0x48, 0x65, 0x72, 0x6f, 0x4d, 0x61, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x74, 0x65, 0x10, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x55, 0x70, 0x45, 0x72, 0x72,
0x9a, 0x0a, 0x12, 0x13, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x10, 0x99, 0x0a, 0x12, 0x14, 0x0a, 0x0f, 0x48, 0x65, 0x72, 0x6f, 0x4d, 0x61, 0x78, 0x52, 0x65,
0x6e, 0x61, 0x74, 0x65, 0x10, 0x9b, 0x0a, 0x12, 0x18, 0x0a, 0x13, 0x48, 0x65, 0x72, 0x6f, 0x4e, 0x73, 0x6f, 0x6e, 0x61, 0x74, 0x65, 0x10, 0x9a, 0x0a, 0x12, 0x13, 0x0a, 0x0e, 0x48, 0x65, 0x72,
0x6f, 0x74, 0x4e, 0x65, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x74, 0x65, 0x10, 0x9c, 0x6f, 0x4e, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x74, 0x65, 0x10, 0x9b, 0x0a, 0x12, 0x18,
0x0a, 0x12, 0x11, 0x0a, 0x0c, 0x48, 0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x0a, 0x13, 0x48, 0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x74, 0x4e, 0x65, 0x65, 0x64, 0x52, 0x65, 0x73,
0x79, 0x10, 0x9d, 0x0a, 0x12, 0x0f, 0x0a, 0x0a, 0x48, 0x65, 0x72, 0x6f, 0x43, 0x72, 0x65, 0x61, 0x6f, 0x6e, 0x61, 0x74, 0x65, 0x10, 0x9c, 0x0a, 0x12, 0x11, 0x0a, 0x0c, 0x48, 0x65, 0x72, 0x6f,
0x74, 0x65, 0x10, 0x9e, 0x0a, 0x12, 0x14, 0x0a, 0x0f, 0x48, 0x65, 0x72, 0x6f, 0x45, 0x71, 0x75, 0x4e, 0x6f, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x10, 0x9d, 0x0a, 0x12, 0x0f, 0x0a, 0x0a, 0x48,
0x69, 0x70, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x10, 0x9f, 0x0a, 0x12, 0x12, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x10, 0x9e, 0x0a, 0x12, 0x14, 0x0a, 0x0f,
0x65, 0x72, 0x6f, 0x4d, 0x61, 0x78, 0x41, 0x77, 0x61, 0x6b, 0x65, 0x6e, 0x10, 0xa0, 0x0a, 0x12, 0x48, 0x65, 0x72, 0x6f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x10,
0x0f, 0x0a, 0x0a, 0x48, 0x65, 0x72, 0x6f, 0x49, 0x73, 0x4c, 0x6f, 0x63, 0x6b, 0x10, 0xa1, 0x0a, 0x9f, 0x0a, 0x12, 0x12, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x4d, 0x61, 0x78, 0x41, 0x77, 0x61,
0x12, 0x11, 0x0a, 0x0c, 0x48, 0x65, 0x72, 0x6f, 0x4d, 0x61, 0x78, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x6b, 0x65, 0x6e, 0x10, 0xa0, 0x0a, 0x12, 0x0f, 0x0a, 0x0a, 0x48, 0x65, 0x72, 0x6f, 0x49, 0x73,
0x10, 0xa2, 0x0a, 0x12, 0x14, 0x0a, 0x0f, 0x48, 0x65, 0x72, 0x6f, 0x43, 0x6f, 0x73, 0x74, 0x54, 0x4c, 0x6f, 0x63, 0x6b, 0x10, 0xa1, 0x0a, 0x12, 0x11, 0x0a, 0x0c, 0x48, 0x65, 0x72, 0x6f, 0x4d,
0x79, 0x70, 0x65, 0x45, 0x72, 0x72, 0x10, 0xa3, 0x0a, 0x12, 0x10, 0x0a, 0x0b, 0x48, 0x65, 0x72, 0x61, 0x78, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x10, 0xa2, 0x0a, 0x12, 0x14, 0x0a, 0x0f, 0x48, 0x65,
0x6f, 0x53, 0x74, 0x61, 0x72, 0x45, 0x72, 0x72, 0x10, 0xa4, 0x0a, 0x12, 0x10, 0x0a, 0x0b, 0x48, 0x72, 0x6f, 0x43, 0x6f, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x45, 0x72, 0x72, 0x10, 0xa3, 0x0a,
0x65, 0x72, 0x6f, 0x54, 0x79, 0x70, 0x65, 0x45, 0x72, 0x72, 0x10, 0xa5, 0x0a, 0x12, 0x13, 0x0a, 0x12, 0x10, 0x0a, 0x0b, 0x48, 0x65, 0x72, 0x6f, 0x53, 0x74, 0x61, 0x72, 0x45, 0x72, 0x72, 0x10,
0x0e, 0x48, 0x65, 0x72, 0x6f, 0x45, 0x78, 0x70, 0x54, 0x79, 0x70, 0x65, 0x45, 0x72, 0x72, 0x10, 0xa4, 0x0a, 0x12, 0x10, 0x0a, 0x0b, 0x48, 0x65, 0x72, 0x6f, 0x54, 0x79, 0x70, 0x65, 0x45, 0x72,
0xa6, 0x0a, 0x12, 0x12, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x41, 0x64, 0x64, 0x4d, 0x61, 0x78, 0x72, 0x10, 0xa5, 0x0a, 0x12, 0x13, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x45, 0x78, 0x70, 0x54,
0x45, 0x78, 0x70, 0x10, 0xa7, 0x0a, 0x12, 0x12, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x53, 0x74, 0x79, 0x70, 0x65, 0x45, 0x72, 0x72, 0x10, 0xa6, 0x0a, 0x12, 0x12, 0x0a, 0x0d, 0x48, 0x65, 0x72,
0x61, 0x72, 0x4c, 0x76, 0x45, 0x72, 0x72, 0x10, 0xa8, 0x0a, 0x12, 0x12, 0x0a, 0x0d, 0x48, 0x65, 0x6f, 0x41, 0x64, 0x64, 0x4d, 0x61, 0x78, 0x45, 0x78, 0x70, 0x10, 0xa7, 0x0a, 0x12, 0x12, 0x0a,
0x72, 0x6f, 0x4d, 0x61, 0x78, 0x53, 0x74, 0x61, 0x72, 0x4c, 0x76, 0x10, 0xa9, 0x0a, 0x12, 0x19, 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x53, 0x74, 0x61, 0x72, 0x4c, 0x76, 0x45, 0x72, 0x72, 0x10, 0xa8,
0x0a, 0x14, 0x44, 0x72, 0x61, 0x77, 0x43, 0x61, 0x72, 0x64, 0x54, 0x79, 0x70, 0x65, 0x4e, 0x6f, 0x0a, 0x12, 0x12, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x4d, 0x61, 0x78, 0x53, 0x74, 0x61, 0x72,
0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xaa, 0x0a, 0x12, 0x13, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x4c, 0x76, 0x10, 0xa9, 0x0a, 0x12, 0x19, 0x0a, 0x14, 0x44, 0x72, 0x61, 0x77, 0x43, 0x61, 0x72,
0x6f, 0x4d, 0x61, 0x78, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x4c, 0x76, 0x10, 0xab, 0x0a, 0x12, 0x1e, 0x64, 0x54, 0x79, 0x70, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xaa, 0x0a,
0x0a, 0x19, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x6e, 0x46, 0x6f, 0x75, 0x12, 0x13, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x4d, 0x61, 0x78, 0x53, 0x6b, 0x69, 0x6c, 0x6c,
0x6e, 0x64, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x10, 0xf8, 0x0a, 0x12, 0x1c, 0x4c, 0x76, 0x10, 0xab, 0x0a, 0x12, 0x1e, 0x0a, 0x19, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65,
0x0a, 0x17, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x76, 0x6c, 0x69, 0x6d, 0x6e, 0x74, 0x4f, 0x6e, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65,
0x69, 0x74, 0x52, 0x65, 0x61, 0x63, 0x68, 0x65, 0x64, 0x10, 0xf9, 0x0a, 0x12, 0x14, 0x0a, 0x0f, 0x6e, 0x74, 0x10, 0xf8, 0x0a, 0x12, 0x1c, 0x0a, 0x17, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65,
0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x73, 0x57, 0x6f, 0x72, 0x6e, 0x10, 0x6e, 0x74, 0x4c, 0x76, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x61, 0x63, 0x68, 0x65, 0x64,
0xfa, 0x0a, 0x12, 0x1b, 0x0a, 0x16, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x4e, 0x6f, 0x10, 0xf9, 0x0a, 0x12, 0x14, 0x0a, 0x0f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74,
0x74, 0x46, 0x69, 0x6e, 0x64, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x10, 0xdc, 0x0b, 0x12, 0x49, 0x73, 0x57, 0x6f, 0x72, 0x6e, 0x10, 0xfa, 0x0a, 0x12, 0x1b, 0x0a, 0x16, 0x4d, 0x61, 0x69,
0x15, 0x0a, 0x10, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x49, 0x44, 0x46, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x69, 0x6e, 0x64, 0x43, 0x68, 0x61, 0x70,
0x6c, 0x65, 0x64, 0x10, 0xdd, 0x0b, 0x12, 0x15, 0x0a, 0x10, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x74, 0x65, 0x72, 0x10, 0xdc, 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, 0x6e, 0x65, 0x49, 0x44, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x10, 0xdd, 0x0b, 0x12, 0x15, 0x0a,
0x13, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x72, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x10, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e,
0x6f, 0x75, 0x6e, 0x64, 0x10, 0xdf, 0x0b, 0x12, 0x19, 0x0a, 0x14, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x64, 0x10, 0xde, 0x0b, 0x12, 0x18, 0x0a, 0x13, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65,
0x69, 0x6e, 0x65, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x10, 0x50, 0x72, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xdf, 0x0b, 0x12, 0x19,
0xe0, 0x0b, 0x12, 0x1b, 0x0a, 0x16, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x43, 0x6f, 0x0a, 0x14, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74,
0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x10, 0xe1, 0x0b, 0x12, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x10, 0xe0, 0x0b, 0x12, 0x1b, 0x0a, 0x16, 0x4d, 0x61, 0x69,
0x0d, 0x0a, 0x08, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x6e, 0x69, 0x74, 0x10, 0xc0, 0x0c, 0x12, 0x0e, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x77,
0x0a, 0x09, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x65, 0x74, 0x10, 0xc1, 0x0c, 0x12, 0x0f, 0x61, 0x72, 0x64, 0x10, 0xe1, 0x0b, 0x12, 0x0d, 0x0a, 0x08, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x6e,
0x0a, 0x0a, 0x54, 0x61, 0x73, 0x6b, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x10, 0xc2, 0x0c, 0x12, 0x69, 0x74, 0x10, 0xc0, 0x0c, 0x12, 0x0e, 0x0a, 0x09, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73,
0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x10, 0x65, 0x74, 0x10, 0xc1, 0x0c, 0x12, 0x0f, 0x0a, 0x0a, 0x54, 0x61, 0x73, 0x6b, 0x48, 0x61, 0x6e,
0xc3, 0x0c, 0x12, 0x13, 0x0a, 0x0e, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x64, 0x6c, 0x65, 0x10, 0xc2, 0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65,
0x49, 0x6e, 0x69, 0x74, 0x10, 0xc4, 0x0c, 0x12, 0x16, 0x0a, 0x11, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x10, 0xc3, 0x0c, 0x12, 0x13, 0x0a, 0x0e, 0x54, 0x61, 0x73,
0x63, 0x74, 0x69, 0x76, 0x65, 0x4e, 0x6f, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xc5, 0x0c, 0x12, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x69, 0x74, 0x10, 0xc4, 0x0c, 0x12, 0x16,
0x17, 0x0a, 0x12, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4e, 0x6f, 0x65, 0x0a, 0x11, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4e, 0x6f, 0x66, 0x6f,
0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0xc6, 0x0c, 0x12, 0x13, 0x0a, 0x0e, 0x54, 0x61, 0x73, 0x6b, 0x75, 0x6e, 0x64, 0x10, 0xc5, 0x0c, 0x12, 0x17, 0x0a, 0x12, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63,
0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x10, 0xc7, 0x0c, 0x12, 0x11, 0x0a, 0x74, 0x69, 0x76, 0x65, 0x4e, 0x6f, 0x65, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0xc6, 0x0c, 0x12,
0x0c, 0x54, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x10, 0xc8, 0x0c, 0x13, 0x0a, 0x0e, 0x54, 0x61, 0x73, 0x6b, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65,
0x12, 0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x54, 0x61, 0x67, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x64, 0x10, 0xc7, 0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69,
0x10, 0xc9, 0x0c, 0x12, 0x10, 0x0a, 0x0b, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x45, 0x6d, 0x70, 0x73, 0x68, 0x65, 0x64, 0x10, 0xc8, 0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x54,
0x74, 0x79, 0x10, 0xca, 0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x4e, 0x6f, 0x74, 0x61, 0x67, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x10, 0xc9, 0x0c, 0x12, 0x10, 0x0a, 0x0b, 0x54, 0x61,
0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xcb, 0x0c, 0x12, 0x17, 0x0a, 0x12, 0x53, 0x68, 0x6f, 0x70, 0x73, 0x6b, 0x49, 0x64, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x10, 0xca, 0x0c, 0x12, 0x11, 0x0a, 0x0c,
0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x73, 0x53, 0x6f, 0x6c, 0x64, 0x4f, 0x75, 0x74, 0x10, 0xa4, 0x54, 0x61, 0x73, 0x6b, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xcb, 0x0c, 0x12,
0x0d, 0x12, 0x1c, 0x0a, 0x17, 0x53, 0x68, 0x6f, 0x70, 0x4e, 0x6f, 0x53, 0x75, 0x72, 0x70, 0x6c, 0x17, 0x0a, 0x12, 0x53, 0x68, 0x6f, 0x70, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x73, 0x53, 0x6f,
0x75, 0x73, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x4e, 0x75, 0x6d, 0x10, 0xa5, 0x0d, 0x12, 0x6c, 0x64, 0x4f, 0x75, 0x74, 0x10, 0xa4, 0x0d, 0x12, 0x1c, 0x0a, 0x17, 0x53, 0x68, 0x6f, 0x70,
0x0c, 0x0a, 0x07, 0x4d, 0x61, 0x69, 0x6c, 0x45, 0x72, 0x72, 0x10, 0x88, 0x0e, 0x12, 0x13, 0x0a, 0x4e, 0x6f, 0x53, 0x75, 0x72, 0x70, 0x6c, 0x75, 0x73, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68,
0x0e, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0x4e, 0x75, 0x6d, 0x10, 0xa5, 0x0d, 0x12, 0x0c, 0x0a, 0x07, 0x4d, 0x61, 0x69, 0x6c, 0x45, 0x72,
0xec, 0x0e, 0x12, 0x13, 0x0a, 0x0d, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x4c, 0x65, 0x76, 0x6c, 0x72, 0x10, 0x88, 0x0e, 0x12, 0x13, 0x0a, 0x0e, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x4e, 0x6f,
0x45, 0x72, 0x72, 0x10, 0xb9, 0x94, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xec, 0x0e, 0x12, 0x13, 0x0a, 0x0d, 0x50, 0x61, 0x67,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x6f, 0x64, 0x61, 0x4c, 0x65, 0x76, 0x6c, 0x45, 0x72, 0x72, 0x10, 0xb9, 0x94, 0x01, 0x42, 0x06,
0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (

View File

@ -104,25 +104,24 @@ type DBUser struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID 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 Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid" bson:"uid"` //用户ID
Uuid string `protobuf:"bytes,3,opt,name=uuid,proto3" json:"uuid" bson:"uuid"` //玩家唯一uuid Uuid string `protobuf:"bytes,3,opt,name=uuid,proto3" json:"uuid" bson:"uuid"` //玩家唯一uuid
Binduid string `protobuf:"bytes,4,opt,name=binduid,proto3" json:"binduid" bson:"binduid"` //玩家账号 Binduid string `protobuf:"bytes,4,opt,name=binduid,proto3" json:"binduid" bson:"binduid"` //玩家账号
Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name" bson:"name"` //玩家名 Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name" bson:"name"` //玩家名
Sid string `protobuf:"bytes,6,opt,name=sid,proto3" json:"sid" bson:"sid"` //区服id Sid string `protobuf:"bytes,6,opt,name=sid,proto3" json:"sid" bson:"sid"` //区服id
Createip string `protobuf:"bytes,7,opt,name=createip,proto3" json:"createip" bson:"createip"` //创建账号时的ip Createip string `protobuf:"bytes,7,opt,name=createip,proto3" json:"createip" bson:"createip"` //创建账号时的ip
Lastloginip string `protobuf:"bytes,8,opt,name=lastloginip,proto3" json:"lastloginip" bson:"lastloginip"` //最后一次登录时的ip Lastloginip string `protobuf:"bytes,8,opt,name=lastloginip,proto3" json:"lastloginip" bson:"lastloginip"` //最后一次登录时的ip
Ctime int64 `protobuf:"varint,9,opt,name=ctime,proto3" json:"ctime" bson:"ctime"` //玩家创号时间戳 Ctime int64 `protobuf:"varint,9,opt,name=ctime,proto3" json:"ctime" bson:"ctime"` //玩家创号时间戳
Logintime int64 `protobuf:"varint,10,opt,name=logintime,proto3" json:"logintime" bson:"logintime"` //最后一次登录时间 Logintime int64 `protobuf:"varint,10,opt,name=logintime,proto3" json:"logintime" bson:"logintime"` //最后一次登录时间
FriendPoint int32 `protobuf:"varint,11,opt,name=friendPoint,proto3" json:"friendPoint" bson:"friendPoint"` //友情点 Avatar string `protobuf:"bytes,12,opt,name=avatar,proto3" json:"avatar" bson:"avatar"` //头像
Avatar string `protobuf:"bytes,12,opt,name=avatar,proto3" json:"avatar" bson:"avatar"` //头像 Gold int32 `protobuf:"varint,13,opt,name=gold,proto3" json:"gold" bson:"gold"` //金币
Gold int32 `protobuf:"varint,13,opt,name=gold,proto3" json:"gold" bson:"gold"` //金币 Exp int32 `protobuf:"varint,14,opt,name=exp,proto3" json:"exp" bson:"exp"` //经验
Exp int32 `protobuf:"varint,14,opt,name=exp,proto3" json:"exp" bson:"exp"` //经验 Created bool `protobuf:"varint,15,opt,name=created,proto3" json:"created" bson:"created"` //创角
Created bool `protobuf:"varint,15,opt,name=created,proto3" json:"created" bson:"created"` //创角 Lv int32 `protobuf:"varint,16,opt,name=lv,proto3" json:"lv" bson:"lv"` //等级
Lv int32 `protobuf:"varint,16,opt,name=lv,proto3" json:"lv" bson:"lv"` //等级 Vip int32 `protobuf:"varint,17,opt,name=vip,proto3" json:"vip" bson:"vip"` // vip
Vip int32 `protobuf:"varint,17,opt,name=vip,proto3" json:"vip" bson:"vip"` // vip Diamond int32 `protobuf:"varint,18,opt,name=diamond,proto3" json:"diamond" bson:"diamond"` // 钻石
Diamond int32 `protobuf:"varint,18,opt,name=diamond,proto3" json:"diamond" bson:"diamond"` // 钻石 Title int32 `protobuf:"varint,19,opt,name=title,proto3" json:"title"` //@go_tags(`bson:"title"`)头衔
Title int32 `protobuf:"varint,19,opt,name=title,proto3" json:"title"` //@go_tags(`bson:"title"`)头衔
} }
func (x *DBUser) Reset() { func (x *DBUser) Reset() {
@ -227,13 +226,6 @@ func (x *DBUser) GetLogintime() int64 {
return 0 return 0
} }
func (x *DBUser) GetFriendPoint() int32 {
if x != nil {
return x.FriendPoint
}
return 0
}
func (x *DBUser) GetAvatar() string { func (x *DBUser) GetAvatar() string {
if x != nil { if x != nil {
return x.Avatar return x.Avatar
@ -446,7 +438,7 @@ var file_user_user_db_proto_rawDesc = []byte{
0x61, 0x67, 0x12, 0x2a, 0x0a, 0x10, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x53, 0x65, 0x72, 0x61, 0x67, 0x12, 0x2a, 0x0a, 0x10, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x53, 0x65, 0x72,
0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x47, 0x61, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x47, 0x61,
0x74, 0x65, 0x77, 0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x0e, 0x74, 0x65, 0x77, 0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x0e,
0x0a, 0x02, 0x69, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x22, 0xbc, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x22, 0x9a,
0x03, 0x0a, 0x06, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x0a, 0x06, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 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, 0x12, 0x0a, 0x04, 0x75, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x75,
@ -462,41 +454,39 @@ var file_user_user_db_proto_rawDesc = []byte{
0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x74, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x74,
0x69, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x74, 0x69, 0x6d, 0x65,
0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x74, 0x69, 0x6d, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x74, 0x69, 0x6d,
0x65, 0x12, 0x20, 0x0a, 0x0b, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28,
0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x50, 0x6f, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x67, 0x6f, 0x6c,
0x69, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x0c, 0x20, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x67, 0x6f, 0x6c, 0x64, 0x12, 0x10, 0x0a,
0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x67, 0x03, 0x65, 0x78, 0x70, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12,
0x6f, 0x6c, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x67, 0x6f, 0x6c, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08,
0x10, 0x0a, 0x03, 0x65, 0x78, 0x70, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x78, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18,
0x70, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x0f, 0x20, 0x01, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x6c, 0x76, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x69, 0x70,
0x28, 0x08, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x18, 0x11, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x76, 0x69, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x64,
0x76, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x6c, 0x76, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x18, 0x12, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x64, 0x69,
0x69, 0x70, 0x18, 0x11, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x76, 0x69, 0x70, 0x12, 0x18, 0x0a, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x13,
0x07, 0x64, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x18, 0x12, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x22, 0xc7, 0x02, 0x0a, 0x0d,
0x64, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x10, 0x0a,
0x18, 0x13, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x22, 0xc7, 0x02, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12,
0x0a, 0x0d, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x75, 0x61, 0x7a, 0x68, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52,
0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x06, 0x68, 0x75, 0x61, 0x7a, 0x68, 0x69, 0x12, 0x1c, 0x0a, 0x09, 0x6b, 0x61, 0x6e, 0x67, 0x6a,
0x64, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x75, 0x61, 0x7a, 0x68, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x75, 0x63, 0x68, 0x69, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x6b, 0x61, 0x6e, 0x67,
0x0d, 0x52, 0x06, 0x68, 0x75, 0x61, 0x7a, 0x68, 0x69, 0x12, 0x1c, 0x0a, 0x09, 0x6b, 0x61, 0x6e, 0x6a, 0x75, 0x63, 0x68, 0x69, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x61, 0x6f, 0x67, 0x75, 0x61, 0x6e,
0x67, 0x6a, 0x75, 0x63, 0x68, 0x69, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x6b, 0x61, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x67, 0x61, 0x6f, 0x67, 0x75, 0x61, 0x6e,
0x6e, 0x67, 0x6a, 0x75, 0x63, 0x68, 0x69, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x61, 0x6f, 0x67, 0x75, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x77, 0x75, 0x6c, 0x69, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52,
0x61, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x67, 0x61, 0x6f, 0x67, 0x75, 0x04, 0x77, 0x75, 0x6c, 0x69, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x18, 0x07,
0x61, 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x77, 0x75, 0x6c, 0x69, 0x18, 0x06, 0x20, 0x01, 0x28, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x12, 0x16, 0x0a, 0x06, 0x65,
0x08, 0x52, 0x04, 0x77, 0x75, 0x6c, 0x69, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x66, 0x66, 0x65, 0x63, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x66, 0x66,
0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x12, 0x16, 0x0a, 0x65, 0x63, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x75, 0x61, 0x6a, 0x69, 0x18, 0x09, 0x20, 0x01,
0x06, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x28, 0x08, 0x52, 0x05, 0x67, 0x75, 0x61, 0x6a, 0x69, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x75, 0x62,
0x66, 0x66, 0x65, 0x63, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x75, 0x61, 0x6a, 0x69, 0x18, 0x09, 0x65, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x75, 0x62, 0x65, 0x6e, 0x12,
0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x67, 0x75, 0x61, 0x6a, 0x69, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x6e, 0x73, 0x75, 0x6f, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52,
0x75, 0x62, 0x65, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x75, 0x62, 0x65, 0x06, 0x74, 0x61, 0x6e, 0x73, 0x75, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x68, 0x75, 0x6f, 0x64, 0x6f,
0x6e, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x6e, 0x73, 0x75, 0x6f, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x6e, 0x67, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x68, 0x75, 0x6f, 0x64, 0x6f, 0x6e,
0x08, 0x52, 0x06, 0x74, 0x61, 0x6e, 0x73, 0x75, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x68, 0x75, 0x6f, 0x67, 0x12, 0x1c, 0x0a, 0x09, 0x78, 0x75, 0x61, 0x6e, 0x73, 0x68, 0x61, 0x6e, 0x67, 0x18, 0x0d,
0x64, 0x6f, 0x6e, 0x67, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x68, 0x75, 0x6f, 0x64, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x78, 0x75, 0x61, 0x6e, 0x73, 0x68, 0x61, 0x6e, 0x67, 0x12,
0x6f, 0x6e, 0x67, 0x12, 0x1c, 0x0a, 0x09, 0x78, 0x75, 0x61, 0x6e, 0x73, 0x68, 0x61, 0x6e, 0x67, 0x14, 0x0a, 0x05, 0x73, 0x61, 0x69, 0x6a, 0x69, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05,
0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x78, 0x75, 0x61, 0x6e, 0x73, 0x68, 0x61, 0x6e, 0x73, 0x61, 0x69, 0x6a, 0x69, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70,
0x67, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x61, 0x69, 0x6a, 0x69, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x52, 0x05, 0x73, 0x61, 0x69, 0x6a, 0x69, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (

File diff suppressed because it is too large Load Diff

View File

@ -383,6 +383,9 @@ type DBUserExpand struct {
Activeday int32 `protobuf:"varint,11,opt,name=activeday,proto3" json:"activeday"` //日活跃度 Activeday int32 `protobuf:"varint,11,opt,name=activeday,proto3" json:"activeday"` //日活跃度
Activeweek int32 `protobuf:"varint,12,opt,name=activeweek,proto3" json:"activeweek"` //周活跃度 Activeweek int32 `protobuf:"varint,12,opt,name=activeweek,proto3" json:"activeweek"` //周活跃度
Sign string `protobuf:"bytes,13,opt,name=sign,proto3" json:"sign"` //用户签名 Sign string `protobuf:"bytes,13,opt,name=sign,proto3" json:"sign"` //用户签名
FriendPoint int32 `protobuf:"varint,14,opt,name=friendPoint,proto3" json:"friendPoint"` //友情点
FriendPointID int32 `protobuf:"varint,15,opt,name=friendPointID,proto3" json:"friendPointID"` //每日获赠友情点
FriendPointOD int32 `protobuf:"varint,16,opt,name=friendPointOD,proto3" json:"friendPointOD"` //每日送出友情点
} }
func (x *DBUserExpand) Reset() { func (x *DBUserExpand) Reset() {
@ -508,6 +511,27 @@ func (x *DBUserExpand) GetSign() string {
return "" return ""
} }
func (x *DBUserExpand) GetFriendPoint() int32 {
if x != nil {
return x.FriendPoint
}
return 0
}
func (x *DBUserExpand) GetFriendPointID() int32 {
if x != nil {
return x.FriendPointID
}
return 0
}
func (x *DBUserExpand) GetFriendPointOD() int32 {
if x != nil {
return x.FriendPointOD
}
return 0
}
var File_userexpand_proto protoreflect.FileDescriptor var File_userexpand_proto protoreflect.FileDescriptor
var file_userexpand_proto_rawDesc = []byte{ var file_userexpand_proto_rawDesc = []byte{
@ -536,7 +560,7 @@ var file_userexpand_proto_rawDesc = []byte{
0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x2b, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x2b, 0x0a, 0x0a, 0x63, 0x6f, 0x6d,
0x70, 0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e,
0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70,
0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x22, 0xe1, 0x04, 0x0a, 0x0c, 0x44, 0x42, 0x55, 0x73, 0x65, 0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x22, 0xcf, 0x05, 0x0a, 0x0c, 0x44, 0x42, 0x55, 0x73, 0x65,
0x72, 0x45, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x72, 0x45, 0x78, 0x70, 0x61, 0x6e, 0x64, 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, 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, 0x2c, 0x0a, 0x11, 0x6c, 0x61, 0x73, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x2c, 0x0a, 0x11, 0x6c, 0x61, 0x73,
@ -566,16 +590,23 @@ var file_userexpand_proto_rawDesc = []byte{
0x64, 0x61, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x77, 0x65, 0x65, 0x64, 0x61, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x77, 0x65, 0x65,
0x6b, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x77, 0x6b, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x77,
0x65, 0x65, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x65, 0x65, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x0d, 0x20, 0x01, 0x28,
0x09, 0x52, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x1a, 0x39, 0x0a, 0x0b, 0x54, 0x75, 0x6a, 0x69, 0x61, 0x09, 0x52, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x66, 0x72, 0x69, 0x65, 0x6e,
0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x64, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x66, 0x72,
0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x69, 0x65, 0x6e, 0x64, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x66, 0x72, 0x69,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x65, 0x6e, 0x64, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x49, 0x44, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05,
0x38, 0x01, 0x1a, 0x46, 0x0a, 0x0f, 0x50, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x0d, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x49, 0x44, 0x12,
0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x24, 0x0a, 0x0d, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x44,
0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x50, 0x6f,
0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x69, 0x6e, 0x74, 0x4f, 0x44, 0x1a, 0x39, 0x0a, 0x0b, 0x54, 0x75, 0x6a, 0x69, 0x61, 0x6e, 0x45,
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28,
0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x09, 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,
0x1a, 0x46, 0x0a, 0x0f, 0x50, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x45, 0x6e,
0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 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 ( var (

View File

@ -9,10 +9,11 @@ import (
"github.com/spf13/cast" "github.com/spf13/cast"
) )
func ParseP(p string) (string, string, bool) { // 拆分Uid
s := strings.SplitN(p, ".", 2) func UIdSplit(uid string) (string, string, bool) {
s := strings.SplitN(uid, "_", 2)
if len(s) < 2 { if len(s) < 2 {
log.Debugf("param P err: %s", p) log.Debugf("split uid err: %s", uid)
return "", "", false return "", "", false
} }