dto

package
v0.0.0-...-db40093 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UppercaseString

type UppercaseString string

func (*UppercaseString) Scan

func (us *UppercaseString) Scan(src interface{}) error

func (UppercaseString) Value

func (us UppercaseString) Value() (driver.Value, error)

type User

type User struct {
	ID        int             `json:"id" example:"1"`
	Email     string          `json:"email" example:"example@example.com"`
	Name      UppercaseString `json:"name" example:"muchlis"`
	Password  string          `json:"-"`
	Roles     []string        `json:"roles" example:"ADMIN,NORMAL"`
	CreatedAt int64           `json:"created_at" example:"1631341964"`
	UpdatedAt int64           `json:"updated_at" example:"1631341964"`
}

func (*User) Prepare

func (u *User) Prepare()

type UserEditRequest

type UserEditRequest struct {
	Email string   `json:"email" example:"example@example.com"`
	Name  string   `json:"name" example:"muchlis"`
	Roles []string `json:"roles" example:"ADMIN,NORMAL"`
}

func (UserEditRequest) Validate

func (u UserEditRequest) Validate() error

type UserLoginRequest

type UserLoginRequest struct {
	UserID   int    `json:"user_id"`
	Password string `json:"password"`
}

UserLoginResponse balikan user ketika sukses login dengan tambahan AccessToken

type UserLoginResponse

type UserLoginResponse struct {
	ID           int      `json:"id" example:"1"`
	Email        string   `json:"email" example:"example@example.com"`
	Name         string   `json:"name" example:"muchlis"`
	Roles        []string `json:"roles" example:"ADMIN,NORMAL,BASIC"`
	AccessToken  string   `json:"access_token" example:"eyJhbGciOiJIUzI1N.ywibmFtZSI6IkR5cGUiOjB9.aFjz4esDQ4-_K3dMUmo"`
	RefreshToken string   `json:"refresh_token" example:"eyJhbGciOiJIUzI1N.ywibmFtZSI6IkR5cGUiOjB9.aFjz4esDQ4-_K3dMUmo"`
	Expired      int64    `json:"expired" example:"1631341964"`
}

UserLoginResponse balikan user ketika sukses login dengan tambahan AccessToken

type UserRefreshTokenRequest

type UserRefreshTokenRequest struct {
	RefreshToken string `json:"refresh_token" example:"eyJhbGciOiJIUzI1N.ywibmFtZSI6IkR5cGUiOjB9.aFjz4esDQ4-_K3dMUmo"`
}

type UserRefreshTokenResponse

type UserRefreshTokenResponse struct {
	AccessToken string `json:"access_token" example:"eyJhbGciOiJIUzI1N.ywibmFtZSI6IkR5cGUiOjB9.aFjz4esDQ4-_K3dMUmo"`
	Expired     int64  `json:"expired" example:"1631341964"`
}

UserRefreshTokenResponse mengembalikan token dengan claims yang sama dengan token sebelumnya dengan expired yang baru

type UserRegisterReq

type UserRegisterReq struct {
	ID       int      `json:"id" example:"1"`
	Email    string   `json:"email" example:"example@example.com"`
	Name     string   `json:"name" example:"muchlis"`
	Password string   `json:"password" example:"password123"`
	Roles    []string `json:"roles" example:"ADMIN,NORMAL,BASIC"`
}

func (UserRegisterReq) Validate

func (u UserRegisterReq) Validate() error

Jump to

Keyboard shortcuts

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