12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <?php
- /**
- * Created by PhpStorm.
- * User: ZhangFeng
- * Date: 2018/1/29
- * Time: 16:00
- * Description:
- */
- namespace backend\controllers;
- use yii\web\Controller;
- use common\logic\Queue;
- class QueueController extends Controller
- {
- /**
- * 创建队列
- */
- public function actionCreateQueue()
- {
- $params = \Yii::$app->request->get();
- $queue = new Queue();
- $queue->load(['Queue' => $params]);
- if ($queue->validate()) {
- $res = $queue->createQueue();
- echo json_encode(['code' => 200,'message' => 'OK','data' => ['name' => $res]]);
- } else {
- echo json_encode(['code' => 201,'message' => '']);
- }
- }
- /**
- * 删除队列
- */
- public function actionDeleteQueue()
- {
- $params = \Yii::$app->request->get();
- $queue = new Queue();
- $queue->load(['Queue' => $params]);
- if ($queue->validate()) {
- $res = $queue->deleteQueue();
- echo json_encode(['code' => 200,'message' => 'OK','data' => [$res]]);
- } else {
- }
- }
- /**
- * 获取队列列表
- */
- public function actionListQueue()
- {
- $params = \Yii::$app->request->get();
- $queue = new Queue();
- $queue->load(['Queue' => $params]);
- if ($queue->validate()) {
- $res = $queue->listQueue();
- echo json_encode(['code' => 200,'message' => 'OK','data' => $res]);
- } else {
- }
- }
- public function actionSetQueueAttributes()
- {
- }
- }
|