作者 yangfu
package query
type ExcelDataFieldsQuery struct {
//操作人
// 业务编码
Code string `form:"code"`
}
... ...
... ... @@ -8,6 +8,7 @@ import (
"github.com/linmadan/egglib-go/core/application"
"github.com/linmadan/egglib-go/utils/excel"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/excelData/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/excelData/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/domainService"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user"
... ... @@ -215,9 +216,9 @@ func (srv ExcelDataService) FileImportTemplate(importDataCommand *command.Import
}, nil
}
func (srv ExcelDataService) GetExcelDataFields(code string) (interface{}, error) {
func (srv ExcelDataService) GetExcelDataFields(param *query.ExcelDataFieldsQuery) (interface{}, error) {
dataFileds := []DataFieldOptions{}
switch code {
switch param.Code {
case domain.ExportCompanyUser:
dataFileds = (ExportCompanyUserData{}).AllFields()
case domain.ExportCooperationUser:
... ...
... ... @@ -293,5 +293,8 @@ func (controller *ExcelDataController) ExportCooperationUser() {
//GetExcelDataFields 获取导出excel数据的可选字段
func (controller *ExcelDataController) GetExcelDataFields() {
code := controller.GetString(":code")
var excelService = service.NewExcelDataService(nil)
data, _ := excelService.GetExcelDataFields(&query.ExcelDataFieldsQuery{Code: code})
controller.Response(data, nil)
}
... ...
... ... @@ -15,4 +15,7 @@ func init() {
web.Router("/v1/web/file-import", &web_client.ExcelDataController{}, "Post:FileImport")
web.Router("/v1/web/file-export", &web_client.ExcelDataController{}, "Post:FileExport")
web.Router("/v1/web/file-import-template/:code", &web_client.ExcelDataController{}, "Get:FileImportTemplate")
web.Router("/v1/web/file-export/fields/:code", &web_client.ExcelDataController{}, "Get:GetExcelDataFields")
}
... ...