api.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <?php
  2. use App\Http\Controllers\ClassifyController;
  3. use App\Http\Controllers\LoginController;
  4. use App\Http\Controllers\LookJobController;
  5. use App\Http\Controllers\UserController;
  6. use Illuminate\Http\Request;
  7. use Illuminate\Support\Facades\Route;
  8. use App\Http\Controllers\JobController;
  9. /*
  10. |--------------------------------------------------------------------------
  11. | API Routes
  12. |--------------------------------------------------------------------------
  13. |
  14. | Here is where you can register API routes for your application. These
  15. | routes are loaded by the RouteServiceProvider within a group which
  16. | is assigned the "api" middleware group. Enjoy building your API!
  17. |
  18. */
  19. /** @var TYPE_NAME $api */
  20. $api = app("Dingo\Api\Routing\Router");
  21. $api->version('v1', function ($api) {
  22. $api->group(['middleware'=>'check_token'],function ($api) {
  23. /**发布招工信息**/
  24. $api->post('/AddInfo',[JobController::class,'AddInfo']);
  25. /**上传图片**/
  26. $api->post('/UploadImg', [JobController::class,'UploadImg']);
  27. $api->post('/AddUpdateInfo', [LookJobController::class,'AddUpdateInfo']);
  28. $api->group(['prefix' => 'job'], function($api) {
  29. /*获取个人发布的找活信息**/
  30. $api->post('GetUserJobList', [JobController::class,'GetUserJobList']);
  31. /**更新状态**/
  32. $api->post('/UpdateStatus',[JobController::class,'UpdateStatus']);
  33. /**删除**/
  34. $api->delete('/DelJobInfo',[JobController::class,'DelJobInfo']);
  35. });
  36. $api->group(['prefix' => 'Lookjob'], function($api) {
  37. /**获取个人找活信息**/
  38. $api->post('/GetUserInfoList', [LookJobController::class,'GetUserInfoList']);
  39. /**更新状态**/
  40. $api->post('/UpdateStatus', [LookJobController::class,'UpdateStatus']);
  41. /**删除**/
  42. $api->delete('/DelLookJobInfo',[LookJobController::class,'DelLookJobInfo']);
  43. });
  44. $api->group(['prefix' => 'User'], function($api) {
  45. /**获取个人信息**/
  46. $api->post('/GetUserInfo', [UserController::class,'GetUserInfo']);
  47. /**更新个人信息**/
  48. $api->post('/UpdateUserInfo', [UserController::class,'UpdateUserInfo']);
  49. /**上传头像**/
  50. $api->post('/UploadImg', [UserController::class,'UploadImg']);
  51. });
  52. });
  53. $api->group(['prefix' => 'job'], function($api) {
  54. /**获取招工列表**/
  55. $api->post('/JobList',[JobController::class,'JobList']);
  56. $api->post('/GetJobDetail',[JobController::class,'GetJobDetail']);
  57. });
  58. $api->group(['prefix' => 'Lookjob'], function($api) {
  59. /*获取个人发布的找活信息**/
  60. $api->post('GetLookJobList', [LookJobController::class,'GetLookJobList']);
  61. $api->post('GetLookJobDetail', [LookJobController::class,'GetLookJobDetail']);
  62. });
  63. $api->get('classify/AddClassify',[ClassifyController::class,'AddClassify']);
  64. $api->post('/User/UpdatePwd', [UserController::class,'UpdatePwd']);
  65. $api->group(['middleware' => 'throttles:5,1','prefix' => 'Login'], function($api) {
  66. $api->group(['middleware' => 'throttles:5,1'], function($api) {
  67. /**注册**/
  68. $api->post('register', [LoginController::class,'Register']);
  69. });
  70. $api->get('captcha', [LoginController::class,'captcha']);
  71. $api->get('verifyCaptcha', [LoginController::class,'verifyCaptcha']);
  72. $api->get('Token', [LoginController::class,'Token']);
  73. /**图片验证码**/
  74. // $api->post('VerifyCode', [LoginController::class,'VerifyCode']);
  75. });
  76. $api->group(['middleware' => 'throttlesms:10,2','prefix' => 'Login'], function($api) {
  77. //获取短信验证码
  78. $api->post('SendSms', [LoginController::class,'SendSms']);
  79. });
  80. $api->group(['middleware' => 'throttles:500,1','prefix' => 'Login'], function($api) {
  81. /**图片验证码**/
  82. $api->post('VerifyCode', [LoginController::class,'VerifyCode']);
  83. $api->get('codeEs', [LoginController::class,'codeEs']);
  84. });
  85. $api->group(['prefix' => 'Login'], function($api) {
  86. /*登录**/
  87. $api->post('Login', [LoginController::class,'Login']);
  88. });
  89. });