UserActionBarController.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. namespace App\Http\Controllers;
  3. use App\Models;
  4. use Illuminate\Http\Request;
  5. use Illuminate\Support\Facades\Validator;
  6. // 这个class的方法需要在中间件里加上权限判断,管理员才能执行
  7. class UserActionBarController extends Controller
  8. {
  9. // public function AddUserActionBar(Request $request)
  10. // {
  11. // $validator = Validator::make($request->all(), [
  12. // "ownerType" => "required|max:32",
  13. // "ownerId" => "required|integer|min:1",
  14. // "barId" => "required|integer|min:1"
  15. // ]);
  16. // if ($validator->fails()) {
  17. // return $this->fail(REQUEST_PARAM_ERROR, $this->error[REQUEST_PARAM_ERROR], $validator->errors());
  18. // }
  19. //
  20. // $ownerType = $request->input("ownerType");
  21. // $ownerId = (int)$request->input("ownerId");
  22. // $barId = (int)$request->input("barId");
  23. //
  24. // $userActionBar = new Models\UserActionBar();
  25. // $result = $userActionBar->AssignUserActionBar($ownerType, $ownerId, $barId);
  26. // if ($result["code"] == 0) {
  27. // return $this->success($result["data"]);
  28. // }
  29. // return $this->fail($result["code"], $this->error[$result["code"]]);
  30. // }
  31. //
  32. // public function RemoveUserActionBar(Request $request)
  33. // {
  34. // $validator = Validator::make($request->all(), [
  35. // "id" => "required|integer|min:1",
  36. //// "ownerType" => "required|max:32",
  37. //// "ownerId" => "required|integer|min:1",
  38. //// "barId" => "required|integer|min:1"
  39. // ]);
  40. // if ($validator->fails()) {
  41. // return $this->fail(REQUEST_PARAM_ERROR, $this->error[REQUEST_PARAM_ERROR], $validator->errors());
  42. // }
  43. //
  44. // $id = (int)$request->input("id");
  45. //// $ownerType = $request->input("ownerType");
  46. //// $ownerId = $request->input("ownerId");
  47. //// $barId = $request->input("barId");
  48. //
  49. // $userActionBar = new Models\UserActionBar();
  50. // $code = $userActionBar->RemoveUserActionBar($id);
  51. // return $this->response($code, $this->error[$code]);
  52. // }
  53. }