no message

This commit is contained in:
hellcat 2025-07-15 16:57:59 +08:00
parent 7756568302
commit 8dd9eb5efd
19 changed files with 580 additions and 0 deletions

View File

@ -0,0 +1,48 @@
<?php
namespace App\Http\Controllers\Api;
//use App\Models\Book as ModelBook;
//use App\Models\BookOption as ModelBookOption;
//use App\Services\TomTool\Http;
use App\Models\GoodPool as ModelGoodPool;
class GithubController
{
private function echo($zz){
return $zz;
}
private function eval($sEval)
{
return eval("return ".$sEval);
}
private function date($date)
{
return date($date);
}
private function goodToStr($sGood)
{
$aGood = json_decode($sGood, true);
$sGoodStr = "";
$i = 0;
foreach ($aGood as $row) {
if ($i !== 0) {
$sGoodStr .= "
";
}
$sGoodStr .= $row;
$i++;
}
return $sGoodStr;
}
}

View File

@ -0,0 +1,20 @@
<?php
namespace App\Http\Controllers\Api;
//use App\Models\Book as ModelBook;
//use App\Models\BookOption as ModelBookOption;
//use App\Services\TomTool\Http;
use App\Models\GoodPool as ModelGoodPool;
class GoodController
{
// public function rand($sClass)
// {
// $oGood = ModelGoodPool::_all();
//
// tomd($oGood, 1);
// }
}

View File

@ -0,0 +1,80 @@
<?php
namespace App\Http\Controllers;
//use Illuminate\Http\Request;
//use App\Models\ArticleList;
//use App\Services\Time;
//use voku\helper\AntiXSS;
//use App\Models\Tags;
//use App\Services\TomTool\Http;
use App\Models\Book as ModelBook;
use App\Models\BookOption as ModelBookOption;
use App\Services\TG\Http as TGHttp;
class CronController
{
public $oTGHttp;
function __construct()
{
$this->oTGHttp = new TGHttp();
$this->oTGHttp->sApiToken = env('telegram_token');
$this->oTGHttp->sApiChatId = env('telegram_chatid');
}
public function index()
{
$h = date("H");
$i = date("i");
$s = date("s");
//// test
$k = $_GET["k"] ?? false;
$v = $_GET["v"] ?? false;
if ($k == "h") {
$h = $v;
} else if ($k == "i") {
$i = $v;
} else if ($k == "k") {
$s = $v;
}
// $h = "00";
//// test end
if ($h == "00" && $i== "00") {
$iFireWarningLine = ModelBookOption::_hit("fire_warning_line");
$sDateWarningLine = date("Y-m-d H:i:s", strtotime($iFireWarningLine."day"));
$oBook = ModelBook::whereDate("fire", "<=", $sDateWarningLine)->where("fire_close", 0)->get();
if (!$oBook->isEmpty()) {
$oDateNow = new \DateTime();
foreach ($oBook as $oBookRow) {
$oDateRag = new \DateTime($oBookRow->fire);
$iDiffDay = $oDateNow->diff($oDateRag)->days;
if ($oDateNow > $oDateRag) {
$iDiffDay = -$iDiffDay;
}
$sTgStr = "⚠️⚠️⚠️ {{ ".$oBookRow->rag." }} 还有 {{ ".$iDiffDay." }} 天到期 ⚠️⚠️⚠️";
$this->oTGHttp->sendToTG($sTgStr);
}
}
}
}
}

View File

@ -0,0 +1,18 @@
<?php
namespace App\Http\Controllers;
//use App\Models\Book as ModelBook;
//use App\Models\BookOption as ModelBookOption;
//use App\Services\TomTool\Http;
//use App\Models\DoveSite as ModelDoveSite;
class GoodController
{
public function rand($sClass)
{
}
}

21
app/Models/Blade.php Executable file
View File

