feature: server push status

This commit is contained in:
tokumeikoi
2021-03-24 16:04:09 +09:00
parent 4e2e3cd2a0
commit cbe5882e01
8 changed files with 31 additions and 23 deletions

View File

@ -20,6 +20,7 @@ class ManageController extends Controller
$serverService->getV2rayServers(),
$serverService->getTrojanServers()
);
$serverService->mergeData($servers);
$tmp = array_column($servers, 'sort');
array_multisort($tmp, SORT_ASC, $servers);
return response([

View File

@ -74,6 +74,7 @@ class DeepbworkController extends Controller
$data = file_get_contents('php://input');
$data = json_decode($data, true);
Cache::put(CacheKey::get('SERVER_V2RAY_ONLINE_USER', $server->id), count($data), 3600);
Cache::put(CacheKey::get('SERVER_V2RAY_LAST_PUSH_AT', $server->id), time(), 3600);
$userService = new UserService();
DB::beginTransaction();
try {

View File

@ -40,6 +40,7 @@ class ShadowsocksTidalabController extends Controller
abort(500, 'fail');
}
Cache::put(CacheKey::get('SERVER_SHADOWSOCKS_LAST_CHECK_AT', $server->id), time(), 3600);
Cache::put(CacheKey::get('SERVER_SHADOWSOCKS_LAST_PUSH_AT', $server->id), time(), 3600);
$serverService = new ServerService();
$users = $serverService->getAvailableUsers(json_decode($server->group_id));
$result = [];

View File

@ -40,6 +40,7 @@ class TrojanTidalabController extends Controller
abort(500, 'fail');
}
Cache::put(CacheKey::get('SERVER_TROJAN_LAST_CHECK_AT', $server->id), time(), 3600);
Cache::put(CacheKey::get('SERVER_TROJAN_LAST_PUSH_AT', $server->id), time(), 3600);
$serverService = new ServerService();
$users = $serverService->getAvailableUsers(json_decode($server->group_id));
$result = [];