| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- // ==========================================================================
- // This is auto-generated by gf cli tool. You may not really want to edit it.
- // ==========================================================================
- package user
- import (
- "database/sql"
- "github.com/gogf/gf/database/gdb"
- )
- // Entity is the golang structure for table qxkj_user.
- type Entity struct {
- Id int `orm:"id,primary" json:"id"` //
- UserName string `orm:"user_name,unique" json:"user_name"` // 用户名
- Mobile string `orm:"mobile,unique" json:"mobile"` // 中国手机不带国家代码,国际手机号格式为:国家代码-手机号
- UserNickname string `orm:"user_nickname" json:"user_nickname"` // 用户昵称
- Birthday int `orm:"birthday" json:"birthday"` // 生日
- CreateTime int `orm:"create_time" json:"create_time"` // 注册时间
- UserPassword string `orm:"user_password" json:"user_password"` // 登录密码;cmf_password加密
- UserStatus int `orm:"user_status" json:"user_status"` // 用户状态;0:禁用,1:正常,2:未验证
- UserEmail string `orm:"user_email" json:"user_email"` // 用户登录邮箱
- Sex int `orm:"sex" json:"sex"` // 性别;0:保密,1:男,2:女
- Avatar string `orm:"avatar" json:"avatar"` // 用户头像
- LastLoginTime int `orm:"last_login_time" json:"last_login_time"` // 最后登录时间
- LastLoginIp string `orm:"last_login_ip" json:"last_login_ip"` // 最后登录ip
- }
- // QxkjUser is alias of Entity, which some developers say they just want.
- type QxkjUser = Entity
- // OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers
- // the data and where attributes for empty values.
- func (r *Entity) OmitEmpty() *arModel {
- return Model.Data(r).OmitEmpty()
- }
- // Inserts does "INSERT...INTO..." statement for inserting current object into table.
- func (r *Entity) Insert() (result sql.Result, err error) {
- return Model.Data(r).Insert()
- }
- // Replace does "REPLACE...INTO..." statement for inserting current object into table.
- // If there's already another same record in the table (it checks using primary key or unique index),
- // it deletes it and insert this one.
- func (r *Entity) Replace() (result sql.Result, err error) {
- return Model.Data(r).Replace()
- }
- // Save does "INSERT...INTO..." statement for inserting/updating current object into table.
- // It updates the record if there's already another same record in the table
- // (it checks using primary key or unique index).
- func (r *Entity) Save() (result sql.Result, err error) {
- return Model.Data(r).Save()
- }
- // Update does "UPDATE...WHERE..." statement for updating current object from table.
- // It updates the record if there's already another same record in the table
- // (it checks using primary key or unique index).
- func (r *Entity) Update() (result sql.Result, err error) {
- return Model.Data(r).Where(gdb.GetWhereConditionOfStruct(r)).Update()
- }
- // Delete does "DELETE FROM...WHERE..." statement for deleting current object from table.
- func (r *Entity) Delete() (result sql.Result, err error) {
- return Model.Where(gdb.GetWhereConditionOfStruct(r)).Delete()
- }
|