platform.go 509 B

123456789101112131415161718
  1. package serializer
  2. import "dsbqj-admin/model/mongo/platform"
  3. type PlatformResponse struct {
  4. ID string `json:"id"`
  5. Name string `json:"name"`
  6. Code string `json:"code"`
  7. Status bool `json:"status"`
  8. }
  9. func BuildPlatformList(list []platform.Platform) []*PlatformResponse {
  10. result := make([]*PlatformResponse, 0, len(list))
  11. for i := range list {
  12. result = append(result, &PlatformResponse{ID: list[i].ID.Hex(), Name: list[i].Name, Code: list[i].Code, Status: list[i].Status})
  13. }
  14. return result
  15. }