This commit is contained in:
parent
5e266912c3
commit
28ca0b2f94
|
@ -103,6 +103,8 @@ func AutocompleteHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
username := session.Values["username"].(string)
|
username := session.Values["username"].(string)
|
||||||
|
|
||||||
code := args["code"].(string)
|
code := args["code"].(string)
|
||||||
|
// TODO: 保存文件
|
||||||
|
|
||||||
line := int(args["cursorLine"].(float64))
|
line := int(args["cursorLine"].(float64))
|
||||||
ch := int(args["cursorCh"].(float64))
|
ch := int(args["cursorCh"].(float64))
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ import (
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// gofmt 格式化 Go 源码文件.
|
||||||
func GoFmtHandler(w http.ResponseWriter, r *http.Request) {
|
func GoFmtHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
data := map[string]interface{}{"succ": true}
|
data := map[string]interface{}{"succ": true}
|
||||||
defer util.RetJSON(w, r, data)
|
defer util.RetJSON(w, r, data)
|
||||||
|
@ -71,6 +72,7 @@ func GoFmtHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 格式化 HTML 文件.
|
||||||
func HTMLFmtHandler(w http.ResponseWriter, r *http.Request) {
|
func HTMLFmtHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
data := map[string]interface{}{"succ": true}
|
data := map[string]interface{}{"succ": true}
|
||||||
defer util.RetJSON(w, r, data)
|
defer util.RetJSON(w, r, data)
|
||||||
|
@ -127,6 +129,7 @@ func HTMLFmtHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 格式化 JSON 文件.
|
||||||
func JSONFmtHandler(w http.ResponseWriter, r *http.Request) {
|
func JSONFmtHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
data := map[string]interface{}{"succ": true}
|
data := map[string]interface{}{"succ": true}
|
||||||
defer util.RetJSON(w, r, data)
|
defer util.RetJSON(w, r, data)
|
||||||
|
|
Loading…
Reference in New Issue