models

package
v0.0.0-...-45465e8 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2022 License: LGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PageNum  = 1
	PageSize = 20
)

Page PageSize Number of data items per page

Variables

This section is empty.

Functions

func DefaultPageNum

func DefaultPageNum(pageNum interface{}) uint

func DefaultPageSize

func DefaultPageSize(pageSize interface{}) uint

func Paginate

func Paginate(pageInfo request.PageInfo) func(db *gorm.DB) *gorm.DB

Paginate 分页查询

Types

type GormModel

type GormModel struct {
	ID        uint       `json:"id" gorm:"primary_key"`
	CreatedAt int64      `json:"createdAt" sql:"index"`
	UpdatedAt int64      `json:"updatedAt"`
	DeletedAt *time.Time `json:"-" sql:"index"`
}

GormModel base user

type Project

type Project struct {
	GormModel
	Name            string      `json:"name"`
	Address         string      `gorm:"NOT NULL;uniqueIndex:idx_uni;type:varchar(64)" json:"address"`
	Email           string      `json:"email"`
	WhiteList       []WhiteList `json:"whiteList"`
	Condition       string      `json:"condition" gorm:"type:json"`
	AirdropContract string      `json:"airdropContract"`
}

Project .

type User

type User struct {
	GormModel
	Name    string `json:"name"`
	Address string `gorm:"NOT NULL;uniqueIndex:idx_uni;type:varchar(64)" json:"address"`
	Email   string `json:"email"`
}

User .

type WhiteList

type WhiteList struct {
	GormModel
	ProjectID  uint
	Address    string
	Commitment string
}

Jump to

Keyboard shortcuts

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