models

package
v0.0.0-...-3bb77e7 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

func NewSuccessMessage

func NewSuccessMessage() *Message

NewSuccessMessage new success message

type Page

type Page struct {
	PageInformation *PageInformation `json:"page_information,omitempty"`
	Entities        interface{}      `json:"entities,omitempty"`
}

Page page model

func NewPage

func NewPage(pageInfo *PageInformation, entities interface{}) *Page

NewPage new page

func (*Page) GetEntities

func (p *Page) GetEntities() interface{}

GetEntities get entities

type PageForm

type PageForm struct {
	Page    int    `json:"page,omitempty" form:"page" query:"page"`
	Size    int    `json:"size,omitempty" form:"size" query:"size"`
	Query   string `json:"query,omitempty" form:"query" query:"query"`
	Sort    string `json:"sort,omitempty" form:"sort" query:"sort"`
	Reverse bool   `json:"reverse,omitempty" form:"reverse" query:"reverse"`
	OrderBy string `json:"-" form:"-"`
}

PageForm page form

func (*PageForm) GetOrderBy

func (f *PageForm) GetOrderBy() string

GetOrderBy get order by

func (*PageForm) GetPage

func (f *PageForm) GetPage() int

GetPage get page

func (*PageForm) GetQuery

func (f *PageForm) GetQuery() string

GetQuery get query

func (*PageForm) GetReverse

func (f *PageForm) GetReverse() bool

GetReverse get reverse

func (*PageForm) GetSize

func (f *PageForm) GetSize() int

GetSize get size

func (*PageForm) GetSort

func (f *PageForm) GetSort() string

GetSort get sort

type PageInformation

type PageInformation struct {
	Page     int   `json:"page,omitempty"`
	Size     int   `json:"size,omitempty"`
	Count    int64 `json:"count,omitempty"`
	LastPage int   `json:"last_page,omitempty"`
}

PageInformation page information

type Timestamp

type Timestamp int64

type Token

type Token struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
}

type TokenClaims

type TokenClaims struct {
	jwt.RegisteredClaims
	Role string `json:"role"`
}

token claims

type TokenUser

type TokenUser struct {
	UserID    string `json:"user_id"`
	UserLevel string `json:"user_level"`
}

ข้อมูล return สำหรับนำไป token.request ต่อ

type User

type User struct {
	Pubkey       string    `json:"pubkey" gorm:"primaryKey;type:varchar(64)"`
	CreatedAt    Timestamp `json:"created_at" gorm:"type:integer"`
	UpdatedAt    Timestamp `json:"updated_at" gorm:"type:integer"`
	DeletedAt    Timestamp `json:"deleted_at" gorm:"type:integer"`
	Name         string    `json:"name"`
	LightningURL string    `json:"lightning_url"`
}

func (User) TableName

func (User) TableName() string

Jump to

Keyboard shortcuts

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