(req dto.SearchWithPage)
| 76 | } |
| 77 | |
| 78 | func (f *FtpService) SearchWithPage(req dto.SearchWithPage) (int64, interface{}, error) { |
| 79 | total, lists, err := ftpRepo.Page(req.Page, req.PageSize, ftpRepo.WithLikeUser(req.Info), repo.WithOrderDesc("created_at")) |
| 80 | if err != nil { |
| 81 | return 0, nil, err |
| 82 | } |
| 83 | var users []dto.FtpInfo |
| 84 | for _, user := range lists { |
| 85 | var item dto.FtpInfo |
| 86 | if err := copier.Copy(&item, &user); err != nil { |
| 87 | return 0, nil, buserr.WithDetail("ErrStructTransform", err.Error(), nil) |
| 88 | } |
| 89 | item.Password, _ = encrypt.StringDecrypt(item.Password) |
| 90 | users = append(users, item) |
| 91 | } |
| 92 | return total, users, err |
| 93 | } |
| 94 | |
| 95 | func (f *FtpService) Sync() error { |
| 96 | client, err := toolbox.NewFtpClient() |
nothing calls this directly
no test coverage detected