12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <?php
- /**
- * Post.php UTF-8
- * 文章处理
- *
- * @date : 2017/11/23 21:42
- *
- * @license 这不是一个自由软件,未经授权不许任何使用和传播。
- * @author : wuyonghong <wyh@huosdk.com>
- * @version : HUOSDK 8.0
- */
- namespace huo\controller\richtext;
- use huo\controller\common\Base;
- use huo\logic\posts\PostsLogic;
- use huolib\constant\NewsConst;
- use huolib\constant\RichTextKeyConst;
- use huolib\status\CommonStatus;
- class RichText extends Base {
- protected $post_logic;
- public function __construct(PostsLogic $post_logic = null) {
- if (null === $post_logic) {
- $this->post_logic = new PostsLogic();
- } else {
- $this->post_logic = $post_logic;
- }
- }
- /**
- * 根据key获取富文本详情
- *
- * @param $key
- *
- * @return array
- *
- */
- public function getDetail($key) {
- switch ($key) {
- case RichTextKeyConst::RTK_ANTI_ADDICTION:
- $_post_id = NewsConst::NEWS_ID_ANTI_ADDICTION;
- break;
- case RichTextKeyConst::RTK_ANTI_FRAUD:
- $_post_id = NewsConst::NEWS_ID_ANTI_FRAUD;
- break;
- case RichTextKeyConst::DISPUTE_RESOLUTION:
- $_post_id = NewsConst::NEWS_ID_DISPUTE_RESOLUTION;
- break;
- case RichTextKeyConst::RTK_USER_AGREEMENT:
- $_post_id = NewsConst::NEWS_ID_USER_AGREEMENT;
- break;
- case RichTextKeyConst::RTK_INTEGRAL_RULE:
- $_post_id = NewsConst::NEWS_ID_INTEGRAL_RULE;
- break;
- case RichTextKeyConst::RTK_CERTIFICATE_NUMBER:
- $_post_id = NewsConst::NEWS_ID_CERTIFICATE_NUMBER;
- break;
- case RichTextKeyConst::RTK_RECORD_NUMBER:
- $_post_id = NewsConst::NEWS_ID_RECORD_NUMBER;
- break;
- case RichTextKeyConst::RTK_ABOUT:
- $_post_id = NewsConst::NEWS_ID_ABOUT_US;
- break;
- case RichTextKeyConst::RTK_BUSINESS_COOPERATION:
- $_post_id = NewsConst::NEWS_ID_CONTACT_US;
- break;
- case RichTextKeyConst::RTK_COOPERATIVE:
- $_post_id = NewsConst::NEWS_ID_JOIN_US;
- break;
- case RichTextKeyConst::RTK_PARENT_SUP:
- $_post_id = NewsConst::NEWS_ID_PARENT_CARE;
- break;
- default:
- return $this->retErrMsg(CommonStatus::INVALID_PARAMS);
- }
- $_data = $this->post_logic->getDetail($_post_id);
- return $this->retSucMsg(CommonStatus::NO_ERROR, $_data);
- }
- }
|