|
@@ -9,48 +9,48 @@ use Illuminate\Support\Facades\Validator;
|
|
// 这个class的方法需要在中间件里加上权限判断,管理员才能执行
|
|
// 这个class的方法需要在中间件里加上权限判断,管理员才能执行
|
|
class UserActionBarController extends Controller
|
|
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->AddUserActionBar($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",
|
|
|
|
|
|
+// public function AddUserActionBar(Request $request)
|
|
|
|
+// {
|
|
|
|
+// $validator = Validator::make($request->all(), [
|
|
// "ownerType" => "required|max:32",
|
|
// "ownerType" => "required|max:32",
|
|
// "ownerId" => "required|integer|min:1",
|
|
// "ownerId" => "required|integer|min:1",
|
|
// "barId" => "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");
|
|
|
|
|
|
+// ]);
|
|
|
|
+// if ($validator->fails()) {
|
|
|
|
+// return $this->fail(REQUEST_PARAM_ERROR, $this->error[REQUEST_PARAM_ERROR], $validator->errors());
|
|
|
|
+// }
|
|
|
|
+//
|
|
// $ownerType = $request->input("ownerType");
|
|
// $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]);
|
|
|
|
- }
|
|
|
|
|
|
+// $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]);
|
|
|
|
+// }
|
|
}
|
|
}
|