1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- namespace App\Http\Controllers;
- use App\Models;
- use Illuminate\Http\Request;
- use Illuminate\Support\Facades\Validator;
- // 这个class的方法需要在中间件里加上权限判断,管理员才能执行
- class UserActionBarController extends Controller
- {
- // public function AddUserActionBar(Request $request)
- // {
- // $validator = Validator::make($request->all(), [
- // "ownerType" => "required|max:32",
- // "ownerId" => "required|integer|min:1",
- // "barId" => "required|integer|min:1"
- // ]);
- // if ($validator->fails()) {
- // return $this->fail(REQUEST_PARAM_ERROR, $this->error[REQUEST_PARAM_ERROR], $validator->errors());
- // }
- //
- // $ownerType = $request->input("ownerType");
- // $ownerId = (int)$request->input("ownerId");
- // $barId = (int)$request->input("barId");
- //
- // $userActionBar = new Models\UserActionBar();
- // $result = $userActionBar->AssignUserActionBar($ownerType, $ownerId, $barId);
- // if ($result["code"] == 0) {
- // return $this->success($result["data"]);
- // }
- // return $this->fail($result["code"], $this->error[$result["code"]]);
- // }
- //
- // public function RemoveUserActionBar(Request $request)
- // {
- // $validator = Validator::make($request->all(), [
- // "id" => "required|integer|min:1",
- //// "ownerType" => "required|max:32",
- //// "ownerId" => "required|integer|min:1",
- //// "barId" => "required|integer|min:1"
- // ]);
- // if ($validator->fails()) {
- // return $this->fail(REQUEST_PARAM_ERROR, $this->error[REQUEST_PARAM_ERROR], $validator->errors());
- // }
- //
- // $id = (int)$request->input("id");
- //// $ownerType = $request->input("ownerType");
- //// $ownerId = $request->input("ownerId");
- //// $barId = $request->input("barId");
- //
- // $userActionBar = new Models\UserActionBar();
- // $code = $userActionBar->RemoveUserActionBar($id);
- // return $this->response($code, $this->error[$code]);
- // }
- }
|