config_barn_type.go 923 B

1234567891011121314151617181920212223242526272829303132333435
  1. package model
  2. import (
  3. pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow"
  4. )
  5. type ConfigPenType struct {
  6. Id int64 `json:"id"`
  7. Name string `json:"name"`
  8. Remarks string `json:"remarks"`
  9. IsShow pasturePb.IsShow_Kind `json:"is_show"`
  10. CreatedAt int64 `json:"created_at"`
  11. UpdatedAt int64 `json:"updated_at"`
  12. }
  13. func (c *ConfigPenType) TableName() string {
  14. return "config_pen_type"
  15. }
  16. type ConfigBarnTypeSlice []*ConfigPenType
  17. func (c ConfigBarnTypeSlice) ToPB() []*pasturePb.SearchBaseConfigList {
  18. res := make([]*pasturePb.SearchBaseConfigList, len(c))
  19. for i, d := range c {
  20. res[i] = &pasturePb.SearchBaseConfigList{
  21. Id: int32(d.Id),
  22. Name: d.Name,
  23. Remarks: d.Remarks,
  24. IsShow: d.IsShow,
  25. CreatedAt: int32(d.CreatedAt),
  26. UpdatedAt: int32(d.UpdatedAt),
  27. }
  28. }
  29. return res
  30. }