|
|
|
@ -19,6 +19,8 @@ func NewUserController(service services.UserService) UserController { |
|
|
|
func (controller *UserController) Route(app *fiber.App) { |
|
|
|
app.Get("/user/info", controller.UserInfo) |
|
|
|
app.Get("/user/avatar", controller.UserAvatar) |
|
|
|
app.Get("/user/my/privacy", controller.UserMyPrivacySetting) |
|
|
|
app.Get("/user/my/groups", controller.UserMyListGroups) |
|
|
|
} |
|
|
|
|
|
|
|
func (controller *UserController) UserInfo(c *fiber.Ctx) error { |
|
|
|
@ -39,6 +41,7 @@ func (controller *UserController) UserInfo(c *fiber.Ctx) error { |
|
|
|
Results: response, |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
func (controller *UserController) UserAvatar(c *fiber.Ctx) error { |
|
|
|
var request structs.UserAvatarRequest |
|
|
|
err := c.QueryParser(&request) |
|
|
|
@ -57,3 +60,25 @@ func (controller *UserController) UserAvatar(c *fiber.Ctx) error { |
|
|
|
Results: response, |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
func (controller *UserController) UserMyPrivacySetting(c *fiber.Ctx) error { |
|
|
|
response, err := controller.Service.UserMyPrivacySetting(c) |
|
|
|
utils.PanicIfNeeded(err) |
|
|
|
|
|
|
|
return c.JSON(utils.ResponseData{ |
|
|
|
Code: 200, |
|
|
|
Message: "Success", |
|
|
|
Results: response, |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
func (controller *UserController) UserMyListGroups(c *fiber.Ctx) error { |
|
|
|
response, err := controller.Service.UserMyListGroups(c) |
|
|
|
utils.PanicIfNeeded(err) |
|
|
|
|
|
|
|
return c.JSON(utils.ResponseData{ |
|
|
|
Code: 200, |
|
|
|
Message: "Success", |
|
|
|
Results: response, |
|
|
|
}) |
|
|
|
} |