app.php 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. use think\facade\Route;
  12. /**
  13. * 应用模块 相关路由
  14. */
  15. Route::group('app', function () {
  16. /** 公众号 */
  17. Route::group(function () {
  18. //菜单值
  19. Route::get('wechat/menu', 'v1.application.wechat.menus/index')->option(['real_name' => '微信公众号菜单列表']);
  20. //保存菜单
  21. Route::post('wechat/menu', 'v1.application.wechat.menus/save')->option(['real_name' => '保存微信公众号菜单']);
  22. //图文列表
  23. Route::get('wechat/news', 'v1.application.wechat.WechatNewsCategory/index')->option(['real_name' => '图文列表']);
  24. //详情
  25. Route::get('wechat/news/:id', 'v1.application.wechat.WechatNewsCategory/read')->option(['real_name' => '图文详情']);
  26. //保存图文
  27. Route::post('wechat/news', 'v1.application.wechat.WechatNewsCategory/save')->option(['real_name' => '保存图文']);
  28. //删除图文
  29. Route::delete('wechat/news/:id', 'v1.application.wechat.WechatNewsCategory/delete')->option(['real_name' => '删除图文']);
  30. //发送图文消息
  31. Route::post('wechat/push', 'v1.application.wechat.WechatNewsCategory/push')->option(['real_name' => '发送图文消息']);
  32. //关注回复
  33. Route::get('wechat/reply', 'v1.application.wechat.Reply/reply')->option(['real_name' => '关注回复']);
  34. //获取关注回复二维码
  35. Route::get('wechat/code_reply/:id', 'v1.application.wechat.Reply/code_reply')->option(['real_name' => '获取关注回复二维码']);
  36. //关键字回复列表
  37. Route::get('wechat/keyword', 'v1.application.wechat.Reply/index')->option(['real_name' => '关键字回复列表']);
  38. //关键字详情
  39. Route::get('wechat/keyword/:id', 'v1.application.wechat.Reply/read')->option(['real_name' => '关键字回复详情']);
  40. //保存关键字修改
  41. Route::post('wechat/keyword/:id', 'v1.application.wechat.Reply/save')->option(['real_name' => '保存关键字回复']);
  42. //删除关键字
  43. Route::delete('wechat/keyword/:id', 'v1.application.wechat.Reply/delete')->option(['real_name' => '删除关键字回复']);
  44. //修改关键字状态
  45. Route::put('wechat/keyword/set_status/:id/:status', 'v1.application.wechat.Reply/set_status')->option(['real_name' => '修改关键字回复状态']);
  46. //一键同步微信模版消息消息
  47. Route::get('wechat/syncSubscribe', 'v1.application.wechat.WechatTemplate/syncSubscribe')->name('syncSubscribe')->option(['real_name' => '一键同步模版消息']);
  48. })->option(['parent' => 'app', 'cate_name' => '公众号']);
  49. /** 小程序 */
  50. Route::group(function () {
  51. //一键同步订阅消息
  52. Route::get('routine/syncSubscribe', 'v1.application.routine.RoutineTemplate/syncSubscribe')->name('syncSubscribe')->option(['real_name' => '一键同步订阅消息']);
  53. //下载小程序模版页面数据
  54. Route::get('routine/info', 'v1.application.routine.RoutineTemplate/getDownloadInfo')->option(['real_name' => '下载小程序页面数据']);
  55. //下载小程序模版
  56. Route::post('routine/download', 'v1.application.routine.RoutineTemplate/downloadTemp')->option(['real_name' => '下载小程序模版']);
  57. })->option(['parent' => 'app', 'cate_name' => '小程序']);
  58. /** 公众号渠道码 */
  59. Route::group(function () {
  60. Route::get('wechat_qrcode/cate/list', 'v1.application.wechat.WechatQrcode/getCateList')->option(['real_name' => '渠道码分类列表']);
  61. Route::get('wechat_qrcode/cate/create/:id', 'v1.application.wechat.WechatQrcode/createForm')->option(['real_name' => '渠道码分类添加编辑表单']);
  62. Route::post('wechat_qrcode/cate/save', 'v1.application.wechat.WechatQrcode/saveCate')->option(['real_name' => '渠道码分类保存']);
  63. Route::delete('wechat_qrcode/cate/del/:id', 'v1.application.wechat.WechatQrcode/delCate')->option(['real_name' => '渠道码分类删除']);
  64. Route::post('wechat_qrcode/save/:id', 'v1.application.wechat.WechatQrcode/saveQrcode')->option(['real_name' => '保存渠道码']);
  65. Route::get('wechat_qrcode/info/:id', 'v1.application.wechat.WechatQrcode/qrcodeInfo')->option(['real_name' => '渠道码详情']);
  66. Route::get('wechat_qrcode/list', 'v1.application.wechat.WechatQrcode/qrcodeList')->option(['real_name' => '渠道码列表']);
  67. Route::delete('wechat_qrcode/del/:id', 'v1.application.wechat.WechatQrcode/delQrcode')->option(['real_name' => '删除渠道码']);
  68. Route::put('wechat_qrcode/set_status/:id/:status', 'v1.application.wechat.WechatQrcode/setStatus')->option(['real_name' => '切换渠道码状态']);
  69. Route::get('wechat_qrcode/user_list/:qid', 'v1.application.wechat.WechatQrcode/userList')->option(['real_name' => '渠道码用户列表']);
  70. Route::get('wechat_qrcode/statistic/:qid', 'v1.application.wechat.WechatQrcode/qrcodeStatistic')->option(['real_name' => '渠道码统计']);
  71. })->option(['parent' => 'app', 'cate_name' => '公众号渠道码']);
  72. /** 客服相关 */
  73. Route::group(function () {
  74. //客服反馈接口
  75. Route::resource('feedback', 'v1.kefu.StoreServiceFeedback')->only(['index', 'delete', 'update', 'edit'])->option([
  76. 'real_name' => [
  77. 'index' => '获取用户反馈列表',
  78. 'edit' => '获取修改用户反馈表单',
  79. 'update' => '修改用户反馈',
  80. 'delete' => '删除用户反馈'
  81. ]
  82. ]);
  83. //话术接口
  84. Route::resource('wechat/speechcraft', 'v1.kefu.StoreServiceSpeechcraft')->except(['read'])->option([
  85. 'real_name' => [
  86. 'index' => '获取客服话术列表',
  87. 'create' => '获取客服话术表单',
  88. 'save' => '保存客服话术',
  89. 'edit' => '获取修改客服话术表单',
  90. 'update' => '修改客服话术',
  91. 'delete' => '删除客服话术'
  92. ]
  93. ]);
  94. //话术分类接口
  95. Route::resource('wechat/speechcraftcate', 'v1.kefu.StoreServiceSpeechcraftCate')->except(['read'])->option([
  96. 'real_name' => [
  97. 'index' => '获取客服话术分类列表',
  98. 'create' => '获取客服话术分类表单',
  99. 'save' => '保存客服话术分类',
  100. 'edit' => '获取修改客服话术分类表单',
  101. 'update' => '修改客服话术分类',
  102. 'delete' => '删除客服话术分类'
  103. ]
  104. ]);
  105. //客服列表
  106. Route::get('wechat/kefu', 'v1.kefu.StoreService/index')->option(['real_name' => '客服列表']);
  107. //客服登录
  108. Route::get('wechat/kefu/login/:id', 'v1.kefu.StoreService/keufLogin')->option(['real_name' => '客服登录']);
  109. //新增客服选择用户列表
  110. Route::get('wechat/kefu/create', 'v1.kefu.StoreService/create')->option(['real_name' => '新增客服选择用户列表']);
  111. //新增客服表单
  112. Route::get('wechat/kefu/add', 'v1.kefu.StoreService/add')->option(['real_name' => '添加客服表单']);
  113. //保存新建的数据
  114. Route::post('wechat/kefu', 'v1.kefu.StoreService/save')->option(['real_name' => '添加客服']);
  115. //编辑客服表单
  116. Route::get('wechat/kefu/:id/edit', 'v1.kefu.StoreService/edit')->option(['real_name' => '修改客服表单']);
  117. //保存编辑的数据
  118. Route::put('wechat/kefu/:id', 'v1.kefu.StoreService/update')->option(['real_name' => '修改客服']);
  119. //删除
  120. Route::delete('wechat/kefu/:id', 'v1.kefu.StoreService/delete')->option(['real_name' => '删除客服']);
  121. //修改状态
  122. Route::put('wechat/kefu/set_status/:id/:status', 'v1.kefu.StoreService/set_status')->option(['real_name' => '修改客服状态']);
  123. //聊天记录
  124. Route::get('wechat/kefu/record/:id', 'v1.kefu.StoreService/chat_user')->option(['real_name' => '聊天记录']);
  125. //查看对话
  126. Route::get('wechat/kefu/chat_list', 'v1.kefu.StoreService/chat_list')->option(['real_name' => '查看对话']);
  127. //客服自动回复列表
  128. Route::get('kefu/auto_reply/list', 'v1.kefu.StoreServiceAutoReply/autoReplyList')->option(['real_name' => '客服自动回复列表']);
  129. //客服自动回复添加修改表单
  130. Route::get('kefu/auto_reply/form/:id', 'v1.kefu.StoreServiceAutoReply/autoReplyForm')->option(['real_name' => '客服自动回复添加修改表单']);
  131. //客服自动回复添加修改保存
  132. Route::post('kefu/auto_reply/save/:id', 'v1.kefu.StoreServiceAutoReply/autoReplySave')->option(['real_name' => '客服自动回复添加修改保存']);
  133. //客服自动回复修改状态
  134. Route::put('kefu/auto_reply/status/:id/:status', 'v1.kefu.StoreServiceAutoReply/autoReplyStatus')->option(['real_name' => '客服自动回复修改状态']);
  135. //客服自动回复删除
  136. Route::delete('kefu/auto_reply/del/:id', 'v1.kefu.StoreServiceAutoReply/autoReplyDel')->option(['real_name' => '客服自动回复删除']);
  137. })->option(['parent' => 'app', 'cate_name' => '客服相关']);
  138. })->middleware([
  139. \app\http\middleware\AllowOriginMiddleware::class,
  140. \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
  141. \app\adminapi\middleware\AdminCheckRoleMiddleware::class,
  142. \app\adminapi\middleware\AdminLogMiddleware::class
  143. ])->option(['mark' => 'app', 'mark_name' => '应用模块']);