base

package
v1.230621.4 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ID = "_id"

Variables

This section is empty.

Functions

func GetFieldName

func GetFieldName(field reflect.StructField) string

通过反射获取字段名称

func GetFieldValue

func GetFieldValue(val reflect.Value) interface{}

获取字段的实际值

func In

func In(target string, str_array []string) bool

判断字符串是否包含在数组内

Types

type BaseId

type BaseId struct {
	//主键
	Id *primitive.ObjectID `bson:"_id" json:"_id"`
	//创建时间
	CreatedAt *time.Time `bson:"createdAt" json:"createdAt,omitempty" update:"setOnInsert"`
	//修改时间
	UpdatedAt *time.Time `bson:"updatedAt" json:"updatedAt,omitempty"`
}

默认类型

Jump to

Keyboard shortcuts

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