Documentation
¶
Index ¶
- type Case
- func (model *Case) Create() error
- func (model *Case) Delete() error
- func (model *Case) FindPaged(page int, rows int, orderby []string, sort []string, filter interface{}) (basemodel.PagedFindResult, error)
- func (model *Case) FindSingle(filter interface{}) error
- func (model *Case) FindbyID(id uint64) error
- func (model *Case) FirstOrCreate() error
- func (model *Case) Save() error
- type Client
- type Edu
- func (model *Edu) Create() error
- func (model *Edu) Delete() error
- func (base *Edu) FindPaged(filter interface{}) (basemodel.PagedFindResult, error)
- func (model *Edu) FindSingle(filter interface{}) error
- func (model *Edu) FindbyID(id uint64) error
- func (model *Edu) FirstOrCreate() error
- func (model *Edu) Save() error
- type Roles
- func (model *Roles) Create() error
- func (model *Roles) Delete() error
- func (model *Roles) FilterSearchSingle(filter interface{}) error
- func (model *Roles) FindFilter(limit int, offset int, orderby []string, sort []string, filter interface{}) (interface{}, error)
- func (model *Roles) FindbyID(id uint64) error
- func (model *Roles) PagedFindFilter(page int, rows int, orderby []string, sort []string, filter interface{}) (basemodel.PagedFindResult, error)
- func (model *Roles) Save() error
- type User
- func (model *User) BeforeCreate() (err error)
- func (model *User) ChangePassword(rawpassword string) error
- func (model *User) Create() error
- func (model *User) Delete() error
- func (model *User) FilterSearchSingle(filter interface{}) error
- func (model *User) FindbyID(id uint64) error
- func (model *User) FirstLoginChangePassword(password string)
- func (model *User) PagedFilterSearch(page int, rows int, orderby []string, sorts []string, filter interface{}) (basemodel.PagedFindResult, error)
- func (model *User) Save() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Case ¶
type Case struct { basemodel.BaseModel Location postgres.Jsonb `json:"location" gorm:"column:location"` DataDetail postgres.Jsonb `json:"data_detail" gorm:"column:data_detail"` }
Case main type
func (*Case) FindPaged ¶
func (model *Case) FindPaged(page int, rows int, orderby []string, sort []string, filter interface{}) (basemodel.PagedFindResult, error)
PagedFindFilter func
func (*Case) FindSingle ¶
SingleFindFilter func
func (*Case) FirstOrCreate ¶
FirstOrCreate create if not exist, or skip if exist
type Client ¶
type Client struct { basemodel.BaseModel Name string `json:"name" gorm:"column:name"` Key string `json:"key" gorm:"column:key"` Secret string `json:"secret" gorm:"column:secret"` }
Client struct
func (*Client) SingleFindFilter ¶
SingleFindFilter func
type Edu ¶
type Edu struct { basemodel.BaseModel Title string `json:"title" gorm:"column:title"` Description string `json:"description" gorm:"column:description"` }
Edu main type
func (*Edu) FindPaged ¶
func (base *Edu) FindPaged(filter interface{}) (basemodel.PagedFindResult, error)
PagedFindFilter func
func (*Edu) FindSingle ¶
SingleFindFilter func
func (*Edu) FirstOrCreate ¶
FirstOrCreate create if not exist, or skip if exist
type Roles ¶
type Roles struct { basemodel.BaseModel Name string `json:"name" gorm:"column:name"` Description string `json:"description" gorm:"column:description"` System string `json:"system" gorm:"column:system"` Status string `json:"status" gorm:"column:status" sql:"DEFAULT:active"` Permissions pq.StringArray `json:"permissions" gorm:"column:permissions"` }
Roles main type
func (*Roles) FilterSearchSingle ¶
FilterSearchSingle use filter to find one role
func (*Roles) FindFilter ¶
func (model *Roles) FindFilter(limit int, offset int, orderby []string, sort []string, filter interface{}) (interface{}, error)
FindFilter use filter to find all matching role
func (*Roles) PagedFindFilter ¶
func (model *Roles) PagedFindFilter(page int, rows int, orderby []string, sort []string, filter interface{}) (basemodel.PagedFindResult, error)
PagedFindFilter use filter to find all matching role, return using paging format
type User ¶
type User struct { basemodel.BaseModel Roles pq.Int64Array `json:"roles" gorm:"column:roles"` Username string `json:"username" gorm:"column:username;type:varchar(255);unique;not null"` Email string `json:"email" gorm:"column:email;type:varchar(255)"` Phone string `json:"phone" gorm:"column:phone;type:varchar(255)"` Password string `json:"password" gorm:"column:password;type:text;not null"` Status string `json:"status" gorm:"column:status;type:boolean" sql:"DEFAULT:TRUE"` FirstLogin bool `json:"first_login" gorm:"column:first_login;type:boolean" sql:"DEFAULT:TRUE"` }
User main type
func (*User) BeforeCreate ¶
BeforCreate gorm callback hook
func (*User) ChangePassword ¶
ChangePassword update password to encrypted. does not save
func (*User) FilterSearchSingle ¶
FilterSearchSingle func
func (*User) FirstLoginChangePassword ¶
FirstLoginChangePassword set new password and first login to false
func (*User) PagedFilterSearch ¶
func (model *User) PagedFilterSearch(page int, rows int, orderby []string, sorts []string, filter interface{}) (basemodel.PagedFindResult, error)
PagedFilterSearch func