api.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. <?php
  2. use App\Http\Controllers\Api\V1\DashboardController;
  3. use App\Http\Controllers\Api\V1\Mentality\ScaleCategoryController;
  4. use App\Models\Scale;
  5. use Illuminate\Support\Facades\Route;
  6. /*
  7. |--------------------------------------------------------------------------
  8. | API Routes
  9. |--------------------------------------------------------------------------
  10. |
  11. | Here is where you can register API routes for your application. These
  12. | routes are loaded by the RouteServiceProvider within a group which
  13. | is assigned the "api" middleware group. Enjoy building your API!
  14. |
  15. */
  16. Route::group(['namespace' => 'Api'], function(){
  17. Route::group(['namespace' => 'V1'], function(){
  18. //测试
  19. Route::resource('test', 'TestController');
  20. //微信信息通知地址(暂时没有用)
  21. Route::resource('wx_notification', 'WxNotificationController');
  22. //统一微信入口 授权拿第三方用户id
  23. Route::get('third_wx_auth', 'ThirdWxController@auth');
  24. //统一微信入口 获取JSSDK
  25. Route::post('third_wx_jssdk', 'ThirdWxController@getJsSdk');
  26. //统一微信入口 授权拿第三方用户id
  27. Route::get('third_user_info', 'ThirdWxController@getUserInfo');
  28. //统一用户名密码入口
  29. Route::resource('third_up', 'ThirdUpController');
  30. //iOS 审核显示
  31. Route::get('iOSshow', 'VersionController@iOSshow');
  32. //api认证
  33. Route::group(['middleware'=>['apiSign']], function(){
  34. //天气预报接口
  35. Route::resource('weather', 'WeatherController');
  36. //版本信息
  37. Route::resource('version', 'VersionController');
  38. //推荐
  39. Route::resource('commend', 'CommendController');
  40. //token验证
  41. Route::group(['middleware'=>['token']], function(){
  42. //退出登陆
  43. Route::resource('login_out', 'LoginOutController', ['only'=>['store']]);
  44. //用户
  45. Route::resource('user', 'UserController');
  46. //统一H5聊天
  47. Route::resource('third_h5_chat', 'ThirdH5ChatController');
  48. //上传图片
  49. Route::resource('upload', 'UploadController', ['only'=>['store']]);
  50. //AI聊天历史列表
  51. Route::get('AiChatList', 'Chat\AiChatController@index');
  52. //AI聊天发送数据
  53. Route::post('AiChatSendData', 'Chat\AiChatController@sendData');
  54. //banner
  55. // Route::resource('banner', 'BannerController', ['only'=>['index']]);
  56. // 系统配置
  57. // Route::resource('config', 'SysConfigController', ['only'=>['index']]);
  58. // //专家来了
  59. // Route::group(['namespace' => 'Specialist', 'prefix' => 'specialist'], function(){
  60. // //首页 一级栏目列表 二级栏目列表 栏目详情
  61. // Route::resource('index', 'IndexController');
  62. //// Route::resource('getChapterList', 'IndexController');
  63. // Route::get('getChapterList', 'IndexController@getChapterList')->name('getChapterList');
  64. // //详情 列表 详情
  65. // Route::resource('specialist_info', 'SpecialistInfoController');
  66. // });
  67. //心理大厅
  68. Route::group(['namespace' => 'Mentality', 'prefix' => 'mentality'], function(){
  69. //反馈意见
  70. // Route::resource('feedback','FeedBackController');
  71. // //量表分类 列表
  72. // Route::resource('scale_category', 'ScaleCategoryController');
  73. // //量表 列表
  74. // Route::resource('scale', 'ScaleController');
  75. // //获取数据
  76. // Route::get('gettestinfo', 'ScaleController@getTestInfo')->name('getTestInfo');
  77. //开始测评
  78. Route::get('start_test', 'ScaleController@startTest')->name('startTest');
  79. // //训练分类 列表
  80. // Route::resource('drill_category', 'DrillCategoryController');
  81. //// 训练 列表 详情
  82. // Route::resource('drill', 'DrillController');
  83. //// 训练扩展 详情
  84. // Route::resource('play', 'PlayController');
  85. // //心情记录 列表 详情 添加 修改
  86. // Route::resource('mood', 'MoodController');
  87. // //用户周记录 列表,详情
  88. // Route::resource('week', 'WeekController');
  89. // //心情等级 列表
  90. // Route::resource('mood_level', 'MoodLevelController');
  91. // //心情标签 列表
  92. // Route::resource('mood_tag', 'MoodTagController');
  93. // //睡眠等级 列表
  94. // Route::resource('sleep_level', 'SleepLevelController');
  95. //睡眠 列表 添加
  96. // Route::resource('sleep', 'SleepController');
  97. // //给未来的信 添加
  98. // Route::resource('letter', 'LetterController');
  99. // //统计 心情 睡眠
  100. // Route::resource('statistics', 'StatisticsController');
  101. // //统计心情下拉选择
  102. // Route::get('mood_select', 'StatisticsController@getMoodSelect')->name('statisticsMoodSelect');
  103. // //统计睡眠下拉选择
  104. // Route::get('sleep_select', 'StatisticsController@getSleepSelect')->name('statisticsSleepSelect');
  105. // //收藏 添加取消收藏
  106. // Route::resource('collect', 'CollectController');
  107. // //浏览记录 列表
  108. // Route::resource('browse_record', 'BrowseRecordController');
  109. });
  110. });
  111. //微信H5
  112. Route::group(['namespace' => 'MpUser' , 'prefix' => 'mp_user'], function(){
  113. Route::resource('access_token', 'AccessTokenController');
  114. Route::resource('mp_user', 'MpUserController'); //微信小程序登录
  115. });
  116. //微信公众号
  117. Route::group(['namespace' => 'MpService' , 'prefix' => 'mp_service'], function(){
  118. Route::resource('jsapi_sign', 'JsapiSignController');
  119. });
  120. // //专家来了
  121. // Route::group(['namespace' => 'Specialist', 'prefix' => 'specialist'], function(){
  122. // //首页 一级栏目列表 二级栏目列表 栏目详情
  123. // Route::resource('index', 'IndexController');
  124. //// Route::resource('getChapterList', 'IndexController');
  125. //// Route::get('getChapterList', 'IndexController@getChapterList')->name('getChapterList');
  126. // //详情 列表 详情
  127. // Route::resource('specialist_info', 'SpecialistInfoController');
  128. // });
  129. // Route::group(['namespace' => 'Mentality', 'prefix' => 'mentality'], function(){
  130. // //反馈意见
  131. // //量表分类 列表
  132. // Route::resource('scale_category', 'ScaleCategoryController');
  133. // //量表 列表
  134. // Route::resource('scale', 'ScaleController');
  135. // //获取数据
  136. // //开始测评
  137. // //训练分类 列表
  138. // Route::resource('drill_category', 'DrillCategoryController');
  139. // //训练 列表 详情
  140. // Route::resource('drill', 'DrillController');
  141. // Route::resource('play', 'PlayController');
  142. //
  143. // });
  144. // //专家来了
  145. // Route::group(['namespace' => 'Specialist', 'prefix' => 'specialist'], function(){
  146. // //首页 一级栏目列表 二级栏目列表 栏目详情
  147. // Route::resource('index', 'IndexController');
  148. // //详情 列表 详情
  149. // Route::resource('specialist_info', 'SpecialistInfoController');
  150. // });
  151. Route::resource('config', 'SysConfigController', ['only'=>['index']]);
  152. //banner
  153. Route::resource('banner', 'BannerController', ['only'=>['index']]);
  154. //量表分类
  155. Route::resource('scale_category', 'Mentality\ScaleCategoryController');
  156. //训练分类 列表
  157. Route::resource('drill_category', 'Mentality\DrillCategoryController');
  158. //专家来了
  159. Route::group(['namespace' => 'Specialist', 'prefix' => 'specialist'], function(){
  160. //首页 一级栏目列表 二级栏目列表 栏目详情
  161. Route::resource('index', 'IndexController');
  162. Route::get('category', 'IndexController@category');
  163. // Route::resource('getChapterList', 'IndexController');
  164. Route::get('getChapterList', 'IndexController@getChapterList')->name('getChapterList');
  165. Route::group(['middleware'=>['token']], function(){
  166. //专家来了点赞
  167. Route::get('thumbsUpNum/{id}', 'SpecialistInfoController@thumbsUpNum')->name('thumbsUpNum');
  168. //专家来了喜欢
  169. Route::get('loveNum/{id}', 'SpecialistInfoController@loveNum')->name('loveNum');
  170. //专家来了信息关联列表
  171. Route::get('specialistInfosAssociationList', 'SpecialistInfoController@specialistInfosAssociationList')->name('specialistInfosAssociationList');
  172. //专家来了留言
  173. Route::post('leaveMessage', 'SpecialistInfoController@leaveMessage')->name('leaveMessage');
  174. //详情 列表 详情
  175. Route::resource('specialist_info', 'SpecialistInfoController');
  176. });
  177. });
  178. Route::group(['namespace' => 'Mentality', 'prefix' => 'mentality', 'middleware'=>['token']], function(){
  179. //反馈意见
  180. Route::resource('feedback','FeedBackController');
  181. //量表分类 列表
  182. Route::resource('scale_category', 'ScaleCategoryController');
  183. //量表 列表
  184. Route::resource('scale', 'ScaleController');
  185. //获取数据
  186. Route::get('gettestinfo', 'ScaleController@getTestInfo')->name('getTestInfo');
  187. //开始测评
  188. // Route::get('start_test', 'ScaleController@startTest')->name('startTest');
  189. //训练分类 列表
  190. Route::resource('drill_category', 'DrillCategoryController');
  191. // 训练 列表 详情
  192. Route::resource('drill', 'DrillController');
  193. //训练点赞
  194. Route::get('drillContent/thumbsUpNum/{id}', 'DrillController@thumbsUpNum')->name('thumbsUpNum');
  195. //训练喜欢
  196. Route::get('drillContent/loveNum/{id}', 'DrillController@loveNum')->name('loveNum');
  197. //训练留言
  198. Route::post('drillContent/leaveMessage', 'DrillController@leaveMessage')->name('leaveMessage');
  199. //播放训练科目
  200. Route::get('drillContent/drillPlaySubject/{id}', 'DrillController@playSubject');
  201. // 训练扩展 详情
  202. Route::resource('play', 'PlayController');
  203. //心情记录 列表 详情 添加 修改
  204. Route::resource('mood', 'MoodController');
  205. //用户周记录 列表,详情
  206. Route::resource('week', 'WeekController');
  207. //心情等级 列表
  208. Route::resource('mood_level', 'MoodLevelController');
  209. //心情标签 列表
  210. Route::resource('mood_tag', 'MoodTagController');
  211. //睡眠等级 列表
  212. Route::resource('sleep_level', 'SleepLevelController');
  213. //睡眠 列表 添加
  214. Route::resource('sleep', 'SleepController');
  215. //给未来的信 添加
  216. Route::resource('letter', 'LetterController');
  217. //统计 心情 睡眠
  218. Route::resource('statistics', 'StatisticsController');
  219. //统计心情下拉选择
  220. Route::get('mood_select', 'StatisticsController@getMoodSelect')->name('statisticsMoodSelect');
  221. //统计睡眠下拉选择
  222. Route::get('sleep_select', 'StatisticsController@getSleepSelect')->name('statisticsSleepSelect');
  223. //收藏 添加取消收藏
  224. Route::resource('collect', 'CollectController');
  225. //浏览记录 列表
  226. Route::resource('browse_record', 'BrowseRecordController');
  227. });
  228. });
  229. //数据统计
  230. Route::prefix('dashboard/')->group(function () {
  231. Route::get('period_register', 'DashboardController@getPeriodRegisiter');
  232. Route::get('/video_count', [DashboardController::class, 'videoCount']);
  233. Route::get('/video', [DashboardController::class, 'video']);
  234. Route::get('/report', [DashboardController::class, 'report']);
  235. });
  236. Route::group(['prefix' => 'workstation'], function(){
  237. Route::post('login', 'FourActivityController@loginOrRegister')->middleware('psy_user');
  238. Route::group(['prefix' => 'report'], function(){
  239. Route::post('do', 'FourActivityController@store')->middleware('psy_user');
  240. Route::post('re-do', 'FourActivityController@store')->middleware('psy_user');
  241. Route::get('/', 'FourActivityController@list')->middleware('psy_user');
  242. Route::get('/{id}', 'FourActivityController@show')->middleware('psy_user');
  243. });
  244. Route::post('upload', 'FourActivityController@upload');
  245. });
  246. Route::get('/sc/tree', [ScaleCategoryController::class, 'tree']);
  247. });
  248. });