123456789101112131415161718192021222324252627 |
- package admin
- import (
- "github.com/gin-gonic/gin"
- "net/http"
- "ulink-admin/frame"
- )
- type HelloController struct {
- }
- func (ctr *HelloController) Json(c *frame.Context) frame.Json {
- return gin.H{
- "hello": "world",
- }
- }
- func (ctr *HelloController) File(c *frame.Context) frame.File {
- head := http.Header{}
- head.Set("Content-Type", "application/octet-stream")
- head.Set("Content-Disposition", "attachment; filename="+"Workbook.xls")
- head.Set("Content-Transfer-Encoding", "binary")
- return frame.File{
- Data: []byte("123, 123, 12312, 3123"),
- ContentType: "application/octet-stream",
- FileName: "1.csv",
- }
- }
|