(c *gin.Context)
| 26 | } |
| 27 | |
| 28 | func (h *MarkdownHandler) GetDocument(c *gin.Context) { |
| 29 | hash := c.Param("hash") |
| 30 | doc, ok := h.md.GetDocument(hash) |
| 31 | if !ok { |
| 32 | c.JSON(http.StatusNotFound, gin.H{"error": service.ErrDocNotFound.Error()}) |
| 33 | return |
| 34 | } |
| 35 | c.JSON(http.StatusOK, gin.H{"content": doc.Content}) |
| 36 | } |
| 37 | |
| 38 | func (h *MarkdownHandler) UpdateDocument(c *gin.Context) { |
| 39 | var req struct { |