Example #1
0
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},
	})
}
Example #2
0
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)
}