123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <?php
- /**
- * MessageController.php UTF-8
- *
- *
- * @date : 2018/5/29 17:47
- *
- * @license 这不是一个自由软件,未经授权不许任何使用和传播。
- * @author : luowei <lw@huosdk.com>
- * @version : HUOSDK 8.0
- */
- namespace api\cfloat\controller;
- use api\common\controller\CFloatBaseController;
- use huo\controller\message\Message;
- use huolib\status\CommonStatus;
- class MessageController extends CFloatBaseController {
- public function _initialize() {
- parent::_initialize();
- $this->checkLogin();
- }
- /**
- * Client浮点消息列表
- * http://doc.1tsdk.com/138?page_id=3370
- * 【域名】/cfloat/msg/list
- */
- public function index() {
- $_mem_id = $this->getMemId();
- $_param = $this->request->param();
- $_page = $this->request->param('page/d', 1);
- $_offset = $this->request->param('offset/d', 10);
- $_msg_class = new Message();
- $_rs = $_msg_class->getList($_param, $_page.','.$_offset, $_mem_id);
- if (CommonStatus::NO_ERROR != $_rs['code']) {
- $this->error($_rs['msg'], [], $_rs['code']);
- }
- $this->success($_rs['msg'], $_rs['data'], $_rs['code']);
- }
- /**
- * 消息详情
- * http://doc.1tsdk.com/138?page_id=3371
- * 【域名】/cfloat/msg/detail
- *
- */
- public function detail() {
- $_mem_id = $this->getMemId();
- $_param = $this->request->param();
- $_msg_id = get_val($_param, 'id');
- if (empty($_msg_id)) {
- $this->error('消息ID不能为空', [], CommonStatus::INVALID_PARAMS);
- }
- $_msg_class = new Message();
- $_rs = $_msg_class->getDetail($_msg_id, $_mem_id);
- if (CommonStatus::NO_ERROR != $_rs['code']) {
- $this->error($_rs['msg'], [], $_rs['code']);
- }
- $this->success($_rs['msg'], $_rs['data'], $_rs['code']);
- }
- }
|