no message

master
DESKTOP-4RNDQIC\29019 2021-03-26 21:44:35 +08:00
parent 540229aa5e
commit 33e10b99ab
2 changed files with 14 additions and 3 deletions

View File

@ -795,7 +795,18 @@ func DeleteDocTemplate(c *gin.Context) {
defer func() { defer func() {
c.JSON(200, resp) c.JSON(200, resp)
}() }()
type ReqDeleteDocTemplate struct { sid := c.Param("id")
id,e := strconv.Atoi(sid)
if nil != e{
log.Print(e.Error())
return
} }
e = model.DeleteDocTemplate(int32(id))
if nil != e{
log.Print(e.Error())
return
}
resp.Data = nil
resp.Msg = "OK"
resp.Status = 0
} }

View File

@ -37,7 +37,7 @@ func UpdateDocTemplate(templ DocTemplate) error{
} }
func DeleteDocTemplate(id int32) error{ func DeleteDocTemplate(id int32) error{
sql := fmt.Sprintf(`delete from doc_template doc_template memo.id = '%d'`,id) sql := fmt.Sprintf(`delete from doc_template where id = '%d'`,id)
_, e := db.GetMysqlClient().Query(sql) _, e := db.GetMysqlClient().Query(sql)
if nil != e { if nil != e {
logs.Error(e.Error()) logs.Error(e.Error())