dto

package
v0.0.0-...-aec1c34 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicQueryParam

type BasicQueryParam struct {
	Paginator struct {
		Page     int
		PageSize int
	}
	Filter struct {
		OrederBy []string
	}
}

BasicQueryParam should be used to param basic pagination and orderby queryparams

func NewBasicQueryParam

func NewBasicQueryParam() *BasicQueryParam

type CreateAccountRequest

type CreateAccountRequest struct {
	Name     string `json:"name,omitempty"`
	Email    string `json:"email,omitempty"`
	Password string `json:"password,omitempty"`
	Role     string `json:"role,omitempty"`
}

type CreateAccountResponse

type CreateAccountResponse struct {
	UserID uint  `json:"user_id,omitempty"`
	Err    error `json:"error,omitempty"`
}

func (CreateAccountResponse) Failed

func (resp CreateAccountResponse) Failed() error

type CustomClaim

type CustomClaim struct {
	*stdjwt.StandardClaims
	AccntID uint   `json:"accnt_id"`
	Email   string `json:"email"`
	Role    string `json:"role"`
}

CustomClaim defines the claim to be used in JWT

type GetAccountResponse

type GetAccountResponse struct {
	ID           uint   `json:"account_id"`
	Name         string `json:"name"`
	Email        string `json:"email"`
	Role         string `json:"role"`
	TotalRecords int    `json:"-"`
}

type ListAccountResponse

type ListAccountResponse struct {
	Accounts []GetAccountResponse `json:"accounts,omitempty"`
	PageInfo *Page                `json:"page,omitempty"`
	Err      error                `json:"error,omitempty"`
}

func (ListAccountResponse) Failed

func (resp ListAccountResponse) Failed() error

type LoginRequest

type LoginRequest struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

type LoginResponse

type LoginResponse struct {
	AccessToken  string `json:"access_token,omitempty"`
	RefreshToken string `json:"refresh_token,omitempty"`
	Err          error  `json:"err,omitempty"`
}

func (LoginResponse) Failed

func (resp LoginResponse) Failed() error

type Page

type Page struct {
	Page         int `json:"current_page"`
	PageSize     int `json:"page_size"`
	TotalRecords int `json:"total_records"`
}

Jump to

Keyboard shortcuts

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