mirror of
https://github.com/criyle/go-judge.git
synced 2025-11-04 14:50:02 +08:00
- Add new command executorserver as the draft executor server - Move shared pool logic into /pkg/pool
23 lines
387 B
Go
23 lines
387 B
Go
package main
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func handleRun(c *gin.Context) {
|
|
var req request
|
|
if err := c.ShouldBindJSON(&req); err != nil {
|
|
c.AbortWithError(http.StatusBadRequest, err)
|
|
return
|
|
}
|
|
|
|
if len(req.Cmd) == 0 {
|
|
c.AbortWithStatusJSON(http.StatusBadRequest, "no cmd provided")
|
|
return
|
|
}
|
|
ret := submitRequest(&req)
|
|
c.JSON(http.StatusOK, <-ret)
|
|
}
|