socials

package
v0.0.0-...-f828163 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClubSocial

func ClubSocial(clubParams types.RouteParams)

func GetClubSocials

func GetClubSocials(db *gorm.DB, clubID uuid.UUID) ([]models.Social, error)

func PutClubSocial

func PutClubSocial(db *gorm.DB, social models.Social) (*models.Social, error)

Types

type ClubSocialController

type ClubSocialController struct {
	// contains filtered or unexported fields
}

func NewClubSocialController

func NewClubSocialController(clubSocialService ClubSocialServiceInterface) *ClubSocialController

func (*ClubSocialController) GetClubSocials

func (cc *ClubSocialController) GetClubSocials(c *fiber.Ctx) error

GetClubSocials godoc

@Summary Retrieve all socials for a club @Description Retrieves all socials associated with a club @ID get-socials-by-club @Tags club-social @Produce json @Param clubID path string true "Club ID" @Success 200 {object} []models.Social @Failure 400 {object} error @Failure 404 {object} error @Failure 500 {object} error @Router /clubs/{clubID}/socials/ [get]

func (*ClubSocialController) PutSocial

func (cc *ClubSocialController) PutSocial(c *fiber.Ctx) error

PutSocial godoc

@Summary Creates a social @Description Creates a social @ID put-social @Tags club-social @Accept json @Produce json @Param clubID path string true "Club ID" @Param socialBody body PutSocialRequestBody true "Social Body" @Success 201 {object} models.Social @Failure 400 {object} error @Failure 401 {object} error @Failure 404 {object} error @Failure 500 {object} error @Router /clubs/{clubID}/socials/ [put]

type ClubSocialService

type ClubSocialService struct {
	types.ServiceParams
}

func (*ClubSocialService) GetClubSocials

func (c *ClubSocialService) GetClubSocials(clubID string) ([]models.Social, error)

func (*ClubSocialService) PutClubSocial

func (c *ClubSocialService) PutClubSocial(clubID string, contactBody PutSocialRequestBody) (*models.Social, error)

type ClubSocialServiceInterface

type ClubSocialServiceInterface interface {
	GetClubSocials(clubID string) ([]models.Social, error)
	PutClubSocial(clubID string, contactBody PutSocialRequestBody) (*models.Social, error)
}

func NewClubSocialService

func NewClubSocialService(params types.ServiceParams) ClubSocialServiceInterface

type PutSocialRequestBody

type PutSocialRequestBody struct {
	Type    models.SocialType `json:"type" validate:"required,max=255,oneof=facebook instagram x linkedin youtube github slack discord email customSite"`
	Content string            `json:"content" validate:"required,social_pointer,max=255"`
}

Jump to

Keyboard shortcuts

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