feat: 开放API授权相关

This commit is contained in:
2025-05-20 14:40:39 +08:00
parent 0b9001a739
commit 4828bde695
16 changed files with 577 additions and 1 deletions

View File

@@ -0,0 +1,33 @@
<?php
declare (strict_types = 1);
namespace app\openapi\model;
use think\Model;
/**
* @mixin \think\Model
*/
class OAuthAuthCodeModel extends Model
{
// 表名
protected $name = 'oauth_auth_code';
// 字段信息
protected $schema = [
'id' => 'int',
'code' => 'string',
'client_id' => 'string',
'user_id' => 'int',
'expires' => 'int',
'redirect_uri' => 'string',
'scope' => 'string',
'created_at' => 'datetime',
];
// code范围查询
public function scopeCode($query, $code)
{
$query->where('code', '=', $code);
}
}