You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

21 lines
673 B

func (a *$1Service) Get$2List(ctx context.Context, req *model.Gb$2ReqParams) (interface{}, error) {
var l []*model.Gb$2
cnt, err := a.$2.Q().Filter(req).List(ctx, &l)
if err != nil {
return nil, errors.WithStack(err)
}
if req.Export {
rst, _ := excelize.Excelize(l,
excelize.ColumnFilter(\"create_time\ excelize.FilterTimestamp),
)
return rst, nil
}
pagination := &schema.PaginationResult{
Count: cnt,
List: l,
PageNum: req.PageNum,
PageSize: req.PageSize,
}
return pagination, nil
}