Documentation ¶
Index ¶
- Variables
- func Delete(where ...interface{}) (result sql.Result, err error)
- func FindArray(fieldsAndWhere ...interface{}) ([]gdb.Value, error)
- func FindCount(where ...interface{}) (int, error)
- func FindValue(fieldsAndWhere ...interface{}) (gdb.Value, error)
- func Insert(data ...interface{}) (result sql.Result, err error)
- func InsertIgnore(data ...interface{}) (result sql.Result, err error)
- func Replace(data ...interface{}) (result sql.Result, err error)
- func Save(data ...interface{}) (result sql.Result, err error)
- func Update(dataAndWhere ...interface{}) (result sql.Result, err error)
- type Entity
- func (r *Entity) Delete() (result sql.Result, err error)
- func (r *Entity) Insert() (result sql.Result, err error)
- func (r *Entity) InsertIgnore() (result sql.Result, err error)
- func (r *Entity) OmitEmpty() *arModel
- func (r *Entity) Replace() (result sql.Result, err error)
- func (r *Entity) Save() (result sql.Result, err error)
- func (r *Entity) Update() (result sql.Result, err error)
Constants ¶
This section is empty.
Variables ¶
var ( // Table is the table name of gf_reply. Table = "gf_reply" // Model is the model object of gf_reply. Model = &arModel{g.DB("default").Table(Table).Safe()} // Columns defines and stores column names for table gf_reply. Columns = struct { Id string // 回复ID Pid string // 回复对应的上一级回复ID(没有的话默认为0) Type string // 评论类型 0:回复 1:文章 2:问答 Tid string // 对应内容ID Uid string // 网站用户ID Zan string // 赞 Cai string // 踩 Title string // 回复标题 Content string // 回复内容 CreateAt string // 创建时间 UpdateAt string // }{ Id: "id", Pid: "pid", Type: "type", Tid: "tid", Uid: "uid", Zan: "zan", Cai: "cai", Title: "title", Content: "content", CreateAt: "create_at", UpdateAt: "update_at", } )
Functions ¶
func InsertIgnore ¶
InsertIgnore is a convenience method for Model.InsertIgnore.
Types ¶
type Entity ¶
type Entity struct { Id uint `orm:"id,primary" json:"id"` // 回复ID Pid uint `orm:"pid" json:"pid"` // 回复对应的上一级回复ID(没有的话默认为0) Type uint `orm:"type" json:"type"` // 评论类型 0:回复 1:文章 2:问答 Tid uint `orm:"tid" json:"tid"` // 对应内容ID Uid uint `orm:"uid" json:"uid"` // 网站用户ID Zan uint `orm:"zan" json:"zan"` // 赞 Cai uint `orm:"cai" json:"cai"` // 踩 Title string `orm:"title" json:"title"` // 回复标题 Content string `orm:"content" json:"content"` // 回复内容 CreateAt *gtime.Time `orm:"create_at" json:"create_at"` // 创建时间 UpdateAt *gtime.Time `orm:"update_at" json:"update_at"` // }
Entity is the golang structure for table gf_reply.
func (*Entity) Delete ¶
Delete does "DELETE FROM...WHERE..." statement for deleting current object from table.
func (*Entity) Insert ¶
Inserts does "INSERT...INTO..." statement for inserting current object into table.
func (*Entity) InsertIgnore ¶
InsertIgnore does "INSERT IGNORE INTO ..." statement for inserting current object into table.
func (*Entity) OmitEmpty ¶
func (r *Entity) OmitEmpty() *arModel
OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers the data and where attributes for empty values.
func (*Entity) Replace ¶
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.