@ -0,0 +1,21 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Blade extends Model
{
protected $table = 'blade';
public static function _listKey()
{
$aSelf = self::all()->toArray();
foreach ($aSelf as &$aSelfRow) {
unset($aSelfRow["content"]);
}
return $aSelf;
}
}

22
app/Models/BladeJctj.php Executable file
View File

@ -0,0 +1,22 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Jctj extends Model
{
protected $table = 'jctj';
public $timestamps = false;
// public static function _listKey()
// {
// $aSelf = self::all()->toArray();
//
// foreach ($aSelf as &$aSelfRow) {
// unset($aSelfRow["content"]);
// }
//
// return $aSelf;
// }
}

22
app/Models/BladeJctjOption.php Executable file
View File

@ -0,0 +1,22 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class BladeJctj extends Model
{
protected $table = 'blade_jctj';
public $timestamps = false;
// public static function _listKey()
// {
// $aSelf = self::all()->toArray();
//
// foreach ($aSelf as &$aSelfRow) {
// unset($aSelfRow["content"]);
// }
//
// return $aSelf;
// }
}

19
app/Models/GoodPool.php Executable file
View File

@ -0,0 +1,19 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Ship extends Model
{
protected $table = 'ship';
public $timestamps = false;
public static function _find($sCode)
{
$oSelf = self::where("code", $sCode)->first();
return $oSelf;
}
}

64
app/Models/Me.php Executable file
View File

@ -0,0 +1,64 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class GoodPool extends Model
{
protected $table = 'good_pool';
public $timestamps = false;
// public static function _find($sCode)
// {
// $oSelf = self::where("code", $sCode)->first();
//
// return $oSelf;
// }
public static function _all()
{
$oSelf = self::all();
// $oNew;
foreach ($oSelf as &$oSelfRow) {
$oSelfRow->good = json_decode($oSelfRow->good);
}
return $oSelf;
}
public static function _rand($sClass)
{
$aGood = self::where("class", $sClass)->get()->toArray();
$iGoodRandKey = array_rand($aGood);
$aGoodRand = $aGood[$iGoodRandKey];
return $aGoodRand;
}
public static function _goodToGithub($sGood, $bEnter = true)
{
$aGood = json_decode($sGood);
$str = "";
$i = 0;
foreach ($aGood as $sGoodRow) {
if ($i !== 0) {
$str .= "
";
if ($bEnter == true) {
$str .= "
";
}
}
$str .= $sGoodRow;
$i++;
}
return $str;
}
}

View File

@ -0,0 +1,69 @@
<?php
namespace App\Services\TG\Hook\Mod;
use App\Models\Blade as ModelBlade;
class Blade extends Base {
private function filter($oBlade)
{
foreach ($oBlade as &$oBladeRow) {
unset($oBladeRow->content);
unset($oBladeRow->id);
}
return $oBlade;
}
public function List()
{
$oBlade = ModelBlade::all();
$oBlade = $this->filter($oBlade);
return $this->toJson($oBlade);
}
public function Find($aParam)
{
$sField = $aParam["aOption"][1] ?? "id";
$sValue = $aParam["aArg"][1] ?? false;
if ($sValue == "?") {
return "/blade#find__{field?} {value}";
}
$oBlade = ModelBlade::where($sField, $sValue)->first();
return $oBlade->content;
}
public function Like($aParam)
{
$sField = $aParam["aOption"][1] ?? false;
$sValue = $aParam["aArg"][1] ?? false;
if ($sValue == "?") {
return "/blade#like__{field} {value}";
}
if (!$sField) {
return "需要field";
}
if (!$sValue) {
return "需要value";
}
$oBlade = ModelBlade::where($sField, "like", "%".$sValue."%")->get();
$oBlade = $this->filter($oBlade);
return $this->toJson($oBlade);
}
public function Del($aParam)
{
$sCode = $aParam["aArg"][]
}
}

View File

