Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Comment ¶
type Comment struct { ID uint `json:"id" gorm:"primaryKey"` UserID uint `json:"user_id"` PhotoID uint `json:"photo_id"` Message string `json:"message" valid:"required~Comment message is required" example:"Sheesh!" gorm:"not null"` User *User `json:"user,omitempty"` Photo *Photo `json:"photo,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` }
type CommentRepo ¶
type CommentUsecase ¶
type Photo ¶
type Photo struct { ID uint `json:"id" gorm:"primaryKey"` UserID uint `json:"user_id"` Title string `json:"title" valid:"required~Photo title is required" example:"My Sweet Photo" gorm:"not null"` PhotoUrl string `` /* 137-byte string literal not displayed */ Caption string `json:"caption" example:"Beautiful as it is"` User *User `json:"user,omitempty"` Comments *[]Comment `json:"-" gorm:"constraint:OnDelete:SET NULL;"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` }
type PhotoUsecase ¶
type SocialMedia ¶
type SocialMedia struct { ID uint `json:"id" gorm:"primaryKey"` UserID uint `json:"user_id"` Name string `json:"name" valid:"required~Social media name is required" example:"johndee13" gorm:"not null"` SocialMediaUrl string `json:"social_media_url" valid:"required~Social media url is required" example:"johndee13url" gorm:"not null"` User *User `json:"user,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` }
func (*SocialMedia) BeforeCreate ¶
func (s *SocialMedia) BeforeCreate(db *gorm.DB) (err error)
func (*SocialMedia) BeforeUpdate ¶
func (s *SocialMedia) BeforeUpdate(db *gorm.DB) (err error)
type SocialMediaRepo ¶
type SocialMediaRepo interface { Fetch(context.Context, *[]SocialMedia, uint) error Store(context.Context, *SocialMedia) error GetByUserID(context.Context, *SocialMedia, uint) error Update(context.Context, SocialMedia, uint) (SocialMedia, error) Delete(context.Context, uint) error }
type SocialMediaUsecase ¶
type SocialMediaUsecase interface { Fetch(context.Context, *[]SocialMedia, uint) error Store(context.Context, *SocialMedia) error GetByUserID(context.Context, *SocialMedia, uint) error Update(context.Context, SocialMedia, uint) (SocialMedia, error) Delete(context.Context, uint) error }
type User ¶
type User struct { ID uint `json:"id" gorm:"primaryKey"` Username string `json:"username" valid:"required~Username is required" example:"Johndee" gorm:"not null;uniqueIndex;"` Email string `` /* 131-byte string literal not displayed */ Password string `` /* 166-byte string literal not displayed */ Age int `` /* 145-byte string literal not displayed */ ProfileImageUrl string `json:"profile_image_url,omitempty" example:"https://avatars.dicebear.com/api/identicon/your-custom-seed.svg"` Photos *[]Photo `json:"-" gorm:"constraint:OnDelete:SET NULL;"` Comments *[]Comment `json:"-" gorm:"constraint:OnDelete:SET NULL;"` SocialMedia *SocialMedia `json:"-" gorm:"constraint:OnDelete:SET NULL;"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` }
Click to show internal directories.
Click to hide internal directories.