You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
892 B

  1. import ApiService from '@/services/api.service'
  2. class AnnotationService {
  3. constructor() {
  4. this.request = ApiService
  5. }
  6. getAnnotationList(projectId, docId) {
  7. return this.request.get(`/projects/${projectId}/docs/${docId}/annotations`)
  8. }
  9. addAnnotation(projectId, docId, payload) {
  10. return this.request.post(`/projects/${projectId}/docs/${docId}/annotations`, payload)
  11. }
  12. deleteAnnotation(projectId, docId, annotationId) {
  13. return this.request.delete(`/projects/${projectId}/docs/${docId}/annotations/${annotationId}`)
  14. }
  15. clearAnnotations(projectId, docid) {
  16. return this.request.delete(`/projects/${projectId}/docs/${docid}/annotations`)
  17. }
  18. updateAnnotation(projectId, docId, annotationId, payload) {
  19. return this.request.patch(`/projects/${projectId}/docs/${docId}/annotations/${annotationId}`, payload)
  20. }
  21. }
  22. export default new AnnotationService()