From 4383d4969482038253f58f360d424764942076b4 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Sun, 8 Oct 2023 16:47:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E4=BC=9A=E9=95=BF=E5=BC=B9?= =?UTF-8?q?=E5=8A=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/sociaty/api_cross_accuse.go | 16 +++++++++++++--- modules/sociaty/model_sociaty.go | 3 ++- pb/capturesheep_msg.pb.go | 8 ++++---- pb/sociaty_msg.pb.go | 16 +++++++++++++--- 4 files changed, 32 insertions(+), 11 deletions(-) diff --git a/modules/sociaty/api_cross_accuse.go b/modules/sociaty/api_cross_accuse.go index 62775a112..0e070b44a 100644 --- a/modules/sociaty/api_cross_accuse.go +++ b/modules/sociaty/api_cross_accuse.go @@ -29,6 +29,15 @@ func (this *apiComp) Accuse(session comm.IUserSession, req *pb.SociatyAccuseReq) return } + if sociaty.AccuseTime > 0 { //正在弹劾中 + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + Message: "AccuseTime > 0, Accuseing", + } + return + } + // 校验权限 if !this.module.modelSociaty.isRight(uid, sociaty, pb.SociatyJob_VICEPRESIDENT, @@ -47,8 +56,8 @@ func (this *apiComp) Accuse(session comm.IUserSession, req *pb.SociatyAccuseReq) if errors.As(err, &customErr) { code := customErr.Code errdata = &pb.ErrorData{ - Code: code, - Title: code.ToString(), + Code: code, + Title: code.ToString(), Datastring: sociaty.Id, } } else { @@ -68,7 +77,8 @@ func (this *apiComp) Accuse(session comm.IUserSession, req *pb.SociatyAccuseReq) } rsp := &pb.SociatyAccuseResp{ - SociatyId: sociaty.Id, + SociatyId: sociaty.Id, + AccuseTime: sociaty.AccuseTime, } session.SendMsg(string(this.module.GetType()), SociatySubTypeAccuse, rsp) diff --git a/modules/sociaty/model_sociaty.go b/modules/sociaty/model_sociaty.go index a0877d90e..4db46c971 100644 --- a/modules/sociaty/model_sociaty.go +++ b/modules/sociaty/model_sociaty.go @@ -643,9 +643,10 @@ func (this *ModelSociaty) accuse(sociaty *pb.DBSociaty) error { if left < int64(globalCnf.GuildInitiateImpeachmentTime*3600) || user.Offlinetime == 0 { return comm.NewCustomError(pb.ErrorCode_SociatyNoAccuse) } else { + sociaty.AccuseTime = utils.AddHour(int(globalCnf.GuildImpeachmentCountDown)).Unix() //更新会长的弹劾倒计时时间 update := map[string]interface{}{ - "accuseTime": utils.AddHour(int(globalCnf.GuildImpeachmentCountDown)).Unix(), + "accuseTime": sociaty.AccuseTime, } return this.updateSociaty(sociaty.Id, update) } diff --git a/pb/capturesheep_msg.pb.go b/pb/capturesheep_msg.pb.go index 8765de627..2ead7e153 100644 --- a/pb/capturesheep_msg.pb.go +++ b/pb/capturesheep_msg.pb.go @@ -401,7 +401,7 @@ func (*CapturesheepUseItemResp) Descriptor() ([]byte, []int) { return file_capturesheep_capturesheep_msg_proto_rawDescGZIP(), []int{7} } -//捕养大赛使用道具 +//捕养大赛结算 type CapturesheepOverReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -457,7 +457,7 @@ func (x *CapturesheepOverReq) GetRating() int32 { return 0 } -//捕养大赛使用道具 +//捕养大赛结算 type CapturesheepOverResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -585,7 +585,7 @@ func (x *CapturesheepWeekRewardReq) GetId() int32 { return 0 } -//捕养大赛使用道具 +//周长奖励请求 type CapturesheepWeekRewardResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -680,7 +680,7 @@ func (*CapturesheepAllWeekRewardReq) Descriptor() ([]byte, []int) { return file_capturesheep_capturesheep_msg_proto_rawDescGZIP(), []int{12} } -//捕养大赛使用道具 +//周长奖励请求 type CapturesheepAllWeekRewardResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/pb/sociaty_msg.pb.go b/pb/sociaty_msg.pb.go index 5bbab8d66..355686971 100644 --- a/pb/sociaty_msg.pb.go +++ b/pb/sociaty_msg.pb.go @@ -1990,7 +1990,8 @@ type SociatyAccuseResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - SociatyId string `protobuf:"bytes,1,opt,name=sociatyId,proto3" json:"sociatyId"` + SociatyId string `protobuf:"bytes,1,opt,name=sociatyId,proto3" json:"sociatyId"` + AccuseTime int64 `protobuf:"varint,2,opt,name=accuseTime,proto3" json:"accuseTime"` } func (x *SociatyAccuseResp) Reset() { @@ -2032,6 +2033,13 @@ func (x *SociatyAccuseResp) GetSociatyId() string { return "" } +func (x *SociatyAccuseResp) GetAccuseTime() int64 { + if x != nil { + return x.AccuseTime + } + return 0 +} + // 签到 type SociatySignReq struct { state protoimpl.MessageState @@ -3943,10 +3951,12 @@ var file_sociaty_sociaty_msg_proto_rawDesc = []byte{ 0x1d, 0x0a, 0x03, 0x6a, 0x6f, 0x62, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x4a, 0x6f, 0x62, 0x52, 0x03, 0x6a, 0x6f, 0x62, 0x22, 0x12, 0x0a, 0x10, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x41, 0x63, 0x63, 0x75, 0x73, 0x65, 0x52, - 0x65, 0x71, 0x22, 0x31, 0x0a, 0x11, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x41, 0x63, 0x63, + 0x65, 0x71, 0x22, 0x51, 0x0a, 0x11, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x41, 0x63, 0x63, 0x75, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x6f, 0x63, 0x69, - 0x61, 0x74, 0x79, 0x49, 0x64, 0x22, 0x10, 0x0a, 0x0e, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, + 0x61, 0x74, 0x79, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x75, 0x73, 0x65, 0x54, + 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x61, 0x63, 0x63, 0x75, 0x73, + 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x10, 0x0a, 0x0e, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x22, 0x41, 0x0a, 0x0f, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x53, 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, 0x12, 0x1c, 0x0a, 0x09,