Documentation ¶
Index ¶
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 { 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
Click to show internal directories.
Click to hide internal directories.