dao

package
v0.0.0-...-75e61ff Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2021 License: MIT, MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CREVIEWS = "reviews"
	CCLASSES = "classes"
	CREPORTS = "reported"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type SessionDAO

type SessionDAO struct {
	Server   string
	Database string
}

func (*SessionDAO) Connect

func (m *SessionDAO) Connect()

Establish a connection to database

func (*SessionDAO) DeleteById

func (m *SessionDAO) DeleteById(id string) error

Delete an existing review

func (*SessionDAO) FindAll

func (m *SessionDAO) FindAll() ([]models.ResReview, error)

Find list of reviews: All of reviews

func (*SessionDAO) FindAllClasses

func (m *SessionDAO) FindAllClasses() ([]models.Class, error)

Find All of list of classes

func (*SessionDAO) FindById

func (m *SessionDAO) FindById(id string) (models.Review, error)

Find a review by its id

func (*SessionDAO) FindClassByClassID

func (m *SessionDAO) FindClassByClassID(classId string) (models.Class, error)

Find class by class_id

func (*SessionDAO) FindReviewsByClassID

func (m *SessionDAO) FindReviewsByClassID(classId string, page string, offset string) ([]models.ResReview, error)

Find reviews by class_id

func (*SessionDAO) Insert

func (m *SessionDAO) Insert(review models.Review) error

Insert a review into database

func (*SessionDAO) InsertClass

func (m *SessionDAO) InsertClass(class models.Class) error

Insert class to database

func (*SessionDAO) InsertReport

func (m *SessionDAO) InsertReport(report models.Report) error

Insert report to database

func (*SessionDAO) LastReviews

func (m *SessionDAO) LastReviews(page string, offset string) ([]models.ResReview, error)

Find last reviews range with offset

func (*SessionDAO) UpdateBooById

func (m *SessionDAO) UpdateBooById(id string, newBoo uint64, updateAt time.Time) error

Update boo by id

func (*SessionDAO) UpdateClapById

func (m *SessionDAO) UpdateClapById(id string, newClap uint64, updateAt time.Time) error

Update clap by id

func (*SessionDAO) UpdateNuberReviewByClassID

func (m *SessionDAO) UpdateNuberReviewByClassID(classId string, updateAt time.Time) error

Update number of review

func (*SessionDAO) UpdateReportById

func (m *SessionDAO) UpdateReportById(id string, updateAt time.Time) error

Update reported

func (*SessionDAO) UpdateStatsClassByCreated

func (m *SessionDAO) UpdateStatsClassByCreated(classId string, newStats models.StatClass) error

Update stats on class by class_id

func (*SessionDAO) UpdateStatsClassByDeleted

func (m *SessionDAO) UpdateStatsClassByDeleted(classId string, newStats models.StatClass) error

Update stats on class by class_id

Jump to

Keyboard shortcuts

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