Add channel and message

This commit is contained in:
2025-05-04 19:37:57 +02:00
parent c811ad7e21
commit 498024fc10
11 changed files with 8429 additions and 1 deletions

View 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"
}
}
}

View File

@@ -0,0 +1,7 @@
/**
* channel controller
*/
import { factories } from '@strapi/strapi'
export default factories.createCoreController('api::channel.channel');

View File

@@ -0,0 +1,7 @@
/**
* channel router
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreRouter('api::channel.channel');

View File

@@ -0,0 +1,7 @@
/**
* channel service
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreService('api::channel.channel');

View File

@@ -94,6 +94,12 @@
"relation": "oneToMany", "relation": "oneToMany",
"target": "api::announcement.announcement", "target": "api::announcement.announcement",
"mappedBy": "choral" "mappedBy": "choral"
},
"channels": {
"type": "relation",
"relation": "oneToMany",
"target": "api::channel.channel",
"mappedBy": "choral"
} }
} }
} }

View File

@@ -0,0 +1,38 @@
{
"kind": "collectionType",
"collectionName": "messages",
"info": {
"singularName": "message",
"pluralName": "messages",
"displayName": "Message",
"description": ""
},
"options": {
"draftAndPublish": false
},
"pluginOptions": {},
"attributes": {
"content": {
"type": "string"
},
"fileUrl": {
"type": "string"
},
"author": {
"type": "relation",
"relation": "oneToOne",
"target": "plugin::users-permissions.user"
},
"channel": {
"type": "relation",
"relation": "manyToOne",
"target": "api::channel.channel",
"inversedBy": "messages"
},
"choral": {
"type": "relation",
"relation": "oneToOne",
"target": "api::choral.choral"
}
}
}

View File

@@ -0,0 +1,14 @@
/**
* message controller
*/
import { factories } from "@strapi/strapi";
export default factories.createCoreController(
"api::message.message",
({ strapi }) => ({
async create(ctx) {
return super.create(ctx);
},
})
);

View File

@@ -0,0 +1,7 @@
/**
* message router
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreRouter('api::message.message');

View File

@@ -0,0 +1,7 @@
/**
* message service
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreService('api::message.message');

View File

@@ -511,6 +511,37 @@ export interface ApiBoardBoard extends Struct.CollectionTypeSchema {
}; };
} }
export interface ApiChannelChannel extends Struct.CollectionTypeSchema {
collectionName: 'channels';
info: {
displayName: 'Channel';
pluralName: 'channels';
singularName: 'channel';
};
options: {
draftAndPublish: false;
};
attributes: {
choral: Schema.Attribute.Relation<'manyToOne', 'api::choral.choral'>;
createdAt: Schema.Attribute.DateTime;
createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
Schema.Attribute.Private;
locale: Schema.Attribute.String & Schema.Attribute.Private;
localizations: Schema.Attribute.Relation<
'oneToMany',
'api::channel.channel'
> &
Schema.Attribute.Private;
messages: Schema.Attribute.Relation<'oneToMany', 'api::message.message'>;
name: Schema.Attribute.String;
publishedAt: Schema.Attribute.DateTime;
type: Schema.Attribute.Enumeration<['TEXT', 'AUDIO', 'VIDEO']>;
updatedAt: Schema.Attribute.DateTime;
updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
Schema.Attribute.Private;
};
}
export interface ApiChoralMembershipChoralMembership export interface ApiChoralMembershipChoralMembership
extends Struct.CollectionTypeSchema { extends Struct.CollectionTypeSchema {
collectionName: 'choral_memberships'; collectionName: 'choral_memberships';
@@ -606,6 +637,7 @@ export interface ApiChoralChoral extends Struct.CollectionTypeSchema {
>; >;
boards: Schema.Attribute.Relation<'oneToMany', 'api::board.board'>; boards: Schema.Attribute.Relation<'oneToMany', 'api::board.board'>;
calendar: Schema.Attribute.Relation<'oneToMany', 'api::event.event'>; calendar: Schema.Attribute.Relation<'oneToMany', 'api::event.event'>;
channels: Schema.Attribute.Relation<'oneToMany', 'api::channel.channel'>;
city: Schema.Attribute.String; city: Schema.Attribute.String;
country: Schema.Attribute.String; country: Schema.Attribute.String;
cover: Schema.Attribute.Media<'images' | 'files' | 'videos' | 'audios'>; cover: Schema.Attribute.Media<'images' | 'files' | 'videos' | 'audios'>;
@@ -723,6 +755,42 @@ export interface ApiEventEvent extends Struct.CollectionTypeSchema {
}; };
} }
export interface ApiMessageMessage extends Struct.CollectionTypeSchema {
collectionName: 'messages';
info: {
description: '';
displayName: 'Message';
pluralName: 'messages';
singularName: 'message';
};
options: {
draftAndPublish: false;
};
attributes: {
author: Schema.Attribute.Relation<
'oneToOne',
'plugin::users-permissions.user'
>;
channel: Schema.Attribute.Relation<'manyToOne', 'api::channel.channel'>;
choral: Schema.Attribute.Relation<'oneToOne', 'api::choral.choral'>;
content: Schema.Attribute.String;
createdAt: Schema.Attribute.DateTime;
createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
Schema.Attribute.Private;
fileUrl: Schema.Attribute.String;
locale: Schema.Attribute.String & Schema.Attribute.Private;
localizations: Schema.Attribute.Relation<
'oneToMany',
'api::message.message'
> &
Schema.Attribute.Private;
publishedAt: Schema.Attribute.DateTime;
updatedAt: Schema.Attribute.DateTime;
updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
Schema.Attribute.Private;
};
}
export interface ApiPermissionsTemplatePermissionsTemplate export interface ApiPermissionsTemplatePermissionsTemplate
extends Struct.CollectionTypeSchema { extends Struct.CollectionTypeSchema {
collectionName: 'permissions_templates'; collectionName: 'permissions_templates';
@@ -1303,11 +1371,13 @@ declare module '@strapi/strapi' {
'api::board-card.board-card': ApiBoardCardBoardCard; 'api::board-card.board-card': ApiBoardCardBoardCard;
'api::board-list.board-list': ApiBoardListBoardList; 'api::board-list.board-list': ApiBoardListBoardList;
'api::board.board': ApiBoardBoard; 'api::board.board': ApiBoardBoard;
'api::channel.channel': ApiChannelChannel;
'api::choral-membership.choral-membership': ApiChoralMembershipChoralMembership; 'api::choral-membership.choral-membership': ApiChoralMembershipChoralMembership;
'api::choral-permission.choral-permission': ApiChoralPermissionChoralPermission; 'api::choral-permission.choral-permission': ApiChoralPermissionChoralPermission;
'api::choral.choral': ApiChoralChoral; 'api::choral.choral': ApiChoralChoral;
'api::event-other.event-other': ApiEventOtherEventOther; 'api::event-other.event-other': ApiEventOtherEventOther;
'api::event.event': ApiEventEvent; 'api::event.event': ApiEventEvent;
'api::message.message': ApiMessageMessage;
'api::permissions-template.permissions-template': ApiPermissionsTemplatePermissionsTemplate; 'api::permissions-template.permissions-template': ApiPermissionsTemplatePermissionsTemplate;
'plugin::content-releases.release': PluginContentReleasesRelease; 'plugin::content-releases.release': PluginContentReleasesRelease;
'plugin::content-releases.release-action': PluginContentReleasesReleaseAction; 'plugin::content-releases.release-action': PluginContentReleasesReleaseAction;