添加测试环境部署脚本
parent
1be2d54c25
commit
2b7c0450bb
20
main.go
20
main.go
|
@ -45,7 +45,7 @@ func InitLogs() {
|
|||
func CORSMiddleware(c *gin.Context) {
|
||||
c.Writer.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE, UPDATE")
|
||||
c.Writer.Header().Set("Access-Control-Allow-Origin",
|
||||
"http://172.21.102.193:8080")
|
||||
"http://localhost:8080")
|
||||
c.Writer.Header().Set("Access-Control-Max-Age", "86400")
|
||||
c.Writer.Header().Set("Access-Control-Allow-Headers",
|
||||
"X-Requested-With," +
|
||||
|
@ -98,16 +98,18 @@ func main() {
|
|||
/** 修改密码**/
|
||||
api.POST("modify_pass",middle.AuthMiddle,userController.ModifyPasswd)
|
||||
|
||||
api.GET("/article/:id",controller.GetArticle)
|
||||
api.POST("/articles",controller.GetArticles)
|
||||
api.GET("/article/:id",controller.GetArticle) //获取文章
|
||||
api.POST("/articles",controller.GetArticles) // 获取所有文章
|
||||
api.PUT("/article",controller.AddArticle) // 添加文章
|
||||
api.GET("article_type",controller.ArticlesType) //获取所有文章分类
|
||||
api.POST("/article_update",controller.UpdateArtilce)
|
||||
api.GET("/articleCount",controller.GetArticleCount)
|
||||
api.DELETE("/article/:id",controller.DeleteArticle)
|
||||
api.POST("/image_upload",fileController.OnUpload)
|
||||
api.GET("/image_download/:file",fileController.OnDownLoad)
|
||||
api.GET("/doc_types",controller.ArticlesTypes)
|
||||
api.POST("/article_update",controller.UpdateArtilce) //更新文章
|
||||
api.GET("/articleCount",controller.GetArticleCount) //获取所有文章个数
|
||||
api.DELETE("/article/:id",controller.DeleteArticle) ////删除文章
|
||||
api.POST("/image_upload",fileController.OnUpload) // 上传图片
|
||||
api.GET("/image_download/:file",fileController.OnDownLoad) // 下载图片
|
||||
api.GET("/doc_types",controller.ArticlesTypes) // 获取所有的文章类型
|
||||
|
||||
|
||||
}
|
||||
|
||||
e := r.Run(":" + strconv.Itoa(config.GetPort()))
|
||||
|
|
Loading…
Reference in New Issue