通过接口执行模型检查
This commit is contained in:
@@ -18,6 +18,10 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
models_update()
|
||||
}
|
||||
|
||||
func models_update() {
|
||||
// 初始化模型路由: 检查本地模型目录是否存在, 不存在则创建
|
||||
if _, err := os.Stat("data/models"); err != nil {
|
||||
if err := os.MkdirAll("data/models", 0777); err != nil {
|
||||
@@ -67,6 +71,12 @@ func init() {
|
||||
}
|
||||
}
|
||||
|
||||
// 更新检查本地模型列表
|
||||
func ModelsUpdate(w http.ResponseWriter, r *http.Request) {
|
||||
models_update()
|
||||
w.Write([]byte("ok"))
|
||||
}
|
||||
|
||||
// 獲取模型列表
|
||||
func ModelsGet(w http.ResponseWriter, r *http.Request) {
|
||||
var listview models.ListView
|
||||
|
Reference in New Issue
Block a user