123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- <?php
- // +----------------------------------------------------------------------
- // | Niucloud-admin 企业快速开发的saas管理平台
- // +----------------------------------------------------------------------
- // | 官方网址:https://www.niucloud.com
- // +----------------------------------------------------------------------
- // | niucloud团队 版权所有 开源版本可自由商用
- // +----------------------------------------------------------------------
- // | Author: Niucloud Team
- // +----------------------------------------------------------------------
- namespace app\adminapi\controller\wechat;
- use app\service\admin\wechat\WechatReplyService;
- use core\base\BaseAdminController;
- use think\Response;
- /**
- * 微信公众号管理回复
- */
- class Reply extends BaseAdminController
- {
- /**
- * 关键词回复
- * @return Response
- */
- public function keyword($id)
- {
- $wechat_reply_service = new WechatReplyService();
- return success($wechat_reply_service->getKeywordInfo($id));
- }
- public function getKeywordLists()
- {
- $data = $this->request->params([
- ['keyword', ''],
- ['name', '']
- ]);
- $wechat_reply_service = new WechatReplyService();
- return success($wechat_reply_service->getKeywordPage($data));
- }
- /**
- * 新增关键词回复
- * @return Response
- */
- public function addKeyword()
- {
- $wechat_reply_service = new WechatReplyService();
- $data = $this->request->params([
- ['name', ''],
- ['keyword', ''],
- ['matching_type', '', false],
- ['reply_method', ''],
- ['content', ''],
- ['sort', ''],
- ]);
- $wechat_reply_service->addKeyword($data);
- return success('ADD_SUCCESS');
- }
- /**
- * 更新关键词回复
- * @return Response
- */
- public function editKeyword($id)
- {
- $wechat_reply_service = new WechatReplyService();
- $data = $this->request->params([
- ['name', ''],
- ['keyword', ''],
- ['matching_type', '', false],
- ['reply_method', ''],
- ['content', ''],
- ['sort', ''],
- ]);
- $wechat_reply_service->editKeyword($id, $data);
- return success('EDIT_SUCCESS');
- }
- /**
- * 删除关键字回复
- * @return Response
- */
- public function delKeyword($id)
- {
- $wechat_reply_service = new WechatReplyService();
- $wechat_reply_service->delKeyword($id);
- return success('DELETE_FAIL');
- }
- /**
- * 获取默认回复
- * @return Response
- */
- public function default()
- {
- $wechat_reply_service = new WechatReplyService();
- return success($wechat_reply_service->getDefault());
- }
- /**
- * 更新默认回复
- * @return Response
- */
- public function editDefault()
- {
- $data = $this->request->params([
- ['content', ''],
- ]);
- $wechat_reply_service = new WechatReplyService();
- $wechat_reply_service->editDefault($data);
- return success('SET_SUCCESS');
- }
- /**
- * 获取关注回复
- * @return Response
- */
- public function subscribe()
- {
- $wechat_reply_service = new WechatReplyService();
- return success($wechat_reply_service->getSubscribe());
- }
- /**
- * 更新关注回复
- * @return Response
- */
- public function editSubscribe()
- {
- $data = $this->request->params([
- ['content', ''],
- ]);
- $wechat_reply_service = new WechatReplyService();
- $wechat_reply_service->editSubscribe($data);
- return success('SET_SUCCESS');
- }
- }
|