diff --git a/app/hdl/hdl_demo.go b/app/hdl/hdl_demo.go index 5c62078..5e1df8b 100644 --- a/app/hdl/hdl_demo.go +++ b/app/hdl/hdl_demo.go @@ -4,9 +4,6 @@ import ( "applet/app/e" "applet/app/svc" "github.com/gin-gonic/gin" - "io" - "net/http" - "os" ) func Demo(c *gin.Context) { @@ -24,49 +21,3 @@ func Demo(c *gin.Context) { }, nil) return } -func Demo1(c *gin.Context) { - path := "/data/advertisement-pdf" - imgUrl := "http://miniapp.bianxian.com/_0000000000_2024103011290507244911708.ttf" - - // Get the data - resp, err := http.Get(imgUrl) - if err != nil { - panic(err) - } - defer resp.Body.Close() - - // 创建一个文件用于保存 - out, err := os.Create(path + "/_0000000000_2024103011290507244911708.ttf") - if err != nil { - panic(err) - } - defer out.Close() - - // 然后将响应流和文件流对接起来 - _, err = io.Copy(out, resp.Body) - if err != nil { - panic(err) - } - imgUrl1 := "http://miniapp.bianxian.com/_0000000000_2024103011210157735330925.png" - - // Get the data - resp1, err1 := http.Get(imgUrl1) - if err1 != nil { - panic(err1) - } - defer resp.Body.Close() - - // 创建一个文件用于保存 - out1, err1 := os.Create(path + "/_0000000000_2024103011210157735330925.png") - if err1 != nil { - panic(err1) - } - defer out.Close() - - // 然后将响应流和文件流对接起来 - _, err1 = io.Copy(out1, resp.Body) - if err1 != nil { - panic(err1) - } - return -} diff --git a/app/router/router.go b/app/router/router.go index 9f08caa..19878bd 100644 --- a/app/router/router.go +++ b/app/router/router.go @@ -51,7 +51,6 @@ func Init() *gin.Engine { func route(r *gin.RouterGroup) { r.GET("/test", hdl.Demo) - r.GET("/test1", hdl.Demo1) r.POST("/qiniuyun/callback", hdl.FileImgCallback) //七牛云回调 r.GET("/settle/file/down", hdl.SettleCenterSettleFileDown) //结算中心-结算报表-结算单下载 r.Use(mw.DB) // 以下接口需要用到数据库