no message

master
DESKTOP-4RNDQIC\29019 2021-03-04 21:26:09 +08:00
parent 5b9ec97933
commit cb2534a3cd
1 changed files with 5 additions and 5 deletions

View File

@ -161,7 +161,7 @@ func GetArticle(c *gin.Context) {
func UpdateArtilce(c *gin.Context) {
rsp := RespBase{Msg: "FAIL", Status: 210}
type ReqUpdateArticle struct {
Id int64 `json:"id"`
ID int64 `json:"id"`
Title string `json:"title"`
Content string `json:"content"`
author string `json:"author"`
@ -173,7 +173,7 @@ func UpdateArtilce(c *gin.Context) {
c.JSON(200, rsp)
}()
query := fmt.Sprintf("select * from doc where doc.id = '%d'", id)
query := fmt.Sprintf("select * from doc where doc.id = '%d'", req.ID)
docs := []model.Doc{}
e := db.GetMysqlClient().Query2(query, &docs)
if nil != e {
@ -200,7 +200,7 @@ func UpdateArtilce(c *gin.Context) {
Title: req.Title,
Content: req.Content,
Author: req.author,
ID: req.Id,
ID: req.ID,
IsPublic: int32(req.IsPublic),
Version: (docs[0].Version + 1),
},
@ -244,11 +244,11 @@ func AddArticle(c *gin.Context) {
}
e := model.CreateDoc(
model.Doc{
Type: req.Type,
Type: int32(req.Type),
Title: req.Title,
Content: req.Content,
Author: req.Author,
IsPublic: req.Ispublic,
IsPublic: int32(req.Ispublic),
},
)
if nil != e {