add content, add swagger
This commit is contained in:
47
src/api/category/content-types/category/schema.json
Normal file
47
src/api/category/content-types/category/schema.json
Normal file
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"kind": "collectionType",
|
||||
"collectionName": "categories",
|
||||
"info": {
|
||||
"singularName": "category",
|
||||
"pluralName": "categories",
|
||||
"displayName": "Category"
|
||||
},
|
||||
"options": {
|
||||
"draftAndPublish": true
|
||||
},
|
||||
"pluginOptions": {},
|
||||
"attributes": {
|
||||
"slug": {
|
||||
"type": "uid",
|
||||
"required": true
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "text"
|
||||
},
|
||||
"comment": {
|
||||
"type": "string"
|
||||
},
|
||||
"group": {
|
||||
"type": "enumeration",
|
||||
"required": true,
|
||||
"enum": [
|
||||
"service",
|
||||
"solution"
|
||||
]
|
||||
},
|
||||
"sortOrder": {
|
||||
"type": "integer",
|
||||
"required": true,
|
||||
"default": 0
|
||||
},
|
||||
"vendors": {
|
||||
"type": "relation",
|
||||
"relation": "manyToMany",
|
||||
"target": "api::vendor.vendor",
|
||||
"inversedBy": "categories"
|
||||
}
|
||||
}
|
||||
}
|
||||
7
src/api/category/controllers/category.ts
Normal file
7
src/api/category/controllers/category.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* category controller
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi';
|
||||
|
||||
export default factories.createCoreController('api::category.category');
|
||||
7
src/api/category/routes/category.ts
Normal file
7
src/api/category/routes/category.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* category router
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi';
|
||||
|
||||
export default factories.createCoreRouter('api::category.category');
|
||||
7
src/api/category/services/category.ts
Normal file
7
src/api/category/services/category.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* category service
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi';
|
||||
|
||||
export default factories.createCoreService('api::category.category');
|
||||
Reference in New Issue
Block a user