extrafile中的属性required设置

This commit is contained in:
Xu Chang 2023-04-12 13:41:42 +08:00
parent 64dca4a470
commit 16df186172
19 changed files with 71 additions and 74 deletions

View File

@ -5,10 +5,10 @@ export interface Schema extends EntityShape {
type: 'image' | 'video' | 'audio' | 'file';
bucket: String<16>;
objectId: String<64>;
tag1: String<16>;
tag2: String<16>;
tag1?: String<16>;
tag2?: String<16>;
filename: String<256>;
md5: Text;
md5?: Text;
entity: String<32>;
entityId: String<64>;
extra1?: Text;

View File

@ -5,9 +5,9 @@ var IActionDef = {
stm: {
online: ['offline', 'online'],
offline: ['online', 'offline'],
disabled: [['online', 'offline'], 'disabled'],
disabled: [['online', 'offline'], 'disabled']
},
is: 'offline',
is: 'offline'
};
exports.actions = ["count", "stat", "download", "select", "aggregate", "create", "remove", "update", "online", "offline", "disabled"];
exports.ActionDefDict = {

View File

@ -5,9 +5,9 @@ var IActionDef = {
stm: {
send: ['unsent', 'sending'],
success: ['sending', 'sent'],
fail: ['sending', 'failure'],
fail: ['sending', 'failure']
},
is: 'unsent',
is: 'unsent'
};
exports.actions = ["count", "stat", "download", "select", "aggregate", "create", "remove", "update", "send", "success", "fail"];
exports.ActionDefDict = {

View File

@ -50,17 +50,17 @@ exports.desc = {
attributes: [
{
name: 'mobile',
direction: 'ASC',
direction: 'ASC'
},
{
name: 'code',
direction: 'ASC',
direction: 'ASC'
},
{
name: '$$createAt$$',
direction: 'DESC',
direction: 'DESC'
}
],
]
}
]
};

View File

@ -29,13 +29,13 @@ exports.desc = {
attributes: [
{
name: 'email',
direction: 'ASC',
direction: 'ASC'
},
{
name: 'ableState',
direction: 'ASC',
direction: 'ASC'
}
],
]
}
]
};

View File

@ -11,10 +11,10 @@ export declare type OpSchema = EntityShape & {
type: 'image' | 'video' | 'audio' | 'file';
bucket: String<16>;
objectId: String<64>;
tag1: String<16>;
tag2: String<16>;
tag1?: String<16> | null;
tag2?: String<16> | null;
filename: String<256>;
md5: Text;
md5?: Text | null;
entity: "article" | "user" | string;
entityId: String<64>;
extra1?: Text | null;
@ -29,10 +29,10 @@ export declare type Schema = EntityShape & {
type: 'image' | 'video' | 'audio' | 'file';
bucket: String<16>;
objectId: String<64>;
tag1: String<16>;
tag2: String<16>;
tag1?: String<16> | null;
tag2?: String<16> | null;
filename: String<256>;
md5: Text;
md5?: Text | null;
entity: "article" | "user" | string;
entityId: String<64>;
extra1?: Text | null;

View File

@ -29,14 +29,12 @@ exports.desc = {
}
},
tag1: {
notNull: true,
type: "varchar",
params: {
length: 16
}
},
tag2: {
notNull: true,
type: "varchar",
params: {
length: 16
@ -50,7 +48,6 @@ exports.desc = {
}
},
md5: {
notNull: true,
type: "text"
},
entity: {

View File

@ -5,14 +5,14 @@ exports.actions = ["count", "stat", "download", "select", "aggregate", "create",
var IActionDef = {
stm: {
succeed: ['sending', 'success'],
fail: ['sending', 'failure'],
},
fail: ['sending', 'failure']
}
};
var VisitActionDef = {
stm: {
visit: ['unvisited', 'visited'],
visit: ['unvisited', 'visited']
},
is: 'unvisited',
is: 'unvisited'
};
exports.ActionDefDict = {
iState: IActionDef,

View File

@ -29,13 +29,13 @@ exports.desc = {
attributes: [
{
name: 'mobile',
direction: 'ASC',
direction: 'ASC'
},
{
name: 'ableState',
direction: 'ASC',
direction: 'ASC'
}
],
]
}
]
};

View File

@ -4,9 +4,9 @@ exports.ActionDefDict = exports.actions = void 0;
var IActionDef = {
stm: {
apply: ['active', 'applied'],
abandon: ['active', 'abandoned'],
abandon: ['active', 'abandoned']
},
is: 'active',
is: 'active'
};
exports.actions = ["count", "stat", "download", "select", "aggregate", "create", "remove", "update", "apply", "abandon"];
exports.ActionDefDict = {

View File

@ -55,9 +55,9 @@ exports.desc = {
attributes: [
{
name: 'iState',
direction: 'ASC',
direction: 'ASC'
}
],
]
}
]
};

