feat: add model of scope

This commit is contained in:
FoskyM 2023-10-01 19:23:03 +08:00
parent 465a005d05
commit 91a8f950ec
No known key found for this signature in database
GPG key ID: 42C0ED6994AD7E9C
2 changed files with 12 additions and 1 deletions

View file

@ -1,7 +1,9 @@
import Extend from 'flarum/common/extenders'; import Extend from 'flarum/common/extenders';
import Client from "./models/Client"; import Client from "./models/Client";
import Scope from "./models/Scope";
export default [ export default [
new Extend.Store() new Extend.Store()
.add('oauth-clients', Client), .add('oauth-clients', Client)
.add('oauth-scopes', Scope),
]; ];

View file

@ -0,0 +1,9 @@
import Model from 'flarum/common/Model';
export default class Client extends Model {
scope = Model.attribute('scope');
is_default = Model.attribute('is_default', value => value === 1);
scope_name = Model.attribute('scope_name');
scope_icon = Model.attribute('scope_icon');
scope_desc = Model.attribute('scope_desc');
}