<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\CommonSettings;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Arr;
|
|
use Illuminate\Support\Facades\Redis;
|
|
use Log;
|
|
|
|
class CommonSettingsController extends Controller
|
|
{
|
|
/**
|
|
* Display a listing of the resource.
|
|
*
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function index()
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Show the form for creating a new resource.
|
|
*
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function create()
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Store a newly created resource in storage.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function store(Request $request)
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Display the specified resource.
|
|
*
|
|
* @param \App\CommonSettings $commonSettings
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function show(CommonSettings $commonSettings)
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Show the form for editing the specified resource.
|
|
*
|
|
* @param \App\CommonSettings $commonSettings
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function edit(CommonSettings $commonSettings)
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Update the specified resource in storage.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @param \App\CommonSettings $commonSettings
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function update(Request $request, CommonSettings $commonSettings)
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Remove the specified resource from storage.
|
|
*
|
|
* @param \App\CommonSettings $commonSettings
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function destroy(CommonSettings $commonSettings)
|
|
{
|
|
//
|
|
}
|
|
|
|
public function univJson(Request $request)
|
|
{
|
|
// document.querySelectorAll(".timeline-wrap.edu-exps > div > div.content.join-text-wrap").forEach(univ => console.log(univ.firstChild))
|
|
|
|
|
|
$univ = trim($request->get("univ"));
|
|
Log::info("univ is {$univ}");
|
|
$f = null;
|
|
if (Redis::connection()->get("univ_json") == null) {
|
|
$f = file_get_contents("/Users/shixuesen/Downloads/univ_e.json");
|
|
Redis::connection()->set("univ_json", $f);
|
|
} else {
|
|
$f = Redis::connection()->get("univ_json");
|
|
}
|
|
if ($univ == null || $univ == "") {
|
|
return $f;
|
|
}
|
|
Log::info("univs is " . $f);
|
|
$content = json_decode($f, true);
|
|
return Arr::get($content, $univ, 999);
|
|
}
|
|
}
|