fix(park):修复园区不能搜索的问题。

This commit is contained in:
徐涛
2022-09-06 15:28:27 +08:00
parent 954285e426
commit 8aa4e38760
2 changed files with 18 additions and 6 deletions

View File

@@ -49,7 +49,8 @@ func listAllParksUnderSessionUser(c *gin.Context) {
result.Unauthorized(err.Error())
return
}
parks, err := service.ParkService.ListAllParkBelongsTo(userSession.Uid)
keyword := c.DefaultQuery("keyword", "")
parks, err := service.ParkService.ListAllParkBelongsTo(userSession.Uid, keyword)
if err != nil {
result.Error(http.StatusInternalServerError, err.Error())
return
@@ -60,7 +61,8 @@ func listAllParksUnderSessionUser(c *gin.Context) {
func listAllParksUnderSpecificUser(c *gin.Context) {
result := response.NewResult(c)
requestUserId := c.Param("uid")
parks, err := service.ParkService.ListAllParkBelongsTo(requestUserId)
keyword := c.DefaultQuery("keyword", "")
parks, err := service.ParkService.ListAllParkBelongsTo(requestUserId, keyword)
if err != nil {
result.Error(http.StatusInternalServerError, err.Error())
return