Showing
2 changed files
with
22 additions
and
1 deletions
joongna/controller/controller.go
0 → 100644
1 | +package controller | ||
2 | + | ||
3 | +import ( | ||
4 | + "joongna/service" | ||
5 | + "net/http" | ||
6 | + | ||
7 | + "github.com/labstack/echo/v4" | ||
8 | +) | ||
9 | + | ||
10 | +func Search(c echo.Context) error { | ||
11 | + keyword := c.Param("keyword") | ||
12 | + items, err := service.GetItemByKeyword(keyword) | ||
13 | + if err != nil { | ||
14 | + return err | ||
15 | + } | ||
16 | + return c.JSON(http.StatusOK, items) | ||
17 | +} |
-
Please register or login to post a comment