diff --git a/comm/const.go b/comm/const.go index 15612078e..cb9c88eea 100644 --- a/comm/const.go +++ b/comm/const.go @@ -86,6 +86,7 @@ const ( ModuleOldtimes core.M_Modules = "oldtimes" //旧时光 ModuleCaravan core.M_Modules = "caravan" //巨怪商队 ModuleBuried core.M_Modules = "buried" //埋点中心 + ModuleActivity core.M_Modules = "acrivity" //活动 ) // 数据表名定义处 @@ -258,6 +259,12 @@ const ( //埋点数据统计 TableBuried = "buried" + + // 活动数据 + TableHdData = "hddata" + + // 活动列表 + TableHdList = "huodong" ) // RPC服务接口定义处 @@ -466,7 +473,7 @@ const ( Reddot19110 ReddotType = 19110 // 当存在好感度羁绊可以升级的时候,好感度羁绊界面激活 // 主线 - Reddot24100 ReddotType = 24100 // 主线章节有奖励没领取 + Reddot24101 ReddotType = 24101 // 主线章节有奖励没领取 // 好友 Reddot21101 ReddotType = 21101 //当好友申请存在时,一级位置:好友界面左边申请列表图标上右上角位置 当好友申请处理完红点消失 ) diff --git a/modules/activity/api.go b/modules/activity/api.go new file mode 100644 index 000000000..1abb4f765 --- /dev/null +++ b/modules/activity/api.go @@ -0,0 +1,25 @@ +package activity + +import ( + "go_dreamfactory/lego/core" + "go_dreamfactory/modules" +) + +type apiComp struct { + modules.MCompGate + service core.IService + module *Activity +} + +//组件初始化接口 +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.(*Activity) + this.service = service + return +} + +func (this *apiComp) Start() (err error) { + err = this.MCompGate.Start() + return +} diff --git a/modules/activity/api_getlist.go b/modules/activity/api_getlist.go new file mode 100644 index 000000000..1659dc998 --- /dev/null +++ b/modules/activity/api_getlist.go @@ -0,0 +1,28 @@ +package activity + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/pb" +) + +//参数校验 +func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.ActivityGetListReq) (errdata *pb.ErrorData) { + + return +} + +func (this *apiComp) GetList(session comm.IUserSession, req *pb.ActivityGetListReq) (errdata *pb.ErrorData) { + + list, err := this.module.modelhdList.getHdList(session.GetUserId()) + if err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_DBError, + Title: pb.ErrorCode_DBError.ToString(), + } + return + } + session.SendMsg(string(this.module.GetType()), "getlist", &pb.ActivityGetListResp{ + Data: list, + }) + return +} diff --git a/modules/activity/comp_configure.go b/modules/activity/comp_configure.go new file mode 100644 index 000000000..7941fc6f5 --- /dev/null +++ b/modules/activity/comp_configure.go @@ -0,0 +1,39 @@ +package activity + +import ( + "go_dreamfactory/lego/core" + "go_dreamfactory/lego/sys/log" + "go_dreamfactory/modules" + "go_dreamfactory/sys/configure" +) + +const () + +// /配置管理基础组件 +type configureComp struct { + modules.MCompConfigure +} + +// 组件初始化接口 +func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { + err = this.MCompConfigure.Init(service, module, comp, options) + + return +} + +// 加载多个配置文件 +func (this *configureComp) LoadMultiConfigure(confs map[string]interface{}) (err error) { + for k, v := range confs { + err = configure.RegisterConfigure(k, v, nil) + if err != nil { + log.Errorf("配置文件:%s解析失败!", k) + break + } + } + return +} + +// 读取配置数据 +func (this *configureComp) GetConfigure(name string) (v interface{}, err error) { + return configure.GetConfigure(name) +} diff --git a/modules/activity/model_hddata.go b/modules/activity/model_hddata.go new file mode 100644 index 000000000..b6901c5af --- /dev/null +++ b/modules/activity/model_hddata.go @@ -0,0 +1,53 @@ +package activity + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/lego/core" + "go_dreamfactory/modules" + "go_dreamfactory/pb" + + "go.mongodb.org/mongo-driver/bson/primitive" + "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/x/bsonx" +) + +type modelActivity struct { + modules.MCompModel + module *Activity +} + +func (this *modelActivity) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { + this.TableName = string(comm.TableHdData) + err = this.MCompModel.Init(service, module, comp, options) + this.module = module.(*Activity) + // uid 创建索引 + this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{ + Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}}, + }) + return +} + +func (this *modelActivity) getActivityList(uid string) (result *pb.DBActivityData, err error) { + result = &pb.DBActivityData{ + Uid: uid, + Hid: 0, + Gotarr: []int32{}, + Lasttime: 0, + Val: 0, + } + if err = this.Get(uid, result); err != nil { + if mongo.ErrNoDocuments == err { + result.Id = primitive.NewObjectID().Hex() + result.Uid = uid + + this.Add(uid, result) + err = nil + } + return + } + return +} + +func (this *modelActivity) modifyActivityList(uid string, data map[string]interface{}) error { + return this.Change(uid, data) +} diff --git a/modules/activity/model_hdlist.go b/modules/activity/model_hdlist.go new file mode 100644 index 000000000..9a45e8c92 --- /dev/null +++ b/modules/activity/model_hdlist.go @@ -0,0 +1,35 @@ +package activity + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/lego/core" + "go_dreamfactory/modules" + "go_dreamfactory/pb" +) + +type modelHdList struct { + modules.MCompModel + module *Activity +} + +func (this *modelHdList) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { + this.TableName = string(comm.TableHdList) + err = this.MCompModel.Init(service, module, comp, options) + this.module = module.(*Activity) + + return +} + +func (this *modelHdList) getHdList(uid string) (result []*pb.DBHuodong, err error) { + result = make([]*pb.DBHuodong, 0) + if err = this.GetList(uid, &result); err != nil { + this.module.Errorf("getActivityList db error: %v", err) + err = nil + } + return +} + +// 不需要修改 此接口不调用 +func (this *modelHdList) modifyHdList(uid string, data map[string]interface{}) error { + return this.Change(uid, data) +} diff --git a/modules/activity/module.go b/modules/activity/module.go new file mode 100644 index 000000000..2d11d724b --- /dev/null +++ b/modules/activity/module.go @@ -0,0 +1,43 @@ +package activity + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/lego/core" + "go_dreamfactory/modules" +) + +type Activity struct { + modules.ModuleBase + api *apiComp + configure *configureComp + modelActivity *modelActivity + service core.IService + modelhdList *modelHdList +} + +func NewModule() core.IModule { + return &Activity{} +} + +func (this *Activity) GetType() core.M_Modules { + return comm.ModuleActivity +} + +func (this *Activity) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) { + err = this.ModuleBase.Init(service, module, options) + this.service = service + return +} + +func (this *Activity) OnInstallComp() { + this.ModuleBase.OnInstallComp() + this.api = this.RegisterComp(new(apiComp)).(*apiComp) + this.configure = this.RegisterComp(new(configureComp)).(*configureComp) + this.modelActivity = this.RegisterComp(new(modelActivity)).(*modelActivity) + this.modelhdList = this.RegisterComp(new(modelHdList)).(*modelHdList) +} + +func (this *Activity) CheckActivateActivityCollect(uid string, id string) (err error) { + + return +} diff --git a/modules/mline/module.go b/modules/mline/module.go index 2bf28d953..0755f489d 100644 --- a/modules/mline/module.go +++ b/modules/mline/module.go @@ -53,9 +53,9 @@ func (this *Mline) Start() (err error) { func (this *Mline) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]*pb.ReddotItem) { reddot = make(map[comm.ReddotType]*pb.ReddotItem) for _, v := range rid { - if v == comm.Reddot24100 { - reddot[comm.Reddot24100] = &pb.ReddotItem{ - Rid: int32(comm.Reddot24100), + if v == comm.Reddot24101 { + reddot[comm.Reddot24101] = &pb.ReddotItem{ + Rid: int32(comm.Reddot24101), Activated: this.CheckPoint(session.GetUserId()), } break diff --git a/modules/reddot/api_get.go b/modules/reddot/api_get.go index 4b5c9e69a..ad7bc1baf 100644 --- a/modules/reddot/api_get.go +++ b/modules/reddot/api_get.go @@ -28,7 +28,7 @@ func (this *apiComp) Get(session comm.IUserSession, req *pb.ReddotGetReq) (errda reddot[int32(k)] = v } //主线 - case comm.Reddot24100: + case comm.Reddot24101: for k, v := range this.module.mline.Reddot(session, _rid) { reddot[int32(k)] = v } diff --git a/modules/reddot/api_getall.go b/modules/reddot/api_getall.go index 0417465c7..605c13d40 100644 --- a/modules/reddot/api_getall.go +++ b/modules/reddot/api_getall.go @@ -29,7 +29,7 @@ func (this *apiComp) GetAll(session comm.IUserSession, req *pb.ReddotGetAllReq) reddot[int32(k)] = v } //主线 - for k, v := range this.module.mline.Reddot(session, comm.Reddot24100) { + for k, v := range this.module.mline.Reddot(session, comm.Reddot24101) { reddot[int32(k)] = v } //铁匠铺 diff --git a/pb/activity_db.pb.go b/pb/activity_db.pb.go index 87c3bf32f..5ed75c8e1 100644 --- a/pb/activity_db.pb.go +++ b/pb/activity_db.pb.go @@ -143,21 +143,22 @@ type DBHuodong struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Hdid int32 `protobuf:"varint,1,opt,name=hdid,proto3" json:"hdid"` // 活动ID - Showtime string `protobuf:"bytes,2,opt,name=showtime,proto3" json:"showtime"` // 客户端显示的时间 - Stime int64 `protobuf:"varint,3,opt,name=stime,proto3" json:"stime"` // 开始时间 - Etime int64 `protobuf:"varint,4,opt,name=etime,proto3" json:"etime"` // 结束时间 - Rtime int64 `protobuf:"varint,5,opt,name=rtime,proto3" json:"rtime"` // 刷新时间 - Ttype int32 `protobuf:"varint,6,opt,name=ttype,proto3" json:"ttype"` - Name string `protobuf:"bytes,7,opt,name=name,proto3" json:"name"` // 活动名称 - Htype int32 `protobuf:"varint,8,opt,name=htype,proto3" json:"htype"` // 活动类型 自定义 - Stype int32 `protobuf:"varint,9,opt,name=stype,proto3" json:"stype"` - Itype int32 `protobuf:"varint,10,opt,name=itype,proto3" json:"itype"` - Intr string `protobuf:"bytes,11,opt,name=intr,proto3" json:"intr"` // 活动说明 - Img string `protobuf:"bytes,12,opt,name=img,proto3" json:"img"` // - Icon string `protobuf:"bytes,13,opt,name=icon,proto3" json:"icon"` - Showtype int32 `protobuf:"varint,14,opt,name=showtype,proto3" json:"showtype"` // 显示类型 - Data *ActivityInfo `protobuf:"bytes,15,opt,name=data,proto3" json:"data"` // 活动详细数据 + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID + Hdid int32 `protobuf:"varint,2,opt,name=hdid,proto3" json:"hdid"` // 活动ID + Showtime string `protobuf:"bytes,3,opt,name=showtime,proto3" json:"showtime"` // 客户端显示的时间 + Stime int64 `protobuf:"varint,4,opt,name=stime,proto3" json:"stime"` // 开始时间 + Etime int64 `protobuf:"varint,5,opt,name=etime,proto3" json:"etime"` // 结束时间 + Rtime int64 `protobuf:"varint,6,opt,name=rtime,proto3" json:"rtime"` // 刷新时间 + Ttype int32 `protobuf:"varint,7,opt,name=ttype,proto3" json:"ttype"` + Name string `protobuf:"bytes,8,opt,name=name,proto3" json:"name"` // 活动名称 + Htype int32 `protobuf:"varint,9,opt,name=htype,proto3" json:"htype"` // 活动类型 自定义 + Stype int32 `protobuf:"varint,10,opt,name=stype,proto3" json:"stype"` + Itype int32 `protobuf:"varint,11,opt,name=itype,proto3" json:"itype"` + Intr string `protobuf:"bytes,12,opt,name=intr,proto3" json:"intr"` // 活动说明 + Img string `protobuf:"bytes,13,opt,name=img,proto3" json:"img"` // + Icon string `protobuf:"bytes,14,opt,name=icon,proto3" json:"icon"` + Showtype int32 `protobuf:"varint,15,opt,name=showtype,proto3" json:"showtype"` // 显示类型 + Data *ActivityInfo `protobuf:"bytes,16,opt,name=data,proto3" json:"data"` // 活动详细数据 } func (x *DBHuodong) Reset() { @@ -192,6 +193,13 @@ func (*DBHuodong) Descriptor() ([]byte, []int) { return file_activity_activity_db_proto_rawDescGZIP(), []int{2} } +func (x *DBHuodong) GetId() string { + if x != nil { + return x.Id + } + return "" +} + func (x *DBHuodong) GetHdid() int32 { if x != nil { return x.Hdid @@ -303,11 +311,12 @@ type DBActivityData struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid"` - Hid int32 `protobuf:"varint,2,opt,name=hid,proto3" json:"hid"` - Gotarr []int32 `protobuf:"varint,3,rep,packed,name=gotarr,proto3" json:"gotarr"` - Lasttime int64 `protobuf:"varint,4,opt,name=lasttime,proto3" json:"lasttime"` - Val int32 `protobuf:"varint,5,opt,name=val,proto3" json:"val"` + 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"` + Hid int32 `protobuf:"varint,3,opt,name=hid,proto3" json:"hid"` + Gotarr []int32 `protobuf:"varint,4,rep,packed,name=gotarr,proto3" json:"gotarr"` + Lasttime int64 `protobuf:"varint,5,opt,name=lasttime,proto3" json:"lasttime"` + Val int32 `protobuf:"varint,6,opt,name=val,proto3" json:"val"` } func (x *DBActivityData) Reset() { @@ -342,6 +351,13 @@ func (*DBActivityData) Descriptor() ([]byte, []int) { return file_activity_activity_db_proto_rawDescGZIP(), []int{3} } +func (x *DBActivityData) GetId() string { + if x != nil { + return x.Id + } + return "" +} + func (x *DBActivityData) GetUid() string { if x != nil { return x.Uid @@ -390,38 +406,40 @@ var file_activity_activity_db_proto_rawDesc = []byte{ 0x61, 0x72, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x04, 0x2e, 0x41, 0x72, 0x72, 0x52, 0x03, 0x61, 0x72, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x74, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x62, 0x74, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x68, 0x6f, 0x77, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x68, 0x6f, 0x77, 0x22, 0xe2, 0x02, 0x0a, 0x09, 0x44, - 0x42, 0x48, 0x75, 0x6f, 0x64, 0x6f, 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x64, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x68, 0x64, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, - 0x73, 0x68, 0x6f, 0x77, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x68, 0x6f, 0x77, 0x22, 0xf2, 0x02, 0x0a, 0x09, 0x44, + 0x42, 0x48, 0x75, 0x6f, 0x64, 0x6f, 0x6e, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x64, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x68, 0x64, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, + 0x73, 0x68, 0x6f, 0x77, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x68, 0x6f, 0x77, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x69, 0x6d, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x14, - 0x0a, 0x05, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, - 0x74, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, + 0x74, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x74, 0x79, 0x70, 0x65, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x68, 0x74, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, + 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x74, 0x79, 0x70, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x68, 0x74, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x68, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x79, 0x70, 0x65, - 0x12, 0x14, 0x0a, 0x05, 0x69, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x05, 0x69, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x6e, 0x74, 0x72, 0x18, 0x0b, + 0x79, 0x70, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x79, 0x70, 0x65, + 0x12, 0x14, 0x0a, 0x05, 0x69, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x05, 0x69, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x6e, 0x74, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x6e, 0x74, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x6d, - 0x67, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x69, 0x6d, 0x67, 0x12, 0x12, 0x0a, 0x04, - 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x63, 0x6f, 0x6e, - 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x68, 0x6f, 0x77, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0e, 0x20, 0x01, + 0x67, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x69, 0x6d, 0x67, 0x12, 0x12, 0x0a, 0x04, + 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x63, 0x6f, 0x6e, + 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x68, 0x6f, 0x77, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x68, 0x6f, 0x77, 0x74, 0x79, 0x70, 0x65, 0x12, 0x21, 0x0a, 0x04, - 0x64, 0x61, 0x74, 0x61, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x41, 0x63, 0x74, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, - 0x7a, 0x0a, 0x0e, 0x44, 0x42, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x61, 0x74, - 0x61, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x75, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x68, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x03, 0x68, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x6f, 0x74, 0x61, 0x72, 0x72, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x67, 0x6f, 0x74, 0x61, 0x72, 0x72, 0x12, 0x1a, 0x0a, - 0x08, 0x6c, 0x61, 0x73, 0x74, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x08, 0x6c, 0x61, 0x73, 0x74, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x61, 0x6c, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x76, 0x61, 0x6c, 0x42, 0x06, 0x5a, 0x04, 0x2e, - 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x8a, 0x01, 0x0a, 0x0e, 0x44, 0x42, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x61, + 0x74, 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, 0x10, 0x0a, 0x03, 0x68, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x03, 0x68, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x6f, 0x74, 0x61, 0x72, 0x72, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x67, 0x6f, 0x74, 0x61, 0x72, 0x72, 0x12, 0x1a, + 0x0a, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x61, + 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x76, 0x61, 0x6c, 0x42, 0x06, 0x5a, 0x04, + 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pb/activity_msg.pb.go b/pb/activity_msg.pb.go new file mode 100644 index 000000000..97c76e5e4 --- /dev/null +++ b/pb/activity_msg.pb.go @@ -0,0 +1,320 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc v3.20.0 +// source: activity/activity_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 ActivityGetListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ActivityGetListReq) Reset() { + *x = ActivityGetListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_activity_activity_msg_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ActivityGetListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActivityGetListReq) ProtoMessage() {} + +func (x *ActivityGetListReq) ProtoReflect() protoreflect.Message { + mi := &file_activity_activity_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 ActivityGetListReq.ProtoReflect.Descriptor instead. +func (*ActivityGetListReq) Descriptor() ([]byte, []int) { + return file_activity_activity_msg_proto_rawDescGZIP(), []int{0} +} + +// 获取活动列表 +type ActivityGetListResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data []*DBHuodong `protobuf:"bytes,1,rep,name=data,proto3" json:"data"` +} + +func (x *ActivityGetListResp) Reset() { + *x = ActivityGetListResp{} + if protoimpl.UnsafeEnabled { + mi := &file_activity_activity_msg_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ActivityGetListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActivityGetListResp) ProtoMessage() {} + +func (x *ActivityGetListResp) ProtoReflect() protoreflect.Message { + mi := &file_activity_activity_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 ActivityGetListResp.ProtoReflect.Descriptor instead. +func (*ActivityGetListResp) Descriptor() ([]byte, []int) { + return file_activity_activity_msg_proto_rawDescGZIP(), []int{1} +} + +func (x *ActivityGetListResp) GetData() []*DBHuodong { + if x != nil { + return x.Data + } + return nil +} + +type ActivityGetHdDataReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ActivityGetHdDataReq) Reset() { + *x = ActivityGetHdDataReq{} + if protoimpl.UnsafeEnabled { + mi := &file_activity_activity_msg_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ActivityGetHdDataReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActivityGetHdDataReq) ProtoMessage() {} + +func (x *ActivityGetHdDataReq) ProtoReflect() protoreflect.Message { + mi := &file_activity_activity_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 ActivityGetHdDataReq.ProtoReflect.Descriptor instead. +func (*ActivityGetHdDataReq) Descriptor() ([]byte, []int) { + return file_activity_activity_msg_proto_rawDescGZIP(), []int{2} +} + +// 获取活动数据列表 +type ActivityGetHdDataResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data []*DBActivityData `protobuf:"bytes,1,rep,name=data,proto3" json:"data"` +} + +func (x *ActivityGetHdDataResp) Reset() { + *x = ActivityGetHdDataResp{} + if protoimpl.UnsafeEnabled { + mi := &file_activity_activity_msg_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ActivityGetHdDataResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActivityGetHdDataResp) ProtoMessage() {} + +func (x *ActivityGetHdDataResp) ProtoReflect() protoreflect.Message { + mi := &file_activity_activity_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 ActivityGetHdDataResp.ProtoReflect.Descriptor instead. +func (*ActivityGetHdDataResp) Descriptor() ([]byte, []int) { + return file_activity_activity_msg_proto_rawDescGZIP(), []int{3} +} + +func (x *ActivityGetHdDataResp) GetData() []*DBActivityData { + if x != nil { + return x.Data + } + return nil +} + +var File_activity_activity_msg_proto protoreflect.FileDescriptor + +var file_activity_activity_msg_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x2f, 0x61, 0x63, 0x74, 0x69, 0x76, + 0x69, 0x74, 0x79, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x61, + 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x2f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, + 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x14, 0x0a, 0x12, 0x41, 0x63, 0x74, + 0x69, 0x76, 0x69, 0x74, 0x79, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x22, + 0x35, 0x0a, 0x13, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x47, 0x65, 0x74, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x44, 0x42, 0x48, 0x75, 0x6f, 0x64, 0x6f, 0x6e, 0x67, + 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x16, 0x0a, 0x14, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, + 0x74, 0x79, 0x47, 0x65, 0x74, 0x48, 0x64, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x22, 0x3c, + 0x0a, 0x15, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x47, 0x65, 0x74, 0x48, 0x64, 0x44, + 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x12, 0x23, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x44, 0x42, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, + 0x74, 0x79, 0x44, 0x61, 0x74, 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_activity_activity_msg_proto_rawDescOnce sync.Once + file_activity_activity_msg_proto_rawDescData = file_activity_activity_msg_proto_rawDesc +) + +func file_activity_activity_msg_proto_rawDescGZIP() []byte { + file_activity_activity_msg_proto_rawDescOnce.Do(func() { + file_activity_activity_msg_proto_rawDescData = protoimpl.X.CompressGZIP(file_activity_activity_msg_proto_rawDescData) + }) + return file_activity_activity_msg_proto_rawDescData +} + +var file_activity_activity_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_activity_activity_msg_proto_goTypes = []interface{}{ + (*ActivityGetListReq)(nil), // 0: ActivityGetListReq + (*ActivityGetListResp)(nil), // 1: ActivityGetListResp + (*ActivityGetHdDataReq)(nil), // 2: ActivityGetHdDataReq + (*ActivityGetHdDataResp)(nil), // 3: ActivityGetHdDataResp + (*DBHuodong)(nil), // 4: DBHuodong + (*DBActivityData)(nil), // 5: DBActivityData +} +var file_activity_activity_msg_proto_depIdxs = []int32{ + 4, // 0: ActivityGetListResp.data:type_name -> DBHuodong + 5, // 1: ActivityGetHdDataResp.data:type_name -> DBActivityData + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_activity_activity_msg_proto_init() } +func file_activity_activity_msg_proto_init() { + if File_activity_activity_msg_proto != nil { + return + } + file_activity_activity_db_proto_init() + if !protoimpl.UnsafeEnabled { + file_activity_activity_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ActivityGetListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_activity_activity_msg_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ActivityGetListResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_activity_activity_msg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ActivityGetHdDataReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_activity_activity_msg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ActivityGetHdDataResp); 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_activity_activity_msg_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_activity_activity_msg_proto_goTypes, + DependencyIndexes: file_activity_activity_msg_proto_depIdxs, + MessageInfos: file_activity_activity_msg_proto_msgTypes, + }.Build() + File_activity_activity_msg_proto = out.File + file_activity_activity_msg_proto_rawDesc = nil + file_activity_activity_msg_proto_goTypes = nil + file_activity_activity_msg_proto_depIdxs = nil +}