func findUserByUserID(c *gin.Context, userID, limit string) { user, err := service.FindByUserID(userID) if err != nil { c.JSON(500, nil) return } c.JSON(200, entity.UserRes{ Result: true, Data: []entity.User{user}, }) }
func UserPage(c *gin.Context) { userID := c.Param("userid") user, err := service.FindByUserID(userID) if err != nil { c.JSON(500, nil) return } data := entity.UserPage{ Self: user, } render(c, 200, "user.templ", data) }