go-common/app/admin/ep/merlin/http/machineV2.go

30 lines
532 B
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
package http
import (
"go-common/app/admin/ep/merlin/model"
bm "go-common/library/net/http/blademaster"
"go-common/library/net/http/blademaster/binding"
)
func genMachinesV2(c *bm.Context) {
var (
gmr = &model.GenMachinesRequest{}
err error
username string
)
if username, err = getUsername(c); err != nil {
return
}
if err = c.BindWith(gmr, binding.JSON); err != nil {
return
}
if err = gmr.Verify(); err != nil {
c.JSON(nil, err)
return
}
c.JSON(nil, svc.GenMachinesV2(c, gmr, username))
}