You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
646 B
35 lines
646 B
package core
|
|
|
|
import (
|
|
"aufs/db"
|
|
"encoding/json"
|
|
"net/http"
|
|
)
|
|
|
|
// 输出的结构
|
|
type ScJson struct {
|
|
Message string `json:"message"`
|
|
Status int `json:"status"`
|
|
Data []db.StServerInfo `json:"data"`
|
|
}
|
|
|
|
// 系统设置
|
|
func Settdb(w http.ResponseWriter, r *http.Request) {
|
|
// 数据库初始化
|
|
db.Init()
|
|
sclst := db.GetlScList()
|
|
|
|
// 打印查询结果
|
|
// for _, sc := range sclst {
|
|
// fmt.Printf(&sc.Id, &sc.Scname, &sc.Addr, &sc.Port, &sc.Token, &sc.Status)
|
|
// }
|
|
|
|
//
|
|
scresp := ScJson{
|
|
Message: "success",
|
|
Status: 200,
|
|
Data: sclst,
|
|
}
|
|
uCorsHadler(w, r)
|
|
json.NewEncoder(w).Encode(scresp)
|
|
}
|
|
|