20 lines
471 B
Go
20 lines
471 B
Go
package helper
|
|
|
|
import (
|
|
"users_management/m/model/dto/res"
|
|
"users_management/m/model/entity"
|
|
)
|
|
|
|
func ConvertToDeviceTypeResponse(devices []entity.Device) []res.DeviceTypeResponse {
|
|
var responses []res.DeviceTypeResponse
|
|
for _, devices := range devices {
|
|
deviceResp := res.DeviceTypeResponse{
|
|
ID: devices.ID,
|
|
DeviceType: string(devices.DeviceType),
|
|
DeviceCode: devices.DeviceCode,
|
|
}
|
|
responses = append(responses, deviceResp)
|
|
}
|
|
|
|
return responses
|
|
} |