(search dto.MongodbDBSearch)
| 41 | } |
| 42 | |
| 43 | func (u *MongodbService) SearchWithPage(search dto.MongodbDBSearch) (int64, interface{}, error) { |
| 44 | total, mongodbs, err := mongodbRepo.Page( |
| 45 | search.Page, |
| 46 | search.PageSize, |
| 47 | mongodbRepo.WithByMongodbName(search.Database), |
| 48 | repo.WithByLikeName(search.Info), |
| 49 | repo.WithOrderRuleBy(search.OrderBy, search.Order), |
| 50 | ) |
| 51 | var dtoMongodbs []dto.MongodbDBInfo |
| 52 | for _, mongodb := range mongodbs { |
| 53 | var item dto.MongodbDBInfo |
| 54 | if err := copier.Copy(&item, &mongodb); err != nil { |
| 55 | return 0, nil, buserr.WithDetail("ErrStructTransform", err.Error(), nil) |
| 56 | } |
| 57 | dtoMongodbs = append(dtoMongodbs, item) |
| 58 | } |
| 59 | return total, dtoMongodbs, err |
| 60 | } |
| 61 | |
| 62 | func (u *MongodbService) UpdateDescription(req dto.UpdateDescription) error { |
| 63 | return mongodbRepo.Update(req.ID, map[string]interface{}{"description": req.Description}) |
nothing calls this directly
no test coverage detected