diff --git a/api/errcode/errcode.go b/api/errcode/errcode.go index 5a000a02..97257471 100644 --- a/api/errcode/errcode.go +++ b/api/errcode/errcode.go @@ -67,9 +67,10 @@ var ErrCodeMsgMap = map[ErrCode]string{ ErrCodeVasAlipayUniTransferFail: "支付宝提现失败", ErrCodeVasOverTodayWithdrawCnt: "今日提现次数到达上限", - ErrCodeMomentSrvFail: "动态服务错误", - ErrCodeMomentNotExist: "动态不存在", - ErrCodMomentBlockedFromCreatingMoment: "该用户的动态创建功能已被封禁至%v", + ErrCodeMomentSrvFail: "动态服务错误", + ErrCodeMomentNotExist: "动态不存在", + ErrCodMomentBlockedFromCreatingMoment: "功能封禁中,截止时间:%v", + ErrCodMomentBlockedFromCreatingMomentPermanently: "该功能已被永久封禁", ErrCodeFootPrintSrvFail: "足迹服务错误", ErrCodeFootPrintNotExist: "足迹不存在", @@ -255,10 +256,11 @@ const ( ErrCodeVasOverTodayWithdrawCnt ErrCode = -7022 // 今天提现次数到达上限 // Moment: 8xxx - ErrCodeMomentSrvOk ErrCode = ErrCodeOk - ErrCodeMomentSrvFail ErrCode = -8001 // 动态服务错误 - ErrCodeMomentNotExist ErrCode = -8002 // 动态不存在 - ErrCodMomentBlockedFromCreatingMoment ErrCode = -8003 // 动态创建已被封禁 + ErrCodeMomentSrvOk ErrCode = ErrCodeOk + ErrCodeMomentSrvFail ErrCode = -8001 // 动态服务错误 + ErrCodeMomentNotExist ErrCode = -8002 // 动态不存在 + ErrCodMomentBlockedFromCreatingMoment ErrCode = -8003 // 动态创建已被封禁 + ErrCodMomentBlockedFromCreatingMomentPermanently ErrCode = -8004 // 动态创建已被永久封禁 // FootPrint: 9xxx ErrCodeFootPrintSrvOk ErrCode = ErrCodeOk diff --git a/app/mix/service/apiservice.go b/app/mix/service/apiservice.go index 5513d87b..00ed5fa5 100644 --- a/app/mix/service/apiservice.go +++ b/app/mix/service/apiservice.go @@ -1687,9 +1687,15 @@ func (s *Service) ApiCreateMoment(ctx *gin.Context, req *momentproto.ApiCreateRe var accountpunishment *dbstruct.AccountPunishment if ec, accountpunishment = s.ApiCreateMomentBusinessValidate(ctx, req); ec != errcode.ErrCodeMomentSrvOk { if ec == errcode.ErrCodeAccountPunishmentExist { - ec = errcode.ErrCodMomentBlockedFromCreatingMoment - acctPunEndTime = accountpunishment.GetEndTimeFormatString() - return + if accountpunishment.IsPermanent() { + ec = errcode.ErrCodMomentBlockedFromCreatingMomentPermanently + return + } else { + ec = errcode.ErrCodMomentBlockedFromCreatingMoment + acctPunEndTime = accountpunishment.GetEndTimeFormatString() + return + } + } return } diff --git a/dbstruct/accountpunishment.go b/dbstruct/accountpunishment.go index d00030e6..03e15930 100644 --- a/dbstruct/accountpunishment.go +++ b/dbstruct/accountpunishment.go @@ -5,6 +5,8 @@ import ( "time" ) +const PermanentDuration int64 = 3155760000 + type AccountPunishment struct { Id *int64 `json:"id" bson:"_id"` // 账号处罚表id Mid *int64 `json:"mid" bson:"mid"` // 用户表id @@ -23,3 +25,10 @@ func (p *AccountPunishment) GetEndTimeFormatString() string { } return time.Unix(util.DerefInt64(p.EndTime), 0).Local().Format("2006年1月2日 15时04分05秒") } + +func (p *AccountPunishment) IsPermanent() bool { + if p == nil || p.Duration == nil { + return false + } + return util.DerefInt64(p.Duration) == PermanentDuration +}