fix: resolve frontend build error and order refund bug, add member price filter
This commit is contained in:
@@ -4,11 +4,12 @@ import "quyun/v2/app/requests"
|
||||
|
||||
type ContentListFilter struct {
|
||||
requests.Pagination
|
||||
Keyword *string `query:"keyword"`
|
||||
Genre *string `query:"genre"`
|
||||
TenantID *string `query:"tenantId"`
|
||||
Sort *string `query:"sort"`
|
||||
IsPinned *bool `query:"is_pinned"`
|
||||
Keyword *string `query:"keyword"`
|
||||
Genre *string `query:"genre"`
|
||||
TenantID *string `query:"tenantId"`
|
||||
Sort *string `query:"sort"`
|
||||
IsPinned *bool `query:"is_pinned"`
|
||||
PriceType *string `query:"price_type"`
|
||||
}
|
||||
|
||||
type ContentItem struct {
|
||||
|
||||
@@ -5,6 +5,7 @@ import "quyun/v2/app/requests"
|
||||
type TenantListFilter struct {
|
||||
requests.Pagination
|
||||
Keyword *string `query:"keyword"`
|
||||
Sort *string `query:"sort"`
|
||||
}
|
||||
|
||||
type TenantProfile struct {
|
||||
|
||||
@@ -53,6 +53,10 @@ type Order struct {
|
||||
TenantID string `json:"tenant_id"`
|
||||
TenantName string `json:"tenant_name"`
|
||||
IsVirtual bool `json:"is_virtual"`
|
||||
BuyerName string `json:"buyer_name"`
|
||||
BuyerAvatar string `json:"buyer_avatar"`
|
||||
Title string `json:"title"`
|
||||
Cover string `json:"cover"`
|
||||
}
|
||||
|
||||
type Notification struct {
|
||||
|
||||
@@ -351,6 +351,17 @@ func (r *Routes) Register(router fiber.Router) {
|
||||
r.user.Likes,
|
||||
Local[*models.User]("__ctx_user"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Post /v1/me/notifications/:id/read -> user.MarkNotificationRead")
|
||||
router.Post("/v1/me/notifications/:id/read"[len(r.Path()):], Func2(
|
||||
r.user.MarkNotificationRead,
|
||||
Local[*models.User]("__ctx_user"),
|
||||
PathParam[string]("id"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Post /v1/me/notifications/read-all -> user.MarkAllNotificationsRead")
|
||||
router.Post("/v1/me/notifications/read-all"[len(r.Path()):], Func1(
|
||||
r.user.MarkAllNotificationsRead,
|
||||
Local[*models.User]("__ctx_user"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Get /v1/me/notifications -> user.Notifications")
|
||||
router.Get("/v1/me/notifications"[len(r.Path()):], DataFunc3(
|
||||
r.user.Notifications,
|
||||
|
||||
@@ -260,6 +260,34 @@ func (u *User) Notifications(ctx fiber.Ctx, user *models.User, typeArg string, p
|
||||
return services.Notification.List(ctx, user.ID, page, typeArg)
|
||||
}
|
||||
|
||||
// Mark notification as read
|
||||
//
|
||||
// @Router /v1/me/notifications/:id/read [post]
|
||||
// @Summary Mark as read
|
||||
// @Tags UserCenter
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param id path string 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 {
|
||||
return services.Notification.MarkRead(ctx, user.ID, id)
|
||||
}
|
||||
|
||||
// Mark all notifications as read
|
||||
//
|
||||
// @Router /v1/me/notifications/read-all [post]
|
||||
// @Summary Mark all as read
|
||||
// @Tags UserCenter
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Success 200 {string} string "OK"
|
||||
// @Bind user local key(__ctx_user)
|
||||
func (u *User) MarkAllNotificationsRead(ctx fiber.Ctx, user *models.User) error {
|
||||
return services.Notification.MarkAllRead(ctx, user.ID)
|
||||
}
|
||||
|
||||
// List my coupons
|
||||
//
|
||||
// @Router /v1/me/coupons [get]
|
||||
|
||||
Reference in New Issue
Block a user