feat: align ids to int64
This commit is contained in:
@@ -108,17 +108,17 @@ func (u *User) ListOrders(ctx fiber.Ctx, user *models.User, status string) ([]dt
|
||||
|
||||
// Get user order detail
|
||||
//
|
||||
// @Router /v1/me/orders/:id [get]
|
||||
// @Router /v1/me/orders/:id<int> [get]
|
||||
// @Summary Get order detail
|
||||
// @Description Get user order detail
|
||||
// @Tags UserCenter
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param id path string true "Order ID"
|
||||
// @Param id path int64 true "Order ID"
|
||||
// @Success 200 {object} dto.Order
|
||||
// @Bind user local key(__ctx_user)
|
||||
// @Bind id path
|
||||
func (u *User) GetOrder(ctx fiber.Ctx, user *models.User, id string) (*dto.Order, error) {
|
||||
func (u *User) GetOrder(ctx fiber.Ctx, user *models.User, id int64) (*dto.Order, error) {
|
||||
return services.Order.GetUserOrder(ctx, user.ID, id)
|
||||
}
|
||||
|
||||
@@ -158,27 +158,27 @@ func (u *User) Favorites(ctx fiber.Ctx, user *models.User) ([]dto.ContentItem, e
|
||||
// @Tags UserCenter
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param contentId query string true "Content ID"
|
||||
// @Param contentId query int64 true "Content ID"
|
||||
// @Success 200 {string} string "Added"
|
||||
// @Bind user local key(__ctx_user)
|
||||
// @Bind contentId query
|
||||
func (u *User) AddFavorite(ctx fiber.Ctx, user *models.User, contentId string) error {
|
||||
func (u *User) AddFavorite(ctx fiber.Ctx, user *models.User, contentId int64) error {
|
||||
return services.Content.AddFavorite(ctx, user.ID, contentId)
|
||||
}
|
||||
|
||||
// Remove from favorites
|
||||
//
|
||||
// @Router /v1/me/favorites/:contentId [delete]
|
||||
// @Router /v1/me/favorites/:contentId<int> [delete]
|
||||
// @Summary Remove favorite
|
||||
// @Description Remove from favorites
|
||||
// @Tags UserCenter
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param contentId path string true "Content ID"
|
||||
// @Param contentId path int64 true "Content ID"
|
||||
// @Success 200 {string} string "Removed"
|
||||
// @Bind user local key(__ctx_user)
|
||||
// @Bind contentId path
|
||||
func (u *User) RemoveFavorite(ctx fiber.Ctx, user *models.User, contentId string) error {
|
||||
func (u *User) RemoveFavorite(ctx fiber.Ctx, user *models.User, contentId int64) error {
|
||||
return services.Content.RemoveFavorite(ctx, user.ID, contentId)
|
||||
}
|
||||
|
||||
@@ -204,27 +204,27 @@ func (u *User) Likes(ctx fiber.Ctx, user *models.User) ([]dto.ContentItem, error
|
||||
// @Tags UserCenter
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param contentId query string true "Content ID"
|
||||
// @Param contentId query int64 true "Content ID"
|
||||
// @Success 200 {string} string "Liked"
|
||||
// @Bind user local key(__ctx_user)
|
||||
// @Bind contentId query
|
||||
func (u *User) AddLike(ctx fiber.Ctx, user *models.User, contentId string) error {
|
||||
func (u *User) AddLike(ctx fiber.Ctx, user *models.User, contentId int64) error {
|
||||
return services.Content.AddLike(ctx, user.ID, contentId)
|
||||
}
|
||||
|
||||
// Unlike content
|
||||
//
|
||||
// @Router /v1/me/likes/:contentId [delete]
|
||||
// @Router /v1/me/likes/:contentId<int> [delete]
|
||||
// @Summary Unlike content
|
||||
// @Description Unlike content
|
||||
// @Tags UserCenter
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param contentId path string true "Content ID"
|
||||
// @Param contentId path int64 true "Content ID"
|
||||
// @Success 200 {string} string "Unliked"
|
||||
// @Bind user local key(__ctx_user)
|
||||
// @Bind contentId path
|
||||
func (u *User) RemoveLike(ctx fiber.Ctx, user *models.User, contentId string) error {
|
||||
func (u *User) RemoveLike(ctx fiber.Ctx, user *models.User, contentId int64) error {
|
||||
return services.Content.RemoveLike(ctx, user.ID, contentId)
|
||||
}
|
||||
|
||||
@@ -262,16 +262,16 @@ func (u *User) Notifications(ctx fiber.Ctx, user *models.User, typeArg string, p
|
||||
|
||||
// Mark notification as read
|
||||
//
|
||||
// @Router /v1/me/notifications/:id/read [post]
|
||||
// @Router /v1/me/notifications/:id<int>/read [post]
|
||||
// @Summary Mark as read
|
||||
// @Tags UserCenter
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param id path string true "Notification ID"
|
||||
// @Param id path int64 true "Notification ID"
|
||||
// @Success 200 {string} string "OK"
|
||||
// @Bind user local key(__ctx_user)
|
||||
// @Bind id path
|
||||
func (u *User) MarkNotificationRead(ctx fiber.Ctx, user *models.User, id string) error {
|
||||
func (u *User) MarkNotificationRead(ctx fiber.Ctx, user *models.User, id int64) error {
|
||||
return services.Notification.MarkRead(ctx, user.ID, id)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user