service

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2024 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddNotificationUser

func AddNotificationUser(user model.NotificationUser) (model.NotificationUser, error)

func AddUser

func AddUser(user model.User) (model.User, error)

func AddUserDashboard

func AddUserDashboard(dashboard model.Dashboard, uuid uuid.UUID) (model.Dashboard, error)

func AddWidget

func AddWidget(widget model.Widget) (model.Widget, error)

func GetDashboardById

func GetDashboardById(id primitive.ObjectID) (model.Dashboard, error)

func GetDashboardForUser

func GetDashboardForUser(meetingState string, uuid uuid.UUID) (*model.Dashboard, bool, error)

GetDashboardForUser returns the dashboard for the user, a boolean if it is the default dashboard and if occurred an error

func GetDefaultDashboard

func GetDefaultDashboard(meetingState string) (model.Dashboard, error)

func GetMeetingById

func GetMeetingById(id string) (*meetingModel.Meeting, error)

func GetNotificationUserById

func GetNotificationUserById(id primitive.ObjectID) (model.NotificationUser, error)

func GetNotificationUserByToken

func GetNotificationUserByToken(token string) (model.NotificationUser, error)

func GetNotificationUserByUserId added in v0.1.4

func GetNotificationUserByUserId(id primitive.ObjectID) (model.NotificationUser, error)

func GetNotificationUsers

func GetNotificationUsers() ([]model.NotificationUser, error)

func GetNotificationUsersByUserIds added in v0.1.4

func GetNotificationUsersByUserIds(userIds []primitive.ObjectID) ([]model.NotificationUser, error)

func GetUserById

func GetUserById(id primitive.ObjectID) (model.User, error)

func GetUserByKeycloakId

func GetUserByKeycloakId(id uuid.UUID) (model.User, error)

GetUserByKeycloakId gets a user by keycloak id, creates new one if not existing so far

func GetUsers

func GetUsers() ([]model.User, error)

func GetUsersByIsFollower added in v0.1.4

func GetUsersByIsFollower(athleteIds []primitive.ObjectID) ([]model.User, error)

func GetUsersByIsFollowerOrMe added in v0.1.4

func GetUsersByIsFollowerOrMe(athleteIds []primitive.ObjectID) ([]model.User, error)

func GetUsersByIsMe added in v0.1.4

func GetUsersByIsMe(athleteIds []primitive.ObjectID) ([]model.User, error)

func GetWidgets

func GetWidgets() ([]model.Widget, error)

func Init

func Init(c *mongo.Client)

func ModifyFollowForUser

func ModifyFollowForUser(id uuid.UUID, athleteId primitive.ObjectID, follow bool) (model.User, error)

func ModifyMe

func ModifyMe(id uuid.UUID, athleteId primitive.ObjectID, set bool) (model.User, error)

func ModifyUserLanguage

func ModifyUserLanguage(id uuid.UUID, language string) (model.User, error)

func ModifyUserMeetings

func ModifyUserMeetings(id uuid.UUID, meeting string, subscribe bool) (model.User, error)

func ModifyUserTheme

func ModifyUserTheme(id uuid.UUID, theme string) (model.User, error)

func PingDatabase

func PingDatabase() bool

func RegisterNotificationUser

func RegisterNotificationUser(token string, device model.Device, settings model.NotificationSettings, user *model.User) (model.NotificationUser, error)

RegisterNotificationUser adds the given token to the database, if the token already exists, it just returns the user

func RemoveNotificationUserById

func RemoveNotificationUserById(id primitive.ObjectID) error

func RemoveUserById

func RemoveUserById(id primitive.ObjectID) error

func RemoveUserDashboard

func RemoveUserDashboard(id primitive.ObjectID, uuid uuid.UUID) error

func RemoveWidget

func RemoveWidget(id primitive.ObjectID) error

func SendPushBroadcast

func SendPushBroadcast(channel string, content string) (string, string, string, int, error)

func SendPushMeetingBroadcast

func SendPushMeetingBroadcast(meetingId string, content string) (string, string, string, int, error)

func SendPushNotification

func SendPushNotification(receiver string, title string, subtitle string, message string, interruptionLevel string) (string, string, int, error)

func SendPushNotificationForMeeting added in v0.1.4

func SendPushNotificationForMeeting(meetingId string, request dto.MeetingNotificationRequestDto) (int, int, int, error)

func SendPushNotificationForMeetingAndAthletes added in v0.1.4

func SendPushNotificationForMeetingAndAthletes(meetingId string, athleteIds []primitive.ObjectID, request dto.MeetingNotificationRequestDto) (int, int, int, error)

func SendTestPushNotification

func SendTestPushNotification(receiver string) error

func UpdateNotificationUser

func UpdateNotificationUser(user model.NotificationUser) (model.NotificationUser, error)

func UpdateUser

func UpdateUser(user model.User) (model.User, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL