Feature: 添加Content类型
This commit is contained in:
108
src/api/production/content-types/production/schema.json
Normal file
108
src/api/production/content-types/production/schema.json
Normal file
@ -0,0 +1,108 @@
|
||||
{
|
||||
"kind": "collectionType",
|
||||
"collectionName": "productions",
|
||||
"info": {
|
||||
"singularName": "production",
|
||||
"pluralName": "productions",
|
||||
"displayName": "Production"
|
||||
},
|
||||
"options": {
|
||||
"draftAndPublish": true
|
||||
},
|
||||
"pluginOptions": {
|
||||
"i18n": {
|
||||
"localized": true
|
||||
}
|
||||
},
|
||||
"attributes": {
|
||||
"title": {
|
||||
"type": "string",
|
||||
"pluginOptions": {
|
||||
"i18n": {
|
||||
"localized": true
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"summary": {
|
||||
"type": "string",
|
||||
"pluginOptions": {
|
||||
"i18n": {
|
||||
"localized": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"production_type": {
|
||||
"type": "relation",
|
||||
"relation": "oneToOne",
|
||||
"target": "api::production-type.production-type"
|
||||
},
|
||||
"cover": {
|
||||
"type": "media",
|
||||
"pluginOptions": {
|
||||
"i18n": {
|
||||
"localized": true
|
||||
}
|
||||
},
|
||||
"multiple": false,
|
||||
"allowedTypes": [
|
||||
"images"
|
||||
]
|
||||
},
|
||||
"production_images": {
|
||||
"type": "media",
|
||||
"pluginOptions": {
|
||||
"i18n": {
|
||||
"localized": true
|
||||
}
|
||||
},
|
||||
"multiple": true,
|
||||
"allowedTypes": [
|
||||
"images"
|
||||
]
|
||||
},
|
||||
"production_details": {
|
||||
"type": "richtext",
|
||||
"pluginOptions": {
|
||||
"i18n": {
|
||||
"localized": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"production_specs": {
|
||||
"type": "dynamiczone",
|
||||
"pluginOptions": {
|
||||
"i18n": {
|
||||
"localized": true
|
||||
}
|
||||
},
|
||||
"components": [
|
||||
"production.spec-group"
|
||||
]
|
||||
},
|
||||
"documents": {
|
||||
"type": "media",
|
||||
"pluginOptions": {
|
||||
"i18n": {
|
||||
"localized": true
|
||||
}
|
||||
},
|
||||
"multiple": true,
|
||||
"allowedTypes": [
|
||||
"images",
|
||||
"files",
|
||||
"videos",
|
||||
"audios"
|
||||
]
|
||||
},
|
||||
"show_in_production_list": {
|
||||
"type": "boolean",
|
||||
"pluginOptions": {
|
||||
"i18n": {
|
||||
"localized": true
|
||||
}
|
||||
},
|
||||
"default": true
|
||||
}
|
||||
}
|
||||
}
|
||||
7
src/api/production/controllers/production.ts
Normal file
7
src/api/production/controllers/production.ts
Normal file
@ -0,0 +1,7 @@
|
||||
/**
|
||||
* production controller
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi'
|
||||
|
||||
export default factories.createCoreController('api::production.production');
|
||||
7
src/api/production/routes/production.ts
Normal file
7
src/api/production/routes/production.ts
Normal file
@ -0,0 +1,7 @@
|
||||
/**
|
||||
* production router
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi';
|
||||
|
||||
export default factories.createCoreRouter('api::production.production');
|
||||
7
src/api/production/services/production.ts
Normal file
7
src/api/production/services/production.ts
Normal file
@ -0,0 +1,7 @@
|
||||
/**
|
||||
* production service
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi';
|
||||
|
||||
export default factories.createCoreService('api::production.production');
|
||||
Reference in New Issue
Block a user