problems

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Controller

type Controller interface {
	CreateProblem(c *gin.Context)
	GetProblems(c *gin.Context)
	GetProblem(c *gin.Context)
	GetPage(c *gin.Context)
	UpdateProblem(c *gin.Context)
	GetRankList(c *gin.Context)
	GetRankLists(c *gin.Context)
}

func NewController

func NewController(logger *zap.Logger, s Service, rls ranklists.Service) Controller

type DefaultController

type DefaultController struct {
	// contains filtered or unexported fields
}

func (*DefaultController) CreateProblem

func (pc *DefaultController) CreateProblem(c *gin.Context)

func (*DefaultController) GetPage added in v0.0.6

func (pc *DefaultController) GetPage(c *gin.Context)

func (*DefaultController) GetProblem

func (pc *DefaultController) GetProblem(c *gin.Context)

func (*DefaultController) GetProblems

func (pc *DefaultController) GetProblems(c *gin.Context)

func (*DefaultController) GetRankList added in v0.0.19

func (pc *DefaultController) GetRankList(c *gin.Context)

func (*DefaultController) GetRankLists added in v0.0.19

func (pc *DefaultController) GetRankLists(c *gin.Context)

func (*DefaultController) UpdateProblem

func (pc *DefaultController) UpdateProblem(c *gin.Context)

type DefaultRepository

type DefaultRepository struct {
	// contains filtered or unexported fields
}

func (DefaultRepository) CountProblems

func (m DefaultRepository) CountProblems() (count int64)

func (DefaultRepository) CreatePage

func (m DefaultRepository) CreatePage(problemId uint64, locale, title, description string) (page *models.Page, err error)

func (DefaultRepository) CreateProblem

func (m DefaultRepository) CreateProblem(name, title string) (problem *models.Problem, err error)

func (DefaultRepository) GetPage added in v0.0.6

func (m DefaultRepository) GetPage(problemId uint64, locale string) (p *models.Page, err error)

func (DefaultRepository) GetProblemById

func (m DefaultRepository) GetProblemById(id uint64) (p *models.Problem, err error)

func (DefaultRepository) GetProblemByName

func (m DefaultRepository) GetProblemByName(name string) (p *models.Problem, err error)

func (DefaultRepository) GetProblems

func (m DefaultRepository) GetProblems(offset, limit int) (p []*models.Problem, err error)

func (DefaultRepository) UpdateProblem

func (m DefaultRepository) UpdateProblem(p *models.Problem) error

type InitProblemGroupFn

type InitProblemGroupFn func(r *gin.RouterGroup)

func CreateInitControllersFn

func CreateInitControllersFn(pc Controller) InitProblemGroupFn

type Repository

type Repository interface {
	CreateProblem(name, title string) (p *models.Problem, err error)
	UpdateProblem(p *models.Problem) error
	CreatePage(problemId uint64, locale, title, description string) (p *models.Page, err error)
	GetPage(problemId uint64, locale string) (p *models.Page, err error)

	GetProblemById(id uint64) (*models.Problem, error)
	GetProblemByName(name string) (p *models.Problem, err error)
	GetProblems(offset, limit int) (p []*models.Problem, err error)

	CountProblems() (count int64)
}

func NewRepository

func NewRepository(logger *zap.Logger, db *gorm.DB) Repository

type Service

type Service interface {
	CreateProblem(name, title string) (p *models.Problem, err error)
	UpdateProblem(p *models.Problem, name, title, publicVolume, privateVolume string) (*models.Problem, error)
	GetProblemById(id uint64) (p *models.Problem, err error)
	GetProblemByName(name string) (p *models.Problem, err error)
	GetProblems(page, pageSize int) (res []*models.Problem, err error)

	GetPage(name, locale string) (p *models.Page, err error)
}

func NewService

func NewService(logger *zap.Logger, Repository Repository) Service

Jump to

Keyboard shortcuts

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