api.php 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. use Illuminate\Support\Facades\Route;
  3. /*
  4. |--------------------------------------------------------------------------
  5. | API Routes
  6. |--------------------------------------------------------------------------
  7. |
  8. | Here is where you can register API routes for your application. These
  9. | routes are loaded by the RouteServiceProvider within a group which
  10. | is assigned the "api" middleware group. Enjoy building your API!
  11. |
  12. */
  13. $routes=array(
  14. 'getCurrentGame'=> exeApi('api','PrizeHandle','getNewprizeGamedata'),
  15. 'setCurrentGameStatus' => exeApi( 'api', 'PrizeHandle', 'updateCloses'),
  16. 'setCheckGame'=> exeApi('api','PrizeHandle','UpdateCheckgame'),
  17. 'getjnd28Info'=> exeApi('api','PrizeHandle','Getjnd28Info'),
  18. 'checkJnd28'=>exeApi('api','PrizeHandle', 'checkJnd28'),
  19. 'delGamebetInfo'=> exeApi('api','PrizeHandle','DelinfoBytime'),
  20. 'getOpeninfo' => exeApi( 'api', 'Basicinfo', 'getOnOrOff'),
  21. 'clearTable' => exeApi( 'api', 'Basicinfo', 'clearTable'), //清空指定表数据
  22. 'addRecharge' => exeApi( 'api', 'Recharges', 'AddRecharge'),
  23. 'odds' => exeApi('api', 'BetLog', 'odds'),
  24. 'rechargeMoney'=> exeApi('admin','Regulation','AddOrCutMoney'),
  25. 'countHistory' => exeApi('api', 'History', 'index'),
  26. 'HistoryCount'=>exeApi('api', 'History', 'count'),
  27. 'getBetLog'=> exeApi('api', 'BetLog', 'getBetLog'),
  28. 'updateBnumber'=>exeApi('admin', 'bnumber','update'),
  29. 'batchUpdateBnumber' => exeApi('admin', 'bnumber', 'batchUpdate'),
  30. 'autoOpenPrize'=>exeApi('api', 'OpenPrize','open'),
  31. 'nagentCountwater'=>exeApi('api', 'PrizeHandle','CountWater'), //级差代理业绩统计
  32. 'kygame'=>exeApi('api', 'Kygame','getPipelineRecord'),
  33. 'oggame'=>exeApi('api', 'Oggame','getPipelineRecord'),
  34. 'aggameDownloadFile'=>exeApi('api', 'Aggame','downloadFile'),
  35. 'aggameReadFile'=>exeApi('api', 'Aggame','readerFile'),
  36. 'a'=>exeApi('api', 'Aggame','aftp'),
  37. 'lcqpgame'=>exeApi('api', 'Lcqpgame','getPipelineRecord'),
  38. 'lygame'=>exeApi('api', 'Lygame','getPipelineRecord'),
  39. 'hjgame'=>exeApi('api', 'HjGame','getPipelineRecord'),
  40. 'ogsports'=>exeApi('api', 'Oggame_sport','getPipelineRecord'),
  41. 'fygame'=>exeApi('api', 'fyGame','getBetting'),
  42. 'setSports'=>exeApi('api', 'WriteSports','setSports'),
  43. 'upMatch'=>exeApi('api', 'WriteSports','upMatch'),
  44. );
  45. function exeApi($m, $c, $act)
  46. {
  47. return array('m' => $m, 'c' => $c, 'act' => $act);
  48. }
  49. Route::any('/{name}', function ($name) use($routes) {
  50. if(!isset($routes[$name])){
  51. return responseToJson(-404,'404');
  52. }
  53. $target=$routes[$name];
  54. return appExec($target['m'], $target['c'], $target['act']);
  55. })->middleware('api');