Add conversation and direct message
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "harmony-back",
|
"name": "harmony-back",
|
||||||
"version": "0.11.1",
|
"version": "0.11.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "A Strapi application",
|
"description": "A Strapi application",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
30
src/api/conversation/content-types/conversation/schema.json
Normal file
30
src/api/conversation/content-types/conversation/schema.json
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"kind": "collectionType",
|
||||||
|
"collectionName": "conversations",
|
||||||
|
"info": {
|
||||||
|
"singularName": "conversation",
|
||||||
|
"pluralName": "conversations",
|
||||||
|
"displayName": "Conversation"
|
||||||
|
},
|
||||||
|
"options": {
|
||||||
|
"draftAndPublish": false
|
||||||
|
},
|
||||||
|
"pluginOptions": {},
|
||||||
|
"attributes": {
|
||||||
|
"user1": {
|
||||||
|
"type": "relation",
|
||||||
|
"relation": "oneToOne",
|
||||||
|
"target": "plugin::users-permissions.user"
|
||||||
|
},
|
||||||
|
"user2": {
|
||||||
|
"type": "relation",
|
||||||
|
"relation": "oneToOne",
|
||||||
|
"target": "plugin::users-permissions.user"
|
||||||
|
},
|
||||||
|
"direct_messages": {
|
||||||
|
"type": "relation",
|
||||||
|
"relation": "oneToMany",
|
||||||
|
"target": "api::direct-message.direct-message"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
7
src/api/conversation/controllers/conversation.ts
Normal file
7
src/api/conversation/controllers/conversation.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
/**
|
||||||
|
* conversation controller
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { factories } from '@strapi/strapi'
|
||||||
|
|
||||||
|
export default factories.createCoreController('api::conversation.conversation');
|
||||||
7
src/api/conversation/routes/conversation.ts
Normal file
7
src/api/conversation/routes/conversation.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
/**
|
||||||
|
* conversation router
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { factories } from '@strapi/strapi';
|
||||||
|
|
||||||
|
export default factories.createCoreRouter('api::conversation.conversation');
|
||||||
7
src/api/conversation/services/conversation.ts
Normal file
7
src/api/conversation/services/conversation.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
/**
|
||||||
|
* conversation service
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { factories } from '@strapi/strapi';
|
||||||
|
|
||||||
|
export default factories.createCoreService('api::conversation.conversation');
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
{
|
||||||
|
"kind": "collectionType",
|
||||||
|
"collectionName": "direct_messages",
|
||||||
|
"info": {
|
||||||
|
"singularName": "direct-message",
|
||||||
|
"pluralName": "direct-messages",
|
||||||
|
"displayName": "DirectMessage"
|
||||||
|
},
|
||||||
|
"options": {
|
||||||
|
"draftAndPublish": false
|
||||||
|
},
|
||||||
|
"pluginOptions": {},
|
||||||
|
"attributes": {
|
||||||
|
"content": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"fileUrl": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"user1": {
|
||||||
|
"type": "relation",
|
||||||
|
"relation": "oneToOne",
|
||||||
|
"target": "plugin::users-permissions.user"
|
||||||
|
},
|
||||||
|
"user2": {
|
||||||
|
"type": "relation",
|
||||||
|
"relation": "oneToOne",
|
||||||
|
"target": "plugin::users-permissions.user"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
7
src/api/direct-message/controllers/direct-message.ts
Normal file
7
src/api/direct-message/controllers/direct-message.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
/**
|
||||||
|
* direct-message controller
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { factories } from '@strapi/strapi'
|
||||||
|
|
||||||
|
export default factories.createCoreController('api::direct-message.direct-message');
|
||||||
7
src/api/direct-message/routes/direct-message.ts
Normal file
7
src/api/direct-message/routes/direct-message.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
/**
|
||||||
|
* direct-message router
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { factories } from '@strapi/strapi';
|
||||||
|
|
||||||
|
export default factories.createCoreRouter('api::direct-message.direct-message');
|
||||||
7
src/api/direct-message/services/direct-message.ts
Normal file
7
src/api/direct-message/services/direct-message.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
/**
|
||||||
|
* direct-message service
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { factories } from '@strapi/strapi';
|
||||||
|
|
||||||
|
export default factories.createCoreService('api::direct-message.direct-message');
|
||||||
File diff suppressed because it is too large
Load Diff
80
types/generated/contentTypes.d.ts
vendored
80
types/generated/contentTypes.d.ts
vendored
@@ -678,6 +678,84 @@ export interface ApiChoralChoral extends Struct.CollectionTypeSchema {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface ApiConversationConversation
|
||||||
|
extends Struct.CollectionTypeSchema {
|
||||||
|
collectionName: 'conversations';
|
||||||
|
info: {
|
||||||
|
displayName: 'Conversation';
|
||||||
|
pluralName: 'conversations';
|
||||||
|
singularName: 'conversation';
|
||||||
|
};
|
||||||
|
options: {
|
||||||
|
draftAndPublish: false;
|
||||||
|
};
|
||||||
|
attributes: {
|
||||||
|
createdAt: Schema.Attribute.DateTime;
|
||||||
|
createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||||
|
Schema.Attribute.Private;
|
||||||
|
direct_messages: Schema.Attribute.Relation<
|
||||||
|
'oneToMany',
|
||||||
|
'api::direct-message.direct-message'
|
||||||
|
>;
|
||||||
|
locale: Schema.Attribute.String & Schema.Attribute.Private;
|
||||||
|
localizations: Schema.Attribute.Relation<
|
||||||
|
'oneToMany',
|
||||||
|
'api::conversation.conversation'
|
||||||
|
> &
|
||||||
|
Schema.Attribute.Private;
|
||||||
|
publishedAt: Schema.Attribute.DateTime;
|
||||||
|
updatedAt: Schema.Attribute.DateTime;
|
||||||
|
updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||||
|
Schema.Attribute.Private;
|
||||||
|
user1: Schema.Attribute.Relation<
|
||||||
|
'oneToOne',
|
||||||
|
'plugin::users-permissions.user'
|
||||||
|
>;
|
||||||
|
user2: Schema.Attribute.Relation<
|
||||||
|
'oneToOne',
|
||||||
|
'plugin::users-permissions.user'
|
||||||
|
>;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ApiDirectMessageDirectMessage
|
||||||
|
extends Struct.CollectionTypeSchema {
|
||||||
|
collectionName: 'direct_messages';
|
||||||
|
info: {
|
||||||
|
displayName: 'DirectMessage';
|
||||||
|
pluralName: 'direct-messages';
|
||||||
|
singularName: 'direct-message';
|
||||||
|
};
|
||||||
|
options: {
|
||||||
|
draftAndPublish: false;
|
||||||
|
};
|
||||||
|
attributes: {
|
||||||
|
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::direct-message.direct-message'
|
||||||
|
> &
|
||||||
|
Schema.Attribute.Private;
|
||||||
|
publishedAt: Schema.Attribute.DateTime;
|
||||||
|
updatedAt: Schema.Attribute.DateTime;
|
||||||
|
updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||||
|
Schema.Attribute.Private;
|
||||||
|
user1: Schema.Attribute.Relation<
|
||||||
|
'oneToOne',
|
||||||
|
'plugin::users-permissions.user'
|
||||||
|
>;
|
||||||
|
user2: Schema.Attribute.Relation<
|
||||||
|
'oneToOne',
|
||||||
|
'plugin::users-permissions.user'
|
||||||
|
>;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
export interface ApiEventOtherEventOther extends Struct.CollectionTypeSchema {
|
export interface ApiEventOtherEventOther extends Struct.CollectionTypeSchema {
|
||||||
collectionName: 'event_others';
|
collectionName: 'event_others';
|
||||||
info: {
|
info: {
|
||||||
@@ -1375,6 +1453,8 @@ declare module '@strapi/strapi' {
|
|||||||
'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::conversation.conversation': ApiConversationConversation;
|
||||||
|
'api::direct-message.direct-message': ApiDirectMessageDirectMessage;
|
||||||
'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::message.message': ApiMessageMessage;
|
||||||
|
|||||||
Reference in New Issue
Block a user