| 49 | } |
| 50 | |
| 51 | std::vector<std::shared_ptr<VisitRecord>> VisitRecordOperator::QueryVisitRecords(int page, int page_size) { |
| 52 | using Storage = decltype(db_->GetStorageTypeValue()); |
| 53 | auto storage = std::any_cast<Storage>(db_->GetDbStorage()); |
| 54 | auto qrs = storage.get_all_pointer<VisitRecord>( |
| 55 | order_by(&VisitRecord::id_), |
| 56 | limit(page_size, offset((page-1)*page_size))); |
| 57 | std::vector<std::shared_ptr<VisitRecord>> records; |
| 58 | for (auto& r : qrs) { |
| 59 | records.push_back(std::move(r)); |
| 60 | } |
| 61 | return records; |
| 62 | } |
| 63 | |
| 64 | void VisitRecordOperator::Delete(int id) { |
| 65 | using Storage = decltype(db_->GetStorageTypeValue()); |
no test coverage detected