plug_link_entity.go 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. // ==========================================================================
  2. // This is auto-generated by gf cli tool. You may not really want to edit it.
  3. // ==========================================================================
  4. package plug_link
  5. import (
  6. "database/sql"
  7. "github.com/gogf/gf/database/gdb"
  8. )
  9. // Entity is the golang structure for table plug_link.
  10. type Entity struct {
  11. LinkId int `orm:"link_id,primary" json:"link_id"` //
  12. LinkName string `orm:"link_name" json:"link_name"` // 链接名称
  13. LinkUrl string `orm:"link_url" json:"link_url"` // 链接URL
  14. LinkTarget string `orm:"link_target" json:"link_target"` // 打开方式
  15. LinkTypeid int `orm:"link_typeid" json:"link_typeid"` // 所属栏目ID
  16. LinkQq string `orm:"link_qq" json:"link_qq"` // 联系QQ
  17. LinkOrder int64 `orm:"link_order" json:"link_order"` // 排序
  18. LinkAddtime int `orm:"link_addtime" json:"link_addtime"` // 添加时间
  19. LinkOpen int `orm:"link_open" json:"link_open"` // 0禁用1启用
  20. LinkUsername string `orm:"link_username" json:"link_username"` // 申请友情链接的联系人
  21. LinkEmail string `orm:"link_email" json:"link_email"` // 联系邮箱
  22. LinkRemark string `orm:"link_remark" json:"link_remark"` // 申请友情链接时的备注
  23. }
  24. // OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers
  25. // the data and where attributes for empty values.
  26. func (r *Entity) OmitEmpty() *arModel {
  27. return Model.Data(r).OmitEmpty()
  28. }
  29. // Inserts does "INSERT...INTO..." statement for inserting current object into table.
  30. func (r *Entity) Insert() (result sql.Result, err error) {
  31. return Model.Data(r).Insert()
  32. }
  33. // InsertIgnore does "INSERT IGNORE INTO ..." statement for inserting current object into table.
  34. func (r *Entity) InsertIgnore() (result sql.Result, err error) {
  35. return Model.Data(r).InsertIgnore()
  36. }
  37. // Replace does "REPLACE...INTO..." statement for inserting current object into table.
  38. // If there's already another same record in the table (it checks using primary key or unique index),
  39. // it deletes it and insert this one.
  40. func (r *Entity) Replace() (result sql.Result, err error) {
  41. return Model.Data(r).Replace()
  42. }
  43. // Save does "INSERT...INTO..." statement for inserting/updating current object into table.
  44. // It updates the record if there's already another same record in the table
  45. // (it checks using primary key or unique index).
  46. func (r *Entity) Save() (result sql.Result, err error) {
  47. return Model.Data(r).Save()
  48. }
  49. // Update does "UPDATE...WHERE..." statement for updating current object from table.
  50. // It updates the record if there's already another same record in the table
  51. // (it checks using primary key or unique index).
  52. func (r *Entity) Update() (result sql.Result, err error) {
  53. return Model.Data(r).Where(gdb.GetWhereConditionOfStruct(r)).Update()
  54. }
  55. // Delete does "DELETE FROM...WHERE..." statement for deleting current object from table.
  56. func (r *Entity) Delete() (result sql.Result, err error) {
  57. return Model.Where(gdb.GetWhereConditionOfStruct(r)).Delete()
  58. }