102 lines
2.2 KiB
JavaScript
102 lines
2.2 KiB
JavaScript
import { actions } from "./Action";
|
|
export const desc = {
|
|
attributes: {
|
|
name: {
|
|
type: "varchar",
|
|
params: {
|
|
length: 16
|
|
}
|
|
},
|
|
nickname: {
|
|
type: "varchar",
|
|
params: {
|
|
length: 64
|
|
}
|
|
},
|
|
password: {
|
|
type: "text"
|
|
},
|
|
refId: {
|
|
type: "ref",
|
|
ref: "user"
|
|
},
|
|
passwordSha1: {
|
|
type: "text"
|
|
},
|
|
birth: {
|
|
type: "datetime"
|
|
},
|
|
gender: {
|
|
type: "enum",
|
|
enumeration: ["male", "female"]
|
|
},
|
|
idCardType: {
|
|
type: "enum",
|
|
enumeration: ["ID-Card", "passport", "Mainland-passport"]
|
|
},
|
|
idNumber: {
|
|
type: "varchar",
|
|
params: {
|
|
length: 32
|
|
}
|
|
},
|
|
isRoot: {
|
|
type: "boolean"
|
|
},
|
|
hasPassword: {
|
|
type: "boolean"
|
|
},
|
|
verifyPasswordAt: {
|
|
type: "datetime"
|
|
},
|
|
idState: {
|
|
notNull: true,
|
|
type: "enum",
|
|
enumeration: ["unverified", "verified", "verifying"]
|
|
},
|
|
userState: {
|
|
type: "enum",
|
|
enumeration: ["disabled", "shadow", "normal", "merged"]
|
|
}
|
|
},
|
|
actionType: "crud",
|
|
actions,
|
|
indexes: [
|
|
{
|
|
name: 'index_birth',
|
|
attributes: [
|
|
{
|
|
name: 'birth',
|
|
direction: 'ASC',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: 'index_fulltext',
|
|
attributes: [
|
|
{
|
|
name: 'name',
|
|
},
|
|
{
|
|
name: 'nickname',
|
|
}
|
|
],
|
|
config: {
|
|
type: 'fulltext',
|
|
parser: 'ngram',
|
|
}
|
|
},
|
|
{
|
|
name: 'index_userState_refId',
|
|
attributes: [
|
|
{
|
|
name: 'userState',
|
|
},
|
|
{
|
|
name: "refId",
|
|
}
|
|
]
|
|
}
|
|
]
|
|
};
|