|
|
|
@ -3,6 +3,7 @@ package core |
|
|
|
import ( |
|
|
|
"aufs/db" |
|
|
|
"encoding/json" |
|
|
|
"fmt" |
|
|
|
"net/http" |
|
|
|
"strconv" |
|
|
|
) |
|
|
|
@ -51,3 +52,25 @@ func Scdetail(w http.ResponseWriter, r *http.Request) { |
|
|
|
uCorsHadler(w, r) |
|
|
|
json.NewEncoder(w).Encode(scresp) |
|
|
|
} |
|
|
|
|
|
|
|
// 编辑
|
|
|
|
func Scedit(w http.ResponseWriter, r *http.Request) { |
|
|
|
// 使用post方式
|
|
|
|
if r.Method != http.MethodPost { |
|
|
|
http.Error(w, "Method not allowed", http.StatusMethodNotAllowed) |
|
|
|
return |
|
|
|
} |
|
|
|
// 解析表单数据
|
|
|
|
frmdata := r.ParseForm() |
|
|
|
fmt.Println(frmdata) |
|
|
|
// 获取参数
|
|
|
|
// id := frmdata.Get("id")
|
|
|
|
// // 转换为整数
|
|
|
|
// scid, err := strconv.Atoi(id)
|
|
|
|
// if err != nil {
|
|
|
|
// // 处理转换错误
|
|
|
|
// }
|
|
|
|
// 数据库初始化
|
|
|
|
db.Init() |
|
|
|
// 编辑
|
|
|
|
} |
|
|
|
|