Compare commits

...

6 Commits

Author SHA1 Message Date
f311697047
Adding delete and get to message-id 2023-12-15 14:50:30 +01:00
d57cfd624f
Merge branch 'FinalFixes' into msg_api 2023-12-15 14:46:11 +01:00
8e3b825673
Put tag guest to DisplayArticle
asked-by: Max
2023-12-15 14:44:41 +01:00
f97d4c3ff3
Roles ref problem 2023-12-15 14:41:44 +01:00
abef330bd7 class diagram messaging extension (#13)
Co-authored-by: Anthony Debucquoy <debucquoy.anthony@gmail.com>
Reviewed-on: #13
Reviewed-by: Maxime <231026@umons.ac.be>
2023-12-15 14:36:44 +01:00
4f1a44549b ERB msg done (#14)
# Entity relational diagram

## Messaging extension

```mermaid
%%{init: { "er": {"fontSize": 25}}}%%
erDiagram

%% General
Users

%% Messages
Discussions{
    Integer id PK
    String name
}

Messages{
    Integer id PK
    Integer response FK "Messages"
    String content
}

Discussions ||--o{ Messages: ""
Discussions ||--o{ Users: ""

Messages o|--o{ Messages: "answers"

%% Forums
Forums{
    Integer id PK
    String name
}

Topics{
    Integer id PK
    String subject
    String content
    Boolean locked
}
Answers{
    Integer id PK
    String content
    Boolean anonymous
    TimeStamp creation_time
}

Polls{
    Integer id PK
    enum PollType
}
Options{
    Integer id PK
    String name
}

Forums ||--o{ Users: "Registered"
Forums ||--|| Teacher: "Owner"
Forums ||--|| Course: ""
Forums ||--o{ Topics: ""
Forums ||--o{ Polls: ""

Topics ||--|| Teacher: "Author"
Topics ||--|| Users: "Author"
Topics ||--o{ Answers: ""

Polls ||--o{ Options: ""

Options ||--o{ Votes : ""

Votes }o--|| Users: "Voter"

%% Appointments
Teachers
Appointments{
    Integer id PK
    TIME sent_time
    enum Status
}

Appointments ||--|| Teachers: ""
Appointments ||--|| Users: ""

```

Debucquoy Anthony

Co-authored-by: Debucquoy <debucqquoy.anthony@gmail.com>
Reviewed-on: #14
Reviewed-by: Maxime <231026@umons.ac.be>
2023-12-15 14:36:10 +01:00
4 changed files with 228 additions and 2 deletions

View File

@ -517,6 +517,56 @@ paths:
description: Message sent
'401':
$ref: '#/components/responses/UnauthorizedError'
/discussion/{id}/msg/{msgId}:
parameters:
- name: id
in: path
description: Id of the discussion
required: true
schema:
type: integer
- name: msgId
in: path
description: Id of the message
required: true
schema:
type: integer
get:
summary: get info about message
tags:
- Ext (Messaging)
- discussion
responses:
'200':
description: Ok
content:
application/json:
schema:
type: object
properties:
id:
type: integer
datetime:
type: integer
author:
type: integer
content:
type: string
'401':
$ref: '#/components/responses/UnauthorizedError'
delete:
summary: delete a message
security:
- bearer: []
tags:
- Ext (Messaging)
- discussion
responses:
'201':
description: Message deleted
'401':
$ref: '#/components/responses/UnauthorizedError'
/appointment:
get:
@ -652,7 +702,7 @@ paths:
name: type
required: false
schema:
$ref: '#components/schemas/Roles'
$ref: '#/components/schemas/Roles'
responses:
'200':
description: OK
@ -1519,6 +1569,7 @@ paths:
summary: get a list of article's data
tags:
- Users
- Guest
- Ext (scientific articles)
responses:
'200':

View File

@ -0,0 +1,87 @@
# Entity relational diagram
## Messaging extension
```mermaid
%%{init: { "er": {"fontSize": 25, "stroke": "black" }}}%%
erDiagram
%% General
Users
%% Messages
Discussions{
Integer id PK
String name
}
Messages{
Integer id PK
Integer response FK "Messages"
String content
}
Discussions ||--o{ Messages: ""
Discussions ||--o{ Users: ""
Messages o|--o{ Messages: "answers"
%% Forums
Forums{
Integer id PK
String name
Integer course FK "Course"
}
Topics{
Integer id PK
String subject
String content
Boolean locked
}
Answers{
Integer id PK
String content
Boolean anonymous
TimeStamp creation_time
}
Polls{
Integer id PK
enum PollType
}
Options{
Integer id PK
String name
}
Forums ||--o{ Users: "Registered"
Forums ||--|| Teacher: "Owner"
Forums ||--o{ Topics: ""
Forums ||--o{ Polls: ""
Topics ||--|| Teacher: "Author"
Topics ||--|| Users: "Author"
Topics ||--o{ Answers: ""
Polls ||--o{ Options: ""
Options ||--o{ Votes : ""
Votes }o--|| Users: "Voter"
%% Appointments
Teacher
Appointments{
Integer id PK
Integer teacher FK "Teacher"
TIME sent_time
enum Status
}
Appointments ||--|| Users: ""
```
Debucquoy Anthony

View File

@ -11,8 +11,9 @@ extension_messagerie.pdf:use_case_messagerie.tex extension_messagerie.bbl extens
use_case_messagerie.tex: use_case_messagerie.uml
plantuml -tlatex:nopreamble use_case_messagerie.uml
image: use_case_messagerie.uml interaction_diagram.uml
image: use_case_messagerie.uml interaction_diagram.uml class.uml
plantuml $^
mmdc -i ERD.md -o ERD.png
extension_messagerie.bbl: extension_messagerie.bcf
biber extension_messagerie
@ -24,6 +25,7 @@ clean:
latexmk -C
rm -f use_case_messagerie.tex
rm -f extension_messagerie.{bbl,run.xml}
rm -f class.tex
run: extension_messagerie.pdf
xdg-open $<

View File

@ -0,0 +1,86 @@
@startuml
title Class diagram for Messaging extension
package Messages {
class Message{
content: String
response: Message
respond(User, String)
}
class Discussion{
name: String
users: ArrayList<User>
invite(User)
sendMessage(User, String)
}
Discussion *-- Message
}
package Forums {
class Forum{
name: String
Owner: Teacher
Registered: ArrayList<User>
{static} createForum(Course): Forum
createTopic(String): Topic
createPoll(String, PollType, ArrayList<Option>): Poll
}
class Topic{
subject: String
author: Teacher
content: String
answer(User, String): Answer
lock(Boolean)
}
class Answer{
author: User
content: String
anonymous: Boolean
remove()
}
class Poll{
options: ArrayList<Option>
type: PollType
answer(User, Option): Vote
addOption(Option)
}
class Option{
name: String
}
class Vote{
voter: User
}
enum PollType {
ALLOW_NEW_OPTIONS
ALLOW_MULTIPLE_CHOICE
}
note "Change the behaviour of poll" as N
Forum *-l- Topic
Topic *-l- Answer
Topic <|-d- Poll
Poll *-l- Option
Option "1..*" -d-x Vote
Poll *-- Vote
Poll -- PollType
PollType .r. N
}
package Appointments{
class Appointment{
date: Date
teacher: Teacher
student: Student
{static} Appointment(Student, Teacher, Date)
accept()
refuse()
propose(Date)
export(): File
}
}
Appointments -[hidden]d- Messages
@enduml