- Added SendOTP method for simulating OTP sending. - Implemented LoginWithOTP method for user login/registration via OTP, including user creation if not found. - Added Me method to retrieve current user information. - Implemented Update method for updating user profile details. - Added RealName method for real-name verification. - Implemented GetNotifications method to fetch user notifications. - Created user_test.go for comprehensive unit tests covering login, profile retrieval, updates, real-name verification, and notifications. - Updated database models to use appropriate consts for fields like gender, status, and roles.
65 lines
1.6 KiB
Go
65 lines
1.6 KiB
Go
package services
|
|
|
|
import (
|
|
"context"
|
|
|
|
content_dto "quyun/v2/app/http/v1/dto"
|
|
user_dto "quyun/v2/app/http/v1/dto"
|
|
"quyun/v2/app/requests"
|
|
)
|
|
|
|
// @provider
|
|
type content struct{}
|
|
|
|
func (s *content) List(ctx context.Context, keyword, genre, tenantId, sort string, page int) (*requests.Pager, error) {
|
|
return &requests.Pager{}, nil
|
|
}
|
|
|
|
func (s *content) Get(ctx context.Context, id string) (*content_dto.ContentDetail, error) {
|
|
return &content_dto.ContentDetail{}, nil
|
|
}
|
|
|
|
func (s *content) ListComments(ctx context.Context, id string, page int) (*requests.Pager, error) {
|
|
return &requests.Pager{}, nil
|
|
}
|
|
|
|
func (s *content) CreateComment(ctx context.Context, id string, form *content_dto.CommentCreateForm) error {
|
|
return nil
|
|
}
|
|
|
|
func (s *content) LikeComment(ctx context.Context, id string) error {
|
|
return nil
|
|
}
|
|
|
|
func (s *content) GetLibrary(ctx context.Context) ([]user_dto.ContentItem, error) {
|
|
return []user_dto.ContentItem{}, nil
|
|
}
|
|
|
|
func (s *content) GetFavorites(ctx context.Context) ([]user_dto.ContentItem, error) {
|
|
return []user_dto.ContentItem{}, nil
|
|
}
|
|
|
|
func (s *content) AddFavorite(ctx context.Context, contentId string) error {
|
|
return nil
|
|
}
|
|
|
|
func (s *content) RemoveFavorite(ctx context.Context, contentId string) error {
|
|
return nil
|
|
}
|
|
|
|
func (s *content) GetLikes(ctx context.Context) ([]user_dto.ContentItem, error) {
|
|
return []user_dto.ContentItem{}, nil
|
|
}
|
|
|
|
func (s *content) AddLike(ctx context.Context, contentId string) error {
|
|
return nil
|
|
}
|
|
|
|
func (s *content) RemoveLike(ctx context.Context, contentId string) error {
|
|
return nil
|
|
}
|
|
|
|
func (s *content) ListTopics(ctx context.Context) ([]content_dto.Topic, error) {
|
|
return []content_dto.Topic{}, nil
|
|
}
|