|
|
@@ -38,16 +38,16 @@ final class UserController extends BaseController
|
|
|
if ($node === null) {
|
|
|
return $response->withJson([
|
|
|
'ret' => 0,
|
|
|
- 'data' => 'Node not found.',
|
|
|
+ 'msg' => 'Node not found.',
|
|
|
]);
|
|
|
}
|
|
|
|
|
|
$node->update(['node_heartbeat' => time()]);
|
|
|
|
|
|
- if (($node->node_bandwidth_limit !== 0) && $node->node_bandwidth_limit < $node->node_bandwidth) {
|
|
|
+ if ($node->node_bandwidth_limit !== 0 && $node->node_bandwidth_limit <= $node->node_bandwidth) {
|
|
|
return $response->withJson([
|
|
|
- 'ret' => 1,
|
|
|
- 'data' => [],
|
|
|
+ 'ret' => 0,
|
|
|
+ 'msg' => 'Node out of bandwidth.',
|
|
|
]);
|
|
|
}
|
|
|
|
|
|
@@ -145,7 +145,7 @@ final class UserController extends BaseController
|
|
|
if (! $data || ! is_array($data->data)) {
|
|
|
return $response->withJson([
|
|
|
'ret' => 0,
|
|
|
- 'data' => 'Invalid data.',
|
|
|
+ 'msg' => 'Invalid data.',
|
|
|
]);
|
|
|
}
|
|
|
|
|
|
@@ -156,7 +156,7 @@ final class UserController extends BaseController
|
|
|
if ($node === null) {
|
|
|
return $response->withJson([
|
|
|
'ret' => 0,
|
|
|
- 'data' => 'Node not found.',
|
|
|
+ 'msg' => 'Node not found.',
|
|
|
]);
|
|
|
}
|
|
|
|
|
|
@@ -202,7 +202,7 @@ final class UserController extends BaseController
|
|
|
|
|
|
return $response->withJson([
|
|
|
'ret' => 1,
|
|
|
- 'data' => 'ok',
|
|
|
+ 'msg' => 'ok',
|
|
|
]);
|
|
|
}
|
|
|
|
|
|
@@ -222,7 +222,7 @@ final class UserController extends BaseController
|
|
|
if (! $data || ! is_array($data->data)) {
|
|
|
return $response->withJson([
|
|
|
'ret' => 0,
|
|
|
- 'data' => 'Invalid data.',
|
|
|
+ 'msg' => 'Invalid data.',
|
|
|
]);
|
|
|
}
|
|
|
|
|
|
@@ -232,7 +232,7 @@ final class UserController extends BaseController
|
|
|
if ($node_id === null || ! Node::where('id', $node_id)->exists()) {
|
|
|
return $response->withJson([
|
|
|
'ret' => 0,
|
|
|
- 'data' => 'Node not found.',
|
|
|
+ 'msg' => 'Node not found.',
|
|
|
]);
|
|
|
}
|
|
|
|
|
|
@@ -259,7 +259,7 @@ final class UserController extends BaseController
|
|
|
|
|
|
return $response->withJson([
|
|
|
'ret' => 1,
|
|
|
- 'data' => 'ok',
|
|
|
+ 'msg' => 'ok',
|
|
|
]);
|
|
|
}
|
|
|
|
|
|
@@ -279,7 +279,7 @@ final class UserController extends BaseController
|
|
|
if (! $data || ! is_array($data->data)) {
|
|
|
return $response->withJson([
|
|
|
'ret' => 0,
|
|
|
- 'data' => 'Invalid data.',
|
|
|
+ 'msg' => 'Invalid data.',
|
|
|
]);
|
|
|
}
|
|
|
|
|
|
@@ -289,7 +289,7 @@ final class UserController extends BaseController
|
|
|
if ($node_id === null || ! Node::where('id', $node_id)->exists()) {
|
|
|
return $response->withJson([
|
|
|
'ret' => 0,
|
|
|
- 'data' => 'Node not found.',
|
|
|
+ 'msg' => 'Node not found.',
|
|
|
]);
|
|
|
}
|
|
|
|
|
|
@@ -307,7 +307,7 @@ final class UserController extends BaseController
|
|
|
|
|
|
return $response->withJson([
|
|
|
'ret' => 1,
|
|
|
- 'data' => 'ok',
|
|
|
+ 'msg' => 'ok',
|
|
|
]);
|
|
|
}
|
|
|
}
|