12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <?php
- /**
- * MessageController.php UTF-8
- *
- *
- * @date : 2018/6/11 15:19
- *
- * @license 这不是一个自由软件,未经授权不许任何使用和传播。
- * @author : luowei <lw@huosdk.com>
- * @version : HUOSDK 8.0
- */
- namespace api\wapapp\controller\v8;
- 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();
- }
- /**
- * 消息列表
- * http://doc.1tsdk.com/138?page_id=2852
- * 【域名】/v8/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=2853
- * 【域名】/v8/msg/detail
- *
- */
- public function detail() {
- $_mem_id = $this->getMemId();
- $_param = $this->request->param();
- $_result = $this->validate($_param, 'Message.detail');
- if ($_result !== true) {
- $this->error($_result);
- }
- $_msg_class = new Message();
- $_msg_id = get_val($_param, 'id');
- $_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']);
- }
- }
|