room.go 569 B

12345678910111213141516171819202122232425262728293031
  1. package specialAPIModels
  2. import (
  3. I "devel.mephi.ru/dyokunev/wwwvoip/app/iface"
  4. "voip/app/models"
  5. )
  6. type Room struct {
  7. Appointment
  8. }
  9. type Rooms []Room
  10. func (rooms *Rooms) IConvert(apiHost string, affiliateUnit *models.Unit) (I.Slice, error) {
  11. var convertedRooms models.Rooms
  12. for _, room := range *rooms {
  13. convertedRoom := models.Room{
  14. RootUnitId: affiliateUnit.Id,
  15. RootUnitKey: affiliateUnit.CodeStr,
  16. Name: room.Room,
  17. }
  18. convertedRoom.GenKey()
  19. convertedRooms = append(convertedRooms, convertedRoom)
  20. }
  21. return convertedRooms, nil
  22. }