feat-IRONFANS-160-Robin #586
|
@ -71,8 +71,9 @@ var ErrCodeMsgMap = map[ErrCode]string{
|
||||||
ErrCodeVasAlipayUniTransferFail: "支付宝提现失败",
|
ErrCodeVasAlipayUniTransferFail: "支付宝提现失败",
|
||||||
ErrCodeVasOverTodayWithdrawCnt: "今日提现次数到达上限",
|
ErrCodeVasOverTodayWithdrawCnt: "今日提现次数到达上限",
|
||||||
|
|
||||||
ErrCodeMomentSrvFail: "动态服务错误",
|
ErrCodeMomentSrvFail: "动态服务错误",
|
||||||
ErrCodeMomentNotExist: "动态不存在",
|
ErrCodeMomentNotExist: "动态不存在",
|
||||||
|
ErrCodeMomentNotAStreamer: "当前账号无发帖权限",
|
||||||
// ErrCodeMomentBlockedFromCreatingMoment: "功能封禁中,截止时间:%s",
|
// ErrCodeMomentBlockedFromCreatingMoment: "功能封禁中,截止时间:%s",
|
||||||
// ErrCodeMomentBlockedFromCreatingMomentPermanently: "该功能已被永久封禁",
|
// ErrCodeMomentBlockedFromCreatingMomentPermanently: "该功能已被永久封禁",
|
||||||
|
|
||||||
|
@ -314,9 +315,10 @@ const (
|
||||||
ErrCodeVasOverRefundLimit ErrCode = -7023 // 退款次数达上限
|
ErrCodeVasOverRefundLimit ErrCode = -7023 // 退款次数达上限
|
||||||
|
|
||||||
// Moment: 8xxx
|
// Moment: 8xxx
|
||||||
ErrCodeMomentSrvOk ErrCode = ErrCodeOk
|
ErrCodeMomentSrvOk ErrCode = ErrCodeOk
|
||||||
ErrCodeMomentSrvFail ErrCode = -8001 // 动态服务错误
|
ErrCodeMomentSrvFail ErrCode = -8001 // 动态服务错误
|
||||||
ErrCodeMomentNotExist ErrCode = -8002 // 动态不存在
|
ErrCodeMomentNotExist ErrCode = -8002 // 动态不存在
|
||||||
|
ErrCodeMomentNotAStreamer ErrCode = -8003 // 普通用户禁止发帖
|
||||||
// ErrCodeMomentBlockedFromCreatingMoment ErrCode = -8003 // 动态创建已被封禁
|
// ErrCodeMomentBlockedFromCreatingMoment ErrCode = -8003 // 动态创建已被封禁
|
||||||
// ErrCodeMomentBlockedFromCreatingMomentPermanently ErrCode = -8004 // 动态创建已被永久封禁
|
// ErrCodeMomentBlockedFromCreatingMomentPermanently ErrCode = -8004 // 动态创建已被永久封禁
|
||||||
|
|
||||||
|
|
|
@ -1695,6 +1695,10 @@ func (s *Service) ApiCreateMoment(ctx *gin.Context, req *momentproto.ApiCreateRe
|
||||||
req.Moment.Mid = goproto.Int64(req.BaseRequest.Mid)
|
req.Moment.Mid = goproto.Int64(req.BaseRequest.Mid)
|
||||||
var accountpunishment *dbstruct.AccountPunishment
|
var accountpunishment *dbstruct.AccountPunishment
|
||||||
if ec, accountpunishment = s.ApiCreateMomentBusinessValidate(ctx, req); ec != errcode.ErrCodeMomentSrvOk {
|
if ec, accountpunishment = s.ApiCreateMomentBusinessValidate(ctx, req); ec != errcode.ErrCodeMomentSrvOk {
|
||||||
|
if ec == errcode.ErrCodeRolePrivilegesNotEnough {
|
||||||
|
ec = errcode.ErrCodeMomentNotAStreamer
|
||||||
|
return
|
||||||
|
}
|
||||||
if ec == errcode.ErrCodeAccountPunishmentExist {
|
if ec == errcode.ErrCodeAccountPunishmentExist {
|
||||||
if accountpunishment.IsPermanent() {
|
if accountpunishment.IsPermanent() {
|
||||||
ec = errcode.ErrCodeFunctionBlockedPermanently
|
ec = errcode.ErrCodeFunctionBlockedPermanently
|
||||||
|
|
|
@ -536,6 +536,9 @@ func (s *Service) ApiCreateMomentBusinessValidate(ctx *gin.Context, req *momentp
|
||||||
ec = errcode.ErrCodeMomentSrvOk
|
ec = errcode.ErrCodeMomentSrvOk
|
||||||
|
|
||||||
resultList := businessvalidator.NewAuthBusinessValidator(ctx, req).
|
resultList := businessvalidator.NewAuthBusinessValidator(ctx, req).
|
||||||
|
QueryAccount(_DefaultAccount.OpListByMid).
|
||||||
|
EnsureAccountExist().
|
||||||
|
EnsureIsThisRole(consts.Streamer).
|
||||||
EnsureMediaIsSuccessfullyUploaded(req.Moment.MediaComp).
|
EnsureMediaIsSuccessfullyUploaded(req.Moment.MediaComp).
|
||||||
EnsureSuchAccountPunishmentNotExist(req.GetBaseRequest().Mid, consts.AccountPunishment_BlockFromCreatingMoment, _DefaultAccountPunishment.OpListByMidAndType).
|
EnsureSuchAccountPunishmentNotExist(req.GetBaseRequest().Mid, consts.AccountPunishment_BlockFromCreatingMoment, _DefaultAccountPunishment.OpListByMidAndType).
|
||||||
QueryMomentCreateTimes(_DefaultMomentCreateTimes.OpGetAndUpdate, req.GetBaseRequest().Mid).
|
QueryMomentCreateTimes(_DefaultMomentCreateTimes.OpGetAndUpdate, req.GetBaseRequest().Mid).
|
||||||
|
@ -556,6 +559,9 @@ func (s *Service) ApiUpdateMomentBusinessValidate(ctx *gin.Context, req *momentp
|
||||||
ec = errcode.ErrCodeMomentSrvOk
|
ec = errcode.ErrCodeMomentSrvOk
|
||||||
|
|
||||||
resultList := businessvalidator.NewAuthBusinessValidator(ctx, req).
|
resultList := businessvalidator.NewAuthBusinessValidator(ctx, req).
|
||||||
|
QueryAccount(_DefaultAccount.OpListByMid).
|
||||||
|
EnsureAccountExist().
|
||||||
|
EnsureIsThisRole(consts.Streamer).
|
||||||
EnsureMediaIsSuccessfullyUploaded(req.Moment.MediaComp).
|
EnsureMediaIsSuccessfullyUploaded(req.Moment.MediaComp).
|
||||||
Validate().
|
Validate().
|
||||||
Collect()
|
Collect()
|
||||||
|
|
Loading…
Reference in New Issue