refresh_token.go
604 字节
package command
import (
"fmt"
"github.com/beego/beego/v2/core/validation"
)
type RefreshTokenCommand struct {
// refreshToken
RefreshToken string `json:"refreshToken,omitempty"`
}
func (refreshTokenCommand *RefreshTokenCommand) Valid(validation *validation.Validation) {
}
func (refreshTokenCommand *RefreshTokenCommand) ValidateCommand() error {
valid := validation.Validation{}
b, err := valid.Valid(refreshTokenCommand)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}