This commit is contained in:
Michael 2024-07-22 14:17:00 +02:00
parent a15319c4d1
commit eebf859afa
39 changed files with 2742 additions and 937 deletions

View file

@ -0,0 +1,31 @@
<?php
namespace App\Http\Controllers\GiteaApiController;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
class GiteaApiController extends Controller
{
private $gitea_export;
public function __construct()
{
$this->gitea_export = new GiteaExport();
}
public function export_closed_issues(Request $req)
{
if ($req->input('token') != getenv('GITEA_TOKEN')) {
return redirect('/');
}
$from = $req->input('from_year') . '-' . $req->input('from_month') . '-01';
$to = $req->input('to_year') . '-' . $req->input('to_month') . '-31';
$res = $this->gitea_export->export_issues($from, $to, ['state' => $req->input('issues_type')]);
return view('backend', [
'token' => getenv('GITEA_TOKEN'),
'download' => $res
]);
}
}