(search dto.MysqlDBSearch)
| 56 | } |
| 57 | |
| 58 | func (u *MysqlService) SearchWithPage(search dto.MysqlDBSearch) (int64, interface{}, error) { |
| 59 | total, mysqls, err := mysqlRepo.Page(search.Page, search.PageSize, |
| 60 | mysqlRepo.WithByMysqlName(search.Database), |
| 61 | repo.WithByLikeName(search.Info), |
| 62 | repo.WithOrderRuleBy(search.OrderBy, search.Order), |
| 63 | ) |
| 64 | var dtoMysqls []dto.MysqlDBInfo |
| 65 | for _, mysql := range mysqls { |
| 66 | var item dto.MysqlDBInfo |
| 67 | if err := copier.Copy(&item, &mysql); err != nil { |
| 68 | return 0, nil, buserr.WithDetail("ErrStructTransform", err.Error(), nil) |
| 69 | } |
| 70 | dtoMysqls = append(dtoMysqls, item) |
| 71 | } |
| 72 | return total, dtoMysqls, err |
| 73 | } |
| 74 | |
| 75 | func (u *MysqlService) ListDBOption() ([]dto.MysqlOption, error) { |
| 76 | mysqls, err := mysqlRepo.List() |
nothing calls this directly
no test coverage detected