View File

@ -5,9 +5,9 @@ exports.actions = ["count", "stat", "download", "select", "aggregate", "create",
var IActionDef = {
stm: {
succeed: ['sending', 'success'],
fail: ['sending', 'failure'],
fail: ['sending', 'failure']
},
is: 'sending',
is: 'sending'
};
exports.ActionDefDict = {
iState: IActionDef

View File

@ -50,20 +50,20 @@ exports.desc = {
name: 'index_name',
attributes: [
{
name: 'name',
name: 'name'
},
],
]
},
{
name: 'index_entity',
attributes: [
{
name: 'entity',
name: 'entity'
},
{
name: 'entityId',
name: 'entityId'
}
],
]
}
]
};

View File

@ -5,9 +5,9 @@ var IdActionDef = {
stm: {
verify: ['unverified', 'verifying'],
accept: [['unverified', 'verifying'], 'verified'],
reject: [['verifying', 'verified'], 'unverified'],
reject: [['verifying', 'verified'], 'unverified']
},
is: 'unverified',
is: 'unverified'
};
var UserActionDef = {
stm: {
@ -15,8 +15,8 @@ var UserActionDef = {
disable: [['normal', 'shadow'], 'disabled'],
enable: ['disabled', 'normal'],
mergeTo: [['normal', 'shadow'], 'merged'],
mergeFrom: ['normal', 'normal'],
},
mergeFrom: ['normal', 'normal']
}
};
exports.actions = ["count", "stat", "download", "select", "aggregate", "create", "remove", "update", "grant", "revoke", "activate", "disable", "enable", "mergeTo", "mergeFrom", "verify", "accept", "reject"];
exports.ActionDefDict = {

View File

@ -61,33 +61,33 @@ exports.desc = {
attributes: [
{
name: 'birth',
direction: 'ASC',
direction: 'ASC'
},
],
]
},
{
name: 'index_fulltext',
attributes: [
{
name: 'name',
name: 'name'
},
{
name: 'nickname',
name: 'nickname'
}
],
config: {
type: 'fulltext',
parser: 'ngram',
parser: 'ngram'
}
},
{
name: 'index_userState_refId',
attributes: [
{
name: 'userState',
name: 'userState'
},
{
name: "refId",
name: "refId"
}
]
}

View File

@ -81,23 +81,23 @@ exports.desc = {
name: 'index_entity_entityId',
attributes: [
{
name: 'entity',
name: 'entity'
},
{
name: 'entityId',
name: 'entityId'
},
],
]
},
{
name: 'index_uuid',
attributes: [
{
name: 'expired',
name: 'expired'
},
{
name: 'expiresAt',
name: 'expiresAt'
}
],
]
}
]
};

View File

@ -40,15 +40,15 @@ exports.desc = {
name: 'index_text_application',
attributes: [
{
name: 'text',
name: 'text'
},
{
name: "applicationId",
name: "applicationId"
},
],
config: {
unique: true,
},
unique: true
}
}
]
};

View File

@ -79,34 +79,34 @@ exports.desc = {
name: 'index_entity_entityId_tag',
attributes: [
{
name: 'entity',
name: 'entity'
},
{
name: 'entityId',
name: 'entityId'
},
{
name: 'tag',
name: 'tag'
}
],
]
},
{
name: 'index_expired_expiresAt',
attributes: [
{
name: 'expired',
name: 'expired'
},
{
name: 'expiresAt',
name: 'expiresAt'
},
],
]
},
{
name: 'index_url',
attributes: [
{
name: 'url',
name: 'url'
},
],
]
}
]
};

View File

@ -7,10 +7,10 @@ export interface Schema extends EntityShape {
type: 'image' | 'video' | 'audio' | 'file';
bucket: String<16>;
objectId: String<64>;
tag1: String<16>;
tag2: String<16>;
tag1?: String<16>;
tag2?: String<16>;
filename: String<256>;
md5: Text;
md5?: Text;
entity: String<32>;
entityId: String<64>;
extra1?: Text;