87 lines
3.4 KiB
Go
87 lines
3.4 KiB
Go
package proto
|
||
|
||
import (
|
||
"service/api/consts"
|
||
"service/bizcommon/util"
|
||
"service/library/validator"
|
||
)
|
||
|
||
func (p *OpCreateReq) ProvideNotNullValue() (params []*validator.JsonParam) {
|
||
params = make([]*validator.JsonParam, 0)
|
||
|
||
params = append(params, validator.NewInt64PtrParam("请确认创建动态的所属空间id!", p.ZoneMoment.Zid))
|
||
params = append(params, validator.NewInt64PtrParam("请确认创建动态的可见范围!", p.ZoneMoment.CType))
|
||
params = append(params, validator.NewInt64PtrParam("请确认创建动态的媒体类型!", p.ZoneMoment.MType))
|
||
params = append(params, validator.NewStringPtrParam("请确认创建动态的文案!", p.Text))
|
||
params = append(params, validator.NewStructPtrParam("请确认创建动态的媒体!", p.MediaComp))
|
||
|
||
switch util.DerefInt64(p.ZoneMoment.CType) {
|
||
case consts.ZoneMomentCType_Paid:
|
||
params = append(params, validator.NewInt64PtrParam("请确认创建动态的文字可见范围!", p.ZoneMoment.TextVisibleRange))
|
||
params = append(params, validator.NewInt64PtrParam("请确认创建动态的价格!", p.ZoneMoment.Price))
|
||
switch util.DerefInt64(p.ZoneMoment.MType) {
|
||
case consts.MediaTypeImg:
|
||
params = append(params, validator.NewInt64PtrParam("请确认创建动态的媒体可见范围!", p.ZoneMoment.MediaVisibleRange))
|
||
case consts.MediaTypeVideo:
|
||
params = append(params, validator.NewInt64PtrParam("请确认创建动态是否要模糊封面!", p.ZoneMoment.IsBlurringCover))
|
||
}
|
||
|
||
}
|
||
|
||
return
|
||
}
|
||
|
||
func (p *OpUpdateReq) ProvideNotNullValue() (params []*validator.JsonParam) {
|
||
params = make([]*validator.JsonParam, 0)
|
||
|
||
params = append(params, validator.NewInt64PtrParam("请确认创建动态的可见范围!", p.ZoneMoment.CType))
|
||
params = append(params, validator.NewInt64PtrParam("请确认创建动态的媒体类型!", p.ZoneMoment.MType))
|
||
|
||
switch util.DerefInt64(p.ZoneMoment.CType) {
|
||
case consts.ZoneMomentCType_Paid:
|
||
if p.Text != nil {
|
||
params = append(params, validator.NewStringPtrParam("请确认创建动态的文案!", p.Text))
|
||
}
|
||
if p.MediaComp != nil {
|
||
params = append(params, validator.NewStructPtrParam("请确认创建动态的媒体!", p.MediaComp))
|
||
}
|
||
}
|
||
return
|
||
}
|
||
|
||
func (p *OpDeleteReq) ProvideNotNullValue() (params []*validator.JsonParam) {
|
||
params = make([]*validator.JsonParam, 0)
|
||
|
||
params = append(params, validator.NewInt64PtrParam("请确认待删除动态的id!", p.Id))
|
||
|
||
return
|
||
}
|
||
|
||
func (p *OpReviewReq) ProvideNotNullValue() (params []*validator.JsonParam) {
|
||
params = make([]*validator.JsonParam, 0)
|
||
|
||
params = append(params, validator.NewInt64SliceParam("请确认待审批动态的ids!", p.ZoneMomentIds))
|
||
if p.OpType == consts.ZoneMomentManuallyReview_Reject {
|
||
params = append(params, validator.NewStringParam("请确认人工审批意见!", p.ManuallyReviewOpinion))
|
||
}
|
||
|
||
return
|
||
}
|
||
|
||
func (p *OpHeadReq) ProvideNotNullValue() (params []*validator.JsonParam) {
|
||
params = make([]*validator.JsonParam, 0)
|
||
|
||
params = append(params, validator.NewInt64SliceParam("请确认待审批动态的ids!", p.ZoneMomentIds))
|
||
|
||
return
|
||
}
|
||
|
||
func (p *OpSetPrivateReq) ProvideNotNullValue() (params []*validator.JsonParam) {
|
||
params = make([]*validator.JsonParam, 0)
|
||
|
||
params = append(params, validator.NewInt64PtrParam("请确认待审批动态的id!", p.ZoneMomentId))
|
||
params = append(params, validator.NewStringParam("请确认人工审批意见!", p.ManuallyReviewOpinion))
|
||
|
||
return
|
||
}
|