首次提交 Laravel 專案
This commit is contained in:
+27545
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\tg_Msg;
|
||||
use App\Services\TgApi;
|
||||
use App\Services\UserFun;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class TgController extends Controller
|
||||
{
|
||||
public function Msg($token,Request $request)
|
||||
{
|
||||
$data = $request->all();
|
||||
$data='{"update_id":240447110,"message":{"message_id":1356,"from":{"id":5909523353,"is_bot":false,"first_name":"流浪的","last_name":"阿江","username":"winchen1688","language_code":"zh-hans"},"chat":{"id":-937402821,"title":"易利机器人测试群","type":"group","all_members_are_administrators":true},"date":1745980807,"text":"@xiongia +2000","entities":[{"offset":0,"length":8,"type":"mention"}]}}';
|
||||
$msg=UserFun::Json2Arr($data); //将JSON转换成一維扁平陣列
|
||||
$msg['token']=$token;
|
||||
$tgmsg=tg_Msg::storeFromWebhookJson($msg);
|
||||
$chat_id=TgApi::GetChatInfo($msg);
|
||||
dd($chat_id);
|
||||
|
||||
return $tgmsg;
|
||||
// return response()->json(['status' => 'ok']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="PHPUnit">
|
||||
<option name="directories">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/tests/Unit" />
|
||||
<option value="$PROJECT_DIR$/tests/Feature" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,11 @@
|
||||
* text=auto eol=lf
|
||||
|
||||
*.blade.php diff=html
|
||||
*.css diff=css
|
||||
*.html diff=html
|
||||
*.md diff=markdown
|
||||
*.php diff=php
|
||||
|
||||
/.github export-ignore
|
||||
CHANGELOG.md export-ignore
|
||||
.styleci.yml export-ignore
|
||||
Reference in New Issue
Block a user