feat: Implement notification service and integrate with user interactions
- Added notification service to handle sending and listing notifications. - Integrated notification sending on user follow and order payment events. - Updated user service to include fetching followed tenants. - Enhanced content service to manage access control for content assets. - Implemented logic for listing content topics based on genre. - Updated creator service to manage content updates and pricing. - Improved order service to include detailed order information and notifications. - Added tests for notification CRUD operations and order details.
This commit is contained in:
@@ -211,6 +211,19 @@ func (u *User) RemoveLike(ctx fiber.Ctx, contentId string) error {
|
||||
return services.Content.RemoveLike(ctx.Context(), contentId)
|
||||
}
|
||||
|
||||
// Get following tenants
|
||||
//
|
||||
// @Router /v1/me/following [get]
|
||||
// @Summary Get following
|
||||
// @Description Get following tenants
|
||||
// @Tags UserCenter
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Success 200 {array} dto.TenantProfile
|
||||
func (u *User) Following(ctx fiber.Ctx) ([]dto.TenantProfile, error) {
|
||||
return services.Tenant.ListFollowed(ctx.Context())
|
||||
}
|
||||
|
||||
// Get notifications
|
||||
//
|
||||
// @Router /v1/me/notifications [get]
|
||||
@@ -220,8 +233,10 @@ func (u *User) RemoveLike(ctx fiber.Ctx, contentId string) error {
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param type query string false "Type enum(all, system, order, audit, interaction)"
|
||||
// @Success 200 {array} dto.Notification
|
||||
// @Param page query int false "Page number"
|
||||
// @Success 200 {object} requests.Pager{items=[]dto.Notification}
|
||||
// @Bind typeArg query key(type)
|
||||
func (u *User) Notifications(ctx fiber.Ctx, typeArg string) ([]dto.Notification, error) {
|
||||
return services.User.GetNotifications(ctx.Context(), typeArg)
|
||||
// @Bind page query
|
||||
func (u *User) Notifications(ctx fiber.Ctx, typeArg string, page int) (*requests.Pager, error) {
|
||||
return services.Notification.List(ctx.Context(), page, typeArg)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user