apisFromDAO 将DAO层的API对象列表转换为domain层对象列表
(apis []*dao.Api)
| 120 | |
| 121 | // apisFromDAO 将DAO层的API对象列表转换为domain层对象列表 |
| 122 | func (a *apiRepository) apisFromDAO(apis []*dao.Api) []*domain.Api { |
| 123 | if apis == nil { |
| 124 | return nil |
| 125 | } |
| 126 | result := make([]*domain.Api, 0, len(apis)) |
| 127 | for _, api := range apis { |
| 128 | if api != nil { |
| 129 | result = append(result, a.apiFromDAO(api)) |
| 130 | } |
| 131 | } |
| 132 | return result |
| 133 | } |