blog_classification_entity.go 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // ==========================================================================
  2. // This is auto-generated by gf cli tool. You may not really want to edit it.
  3. // ==========================================================================
  4. package blog_classification
  5. import (
  6. "database/sql"
  7. "github.com/gogf/gf/database/gdb"
  8. )
  9. // Entity is the golang structure for table blog_classification.
  10. type Entity struct {
  11. ClassificationId uint `orm:"classification_id,primary" json:"classification_id"` //
  12. ClassificationName string `orm:"classification_name" json:"classification_name"` // 分类名称
  13. ClassificationPid uint `orm:"classification_pid" json:"classification_pid"` // 分类父id
  14. ClassificationSort uint `orm:"classification_sort" json:"classification_sort"` // 排序
  15. ClassificationType uint `orm:"classification_type" json:"classification_type"` // 分类类型1.频道页/2.发布栏目/3.跳转栏目/4.单页栏目
  16. ClassificationDescribe string `orm:"classification_describe" json:"classification_describe"` // 分类描述
  17. ClassificationStatus uint `orm:"classification_status" json:"classification_status"` // 分类状态,0停用,1正常
  18. ClassificationAddress string `orm:"classification_address" json:"classification_address"` // 跳转栏目的跳转地址
  19. ClassificationContent string `orm:"classification_content" json:"classification_content"` // 单页栏目的内容
  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. }