models

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateTestData

func GenerateTestData() error

GenerateTestData generate test data

func Pagination

func Pagination(dbConn *gorm.DB, pagingOptionCollection *pagination.PagingOptionCollection) *gorm.DB

Pagination pagination

func WhereConditions

func WhereConditions(dbConn *gorm.DB, whereConditions []*WhereCondition) *gorm.DB

WhereConditions where conditions

Types

type User

type User struct {
	Id   int64  `gorm:"PRIMARY_KEY;COLUMN:id"` // id
	Name string `gorm:"COLUMN:name"`           // name
	Age  int64  `gorm:"COLUMN:age"`            // age
}

User user model

func (*User) List

func (m *User) List(in *pb.UserListReq, pagingOptionCollection *pagination.PagingOptionCollection) ([]*User, int64, error)

List user model list

func (*User) NewModel

func (m *User) NewModel() *User

NewModel new model

func (*User) TableName

func (m *User) TableName() string

TableName user table name

func (*User) WhereConditions

func (m *User) WhereConditions(dbConn *gorm.DB, in *pb.UserListReq) *gorm.DB

WhereConditions orm where

type WhereCondition

type WhereCondition struct {
	pagination.PagingWhere
}

WhereCondition where condition

Jump to

Keyboard shortcuts

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