submissions

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: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Controller

type Controller interface {
	CreateSubmission(c *gin.Context)
	GetSubmissions(c *gin.Context)
	GetSubmission(c *gin.Context)
}

func NewController

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

type InitSubmissionGroupFn

type InitSubmissionGroupFn func(r *gin.RouterGroup)

func CreateInitControllersFn

func CreateInitControllersFn(sc Controller) InitSubmissionGroupFn

type Repository

type Repository interface {
	GetSubmission(submissionId string) (*models.Submission, error)
	GetSubmissionById(id uint64) (*models.Submission, error)
	GetSubmissions(offset, limit int, problemId string) ([]*models.Submission, error)
	// TODO: Improve this...
	GetSubmissionsByAccount(offset, limit int, accountId uint64) ([]*models.Submission, error)
	Create(submitterID, problemId uint64, userSpace string) (s *models.Submission, err error)
	Update(s *models.Submission) error
}

func NewRepository

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

type Service

type Service interface {
	Create(submitterID uint64, problemName string, userSpace string) (code int, s *models.Submission, j *models.Judgement, err error)
	GetSubmission(submissionId string) (s *models.Submission, err error)
	GetSubmissions(problemId string, page, pageSize int) (res []*models.Submission, err error)
	GetSubmissionsByAccountId(accountId uint64, page, pageSize int) (res []*models.Submission, err error)
}

func NewService

func NewService(
	logger *zap.Logger,

	repository Repository,
	problemsRepository problems.Repository,
	judgementsService judgements.Service,
) Service

Jump to

Keyboard shortcuts

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