Merge pull request 'by Robin at 20240507' (#408) from feat-IRONFANS-113-Robin into test

Reviewed-on: http://121.41.31.146:3000/wishpal_ironfan/service/pulls/408
This commit is contained in:
chenhao 2024-05-07 22:43:43 +08:00
commit 6ffc4ad2b2
1 changed files with 0 additions and 27 deletions

View File

@ -31,7 +31,6 @@ import (
zonemomentthumbsupproto "service/api/proto/zonemomentthumbsup/proto" zonemomentthumbsupproto "service/api/proto/zonemomentthumbsup/proto"
zonesessionproto "service/api/proto/zonesession/proto" zonesessionproto "service/api/proto/zonesession/proto"
"service/apollostruct" "service/apollostruct"
businessvalidator "service/app/mix/service/business_validator"
"service/bizcommon/common" "service/bizcommon/common"
"service/bizcommon/util" "service/bizcommon/util"
"service/dbstruct" "service/dbstruct"
@ -1589,19 +1588,6 @@ func (s *Service) ApiCreateRealNameAuthentication(ctx *gin.Context, req *realnam
ec = errcode.ErrCodeRealNameAuthenticationSrvOk ec = errcode.ErrCodeRealNameAuthenticationSrvOk
// 1.业务校验,鉴权
result := businessvalidator.NewAuthBusinessValidator(ctx, req).
EnsureIsOperatingHisOwn(util.DerefInt64(req.RealNameAuthentication.Mid)).
QueryAccount(_DefaultAccount.OpListByMid).
EnsureAccountExist().
EnsureIsThisRole(consts.Streamer).
Validate().
Collect()
if ec = result[0].(errcode.ErrCode); ec != errcode.ErrCodeOk {
logger.Error("ApiCreateRealNameAuthentication business validation failed")
return
}
err := _DefaultRealNameAuthentication.OpCreate(ctx, &realname_authenticationproto.OpCreateReq{ err := _DefaultRealNameAuthentication.OpCreate(ctx, &realname_authenticationproto.OpCreateReq{
RealNameAuthentication: req.RealNameAuthentication, RealNameAuthentication: req.RealNameAuthentication,
}) })
@ -1621,19 +1607,6 @@ func (s *Service) ApiCreateRealNameAuthentication(ctx *gin.Context, req *realnam
func (s *Service) ApiGetRealNameAuthenticationListByMid(ctx *gin.Context, req *realname_authenticationproto.ApiListReq) (vo *realname_authenticationproto.RealNameAuthenticationApiVO, ec errcode.ErrCode) { func (s *Service) ApiGetRealNameAuthenticationListByMid(ctx *gin.Context, req *realname_authenticationproto.ApiListReq) (vo *realname_authenticationproto.RealNameAuthenticationApiVO, ec errcode.ErrCode) {
ec = errcode.ErrCodeRealNameAuthenticationSrvOk ec = errcode.ErrCodeRealNameAuthenticationSrvOk
// 1.业务校验,鉴权
result := businessvalidator.NewAuthBusinessValidator(ctx, req).
EnsureIsOperatingHisOwn(util.DerefInt64(req.Mid)).
QueryAccount(_DefaultAccount.OpListByMid).
EnsureAccountExist().
EnsureIsThisRole(consts.Streamer).
Validate().
Collect()
if ec = result[0].(errcode.ErrCode); ec != errcode.ErrCodeOk {
logger.Error("OpCreateRealNameAuthentication business validation failed")
return
}
realname_authentication, err := _DefaultRealNameAuthentication.OpListByMid(ctx, &realname_authenticationproto.OpListByMidReq{ realname_authentication, err := _DefaultRealNameAuthentication.OpListByMid(ctx, &realname_authenticationproto.OpListByMidReq{
Mid: req.Mid, Mid: req.Mid,
}) })