no message

master
zcy 2022-11-08 23:39:04 +08:00
parent 5946bb805d
commit 6c9cb6168d
2 changed files with 26 additions and 1 deletions

View File

@ -208,6 +208,30 @@ func GetArticleCount(c *gin.Context) {
resp.Msg = "OK"
}
func GetArticleHistory(c *gin.Context) {
resp := RespBase{Msg: "FAIL", Status: 211}
defer func() {
c.JSON(200, resp)
}()
query := fmt.Sprintf("select *
from doc_history where doc_history.id = %d",req.id)
doc_history := []model.DocHistory{}
e := db.GetMysqlClient().Query2(query, &doc_history)
if nil != e {
log.Print(e.Error())
return
}
resp.Data = doc_history
resp.Status = 0
resp.Msg = "OK"
}
func GetArticle(c *gin.Context) {
resp := RespBase{Msg: "FAIL", Status: 211}

View File

@ -177,6 +177,7 @@ func main() {
api.GET("/articleCount", controller.GetArticleCount) //获取所有文章个数
api.DELETE("/article/:id", controller.DeleteArticle) ////删除文章
api.DELETE("/article_tree/:id", controller.DeleteArticleTree) ////删除文章
api.GET("/article_history",controller.GetArticleCount) // 历史
api.POST("/image_upload", fileController.OnUpload) // 上传图片,如果图片太大自动裁减为原来的一半
api.POST("/image_upload_origin", fileController.OnUploadOrigin) // 上传图片