NoticeSetting.Class.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. namespace JinDouYun\Controller\System;
  3. use JinDouYun\Controller\BaseController;
  4. use JinDouYun\Model\System\MNoticeSetting;
  5. use Mall\Framework\Core\ErrorCode;
  6. /**
  7. * @copyright Copyright (c) https://www.qianniaovip.com All rights reserved
  8. * Description:
  9. * Class NoticeSetting
  10. * @package JinDouYun\Controller\System
  11. */
  12. class NoticeSetting extends BaseController
  13. {
  14. /**
  15. * @var MNoticeSetting
  16. */
  17. private $objMNoticeSetting;
  18. public function __construct($isCheckAcl = true, $isMustLogin = true, $checkToken = true, $getAreaCode = false)
  19. {
  20. parent::__construct($isCheckAcl, $isMustLogin, $checkToken, $getAreaCode);
  21. $this->objMNoticeSetting = new MNoticeSetting($this->onlineEnterpriseId);
  22. }
  23. /**
  24. * Doc: (des="设置")
  25. * User: XMing
  26. * Date: 2020/11/10
  27. * Time: 6:17 下午
  28. */
  29. public function set()
  30. {
  31. $data = $this->request->getRawJson();
  32. if (empty($data)){
  33. parent::sendOutput('参数为空',ErrorCode::$paramError);
  34. }
  35. if (!isset($data['content']) || empty($data['content'])){
  36. parent::sendOutput('content参数错误',ErrorCode::$paramError);
  37. }
  38. $result = $this->objMNoticeSetting->set($data);
  39. if ($result->isSuccess()) {
  40. parent::sendOutput($result->getData());
  41. }
  42. parent::sendOutput($result->getData(), $result->getErrorCode());
  43. }
  44. /**
  45. * Doc: (des="获取")
  46. * User: XMing
  47. * Date: 2020/11/10
  48. * Time: 6:21 下午
  49. */
  50. public function get()
  51. {
  52. $result = $this->objMNoticeSetting->get();
  53. if ($result->isSuccess()) {
  54. parent::sendOutput($result->getData());
  55. }
  56. parent::sendOutput($result->getData(), $result->getErrorCode());
  57. }
  58. }