notification

package
v0.0.0-...-7df3c15 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2022 License: MIT Imports: 4 Imported by: 0

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)

Jump to

Keyboard shortcuts

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