feat: 新增sql脚本执行及其他优化

This commit is contained in:
meilin.huang
2021-11-25 14:34:15 +08:00
parent a8824d2f18
commit d762d346e0
10 changed files with 177 additions and 20 deletions

View File

@@ -1,6 +1,7 @@
package api
import (
"bytes"
"mayfly-go/base/biz"
"mayfly-go/base/ctx"
"mayfly-go/base/ginx"
@@ -30,6 +31,13 @@ func (m *Machine) Machines(rc *ctx.ReqCtx) {
rc.ResData = res
}
func (m *Machine) MachineStats(rc *ctx.ReqCtx) {
writer := bytes.NewBufferString("")
stats := m.MachineApp.GetCli(GetMachineId(rc.GinCtx)).GetAllStats()
machine.ShowStats(writer, stats)
rc.ResData = writer.String()
}
func (m *Machine) SaveMachine(rc *ctx.ReqCtx) {
g := rc.GinCtx
machineForm := new(form.MachineForm)