Add channel and message
This commit is contained in:
38
src/api/channel/content-types/channel/schema.json
Normal file
38
src/api/channel/content-types/channel/schema.json
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"kind": "collectionType",
|
||||
"collectionName": "channels",
|
||||
"info": {
|
||||
"singularName": "channel",
|
||||
"pluralName": "channels",
|
||||
"displayName": "Channel"
|
||||
},
|
||||
"options": {
|
||||
"draftAndPublish": false
|
||||
},
|
||||
"pluginOptions": {},
|
||||
"attributes": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "enumeration",
|
||||
"enum": [
|
||||
"TEXT",
|
||||
"AUDIO",
|
||||
"VIDEO"
|
||||
]
|
||||
},
|
||||
"choral": {
|
||||
"type": "relation",
|
||||
"relation": "manyToOne",
|
||||
"target": "api::choral.choral",
|
||||
"inversedBy": "channels"
|
||||
},
|
||||
"messages": {
|
||||
"type": "relation",
|
||||
"relation": "oneToMany",
|
||||
"target": "api::message.message",
|
||||
"mappedBy": "channel"
|
||||
}
|
||||
}
|
||||
}
|
||||
7
src/api/channel/controllers/channel.ts
Normal file
7
src/api/channel/controllers/channel.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* channel controller
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi'
|
||||
|
||||
export default factories.createCoreController('api::channel.channel');
|
||||
7
src/api/channel/routes/channel.ts
Normal file
7
src/api/channel/routes/channel.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* channel router
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi';
|
||||
|
||||
export default factories.createCoreRouter('api::channel.channel');
|
||||
7
src/api/channel/services/channel.ts
Normal file
7
src/api/channel/services/channel.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* channel service
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi';
|
||||
|
||||
export default factories.createCoreService('api::channel.channel');
|
||||
Reference in New Issue
Block a user