user

package
v0.0.0-...-cd1d72b Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Active ...
	// flag : user is active
	Active = 1

	// InActive ...
	// flag : user is inactive
	InActive = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Entity

type Entity struct {
	UserID       int64     `json:"user_id"            gorm:"column:user_id;primary_key"`
	TagName      string    `json:"tag_name"           gorm:"column:tag_name"         sql:"not null;type:varchar(190)"`
	ActiveStatus int       `json:"active_status"      gorm:"column:active_status"    sql:"not null;type:tinyint(3)"`
	CreatedAt    time.Time `json:"created_at"         gorm:"column:created_at"       sql:"not null;type:datetime"`
	UpdatedAt    time.Time `json:"updated_at"         gorm:"column:updated_at"       sql:"not null;type:datetime"`
}

Entity describes user table.

func New

func New(tagName string) *Entity

New ...

func (*Entity) Primary

func (e *Entity) Primary() (interface{}, []interface{})

Primary returns

func (Entity) TableName

func (e Entity) TableName() string

TableName returns the table name

func (*Entity) Validate

func (e *Entity) Validate() error

Validate ...

type Repository

type Repository struct {
	*model.RootRepository
}

Repository ...

func NewRepository

func NewRepository(ctx *gin.Context) *Repository

NewRepository ...

func (*Repository) Create

func (r *Repository) Create(ent *Entity) (*Entity, error)

Create inserts the entity

func (*Repository) FindByIDs

func (r *Repository) FindByIDs(ids []int64) ([]Entity, error)

FindByIDs ...

func (*Repository) GetByID

func (r *Repository) GetByID(id int64) (*Entity, error)

GetByID ...

func (*Repository) Update

func (r *Repository) Update(ent *Entity) (*Entity, error)

Update ...

Jump to

Keyboard shortcuts

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