@ -0,0 +1,35 @@
<?php
namespace App\Services\TG\Hook\Mod;
//use App\Models\GoodPool as ModelGoodPool;
//use App\Services\TomTool\Http;
//use App\Models\BladeJctj as ModelBladeJctj;
class Common extends Base {
public $oModelSelf;
public function __construct($oModelSelf)
{
// $this->oModelSelf = $oModelSelf;
$this->_setModel($oModelSelf);
}
public function _setModel($oModelSelf)
{
$this->oModelSelf = $oModelSelf;
}
public function list()
{
// $oJctj = ModelBladeJctj::all();
$oSelf = $this->oModelSelf->all();
tomd($oSelf, 1);
}
}

View File

@ -0,0 +1,108 @@
<?php
namespace App\Services\TG\Hook\Mod;
use App\Models\Ship as ModelShip;
//use App\Services\TomTool\Http;
class Ship extends Base {
public function List()
{
$oShip = ModelShip::all();
foreach ($oShip as $oShipRow) {
$oShipRow->good = json_decode($oShipRow->good, true);
}
return $this->toJson($oShip);
}
public function Find($aParam)
{
$sCode = $aParam["aArg"][1] ?? false;
if (!$sCode) {
return "需要code";
}
$oShip = ModelShip::_find($sCode);
if (!$oShip) {
return "没找到这个";
}
$oShip->good = json_decode($oShip->good);
return $this->toJson($oShip);
}
public function Add($aParam)
{
$sCode = $aParam["aArg"][1] ?? false;
if (!$sCode) {
return "需要code";
}
$oShip = new ModelShip();
$oShip->code = $sCode;
$oShip->save();
return $this->toJson($oShip);
}
public function Set($aParam)
{
$sCode = $aParam["aOption"][1] ?? false;
$sField = $aParam["aOption"][2] ?? false;
// $sValue = $aParam["aArg"][1] ?? false;
$aValue = $aParam["aArg"] ?? false;
$sValue = implode(" ", $aValue);
if (!$sCode) {
return "需要code";
}
if (!$sField) {
return "需要field";
}
if (!$sValue) {
return "需要value";
}
$oShip = ModelShip::_find($sCode);
if (!$oShip) {
return "没找到";
}
$oShip->$sField = $sValue;
$oShip->save();
// return $this->toJson($oShip);
$aParam["aArg"][1] = $oShip->code;
return $this->Find($aParam);
}
}
//[
// "* 好好 - 就是好",
// "* 不好不好 - 就是不好"
//]
//[
// "* 好好 - 就是好",
// "* 不好不好 - 就是不好",
// "* 你就是个瘠薄 - 知道不",
// "* 去死吧 - 去死"
//]

View File

@ -0,0 +1,16 @@
<?php
namespace App\Services\TG\Hook\Mod;
//use App\Models\GoodPool as ModelGoodPool;
//use App\Services\TomTool\Http;
use App\Services\BladeJctj as ModelBladeJctj;
class Jctj extends Base {
public function list()
{
$j
}
}

View File

@ -0,0 +1,31 @@
<?php
namespace App\Services\TG\Hook\Mod;
use App\Models\BladeJctj as ModelBladeJctj;
use App\Services\TG\Hook\Mod\DDT;
class Jctj extends Base {
private $oDDT;
private $aUpdate;
public function __construct($aUpdate)
{
$this->aUpdate = $aUpdate;
$this->oDDT = new DDT(new ModelBladeJctj());
$this->oDDT->_setPrimaryKey("id");
$this->oDDT->_setStrField(["content"]);
}
public function __call($sName, $aArg)
{
return $this->oDDT->$sName($aArg[0]);
}
}

0
public/js/jquery.min.js vendored Normal file
View File

View File

@ -0,0 +1 @@
sdfsd

View File

@ -0,0 +1 @@
sdfsd

View File

@ -0,0 +1,5 @@
<form action="upload.php" method="post" enctype="multipart/form-data">
<label for="file">选择图片:</label>
<input type="file" name="file" id="file" accept="image/*" required>
<input type="submit" value="上传">
</form>

View File