common

package
v0.0.0-...-381d7a5 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//全量更新
	UPDATE_MODE_PUT = iota
	//部分更新
	UPDATE_MODE_PATCH
)

Variables

This section is empty.

Functions

func Validate

func Validate(v any) error

Types

type Brand

type Brand int
const (
	Cisco Brand = iota + 1
	Ruijie
	H3C
	Huawei
	Huawei_CE
	Huawei_FW
	Juniper
)

type DevMeta

type DevMeta struct {
	// 设备Id
	Id int `json:"id" gorm:"column:id"` //如果主键不为id(int)(之前主键用了name varchar(255)),updatedevice时会报WHERE conditions required异常
}

设备通用参数

func NewDevMeta

func NewDevMeta() *DevMeta

type DeviceLevel

type DeviceLevel int
const (
	CORE DeviceLevel = iota + 1
	CONVERGE
	ACCESS
)

type PageRequest

type PageRequest struct {
	// 分页的大小
	PageSize int `json:"page_size"`
	// 当前页码
	PageNumber int `json:"page_number"`
}

func NewPageRequest

func NewPageRequest() *PageRequest

func NewPageRequestFromGinCtx

func NewPageRequestFromGinCtx(c *gin.Context) *PageRequest

func (*PageRequest) Offset

func (req *PageRequest) Offset() int

type UPDATE_MODE

type UPDATE_MODE int

type UserMeta

type UserMeta struct {
	//用户ID
	Id int `json:"id" gorm:"column:id"`
	//创建时间,时间戳 10位,秒
	CreateAt int64 `json:"created_at" gorm:"column:created_at"`
	//更新时间,时间戳 10位,秒
	UpdatedAt int64 `json:"updated_at" gorm:"column:updated_at"`
}

用户通用参数

func NewUserMeta

func NewUserMeta() *UserMeta

Jump to

Keyboard shortcuts

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