1. 获取zip文件 ->临时保存到本地 ->解压 ->解析xml ->创建模板
2. 返回key, 前端通过访问key验证数据处理结果
正在显示
1 个修改的文件
包含
25 行增加
和
0 行删除
| 1 | +package command | ||
| 2 | + | ||
| 3 | +import "github.com/beego/beego/v2/core/validation" | ||
| 4 | + | ||
| 5 | +type VerifyKeyCommand struct { | ||
| 6 | + VerifyKey string `cname:"校验码" json:"key"` | ||
| 7 | +} | ||
| 8 | + | ||
| 9 | +func (in *VerifyKeyCommand) Valid(validation *validation.Validation) { | ||
| 10 | + if len(in.VerifyKey) == 0 { | ||
| 11 | + validation.SetError("key", "校验码无效") | ||
| 12 | + return | ||
| 13 | + } | ||
| 14 | +} | ||
| 15 | + | ||
| 16 | +type ErrorI struct { | ||
| 17 | + FileName string `cname:"文件名称" json:"fileName"` | ||
| 18 | + Message string `cname:"错误消息" json:"message"` | ||
| 19 | +} | ||
| 20 | + | ||
| 21 | +type OutResult struct { | ||
| 22 | + Status string `cname:"状态" json:"status"` | ||
| 23 | + Success []ErrorI `cname:"成功消息" json:"success"` | ||
| 24 | + Failure []ErrorI `cname:"错误消息" json:"failure"` | ||
| 25 | +} |
-
请 注册 或 登录 后发表评论