body

package
v0.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoginBody

type LoginBody struct {
	Account  string `json:"account"`
	Password string `json:"password"`
}

LoginBody - User login structure

type RegisterBody

type RegisterBody struct {
	Account     string     `json:"account" bson:"account" binding:"required"`
	Password    string     `json:"password"  bson:"-" binding:"required,gte=6"`
	Displayname string     `json:"displayname"  bson:"displayname" binding:"required"`
	CryptPass   []byte     `json:"-" bson:"cryptpass,omitempty"`
	CreatedAt   *time.Time `json:"created_at,omitempty" bson:"created_at,omitempty"`
}

RegisterBody ... 注册信息

func (*RegisterBody) GetAccount

func (r *RegisterBody) GetAccount() string

GetAccount - implement domain.RegisterBody

func (*RegisterBody) GetPassword

func (r *RegisterBody) GetPassword() string

GetPassword - implement domain.RegisterBody

func (*RegisterBody) SetCreatedTime

func (r *RegisterBody) SetCreatedTime(t *time.Time)

SetCreatedTime - implement domain.RegisterBody

func (*RegisterBody) SetCryptPass

func (r *RegisterBody) SetCryptPass() error

SetCryptPass - implement domain.RegisterBody

type UserBody

type UserBody struct {
	ID converter.StrToObjectID `bson:"_id,omitempty" json:"id,omitempty"` // 用户ID
	// RegisterBody
	Account     string     `json:"account" bson:"account" binding:"required"`
	Displayname string     `json:"displayname"  bson:"displayname" binding:"required"`
	CryptPass   []byte     `json:"-" bson:"cryptpass,omitempty"`
	CreatedAt   *time.Time `json:"created_at,omitempty" bson:"created_at,omitempty"`
	UpdatedAt   *time.Time `bson:"updated_at,omitempty" json:"updated_at,omitempty"` // 更新时间
}

UserBody - Contain Register Body

func (*UserBody) GetCryptPass

func (u *UserBody) GetCryptPass() []byte

GetCryptPass - implement domain.User

func (*UserBody) GetDisplayName

func (u *UserBody) GetDisplayName() string

GetDisplayName - implement domain.User

func (*UserBody) GetUserID

func (u *UserBody) GetUserID() string

GetUserID - implement domain.User

func (*UserBody) SetUpdatedTime

func (u *UserBody) SetUpdatedTime(t *time.Time)

SetUpdatedTime - implement domain.User

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL