示例#1
0
文件: judge.go 项目: kien8995/judger
func (this *TaskAddController) Http(data map[string]interface{}, w http.ResponseWriter, r *http.Request) {
	judge.AddTask(data)

	result, _ := com.JsonEncode(map[string]interface{}{
		"result": true, //bool, login result
		"msg":    "task added",
	})
	io.WriteString(w, result)
}
示例#2
0
文件: judge.go 项目: kien8995/judger
func (this *TaskAddController) Tcp(data map[string]interface{}, cli *core.Client) {
	judge.AddTask(data)

	result, _ := com.JsonEncode(map[string]interface{}{
		"result": true, //bool, login result
		"msg":    "task added",
	})
	cli.Write(result)
}