attach.py 946 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # -*- coding: utf-8 -*-
  2. # !/usr/bin/env python
  3. from library.jdopen.client.api.base import BaseJdOpenAPI
  4. class JdOpenAttach(BaseJdOpenAPI):
  5. def upload_attach(self, customerNum, attachType, content):
  6. """
  7. 上传附件
  8. """
  9. url = "/v2/agent/declare/attach/upload"
  10. data = {
  11. "customerNum": customerNum,
  12. "attachType": attachType,
  13. "file": content
  14. }
  15. return self._post(url, data=data)
  16. def modify_attach(self, attachNum, customerNum, attachType, content):
  17. """
  18. 修改附件
  19. """
  20. url = "/v1/agent/declare/attach/modify"
  21. data = {
  22. "attachNum": attachNum,
  23. "customerNum": customerNum,
  24. "attachType": attachType,
  25. "file": content
  26. }
  27. return self._post(url, data=data)
  28. def get_attach(self, attachNum):
  29. """
  30. 获取附件信息
  31. """