48 lines
1.2 KiB
PHP
48 lines
1.2 KiB
PHP
<?php
|
|
/**
|
|
* Author: cfn <cfn@leapy.cn>
|
|
*/
|
|
|
|
namespace App\Controller;
|
|
|
|
use Hyperf\HttpServer\Annotation\Controller;
|
|
use Hyperf\HttpServer\Annotation\GetMapping;
|
|
use App\Model\Uuid as uModel;
|
|
|
|
#[Controller("v1")]
|
|
class GaoDingController extends AbstractController
|
|
{
|
|
#[GetMapping("uuid/get")]
|
|
public function get()
|
|
{
|
|
return $this->success(uModel::add());
|
|
}
|
|
|
|
#[GetMapping("uuid/query")]
|
|
public function query()
|
|
{
|
|
$data = uModel::getByUuid($this->request->input("uuid", ""));
|
|
if (empty($data)) {
|
|
return $this->error("系统异常");
|
|
}
|
|
if ($data['status'] != 1) {
|
|
return $this->error("不可用");
|
|
}
|
|
return $this->success($data);
|
|
}
|
|
|
|
#[GetMapping("uuid/exp")]
|
|
public function setExp()
|
|
{
|
|
$uuid = $this->request->input("uuid", "");
|
|
$date = $this->request->input("date", date("Y-m-d"));
|
|
if (!$uuid || !$date) {
|
|
return $this->error("系统错误");
|
|
}
|
|
$res = uModel::where("uuid", $uuid)->where("del_flag", 0)->update([
|
|
'exp' => $date,
|
|
'update_time' => date("Y-m-d H:i:s")
|
|
]);
|
|
return $res ? $this->success("设置成功") : $this->error("设置失败");
|
|
}
|
|
} |