plug_link_entity.go 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. }
  21. // OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers
  22. // the data and where attributes for empty values.
  23. func (r *Entity) OmitEmpty() *arModel {
  24. return Model.Data(r).OmitEmpty()
  25. }
  26. // Inserts does "INSERT...INTO..." statement for inserting current object into table.
  27. func (r *Entity) Insert() (result sql.Result, err error) {
  28. return Model.Data(r).Insert()
  29. }
  30. // InsertIgnore does "INSERT IGNORE INTO ..." statement for inserting current object into table.
  31. func (r *Entity) InsertIgnore() (result sql.Result, err error) {
  32. return Model.Data(r).InsertIgnore()
  33. }
  34. // Replace does "REPLACE...INTO..." statement for inserting current object into table.
  35. // If there's already another same record in the table (it checks using primary key or unique index),
  36. // it deletes it and insert this one.
  37. func (r *Entity) Replace() (result sql.Result, err error) {
  38. return Model.Data(r).Replace()
  39. }
  40. // Save does "INSERT...INTO..." statement for inserting/updating current object into table.
  41. // It updates the record if there's already another same record in the table
  42. // (it checks using primary key or unique index).
  43. func (r *Entity) Save() (result sql.Result, err error) {
  44. return Model.Data(r).Save()
  45. }
  46. // Update does "UPDATE...WHERE..." statement for updating current object from table.
  47. // It updates the record if there's already another same record in the table
  48. // (it checks using primary key or unique index).
  49. func (r *Entity) Update() (result sql.Result, err error) {
  50. return Model.Data(r).Where(gdb.GetWhereConditionOfStruct(r)).Update()
  51. }
  52. // Delete does "DELETE FROM...WHERE..." statement for deleting current object from table.
  53. func (r *Entity) Delete() (result sql.Result, err error) {
  54. return Model.Where(gdb.GetWhereConditionOfStruct(r)).Delete()
  55. }