43 lines
576 B
Go
43 lines
576 B
Go
package controller
|
|
|
|
import (
|
|
"background/model"
|
|
"github.com/gin-gonic/gin"
|
|
"qiniupkg.com/x/log.v7"
|
|
)
|
|
|
|
|
|
func AddHardware(c *gin.Context) {
|
|
resp := RespBase{"unkown error",-231,nil}
|
|
defer func() {
|
|
c.JSON(200,resp)
|
|
}()
|
|
var hardware model.Hardware
|
|
|
|
e := c.BindJSON(&hardware)
|
|
if nil != e{
|
|
log.Print(e)
|
|
print(e)
|
|
return
|
|
}
|
|
if nil != hardware.CreateHardware(){
|
|
print(e)
|
|
return
|
|
}
|
|
resp.Data = nil
|
|
resp.Msg = "OK"
|
|
resp.Status = 0
|
|
}
|
|
|
|
func DeleteHardWare(c *gin.Context) {
|
|
|
|
}
|
|
|
|
func UpdateHardWare(c *gin.Context) {
|
|
|
|
}
|
|
|
|
func ReadHardWare(c *gin.Context) {
|
|
|
|
}
|