TemplateEditRequest.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. class TemplateEditRequest extends SdkRequest {
  3. const REQUEST_URL = "/v2/template/edit"; //接口地址
  4. private $templateId;
  5. private $title;
  6. private $templateParams;
  7. public function getUrl() {
  8. return self::REQUEST_URL;
  9. }
  10. public function getHttpParamers() {
  11. $paramSwitcher = ParamSwitcher::instanceParam();
  12. $paramSwitcher->addParam('templateId', $this->templateId);
  13. $paramSwitcher->addParam('title', $this->title);
  14. $paramSwitcher->addParam('templateParams', $this->templateParams);
  15. $httpParameters = HttpParameter::httpPostParamer();
  16. $httpParameters->setJsonParams(json_encode($paramSwitcher->getParams()));
  17. return $httpParameters;
  18. }
  19. /**
  20. * @return mixed
  21. */
  22. public function getTemplateId()
  23. {
  24. return $this->templateId;
  25. }
  26. /**
  27. * @param mixed $templateId
  28. */
  29. public function setTemplateId($templateId)
  30. {
  31. $this->templateId = $templateId;
  32. }
  33. /**
  34. * @return mixed
  35. */
  36. public function getTitle()
  37. {
  38. return $this->title;
  39. }
  40. /**
  41. * @param mixed $title
  42. */
  43. public function setTitle($title)
  44. {
  45. $this->title = $title;
  46. }
  47. /**
  48. * @return mixed
  49. */
  50. public function getTemplateParams()
  51. {
  52. return $this->templateParams;
  53. }
  54. /**
  55. * @param mixed $templateParams
  56. */
  57. public function setTemplateParams($templateParams)
  58. {
  59. $this->templateParams = $templateParams;
  60. }
  61. }