(p *models.Prompt)
| 7 | ) |
| 8 | |
| 9 | func MapModelPromptToProto(p *models.Prompt) *userv1.Prompt { |
| 10 | if p == nil { |
| 11 | return nil |
| 12 | } |
| 13 | |
| 14 | return &userv1.Prompt{ |
| 15 | Id: p.ID.Hex(), |
| 16 | CreatedAt: timestamppb.New(p.CreatedAt.Time()), |
| 17 | UpdatedAt: timestamppb.New(p.UpdatedAt.Time()), |
| 18 | Title: p.Title, |
| 19 | Content: p.Content, |
| 20 | IsUserPrompt: true, |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | func MapModelPromptsToProto(prompts []*models.Prompt) []*userv1.Prompt { |
| 25 | result := make([]*userv1.Prompt, len(prompts)) |
no outgoing calls
no test coverage detected