Documentation ¶
Index ¶
- Variables
- type Controller
- type DefaultController
- func (pc *DefaultController) CreateProblem(c *gin.Context)
- func (pc *DefaultController) GetPage(c *gin.Context)
- func (pc *DefaultController) GetProblem(c *gin.Context)
- func (pc *DefaultController) GetProblems(c *gin.Context)
- func (pc *DefaultController) GetRankList(c *gin.Context)
- func (pc *DefaultController) GetRankLists(c *gin.Context)
- func (pc *DefaultController) UpdateProblem(c *gin.Context)
- type DefaultRepository
- func (m DefaultRepository) CountProblems() (count int64)
- func (m DefaultRepository) CreatePage(problemId uint64, locale, title, description string) (page *models.Page, err error)
- func (m DefaultRepository) CreateProblem(name, title string) (problem *models.Problem, err error)
- func (m DefaultRepository) GetPage(problemId uint64, locale string) (p *models.Page, err error)
- func (m DefaultRepository) GetProblemById(id uint64) (p *models.Problem, err error)
- func (m DefaultRepository) GetProblemByName(name string) (p *models.Problem, err error)
- func (m DefaultRepository) GetProblems(offset, limit int) (p []*models.Problem, err error)
- func (m DefaultRepository) UpdateProblem(p *models.Problem) error
- type InitProblemGroupFn
- type Repository
- type Service
Constants ¶
This section is empty.
Variables ¶
View Source
var ProviderSet = wire.NewSet(CreateInitControllersFn, NewController, NewService, NewRepository, )
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 ¶
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 (DefaultRepository) CreateProblem ¶
func (m DefaultRepository) CreateProblem(name, title string) (problem *models.Problem, 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
Click to show internal directories.
Click to hide internal directories.