Browse Source

更新

master
huangjiajun 3 weeks ago
parent
commit
02f506b4c5
2 changed files with 0 additions and 50 deletions
  1. +0
    -49
      app/hdl/hdl_demo.go
  2. +0
    -1
      app/router/router.go

+ 0
- 49
app/hdl/hdl_demo.go View File

@@ -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
}

+ 0
- 1
app/router/router.go View File

@@ -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) // 以下接口需要用到数据库


Loading…
Cancel
Save