auth_rule_entity.go 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. // ==========================================================================
  2. // This is auto-generated by gf cli tool. You may not really want to edit it.
  3. // ==========================================================================
  4. package auth_rule
  5. import (
  6. "database/sql"
  7. "github.com/gogf/gf/database/gdb"
  8. )
  9. // Entity is the golang structure for table auth_rule.
  10. type Entity struct {
  11. Id uint `orm:"id,primary" json:"id"` //
  12. Pid uint `orm:"pid" json:"pid"` // 父ID
  13. Name string `orm:"name,unique" json:"name"` // 规则名称
  14. Title string `orm:"title" json:"title"` // 规则名称
  15. Icon string `orm:"icon" json:"icon"` // 图标
  16. Condition string `orm:"condition" json:"condition"` // 条件
  17. Remark string `orm:"remark" json:"remark"` // 备注
  18. MenuType uint `orm:"menu_type" json:"menu_type"` // 类型 0目录 1菜单 2按钮
  19. Createtime uint `orm:"createtime" json:"createtime"` // 创建时间
  20. Updatetime uint `orm:"updatetime" json:"updatetime"` // 更新时间
  21. Weigh int `orm:"weigh" json:"weigh"` // 权重
  22. Status uint `orm:"status" json:"status"` // 状态
  23. AlwaysShow uint `orm:"always_show" json:"always_show"` // 显示状态
  24. Path string `orm:"path" json:"path"` // 路由地址
  25. Component string `orm:"component" json:"component"` // 组件路径
  26. IsFrame uint `orm:"is_frame" json:"is_frame"` // 是否外链 1是 0否
  27. ModuleType string `orm:"module_type" json:"module_type"` // 所属模块
  28. ModelId uint `orm:"model_id" json:"model_id"` // 模型ID
  29. }
  30. // OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers
  31. // the data and where attributes for empty values.
  32. func (r *Entity) OmitEmpty() *arModel {
  33. return Model.Data(r).OmitEmpty()
  34. }
  35. // Inserts does "INSERT...INTO..." statement for inserting current object into table.
  36. func (r *Entity) Insert() (result sql.Result, err error) {
  37. return Model.Data(r).Insert()
  38. }
  39. // InsertIgnore does "INSERT IGNORE INTO ..." statement for inserting current object into table.
  40. func (r *Entity) InsertIgnore() (result sql.Result, err error) {
  41. return Model.Data(r).InsertIgnore()
  42. }
  43. // Replace does "REPLACE...INTO..." statement for inserting current object into table.
  44. // If there's already another same record in the table (it checks using primary key or unique index),
  45. // it deletes it and insert this one.
  46. func (r *Entity) Replace() (result sql.Result, err error) {
  47. return Model.Data(r).Replace()
  48. }
  49. // Save does "INSERT...INTO..." statement for inserting/updating current object into 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) Save() (result sql.Result, err error) {
  53. return Model.Data(r).Save()
  54. }
  55. // Update does "UPDATE...WHERE..." statement for updating current object from table.
  56. // It updates the record if there's already another same record in the table
  57. // (it checks using primary key or unique index).
  58. func (r *Entity) Update() (result sql.Result, err error) {
  59. return Model.Data(r).Where(gdb.GetWhereConditionOfStruct(r)).Update()
  60. }
  61. // Delete does "DELETE FROM...WHERE..." statement for deleting current object from table.
  62. func (r *Entity) Delete() (result sql.Result, err error) {
  63. return Model.Where(gdb.GetWhereConditionOfStruct(r)).Delete()
  64. }