Segment.service.ts 789 B

1234567891011121314151617181920212223242526272829303132
  1. import BaseModel from './BaseModel';
  2. import {
  3. GetQuerySegmentInfoResponse,
  4. GePersistentSegmentInfoResponse,
  5. } from '@server/types';
  6. export class SegementService extends BaseModel {
  7. constructor(props: {}) {
  8. super(props);
  9. Object.assign(this, props);
  10. }
  11. static getQSegments(collectionName: string) {
  12. return super.search<GetQuerySegmentInfoResponse>({
  13. path: `/collections/${collectionName}/qsegments`,
  14. params: {},
  15. });
  16. }
  17. static getPSegments(collectionName: string) {
  18. return super.search<GePersistentSegmentInfoResponse>({
  19. path: `/collections/${collectionName}/psegments`,
  20. params: {},
  21. });
  22. }
  23. static compact(collectionName: string) {
  24. return super.update({
  25. path: `/collections/${collectionName}/compact`,
  26. });
  27. }
  28. }