From cbb4f000677a89c991200f81fac14b9eefceb5d3 Mon Sep 17 00:00:00 2001 From: wangweinj Date: Tue, 17 Jan 2023 17:07:55 +0800 Subject: [PATCH] fix --- controller/usercontroller.go | 3 +-- model/userModel.go | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/controller/usercontroller.go b/controller/usercontroller.go index 76f4a0f..3ba2d04 100644 --- a/controller/usercontroller.go +++ b/controller/usercontroller.go @@ -41,8 +41,6 @@ func upload(ctx iris.Context) { // slice := make([]St, 0) // slice = append(slice, St{ // Name: "ww", - // Age: 12, - // Addr: "上海", // }) b := St{ Name: "ww", @@ -55,5 +53,6 @@ func upload(ctx iris.Context) { // } data := make([]interface{}, 0) data = append(data, &b) + data = append(data, &b) handler.DataToExcel(ctx.ResponseWriter(), ctx.Request(), title, data, "123") } diff --git a/model/userModel.go b/model/userModel.go index eed0ca6..50a5d6d 100644 --- a/model/userModel.go +++ b/model/userModel.go @@ -16,3 +16,9 @@ type User struct { Age int Addr string } + +type User1 struct { + Name string + Age int + Addr string +} -- Gitee