read_sent_notification.go 561 字节
package command

import (
	"fmt"

	"github.com/astaxie/beego/validation"
)

type ReadSentNotificationCommand struct {
	// 发送出的通知ID
	SentNotificationId int64 `json:"sentNotificationId" valid:"Required"`
}

func (readSentNotificationCommand *ReadSentNotificationCommand) ValidateCommand() error {
	valid := validation.Validation{}
	b, err := valid.Valid(readSentNotificationCommand)
	if err != nil {
		return err
	}
	if !b {
		for _, validErr := range valid.Errors {
			return fmt.Errorf("%s  %s", validErr.Key, validErr.Message)
		}
	}
	return nil
}