me

package
v0.0.0-...-41d384d Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFeed

func GetFeed(c *fiber.Ctx) error

func GetNotifications

func GetNotifications(c *fiber.Ctx) error

func GetUnreadNotifications

func GetUnreadNotifications(c *fiber.Ctx) error

func UpdateNotification

func UpdateNotification(c *fiber.Ctx) error

func UpdateUser

func UpdateUser(c *fiber.Ctx) error

func User

func User(c *fiber.Ctx) error

Types

type Notification

type Notification struct {
	ID          primitive.ObjectID  `json:"id"`
	CreatedAt   primitive.Timestamp `json:"created_at"`
	TargetUser  NotificationUser    `json:"target_user"`
	SourceUser  NotificationUser    `json:"source_user"`
	Type        string              `json:"type"`
	TypeContent string              `json:"type_content"`
	Read        bool                `json:"read"`
}

type NotificationUser

type NotificationUser struct {
	ID          primitive.ObjectID  `json:"id"`
	CreatedAt   primitive.Timestamp `json:"created_at"`
	Role        string              `json:"role"`
	DisplayName string              `json:"display_name"`
	Username    string              `json:"username"`
	About       string              `json:"about,omitempty"`
	Points      uint                `json:"points"`
}

type PostsResponse

type PostsResponse struct {
	Message string                       `json:"message"`
	Posts   []models.PostResponseContent `json:"posts"`
}

type UpdateNotificationBody

type UpdateNotificationBody struct {
	Read *bool `json:"read" validate:"required"`
}

type UpdateUserBody

type UpdateUserBody struct {
	Email       string `json:"email" validate:"omitempty,email"`
	DisplayName string `json:"display_name" validate:"omitempty,min=1,max=25"`
	Username    string `json:"username" validate:"omitempty,min=3,max=25,username_valid"`
	Password    string `json:"password" validate:"omitempty,min=8,max=50"`
	About       string `json:"about" validate:"omitempty,max=200"`
}

Jump to

Keyboard shortcuts

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