From 9577fa134642bb81c280f93d2341ac25fdc6c727 Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Wed, 14 Jun 2023 11:50:42 +0800 Subject: [PATCH] update --- .gitignore | 1 + cmd/v2/lib/pb/protocol.go | 33 ++++++++++++++----------------- cmd/v2/robot.log | 15 +------------- cmd/v2/ui/navview.go | 4 ++-- cmd/v2/ui/views/sociaty_create.go | 4 ++-- cmd/v2/ui/views/sociaty_list.go | 30 ++++++++++++++-------------- 6 files changed, 36 insertions(+), 51 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bf0824e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.log \ No newline at end of file diff --git a/cmd/v2/lib/pb/protocol.go b/cmd/v2/lib/pb/protocol.go index f7ae924..fdc566a 100644 --- a/cmd/v2/lib/pb/protocol.go +++ b/cmd/v2/lib/pb/protocol.go @@ -132,12 +132,12 @@ var ( // common.MF(comm.ModuleGourmet, "getranduser"), }, "sociaty": { - // common.MF(comm.ModuleSociaty, sociaty.SociatySubTypeList), - // common.MF(comm.ModuleSociaty, sociaty.SociatySubTypeCreate), + common.MF("sociaty", "list"), + common.MF("sociaty", "create"), common.MF("sociaty", "mine"), common.MF("sociaty", "tasklist"), - // common.MF(comm.ModuleSociaty, sociaty.SociatySubTypeRank), - // common.MF(comm.ModuleSociaty, "boss"), + // common.MF("sociaty", sociaty.SociatySubTypeRank), + // common.MF("sociaty", "boss"), }, "troll": { // common.MF(comm.ModuleTroll, "getlist"), @@ -713,16 +713,13 @@ var ( SubType: "create", Enabled: true, }, - // common.MF(comm.ModuleSociaty, sociaty.SociatySubTypeList): { - // NavLabel: "公会推荐", - // Desc: "公会列表", - // MainType: string(comm.ModuleSociaty), - // SubType: sociaty.SociatySubTypeList, - // Enabled: true, - // Print: func(rsp proto.Message) string { - // return "不打印" - // }, - // }, + common.MF("sociaty", "list"): { + NavLabel: "公会推荐", + Desc: "公会列表", + MainType: "sociaty", + SubType: "list", + Enabled: true, + }, common.MF("sociaty", "mine"): { NavLabel: "我的公会", Desc: "我的公会", @@ -737,17 +734,17 @@ var ( SubType: "tasklist", Enabled: true, }, - // common.MF(comm.ModuleSociaty, sociaty.SociatySubTypeRank): { + // common.MF("sociaty", sociaty.SociatySubTypeRank): { // NavLabel: "排行榜", // Desc: "排行榜", - // MainType: string(comm.ModuleSociaty), + // MainType: string("sociaty"), // SubType: sociaty.SociatySubTypeRank, // Enabled: true, // }, - // common.MF(comm.ModuleSociaty, "boss"): { + // common.MF("sociaty", "boss"): { // NavLabel: "BOSS", // Desc: "BOSS", - // MainType: string(comm.ModuleSociaty), + // MainType: string("sociaty"), // SubType: "boss", // Enabled: true, // }, diff --git a/cmd/v2/robot.log b/cmd/v2/robot.log index ed0f2d5..9069a84 100644 --- a/cmd/v2/robot.log +++ b/cmd/v2/robot.log @@ -1,14 +1 @@ -{"level":"debug","msg":"app starting","time":"2023-06-09 21:54:05","version":"0.0.1"} -{"level":"debug","msg":"choose server","server":"01区","sid":"dfz01","time":"2023-06-09 21:54:08"} -{"account":"6911","level":"debug","msg":"submit login","time":"2023-06-09 21:54:12"} -{"level":"info","mainType":"user","msg":"登录","params":{"account":"6911","sid":"dfz01","area":0,"channel":0,"vcode":0,"vname":""},"subType":"login","time":"2023-06-09 21:54:12"} -{"idx":2,"lbl":"昵称","level":"debug","msg":"更新Prop","time":"2023-06-09 21:54:12","val":"Piratemountain"} -{"id":"worldtask","level":"warning","msg":"Missing tutorial panel","time":"2023-06-09 21:54:14"} -{"id":"worldtask","level":"warning","msg":"Missing tutorial panel","time":"2023-06-09 21:54:14"} -{"id":"worldtask","level":"warning","msg":"Missing tutorial panel","time":"2023-06-09 21:54:14"} -{"id":"worldtask","level":"warning","msg":"Missing tutorial panel","time":"2023-06-09 21:54:14"} -{"id":"worldtask","level":"warning","msg":"Missing tutorial panel","time":"2023-06-09 21:54:14"} -{"id":"worldtask","level":"warning","msg":"Missing tutorial panel","time":"2023-06-09 21:54:15"} -{"level":"debug","mainType":"smithy","msg":"select","subType":"tasklist","time":"2023-06-09 21:54:15"} -{"level":"error","msg":"readMessage err:read tcp 10.0.0.238:14482-\u003e10.0.0.238:7891: wsarecv: An existing connection was forcibly closed by the remote host.","time":"2023-06-09 21:54:31"} -{"level":"debug","msg":"即将与服务器断开链接","time":"2023-06-09 21:54:32"} +{"level":"debug","msg":"app starting","time":"2023-06-14 11:17:53","version":"0.0.1"} diff --git a/cmd/v2/ui/navview.go b/cmd/v2/ui/navview.go index dcd2558..e088982 100644 --- a/cmd/v2/ui/navview.go +++ b/cmd/v2/ui/navview.go @@ -100,8 +100,8 @@ var ( // gourmet // common.MF(comm.ModuleGourmet, "getranduser"): &formview.GourmentGetRandView{}, // sociaty - // common.MF(comm.ModuleSociaty, sociaty.SociatySubTypeList): &formview.SociatyListView{}, - // common.MF(comm.ModuleSociaty, sociaty.SociatySubTypeCreate): &formview.SociatyCreateView{}, + common.MF("sociaty", "list"): &formview.SociatyListView{}, + common.MF("sociaty", "create"): &formview.SociatyCreateView{}, common.MF("sociaty", "mine"): &formview.SociatyMineView{}, common.MF("sociaty", "tasklist"): &formview.SociatyTasklistView{}, // common.MF(comm.ModuleSociaty, sociaty.SociatySubTypeRank): &formview.SociatyRankView{}, diff --git a/cmd/v2/ui/views/sociaty_create.go b/cmd/v2/ui/views/sociaty_create.go index 7e67573..d1e3207 100644 --- a/cmd/v2/ui/views/sociaty_create.go +++ b/cmd/v2/ui/views/sociaty_create.go @@ -41,8 +41,8 @@ func (app *SociatyCreateView) CreateView(t *model.TestCase) fyne.CanvasObject { ApplyLv: cast.ToInt32(applyLv.Text), } if err := service.GetPttService().SendToClient( - string("sociaty"), - "", + "sociaty", + "create", req, ); err != nil { logrus.Error(err) diff --git a/cmd/v2/ui/views/sociaty_list.go b/cmd/v2/ui/views/sociaty_list.go index 720bc1a..8536d0c 100644 --- a/cmd/v2/ui/views/sociaty_list.go +++ b/cmd/v2/ui/views/sociaty_list.go @@ -45,8 +45,8 @@ func (this *SociatyListView) CreateView(t *model.TestCase) fyne.CanvasObject { this.sociatyList = func() { this.itemList.Reset() if err := service.GetPttService().SendToClient( - string("sociaty"), - "", + "sociaty", + "list", &pb.SociatyListReq{}); err != nil { logrus.Error(err) } @@ -68,7 +68,7 @@ func (this *SociatyListView) CreateView(t *model.TestCase) fyne.CanvasObject { logrus.Debugf("%s", selId) if err := service.GetPttService().SendToClient( t.MainType, - "", + "apply", &pb.SociatyApplyReq{ SociatyId: selId, }, @@ -85,8 +85,8 @@ func (this *SociatyListView) CreateView(t *model.TestCase) fyne.CanvasObject { return } if err := service.GetPttService().SendToClient( - string("sociaty"), - "", + "sociaty", + "applycancel", &pb.SociatyApplyCancelReq{ SociatyId: selId, }); err != nil { @@ -108,8 +108,8 @@ func (this *SociatyListView) CreateView(t *model.TestCase) fyne.CanvasObject { filter = pb.SociatyListFilter_APPLYING } if err := service.GetPttService().SendToClient( - string("sociaty"), - "", + "sociaty", + "list", &pb.SociatyListReq{ Filter: filter, }); err != nil { @@ -128,8 +128,8 @@ func (this *SociatyListView) CreateView(t *model.TestCase) fyne.CanvasObject { } this.itemList.Reset() if err := service.GetPttService().SendToClient( - string("sociaty"), - "", + "sociaty", + "search", &pb.SociatySearchReq{ Name: searchEntry.Text, }); err != nil { @@ -153,8 +153,8 @@ func (this *SociatyListView) dataListener() { this.obs.AddListener(observer.EVENT_REQ_RSP, observer.Listener{ OnNotify: func(d interface{}, args ...interface{}) { data := d.(*pb.UserMessage) - if data.MainType == string("sociaty") && - data.SubType == "" { + if data.MainType == "sociaty" && + data.SubType == "list" { rsp := &pb.SociatyListResp{} if !comm.ProtoUnmarshal(data, rsp) { @@ -181,8 +181,8 @@ func (this *SociatyListView) dataListener() { } this.itemList.AddItem(item) } - } else if data.MainType == string("sociaty") && - data.SubType == "" { + } else if data.MainType == "sociaty" && + data.SubType == "search" { rsp := &pb.SociatySearchResp{} if !comm.ProtoUnmarshal(data, rsp) { @@ -222,8 +222,8 @@ func (this *SociatyListView) formdataListen(item *entryItem) { this.obs.AddListener(observer.EVENT_REQ_RSP, observer.Listener{ OnNotify: func(d interface{}, args ...interface{}) { data := d.(*pb.UserMessage) - if !(data.MainType == string("sociaty") && - data.SubType == "") { + if !(data.MainType == "sociaty" && + data.SubType == "mine") { return } rsp := &pb.SociatyMineResp{}