Beispiel #1
0
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)
}
Beispiel #2
0
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)
}