Documentation ¶
Index ¶
- type Comment
- type CommentRepository
- type Count
- type CreatePresentation
- type Presentation
- type PresentationRepository
- type Reaction
- type ReactionRepository
- type ReactionStatistics
- type Repository
- type Review
- type ReviewRepository
- type ReviewStatistics
- type Score
- type SqlxRepository
- func (repo *SqlxRepository) CreateComment(comment *Comment) error
- func (repo *SqlxRepository) CreatePresentation(presentation *CreatePresentation) error
- func (repo *SqlxRepository) CreateReaction(reaction *Reaction) error
- func (repo *SqlxRepository) CreateReview(review *Review) error
- func (repo *SqlxRepository) DeletePresentation(id int) error
- func (repo *SqlxRepository) GetComments(id int) ([]*Comment, error)
- func (repo *SqlxRepository) GetFirstPresentation() (*Presentation, error)
- func (repo *SqlxRepository) GetPresentation(id int) (*Presentation, error)
- func (repo *SqlxRepository) GetPresentations() ([]*Presentation, error)
- func (repo *SqlxRepository) GetReactionStatistics(id int) (*ReactionStatistics, error)
- func (repo *SqlxRepository) GetReviewStatistics(id int) (*ReviewStatistics, error)
- func (repo *SqlxRepository) GetState() (*State, error)
- func (repo *SqlxRepository) IsExistReview(userID uuid.UUID, presenID int) (bool, error)
- func (repo *SqlxRepository) UpdatePresentation(presentation *Presentation) error
- func (repo *SqlxRepository) UpdateReview(review *Review) error
- func (repo *SqlxRepository) UpdateState(state *State) error
- type State
- type StateRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommentRepository ¶
type CreatePresentation ¶
type Presentation ¶
type Presentation struct { ID int `db:"id" json:"id"` Name utils.String `db:"name" json:"name"` Speakers utils.String `db:"speakers" json:"speakers"` Description utils.String `db:"description" json:"description"` Prev utils.Int `db:"prev" json:"prev"` Next utils.Int `db:"next" json:"next"` CreatedAt time.Time `db:"createdAt" json:"createdAt"` UpdatedAt time.Time `db:"updatedAt" json:"updatedAt"` }
type PresentationRepository ¶
type PresentationRepository interface { CreatePresentation(presentation *CreatePresentation) error UpdatePresentation(presentation *Presentation) error GetPresentations() ([]*Presentation, error) GetFirstPresentation() (*Presentation, error) GetPresentation(id int) (*Presentation, error) DeletePresentation(id int) error }
type ReactionRepository ¶
type ReactionRepository interface { CreateReaction(reaction *Reaction) error GetReactionStatistics(id int) (*ReactionStatistics, error) }
type ReactionStatistics ¶
type Repository ¶
type Repository interface { StateRepository PresentationRepository ReactionRepository CommentRepository ReviewRepository }
func NewSqlxRepository ¶
func NewSqlxRepository(db *sqlx.DB) (Repository, error)
NewSqlxRepository リポジトリ実装を初期化して生成します
type ReviewRepository ¶
type ReviewStatistics ¶
type ReviewStatistics struct { PresentationId int `db:"presentationId" json:"presentationId"` Count int `db:"COUNT(*)" json:"count"` AvgSkill float64 `db:"AVG(skill)" json:"avgSkill"` AvgArtistry float64 `db:"AVG(artistry)" json:"avgArtistry"` AvgIdea float64 `db:"AVG(idea)" json:"avgIdea"` AvgPresentation float64 `db:"AVG(presentation)" json:"avgPresentation"` }
type SqlxRepository ¶
type SqlxRepository struct {
// contains filtered or unexported fields
}
SqlxRepository sqlxリポジトリ実装
func (*SqlxRepository) CreateComment ¶
func (repo *SqlxRepository) CreateComment(comment *Comment) error
func (*SqlxRepository) CreatePresentation ¶
func (repo *SqlxRepository) CreatePresentation(presentation *CreatePresentation) error
TODO: read lock
func (*SqlxRepository) CreateReaction ¶
func (repo *SqlxRepository) CreateReaction(reaction *Reaction) error
func (*SqlxRepository) CreateReview ¶
func (repo *SqlxRepository) CreateReview(review *Review) error
func (*SqlxRepository) DeletePresentation ¶
func (repo *SqlxRepository) DeletePresentation(id int) error
func (*SqlxRepository) GetComments ¶
func (repo *SqlxRepository) GetComments(id int) ([]*Comment, error)
func (*SqlxRepository) GetFirstPresentation ¶
func (repo *SqlxRepository) GetFirstPresentation() (*Presentation, error)
func (*SqlxRepository) GetPresentation ¶
func (repo *SqlxRepository) GetPresentation(id int) (*Presentation, error)
func (*SqlxRepository) GetPresentations ¶
func (repo *SqlxRepository) GetPresentations() ([]*Presentation, error)
func (*SqlxRepository) GetReactionStatistics ¶
func (repo *SqlxRepository) GetReactionStatistics(id int) (*ReactionStatistics, error)
func (*SqlxRepository) GetReviewStatistics ¶
func (repo *SqlxRepository) GetReviewStatistics(id int) (*ReviewStatistics, error)
func (*SqlxRepository) GetState ¶
func (repo *SqlxRepository) GetState() (*State, error)
func (*SqlxRepository) IsExistReview ¶
func (*SqlxRepository) UpdatePresentation ¶
func (repo *SqlxRepository) UpdatePresentation(presentation *Presentation) error
func (*SqlxRepository) UpdateReview ¶
func (repo *SqlxRepository) UpdateReview(review *Review) error
func (*SqlxRepository) UpdateState ¶
func (repo *SqlxRepository) UpdateState(state *State) error
Click to show internal directories.
Click to hide internal directories.