background/controller/hardware.go

43 lines
576 B
Go
Raw Normal View History

2020-03-21 03:17:24 +00:00
package controller
import (
2020-03-25 02:57:25 +00:00
"background/model"
2020-03-21 03:17:24 +00:00
"github.com/gin-gonic/gin"
2020-03-25 02:57:25 +00:00
"qiniupkg.com/x/log.v7"
2020-03-21 03:17:24 +00:00
)
2020-03-21 03:17:24 +00:00
func AddHardware(c *gin.Context) {
resp := RespBase{"unkown error",-231,nil}
defer func() {
c.JSON(200,resp)
}()
2020-03-25 02:57:25 +00:00
var hardware model.Hardware
e := c.BindJSON(&hardware)
if nil != e{
log.Print(e)
print(e)
return
}
if nil != hardware.CreateHardware(){
print(e)
return
}
2020-03-24 16:30:55 +00:00
resp.Data = nil
2020-03-21 03:17:24 +00:00
resp.Msg = "OK"
resp.Status = 0
2020-03-24 16:30:55 +00:00
}
func DeleteHardWare(c *gin.Context) {
2020-03-25 02:57:25 +00:00
2020-03-24 16:30:55 +00:00
}
func UpdateHardWare(c *gin.Context) {
}
func ReadHardWare(c *gin.Context) {
}