68 lines
1.5 KiB
PHP
68 lines
1.5 KiB
PHP
<?php
|
|
defined('BASEPATH') or exit('No direct script access allowed');
|
|
|
|
class Wss extends HD_Controller
|
|
{
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
$this->load->model('ws/ws_conn_model');
|
|
$this->load->model('sys/sys_notice_model');
|
|
}
|
|
|
|
public function index()
|
|
{
|
|
$this->data['platformList'] = Sys_notice_model::PLATFORM_LIST;
|
|
$this->data['_title'] = '消息推送工具';
|
|
$this->show_view('sys/utils/wss/index', true);
|
|
}
|
|
|
|
public function lists()
|
|
{
|
|
}
|
|
|
|
public function add()
|
|
{
|
|
$info = $this->input->post();
|
|
if (!$info['uid'] || !$info['content'] || !$info['platform']) {
|
|
return $this->show_json(SYS_CODE_FAIL, '参数错误');
|
|
}
|
|
$params = [
|
|
'platform' => $info['platform'],
|
|
'uid' => $info['uid'],
|
|
'content' => $info['content'],
|
|
];
|
|
$params['url'] = $info['url'] ?: '';
|
|
$endPlatform = Ws_conn_model::PLAT_FORM_SYS_ADMIN;
|
|
/** @var MyResponse $req */
|
|
$req = $this->sys_notice_model->addNotice($params, $endPlatform, 8888888, true);
|
|
if (!$req->isSuccess()) {
|
|
return $this->show_json(SYS_CODE_FAIL, $req->getMessage());
|
|
}
|
|
return $this->show_json(SYS_CODE_SUCCESS, '发送成功');
|
|
}
|
|
|
|
public function get()
|
|
{
|
|
|
|
}
|
|
|
|
public function edit()
|
|
{
|
|
}
|
|
|
|
public function batch()
|
|
{
|
|
|
|
}
|
|
|
|
public function export()
|
|
{
|
|
|
|
}
|
|
|
|
public function del()
|
|
{
|
|
|
|
}
|
|
} |