model.go 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. package model
  2. import "go-common/library/time"
  3. // TableName is used to identify table name in gorm
  4. func (cf *SundryConfig) TableName() string {
  5. return "ap_sundry_config"
  6. }
  7. // TableName is used to identify table name in gorm
  8. func (cf *SundyConfigObject) TableName() string {
  9. return "ap_sundry_config"
  10. }
  11. // InsertMaps is used to insertDb format
  12. type InsertMaps struct {
  13. Team int64 `protobuf:"varint,2,opt,name=team,proto3" json:"team"`
  14. Keyword string `protobuf:"bytes,3,opt,name=keyword,proto3" json:"keyword"`
  15. Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name"`
  16. Value string `protobuf:"bytes,5,opt,name=value,proto3" json:"value"`
  17. Status int64 `protobuf:"bytes,5,opt,name=value,proto3" json:"status"`
  18. }
  19. // TableName is used to identify table name in gorm
  20. func (cf *InsertMaps) TableName() string {
  21. return "ap_sundry_config"
  22. }
  23. // SundyConfigObject is used to format select
  24. type SundyConfigObject struct {
  25. Id int64 `json:"id" gorm:"comumn:id"`
  26. Team int64 `json:"team" gorm:"comumn:team"`
  27. Keyword string `json:"index" gorm:"comumn:keyword"`
  28. Name string `json:"name" gorm:"comumn:name"`
  29. Value string `json:"value" gorm:"comumn:value"`
  30. Ctime time.Time `json:"ctime" gorm:"comumn:ctime"`
  31. Mtime time.Time `json:"mtime" gorm:"comumn:mtime"`
  32. Status int64 `json:"status" gorm:"comumn:status"`
  33. }
  34. // TableName is used to identify table name in gorm
  35. func (cf *ServiceConfigObject) TableName() string {
  36. return "ap_services_config"
  37. }
  38. // TableName is used to identify table name in gorm
  39. func (cf *InsertServiceConfig) TableName() string {
  40. return "ap_services_config"
  41. }
  42. // TableName is used to identify table name in gorm
  43. func (cf *UpdateServiceConfig) TableName() string {
  44. return "ap_services_config"
  45. }
  46. // ServiceConfigObject is used to format select
  47. type ServiceConfigObject struct {
  48. Id int64 `json:"id" gorm:"comumn:id"`
  49. TreeName string `protobuf:"bytes,2,opt,name=tree_name,proto3" json:"tree_name"`
  50. TreePath string `protobuf:"bytes,3,opt,name=tree_path,proto3" json:"tree_path"`
  51. TreeId int64 `protobuf:"varint,4,opt,name=tree_id,proto3" json:"tree_id"`
  52. Service string `protobuf:"bytes,5,opt,name=service,proto3" json:"service"`
  53. Keyword string `protobuf:"bytes,6,opt,name=keyword,proto3" json:"keyword"`
  54. Template int64 `protobuf:"varint,7,opt,name=template,proto3" json:"template"`
  55. Value string `protobuf:"bytes,8,opt,name=value,proto3" json:"value"`
  56. Name string `protobuf:"bytes,9,opt,name=name,proto3" json:"name"`
  57. Status int64 `protobuf:"varint,10,opt,name=status,proto3" json:"status"`
  58. Ctime time.Time `protobuf:"bytes,7,opt,name=ctime,proto3" json:"ctime"`
  59. Mtime time.Time `protobuf:"bytes,8,opt,name=mtime,proto3" json:"mtime"`
  60. }
  61. // InsertServiceConfig is used to insertDb format
  62. type InsertServiceConfig struct {
  63. TreeName string `protobuf:"bytes,3,opt,name=tree_name,proto3" json:"tree_name"`
  64. TreePath string `protobuf:"bytes,3,opt,name=tree_path,proto3" json:"tree_path"`
  65. TreeId int64 `protobuf:"bytes,3,opt,name=tree_id,proto3" json:"tree_id"`
  66. Service string `protobuf:"bytes,2,opt,name=service,json=servuce,proto3" `
  67. Keyword string `protobuf:"bytes,3,opt,name=template,proto3" json:"keyword"`
  68. Template int64 `protobuf:"bytes,3,opt,name=template,proto3" json:"template"`
  69. Value string `protobuf:"bytes,4,opt,name=value,proto3" json:"value"`
  70. Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name"`
  71. Status int64 `protobuf:"varint,6,opt,name=status,proto3" json:"status"`
  72. }
  73. // UpdateServiceConfig is used to insertDb format
  74. type UpdateServiceConfig struct {
  75. Service string `protobuf:"bytes,3,opt,name=service,proto3" json:"service"`
  76. Keyword string `protobuf:"bytes,3,opt,name=template,proto3" json:"keyword"`
  77. Template int64 `protobuf:"bytes,3,opt,name=template,proto3" json:"template"`
  78. Value string `protobuf:"bytes,4,opt,name=value,proto3" json:"value"`
  79. Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name"`
  80. Status int64 `protobuf:"varint,6,opt,name=status,proto3" json:"status"`
  81. }