| 56 | } |
| 57 | |
| 58 | func (i *imlAPIDocModule) GetDoc(ctx context.Context, serviceId string) (*api_doc_dto.ApiDocDetail, error) { |
| 59 | _, err := i.serviceService.Get(ctx, serviceId) |
| 60 | if err != nil { |
| 61 | return nil, err |
| 62 | } |
| 63 | info, err := i.apiDocService.GetDoc(ctx, serviceId) |
| 64 | if err != nil { |
| 65 | if !errors.Is(err, gorm.ErrRecordNotFound) { |
| 66 | return nil, err |
| 67 | } |
| 68 | return nil, nil |
| 69 | } |
| 70 | return &api_doc_dto.ApiDocDetail{ |
| 71 | Content: info.Content, |
| 72 | Updater: info.Updater, |
| 73 | UpdateTime: auto.TimeLabel(info.UpdateAt), |
| 74 | }, nil |
| 75 | } |