Skip to content

Commit

Permalink
[add] Message model
Browse files Browse the repository at this point in the history
  • Loading branch information
TechQuery committed Nov 27, 2023
1 parent 3758279 commit 66bd5a4
Show file tree
Hide file tree
Showing 7 changed files with 580 additions and 444 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ohp/web-server",
"version": "0.8.0",
"version": "0.9.0",
"private": true,
"engines": {
"node": ">=18.0.0 <=20.x.x",
Expand Down
6 changes: 6 additions & 0 deletions src/api/activity/content-types/activity/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,12 @@
},
"component": "business.cooperation",
"required": true
},
"messages": {
"type": "relation",
"relation": "oneToMany",
"target": "api::message.message",
"mappedBy": "activity"
}
}
}
44 changes: 44 additions & 0 deletions src/api/message/content-types/message/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"kind": "collectionType",
"collectionName": "messages",
"info": {
"singularName": "message",
"pluralName": "messages",
"displayName": "Message",
"description": ""
},
"options": {
"draftAndPublish": false
},
"pluginOptions": {
"i18n": {
"localized": true
}
},
"attributes": {
"title": {
"pluginOptions": {
"i18n": {
"localized": true
}
},
"type": "string",
"required": true
},
"content": {
"pluginOptions": {
"i18n": {
"localized": true
}
},
"type": "text",
"required": true
},
"activity": {
"type": "relation",
"relation": "manyToOne",
"target": "api::activity.activity",
"inversedBy": "messages"
}
}
}
7 changes: 7 additions & 0 deletions src/api/message/controllers/message.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* message controller
*/

import { factories } from '@strapi/strapi';

export default factories.createCoreController('api::message.message');
7 changes: 7 additions & 0 deletions src/api/message/routes/message.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* message router
*/

import { factories } from '@strapi/strapi';

export default factories.createCoreRouter('api::message.message');
7 changes: 7 additions & 0 deletions src/api/message/services/message.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* message service
*/

import { factories } from '@strapi/strapi';

export default factories.createCoreService('api::message.message');
Loading

0 comments on commit 66bd5a4

Please sign in to comment.