49 lines
1.1 KiB
JavaScript
49 lines
1.1 KiB
JavaScript
import { actions } from "./Action";
|
|
export const desc = {
|
|
attributes: {
|
|
userId: {
|
|
notNull: true,
|
|
type: "ref",
|
|
ref: "user"
|
|
},
|
|
applicationId: {
|
|
notNull: true,
|
|
type: "ref",
|
|
ref: "oauthApplication"
|
|
},
|
|
authorizedAt: {
|
|
notNull: true,
|
|
type: "datetime"
|
|
},
|
|
codeId: {
|
|
type: "ref",
|
|
ref: "oauthAuthorizationCode"
|
|
},
|
|
tokenId: {
|
|
type: "ref",
|
|
ref: "oauthToken"
|
|
},
|
|
usageState: {
|
|
type: "enum",
|
|
enumeration: ["granted", "denied", "revoked"]
|
|
}
|
|
},
|
|
actionType: "crud",
|
|
actions,
|
|
indexes: [
|
|
// 根据授权码查询唯一记录
|
|
{
|
|
name: 'idx_code_id',
|
|
attributes: [
|
|
{
|
|
name: "codeId",
|
|
direction: 'ASC',
|
|
}
|
|
],
|
|
config: {
|
|
unique: true,
|
|
}
|
|
}
|
|
]
|
|
};
|