models

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTag

func AddTag(name string, state int, createdBy string) bool

func CloseDB

func CloseDB()

func ExistTagByName

func ExistTagByName(name string) bool

func GetTagTotal

func GetTagTotal(maps interface{}) (count int)

Types

type Model

type Model struct {
	ID         int `gorm:"primary_key" json:"id"`
	CreatedOn  int `json:"created_on"`
	ModifiedOn int `json:"modified_on"`
}

type Tag

type Tag struct {
	Model

	Name       string `json:"name"`
	CreatedBy  string `json:"created_by"`
	ModifiedBy string `json:"modified_by"`
	State      int    `json:"state"`
}

func GetTags

func GetTags(pageNum int, pageSize int, maps interface{}) (tags []Tag)

func (*Tag) BeforeCreate

func (tag *Tag) BeforeCreate(scope *gorm.Scope) error

func (*Tag) BeforeUpdate

func (tag *Tag) BeforeUpdate(scope *gorm.Scope) error

Jump to

Keyboard shortcuts

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