更新
This commit is contained in:
@@ -42,6 +42,8 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
@@ -177,6 +179,15 @@ type ExampleImportRes struct {
|
||||
Reasons []string `json:"reasons"` // 失败原因列表
|
||||
}
|
||||
|
||||
// ResMsg 导入结果提示语(response.MsgProvider,前端成功通道直接弹出):
|
||||
// 无失败行时"成功导入 X 条数据",有失败行时"成功导入 X 条,失败 Y 条"
|
||||
func (r *ExampleImportRes) ResMsg() string {
|
||||
if r.Failed > 0 {
|
||||
return fmt.Sprintf("成功导入 %d 条,失败 %d 条", r.Success, r.Failed)
|
||||
}
|
||||
return fmt.Sprintf("成功导入 %d 条数据", r.Success)
|
||||
}
|
||||
|
||||
// ExampleExportReq 导出案例演示请求
|
||||
type ExampleExportReq struct {
|
||||
gmeta.Meta `method:"get" path:"/api/example/export" summary:"导出案例演示" permission:"sys:example:export" log:"案例演示-导出数据" logType:"export"`
|
||||
|
||||
Reference in New Issue
Block a user