refresh_token.go 576 字节
package command

import (
	"fmt"

	"github.com/beego/beego/v2/core/validation"
)

type RefreshTokenCommand struct {
	RefreshToken string `json:"refreshToken" valid:"Required"`
}

func (orgAddCommand *RefreshTokenCommand) Valid(validation *validation.Validation) {

}

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