VersionController.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. namespace App\Http\Controllers\App;
  3. use App\Http\Controllers\Controller;
  4. use App\Http\Controllers\Core\Auth;
  5. use App\Services\Home\FeedService;
  6. use App\Services\Vendor\GeTui\ApiService;
  7. use Illuminate\Http\Request;
  8. class VersionController extends Controller
  9. {
  10. /**
  11. * 判断是否可以开启某版本
  12. */
  13. public function isVersion()
  14. {
  15. $isopen = true;
  16. return array(
  17. 'code' => 200,
  18. 'message' => 'success',
  19. 'data' => array(
  20. 'version' => '2.10.5',
  21. 'isopen' => $isopen
  22. )
  23. );
  24. }
  25. // 获取官方宣传卡片
  26. public function getPartner()
  27. {
  28. $fs = new FeedService();
  29. $data = $fs->getPartner(2, 0);
  30. return response([
  31. 'code' => 200,
  32. 'message' => 'success',
  33. 'data' => $data
  34. ]);
  35. }
  36. public function bindClient(Request $request)
  37. {
  38. $this->validate($request, [
  39. 'client_id' => 'required'
  40. ]);
  41. $cid = $request->post('client_id');
  42. $uid = Auth::auth();
  43. $apiS = new ApiService();
  44. $apiS->bindAlias((string)$cid, (string)$uid);
  45. return response([
  46. 'code' => 200,
  47. 'message' => 'success'
  48. ]);
  49. }
  50. }