Merge branch 'feat-IRONFANS-247-Robin' into conf-247

This commit is contained in:
Robin 2024-11-25 15:24:18 +08:00
commit fd0142a96a
20 changed files with 619 additions and 10 deletions

View File

@ -127,3 +127,8 @@ const (
const (
Notification_PushTime_Instant = 0 // 即时推送
)
const (
GuildRegistrationApprove_Pass = 0
GuildRegistrationApprove_Reject = 1
)

View File

@ -370,3 +370,10 @@ const (
RavenIQTest_VType_Visit = 0 // 访问
RavenIQTest_VType_Paid = 1 // 付款
)
// 公会入驻表status
const (
GuildRegistration_Created = 0 // 已创建(待跟进)
GuildRegistration_Handled = 1 // 已跟进
GuildRegistration_Rejected = 2 // 已拒绝
)

View File

@ -261,6 +261,9 @@ var ErrCodeMsgMap = map[ErrCode]string{
ErrCodeNotificationPullFail: "系统通知表拉取失败",
ErrCodeNotificationWrongStatusForCancellation: "仅可撤销待推送的系统通知",
ErrCodeGuildRegistrationSrvFail: "公会入驻表服务错误",
ErrCodeGuildRegistrationNotExist: "公会入驻表不存在",
ErrCodeRavenIQTestSrvFail: "瑞文智商测试表服务错误",
ErrCodeRavenIQTestNotExist: "瑞文智商测试表不存在",
ErrCodeRavenIQTestQuestionNotExist: "瑞文智商测试表题目不存在",
@ -629,6 +632,11 @@ const (
ErrCodeFrontendRouteSrvFail ErrCode = -47001 // 前端页面路由表服务错误
ErrCodeFrontendRouteNotExist ErrCode = -47002 // 前端页面路由表不存在
// GuildRegistration: 46xxx
ErrCodeGuildRegistrationSrvOk ErrCode = ErrCodeOk
ErrCodeGuildRegistrationSrvFail ErrCode = -46001 // 公会入驻表服务错误
ErrCodeGuildRegistrationNotExist ErrCode = -46002 // 公会入驻表不存在
// Media: 60xxx
ErrCodeMediaSrvOk ErrCode = ErrCodeOk
ErrCodeMediaSrvFail ErrCode = -60001 // 媒体服务错误

View File

@ -0,0 +1,66 @@
package proto
import (
"service/api/base"
"service/dbstruct"
)
// op 创建
type ApiCreateReq struct {
base.BaseRequest
*dbstruct.GuildRegistration
}
type ApiCreateData struct {
}
type ApiCreateResp struct {
base.BaseResponse
Data *ApiCreateData `json:"data"`
}
// op 删除
type ApiDeleteReq struct {
base.BaseRequest
Id int64 `json:"id"`
}
type ApiDeleteData struct {
}
type ApiDeleteResp struct {
base.BaseResponse
Data *ApiDeleteData `json:"data"`
}
// op 更新
type ApiUpdateReq struct {
base.BaseRequest
*dbstruct.GuildRegistration
}
type ApiUpdateData struct {
}
type ApiUpdateResp struct {
base.BaseResponse
Data *ApiUpdateData `json:"data"`
}
// op 列表
type ApiListReq struct {
base.BaseRequest
Offset int `json:"offset"`
Limit int `json:"limit"`
}
type ApiListData struct {
List []*dbstruct.GuildRegistration `json:"list"`
Offset int `json:"offset"`
More int `json:"more"`
}
type ApiListResp struct {
base.BaseResponse
Data *ApiListData `json:"data"`
}

View File

@ -0,0 +1,84 @@
package proto
import (
"service/api/base"
"service/dbstruct"
)
// op 创建
type OpCreateReq struct {
base.BaseRequest
*dbstruct.GuildRegistration
}
type OpCreateData struct {
}
type OpCreateResp struct {
base.BaseResponse
Data *OpCreateData `json:"data"`
}
// op 删除
type OpDeleteReq struct {
base.BaseRequest
Id int64 `json:"id"`
}
type OpDeleteData struct {
}
type OpDeleteResp struct {
base.BaseResponse
Data *OpDeleteData `json:"data"`
}
// op 更新
type OpUpdateReq struct {
base.BaseRequest
*dbstruct.GuildRegistration
}
type OpUpdateData struct {
}
type OpUpdateResp struct {
base.BaseResponse
Data *OpUpdateData `json:"data"`
}
// op 列表
type OpListReq struct {
base.BaseRequest
Mid *int64 `json:"mid"`
Status *int64 `json:"status"`
Offset int `json:"offset"`
Limit int `json:"limit"`
}
type OpListData struct {
List []*dbstruct.GuildRegistration `json:"list"`
Offset int `json:"offset"`
More int `json:"more"`
}
type OpListResp struct {
base.BaseResponse
Data *OpListData `json:"data"`
}
// op 审核
type OpApproveReq struct {
base.BaseRequest
Ids []int64 `json:"ids" bson:"ids"` // id列表
ApproveStatus *int64 `json:"approve_status" bson:"approve_status"` // 审核意见
Remarks string `json:"remarks" bson:"remarks"` // 备注
}
type OpApproveData struct {
}
type OpApproveResp struct {
base.BaseResponse
Data *OpApproveData `json:"data"`
}

View File

@ -0,0 +1,16 @@
package proto
import (
"service/library/validator"
)
// api 创建
func (p *OpApproveReq) ProvideNotNullValue() (params []*validator.JsonParam) {
params = make([]*validator.JsonParam, 0)
params = append(params, validator.NewInt64SliceParam("请填写待审核id列表", p.Ids))
params = append(params, validator.NewInt64PtrParam("请填写审核意见!", p.ApproveStatus))
params = append(params, validator.NewStringParam("请填写备注!", p.Remarks))
return
}

View File

@ -0,0 +1,18 @@
package proto
import (
"service/library/validator"
)
// api 创建
func (p *ApiCreateReq) ProvideNotNullValue() (params []*validator.JsonParam) {
params = make([]*validator.JsonParam, 0)
params = append(params, validator.NewStringPtrParam("请填写公会名称!", p.GuildName))
params = append(params, validator.NewStringPtrParam("请填写联络人!", p.ContactName))
params = append(params, validator.NewStringPtrParam("请填写联系方式!", p.ContactWay))
params = append(params, validator.NewInt64PtrParam("请填写达人数量!", p.StreamerNum))
params = append(params, validator.NewStringSliceParam("请填写合作过的平台!", p.CooperatedPlatform))
return
}

View File

@ -0,0 +1,49 @@
package controller
import (
"service/api/consts"
"service/api/errcode"
guild_registration_proto "service/api/proto/guild_registration/proto"
"service/app/mix/service"
"service/bizcommon/util"
"service/library/logger"
"github.com/gin-gonic/gin"
)
func ApiCreateGuildRegistration(ctx *gin.Context) {
req := ctx.MustGet("client_req").(*guild_registration_proto.ApiCreateReq)
ec := service.DefaultService.ApiCreateGuildRegistration(ctx, req)
if ec != errcode.ErrCodeGuildRegistrationSrvOk {
logger.Error("ApiCreateGuildRegistration fail, req: %v, ec: %v", util.ToJson(req), ec)
ReplyErrorMsg(ctx, "server error")
return
}
ReplyOk(ctx, nil)
}
func ApiGetGuildRegistrationList(ctx *gin.Context) {
req := ctx.MustGet("client_req").(*guild_registration_proto.ApiListReq)
//设置默认页长
if req.Limit == 0 {
req.Limit = consts.DefaultPageSize
}
list, ec := service.DefaultService.ApiGetGuildRegistrationList(ctx, req)
if ec != errcode.ErrCodeGuildRegistrationSrvOk {
logger.Error("ApiGetGuildRegistrationList fail, req: %v, ec: %v", util.ToJson(req), ec)
ReplyErrCodeMsg(ctx, ec)
return
}
data := &guild_registration_proto.ApiListData{
List: list,
Offset: req.Offset + len(list),
}
if len(list) >= req.Limit {
data.More = 1
}
ReplyOk(ctx, data)
}

View File

@ -0,0 +1,49 @@
package controller
import (
"service/api/consts"
"service/api/errcode"
guild_registration_proto "service/api/proto/guild_registration/proto"
"service/app/mix/service"
"service/bizcommon/util"
"service/library/logger"
"github.com/gin-gonic/gin"
)
func OpGetGuildRegistrationList(ctx *gin.Context) {
req := ctx.MustGet("client_req").(*guild_registration_proto.OpListReq)
//设置默认页长
if req.Limit == 0 {
req.Limit = consts.DefaultPageSize
}
list, ec := service.DefaultService.OpGetGuildRegistrationList(ctx, req)
if ec != errcode.ErrCodeGuildRegistrationSrvOk {
logger.Error("OpGetGuildRegistrationList fail, req: %v, ec: %v", util.ToJson(req), ec)
ReplyErrCodeMsg(ctx, ec)
return
}
data := &guild_registration_proto.OpListData{
List: list,
Offset: req.Offset + len(list),
}
if len(list) >= req.Limit {
data.More = 1
}
ReplyOk(ctx, data)
}
func OpApproveGuildRegistration(ctx *gin.Context) {
req := ctx.MustGet("client_req").(*guild_registration_proto.OpApproveReq)
ec := service.DefaultService.OpApproveGuildRegistration(ctx, req)
if ec != errcode.ErrCodeGuildRegistrationSrvOk {
logger.Error("OpApproveGuildRegistration fail, req: %v, ec: %v", util.ToJson(req), ec)
ReplyErrorMsg(ctx, "server error")
return
}
ReplyOk(ctx, nil)
}

View File

@ -35,6 +35,7 @@ import (
emailproto "service/api/proto/email/proto"
feedbackproto "service/api/proto/feedback/proto"
footprintproto "service/api/proto/footprint/proto"
guild_registration_proto "service/api/proto/guild_registration/proto"
hvyogoproto "service/api/proto/hvyogo/proto"
loginproto "service/api/proto/login/proto"
momentproto "service/api/proto/moment/proto"
@ -323,6 +324,11 @@ func Init(r *gin.Engine) {
apiAppGroup := r.Group("/api/app", PrepareToC())
apiAppGroup.POST("install_info", middleware.JSONParamValidator(base.BaseRequest{}), OpGetInstallInfo)
// 公会入驻表
apiGuildRegistrationGroup := r.Group("/api/guild_registration", PrepareToC())
apiGuildRegistrationGroup.POST("create", middleware.JSONParamValidator(guild_registration_proto.ApiCreateReq{}), middleware.JwtAuthenticator(), ApiCreateGuildRegistration)
apiGuildRegistrationGroup.POST("list", middleware.JSONParamValidator(guild_registration_proto.ApiListReq{}), middleware.JwtAuthenticator(), ApiGetGuildRegistrationList)
// =============================== 以下是服务,只允许内网调用 ===============================
// op相关直接调用服务不调用gateway
@ -646,6 +652,11 @@ func Init(r *gin.Engine) {
// opSingleDistributeHisGroup.POST("update", middleware.JSONParamValidator(single_distribute_hisproto.OpUpdateReq{}), middleware.JwtAuthenticator(), OpUpdateSingleDistributeHis)
// opSingleDistributeHisGroup.POST("delete", middleware.JSONParamValidator(single_distribute_hisproto.OpDeleteReq{}), middleware.JwtAuthenticator(), OpDeleteSingleDistributeHis)
// opSingleDistributeHisGroup.POST("list", middleware.JSONParamValidator(single_distribute_hisproto.OpListReq{}), middleware.JwtAuthenticator(), OpGetSingleDistributeHisList)
// 公会入驻表
opGuildRegistrationGroup := r.Group("/op/guild_registration", PrepareOp())
opGuildRegistrationGroup.POST("list", middleware.JSONParamValidator(guild_registration_proto.OpListReq{}), middleware.JwtAuthenticator(), OpGetGuildRegistrationList)
opGuildRegistrationGroup.POST("approve", middleware.JSONParamValidator(guild_registration_proto.OpApproveReq{}), middleware.JwtAuthenticator(), OpApproveGuildRegistration)
}
func ServeFile(ctx *gin.Context) {

View File

@ -32,7 +32,6 @@ import (
emailproto "service/api/proto/email/proto"
feedbackproto "service/api/proto/feedback/proto"
footprintproto "service/api/proto/footprint/proto"
frontend_route_proto "service/api/proto/frontend_route/proto"
imageaudittaskproto "service/api/proto/imageaudittask/proto"
loginproto "service/api/proto/login/proto"
momentproto "service/api/proto/moment/proto"
@ -246,6 +245,10 @@ const (
DBEmail = "email"
COLEmail = "email"
DBGuildRegistration = "guild_registration"
COLGuildRegistration = "guild_registration"
COLGuildRegistrationIdSeq = "guild_registration_id_seq"
DBNotification = "notification"
COLNotification = "notification"
COLNotifReceive = "notif_receive"
@ -255,13 +258,13 @@ const (
COLNotifReceiveIdSeq = "notif_receive_id_seq"
COLNotifReceivePull = "notif_receive_pull"
DBRavenIQTest = "Raven_IQ_test"
COLRavenIQTest = "Raven_IQ_test"
DBHistory = "history"
COLHistory = "history"
DBRavenIQTest = "Raven_IQ_test"
COLRavenIQTest = "Raven_IQ_test"
COLRavenIQTestVisit = "Raven_IQ_test_visit"
DBHistory = "history"
COLHistory = "history"
DBFrontendRoute = "frontend_route"
COLFrontendRoute = "frontend_route"
)
@ -655,6 +658,11 @@ func (m *Mongo) getColEmail() *qmgo.Collection {
return m.clientMix.Database(DBEmail).Collection(COLEmail)
}
// 公会入驻表
func (m *Mongo) getColGuildRegistration() *qmgo.Collection {
return m.clientMix.Database(DBGuildRegistration).Collection(COLGuildRegistration)
}
// 系统通知表
func (m *Mongo) getColNotification() *qmgo.Collection {
return m.clientMix.Database(DBNotification).Collection(COLNotification)
@ -6862,3 +6870,74 @@ func (m *Mongo) GetFrontendRouteById(ctx *gin.Context, id int64) (*dbstruct.Fron
}
return frontendroute, err
}
// 公会入驻表相关
func (m *Mongo) CreateGuildRegistration(ctx *gin.Context, guild_registration *dbstruct.GuildRegistration) error {
col := m.getColGuildRegistration()
_, err := col.InsertOne(ctx, guild_registration)
return err
}
func (m *Mongo) UpdateGuildRegistration(ctx *gin.Context, guild_registration *dbstruct.GuildRegistration) error {
col := m.getColGuildRegistration()
set := util.EntityToM(guild_registration)
set["ut"] = time.Now().Unix()
up := qmgo.M{
"$set": set,
}
err := col.UpdateId(ctx, guild_registration.Id, up)
return err
}
func (m *Mongo) DeleteGuildRegistration(ctx *gin.Context, id int64) error {
col := m.getColGuildRegistration()
update := qmgo.M{
"$set": qmgo.M{
"del_flag": 1,
},
}
err := col.UpdateId(ctx, id, update)
return err
}
func (m *Mongo) GetGuildRegistrationList(ctx *gin.Context, req *guild_registrationproto.OpListReq) ([]*dbstruct.GuildRegistration, error) {
list := make([]*dbstruct.GuildRegistration, 0)
col := m.getColGuildRegistration()
query := qmgo.M{
"del_flag": 0,
}
if req.Mid != nil {
query["mid"] = util.DerefInt64(req.Mid)
}
if req.Status != nil {
query["status"] = util.DerefInt64(req.Status)
}
err := col.Find(ctx, query).Sort("-ct").Skip(int64(req.Offset)).Limit(int64(req.Limit)).All(&list)
if err == qmgo.ErrNoSuchDocuments {
err = nil
return list, err
}
return list, err
}
func (m *Mongo) UpdateGuildRegistrationByIds(ctx *gin.Context, guild_registration *dbstruct.GuildRegistration, ids []int64) error {
col := m.getColGuildRegistration()
set := util.EntityToM(guild_registration)
set["ut"] = time.Now().Unix()
filter := qmgo.M{
"_id": qmgo.M{
"$in": ids,
},
}
up := qmgo.M{
"$set": set,
}
_, err := col.UpdateAll(ctx, filter, up)
return err
}

View File

@ -192,6 +192,11 @@ func (m *Mongo) getColNotifReceiveIdSeq() *qmgo.Collection {
return m.clientMix.Database(DBNotification).Collection(COLNotifReceiveIdSeq)
}
// GuildRegistrationIdSeq序列表
func (m *Mongo) getColGuildRegistrationIdSeq() *qmgo.Collection {
return m.clientMix.Database(DBGuildRegistration).Collection(COLGuildRegistrationIdSeq)
}
// account_id发号器
func (m *Mongo) GetAndUpdateAccountIdSeq(ctx *gin.Context) (accountIdSeq *dbstruct.AccountIdSeq, err error) {
col := m.getColAccountIdSeq()
@ -697,3 +702,22 @@ func (m *Mongo) GetAndUpdateNotifReceiveIdSeq(ctx *gin.Context) (notifReceiveIdS
return &notifReceiveIdSeqInstance, err
}
// guildRegistration_id发号器
func (m *Mongo) GetAndUpdateGuildRegistrationIdSeq(ctx *gin.Context) (guildRegistrationIdSeq *dbstruct.GuildRegistrationIdSeq, err error) {
col := m.getColGuildRegistrationIdSeq()
change := qmgo.Change{
Update: qmgo.M{"$inc": qmgo.M{"seq": 1}},
Upsert: true,
ReturnNew: false,
}
guildRegistrationIdSeqInstance := dbstruct.GuildRegistrationIdSeq{}
if err = col.Find(ctx, qmgo.M{"_id": "guild_registration_id_seq_id"}).Apply(change, &guildRegistrationIdSeqInstance); err != nil {
logger.Error("change error : %v", err)
return
}
return &guildRegistrationIdSeqInstance, err
}

View File

@ -18,6 +18,7 @@ import (
contact_customer_service_sessionproto "service/api/proto/contact_customer_service_session/proto"
emailproto "service/api/proto/email/proto"
feedbackproto "service/api/proto/feedback/proto"
guild_registration_proto "service/api/proto/guild_registration/proto"
hvyogoproto "service/api/proto/hvyogo/proto"
loginproto "service/api/proto/login/proto"
momentproto "service/api/proto/moment/proto"
@ -4705,3 +4706,36 @@ func (s *Service) ApiGetRavenIQTestVisitCount(ctx *gin.Context, req *Raven_IQ_te
}
return
}
// GuildRegistration
func (s *Service) ApiCreateGuildRegistration(ctx *gin.Context, req *guild_registration_proto.ApiCreateReq) (ec errcode.ErrCode) {
ec = errcode.ErrCodeGuildRegistrationSrvOk
req.GuildRegistration.Status = goproto.Int64(consts.GuildRegistration_Created) // 状态已创建
err := _DefaultGuildRegistration.OpCreate(ctx, &guild_registration_proto.OpCreateReq{
BaseRequest: req.BaseRequest,
GuildRegistration: req.GuildRegistration,
})
if err != nil {
logger.Error("OpCreate fail, req: %v, err: %v", util.ToJson(req), err)
ec = errcode.ErrCodeGuildRegistrationSrvFail
return
}
return
}
func (s *Service) ApiGetGuildRegistrationList(ctx *gin.Context, req *guild_registration_proto.ApiListReq) (list []*dbstruct.GuildRegistration, ec errcode.ErrCode) {
ec = errcode.ErrCodeGuildRegistrationSrvOk
list, err := _DefaultGuildRegistration.OpList(ctx, &guild_registration_proto.OpListReq{
Mid: goproto.Int64(req.BaseRequest.Mid),
})
if err != nil {
logger.Error("OpGetGuildRegistrationList fail, req: %v, err: %v", util.ToJson(req), err)
ec = errcode.ErrCodeGuildRegistrationSrvFail
return
}
return
}

View File

@ -0,0 +1,82 @@
package logic
import (
"service/api/consts"
guild_registrationproto "service/api/proto/guild_registration/proto"
"service/app/mix/dao"
"service/dbstruct"
"service/library/logger"
"time"
"github.com/gin-gonic/gin"
goproto "google.golang.org/protobuf/proto"
)
type GuildRegistration struct {
store *dao.Store
}
func NewGuildRegistration(store *dao.Store) (a *GuildRegistration) {
a = &GuildRegistration{
store: store,
}
return
}
func (p *GuildRegistration) OpCreate(ctx *gin.Context, req *guild_registrationproto.OpCreateReq) error {
//生成自增id
seqId, err := p.store.GetAndUpdateGuildRegistrationIdSeq(ctx)
if err != nil {
logger.Error("GetAndUpdateGuildRegistrationIdSeq fail, err: %v", err)
return err
}
req.GuildRegistration.Id = goproto.Int64(seqId.Seq)
req.GuildRegistration.Ct = goproto.Int64(time.Now().Unix())
req.GuildRegistration.Ut = goproto.Int64(time.Now().Unix())
req.GuildRegistration.DelFlag = goproto.Int64(consts.Exist)
err = p.store.CreateGuildRegistration(ctx, req.GuildRegistration)
if err != nil {
logger.Error("CreateGuildRegistration fail, err: %v", err)
return err
}
return nil
}
func (p *GuildRegistration) OpUpdate(ctx *gin.Context, req *guild_registrationproto.OpUpdateReq) error {
err := p.store.UpdateGuildRegistration(ctx, req.GuildRegistration)
if err != nil {
logger.Error("UpdateGuildRegistration fail, err: %v", err)
return err
}
return nil
}
func (p *GuildRegistration) OpDelete(ctx *gin.Context, id int64) error {
err := p.store.DeleteGuildRegistration(ctx, id)
if err != nil {
logger.Error("DeleteGuildRegistration fail, err: %v", err)
return err
}
return nil
}
func (p *GuildRegistration) OpList(ctx *gin.Context, req *guild_registrationproto.OpListReq) ([]*dbstruct.GuildRegistration, error) {
list, err := p.store.GetGuildRegistrationList(ctx, req)
if err != nil {
logger.Error("GetGuildRegistrationList fail, err: %v", err)
return make([]*dbstruct.GuildRegistration, 0), err
}
return list, nil
}
func (p *GuildRegistration) OpUpdateByIds(ctx *gin.Context, req *guild_registrationproto.OpUpdateReq, ids []int64) error {
err := p.store.UpdateGuildRegistrationByIds(ctx, req.GuildRegistration, ids)
if err != nil {
logger.Error("UpdateGuildRegistration fail, err: %v", err)
return err
}
return nil
}

View File

@ -25,6 +25,7 @@ import (
feedbackproto "service/api/proto/feedback/proto"
footprintproto "service/api/proto/footprint/proto"
frontend_route_proto "service/api/proto/frontend_route/proto"
guild_registration_proto "service/api/proto/guild_registration/proto"
hvyogoproto "service/api/proto/hvyogo/proto"
imageaudittaskproto "service/api/proto/imageaudittask/proto"
loginproto "service/api/proto/login/proto"
@ -154,6 +155,7 @@ var (
_DefaultSingleDistributeHis *logic.SingleDistributeHis
_DefaultEmail *logic.Email
_DefaultNotification *logic.Notification
_DefaultGuildRegistration *logic.GuildRegistration
_DefaultRavenIQTest *logic.RavenIQTest
_DefaultAutoResponseCreateTimes *logic.AutoResponseCreateTimes
_DefaultHistory *logic.History
@ -268,6 +270,7 @@ func (s *Service) Init(c any) (err error) {
_DefaultAutoResponseCreateTimes = logic.NewAutoResponseCreateTimes(store)
_DefaultEmail = logic.NewEmail(store)
_DefaultNotification = logic.NewNotification(store)
_DefaultGuildRegistration = logic.NewGuildRegistration(store)
_DefaultRavenIQTest = logic.NewRavenIQTest(store)
_DefaultRavenIQTestVisit = logic.NewRavenIQTestVisit(store)
_DefaultHistory = logic.NewHistory(store)
@ -5363,3 +5366,48 @@ func (s *Service) OpGetFrontendRouteList(ctx *gin.Context, req *frontend_route_p
}
return
}
func (s *Service) OpGetGuildRegistrationList(ctx *gin.Context, req *guild_registration_proto.OpListReq) (list []*dbstruct.GuildRegistration, ec errcode.ErrCode) {
ec = errcode.ErrCodeGuildRegistrationSrvOk
list, err := _DefaultGuildRegistration.OpList(ctx, req)
if err != nil {
logger.Error("OpGetGuildRegistrationList fail, req: %v, err: %v", util.ToJson(req), err)
ec = errcode.ErrCodeGuildRegistrationSrvFail
return
}
return
}
func (s *Service) OpApproveGuildRegistration(ctx *gin.Context, req *guild_registration_proto.OpApproveReq) (ec errcode.ErrCode) {
ec = errcode.ErrCodeGuildRegistrationSrvOk
status := int64(0)
approveStatus := util.DerefInt64(req.ApproveStatus)
if approveStatus == consts.GuildRegistrationApprove_Pass {
status = consts.GuildRegistration_Handled
} else {
status = consts.GuildRegistration_Rejected
}
updateReq := &guild_registration_proto.OpUpdateReq{
BaseRequest: req.BaseRequest,
GuildRegistration: &dbstruct.GuildRegistration{
Status: goproto.Int64(status),
Remarks: goproto.String(req.Remarks),
},
}
err := _DefaultGuildRegistration.OpUpdateByIds(ctx, updateReq, req.Ids)
if err == qmgo.ErrNoSuchDocuments {
ec = errcode.ErrCodeGuildRegistrationNotExist
err = nil
return
}
if err != nil {
logger.Error("OpUpdate fail, req: %v, err: %v", util.ToJson(req), err)
ec = errcode.ErrCodeGuildRegistrationSrvFail
return
}
return
}

View File

@ -9,10 +9,10 @@ import (
func main() {
genSource := &generator.GenSource{
EntityName: "FrontendRoute",
ModuleName: "frontend_route",
EntityCNName: "前端页面路由表",
ErrCodeSeq: "47",
EntityName: "GuildRegistration",
ModuleName: "guild_registration",
EntityCNName: "公会入驻表",
ErrCodeSeq: "48",
}
generator.CreateFileDirectory(genSource)

View File

@ -0,0 +1,18 @@
package dbstruct
type GuildRegistration struct {
Id *int64 `json:"id" bson:"_id"` // 公会入驻表id
Mid *int64 `json:"mid" bson:"mid"` // 关联用户mid
GuildName *string `json:"guild_name" bson:"guild_name"` // 公会名称
ContactName *string `json:"contact_name" bson:"contact_name"` // 联络人
ContactWay *string `json:"contact_way" bson:"contact_way"` // 联系方式
StreamerNum *int64 `json:"streamer_num" bson:"streamer_num"` // 达人数量
CooperatedPlatform []string `json:"cooperated_platform" bson:"cooperated_platform"` // 合作过的平台
AccountShot *MediaComponent `json:"account_shot" bson:"account_shot"` // 相关账号截图
Status *int64 `json:"status" bson:"status"` // 审核状态
Remarks *string `json:"remarks" bson:"remarks"` // 审核备注
Ct *int64 `json:"ct" bson:"ct"` // 创建时间
Ut *int64 `json:"ut" bson:"ut"` // 更新时间
DelFlag *int64 `json:"del_flag" bson:"del_flag"` // 删除标记
}

View File

@ -100,3 +100,7 @@ type NotificationIdSeq struct {
type NotifReceiveIdSeq struct {
Seq int64 //用户Id序列号
}
type GuildRegistrationIdSeq struct {
Seq int64 //Id序列号
}

View File

@ -61,6 +61,7 @@ const (
NodeRavenIQTestVisit // node 瑞文智商测试访问表
NodeNotifBcst // node 系统通知广播表
NodeNotifReceivePull // node 系统通知接收拉取表
NodeGuildRegistration // node 公会入驻表
)
func GenIdInt64(node int64) (int64, error) {
@ -308,3 +309,9 @@ func GenNotifReceivePullId() int64 {
id, _ := GenIdInt64(NodeNotifReceivePull)
return id
}
// guild_registration
func GenGuildRegistrationId() int64 {
id, _ := GenIdInt64(NodeGuildRegistration)
return id
}