Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Notification ¶
type Notification struct { ID int `json:"id"` UserUID int `json:"user_id" validate:"required"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` DeletedAt *time.Time `json:"deleted_at"` Title string `json:"title" validate:"required"` Body string `json:"body" validate:"required"` }
type NotificationRepository ¶
type NotificationRepository interface { Create(*Notification) error ReadByNotificationID(int) (Notification, error) ReadByUserID(int) ([]Notification, error) }
type NotificationRepositoryDb ¶
type NotificationRepositoryDb struct {
// contains filtered or unexported fields
}
func NewNotificationRepositoryDb ¶
func NewNotificationRepositoryDb(db *sql.DB) NotificationRepositoryDb
func (NotificationRepositoryDb) Create ¶
func (r NotificationRepositoryDb) Create(notificationObj *Notification) error
TODO user not found error
func (NotificationRepositoryDb) ReadByNotificationID ¶
func (r NotificationRepositoryDb) ReadByNotificationID(id int) (Notification, error)
func (NotificationRepositoryDb) ReadByUserID ¶
func (r NotificationRepositoryDb) ReadByUserID(id int) ([]Notification, error)
Click to show internal directories.
Click to hide internal directories.