feat: open api for get memos

This commit is contained in:
email
2022-02-06 00:25:41 +08:00
parent 017bbfa6d6
commit c77996a891
4 changed files with 48 additions and 6 deletions

View File

@ -98,8 +98,9 @@ func (s *Server) registerMemoRoutes(g *echo.Group) {
memo, err := s.MemoService.FindMemo(memoFind)
if err != nil {
if common.ErrorCode(err) == common.NotFound {
return echo.NewHTTPError(http.StatusNotFound, fmt.Sprintf("Memo ID not found: %d", memoId))
return echo.NewHTTPError(http.StatusNotFound, fmt.Sprintf("Memo ID not found: %d", memoId)).SetInternal(err)
}
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("Failed to delete memo ID: %v", memoId)).SetInternal(err)
}