(ctx context.Context, sid string)
| 25 | } |
| 26 | |
| 27 | func (i *imlServiceModelMappingService) Get(ctx context.Context, sid string) (*ModelMapping, error) { |
| 28 | entity, err := i.store.First(ctx, map[string]interface{}{"sid": sid}) |
| 29 | if err != nil { |
| 30 | if errors.Is(err, gorm.ErrRecordNotFound) { |
| 31 | return &ModelMapping{ |
| 32 | Sid: sid, |
| 33 | Content: "", |
| 34 | }, nil |
| 35 | } |
| 36 | return nil, err |
| 37 | } |
| 38 | return FromEntity(entity), nil |
| 39 | } |
| 40 | |
| 41 | func FromEntity(e *service.ModelMapping) *ModelMapping { |
| 42 | content := "" |
nothing calls this directly
no test coverage detected