(ctx context.Context, dmID string, clusters []string)
| 94 | } |
| 95 | |
| 96 | func (i *imlDynamicModulePublishService) Latest(ctx context.Context, dmID string, clusters []string) (map[string]*DynamicModulePublish, error) { |
| 97 | result := make(map[string]*DynamicModulePublish) |
| 98 | for _, c := range clusters { |
| 99 | info, err := i.store.First(ctx, map[string]interface{}{"dynamic_module": dmID, "cluster": c}, "create_at desc") |
| 100 | if err != nil { |
| 101 | if errors.Is(err, gorm.ErrRecordNotFound) { |
| 102 | continue |
| 103 | } |
| 104 | return nil, err |
| 105 | } |
| 106 | result[c] = &DynamicModulePublish{ |
| 107 | ID: info.UUID, |
| 108 | DynamicModule: info.DynamicModule, |
| 109 | Module: info.Module, |
| 110 | Cluster: info.Cluster, |
| 111 | Creator: info.Creator, |
| 112 | Version: info.Version, |
| 113 | CreateAt: info.CreateAt, |
| 114 | } |
| 115 | } |
| 116 | return result, nil |
| 117 | } |
| 118 | |
| 119 | func (i *imlDynamicModulePublishService) labelHandler(e *dynamic_module.DynamicModulePublish) []string { |
| 120 | return []string{e.UUID} |
nothing calls this directly
no outgoing calls
no test coverage detected