app

package
v0.0.0-...-f3f7f80 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2019 License: AGPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const GIN_JUDGER = "github.com/syzoj/syzoj-ng-go/svc/app.judger"
View Source
const GIN_USER_ID = "USER_ID"

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Db           *sql.DB
	ListenAddr   string
	Redis        *svcredis.RedisService // The persistent redis instance. No eviction policies allowed.
	RedisCache   *svcredis.RedisService
	JudgeService *judge.JudgeService
	EmailService *email.EmailService // optional
	JudgeToken   string
}

func DefaultApp

func DefaultApp(db *sql.DB, redis *svcredis.RedisService, redisCache *svcredis.RedisService, listenAddr string, judgeService *judge.JudgeService) *App

func (*App) Run

func (a *App) Run(ctx context.Context) error

func (*App) UserMiddleware

func (a *App) UserMiddleware(c *gin.Context)

type ForgetRequest

type ForgetRequest struct {
	Email string `json:"email" form:"email"`
}

type GetProblemResponse

type GetProblemResponse struct {
	Title string `json:"title"`
	Body  string `json:"body"`
}

type GetProblemsResponse

type GetProblemsResponse struct {
	Problems []*GetProblemsResponseProblem
}

type GetProblemsResponseProblem

type GetProblemsResponseProblem struct {
	Id         string      `json:"id"`
	Title      null.String `json:"title"`
	Tags       []string    `json:"tags"`
	SubmitNum  int64       `json:"submit_num"`
	AcceptNum  int64       `json:"accept_num"`
	LastSubmit null.String `json:"last_submit"`
	LastAccept null.String `json:"last_accept"`
}

type HeaderResponse

type HeaderResponse struct {
	User *models.User `json:"user"`
}

type IndexResponse

type IndexResponse struct {
	Divine   *divine.Divine
	Ranklist []*IndexResponseUser    `json:"ranklist"`
	Notices  []*IndexResponseNotice  `json:"notices"`
	Contests []*IndexResponseContest `json:"contests"`
	Problems []*IndexResponseProblem `json:"problems"`
}

type IndexResponseContest

type IndexResponseContest struct {
	ID        int      `json:"id"`
	StartTime null.Int `json:"start_time"`
	EndTime   null.Int `json:"end_time"`
}

type IndexResponseNotice

type IndexResponseNotice struct {
	ID    int         `json:"id"`
	Title null.String `json:"title"`
	Date  null.Int    `json:"date"`
}

type IndexResponseProblem

type IndexResponseProblem struct {
	ID            int         `json:"id"`
	Title         null.String `json:"title"`
	PublicizeTime null.Time   `json:"publicize_time"`
}

type IndexResponseUser

type IndexResponseUser struct {
	ID          int         `json:"id"`
	Username    null.String `json:"username"`
	Nameplate   null.String `json:"nameplate"`
	Information null.String `json:"information"`
}

type LoginRequest

type LoginRequest struct {
	UserName string `json:"username" form:"username"`
	Password string `json:"password" form:"password"`
}

type TaskResult

type TaskResult struct {
	Id   string          `json:"id"`
	Sid  string          `json:"sid"`
	Type string          `json:"type"`
	Data json.RawMessage `json:"data"`
}

Jump to

Keyboard shortcuts

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