导出excel 代码,可以模仿写
package main
import (
"encoding/json"
"fmt"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/xuri/excelize/v2"
"gorm.io/driver/postgres"
"gorm.io/gorm"
"log"
"time"
)
type Questionnaire struct {
OrgName string `gorm:"column:org_name"`
Name string `gorm:"column:name"`
Department string `gorm:"column:department"`
Position string `gorm:"column:position"`
Email string `gorm:"column:email"`
Tel string `gorm:"column:tel"`
Result string `gorm:"column:result"`
Id int `gorm:"column:id;primaryKey"`
CreatedAt time.Time `gorm:"column:created_at;<-:false"`
UpdatedAt time.Time `gorm:"column:updated_at;<-:false"`
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at"`
}
type Question struct {
Name string `json:"name"`
Answer []string `json:"answer"`
}
type QuestionnairePart struct {
PartName string `json:"partName"`
Result []Question `json:"resu