Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
KSZK
DevTeam
kszkepzes
Backend
Commits
ea728345
Commit
ea728345
authored
Aug 03, 2020
by
rlacko
💬
Browse files
Solution documentation
parent
c5689c84
Pipeline
#4727
passed with stages
in 2 minutes and 5 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/resources/solution/solutionDocs.yml
0 → 100644
View file @
ea728345
openapi
:
'
3.0.2'
info
:
title
:
'
Solution
Endpoint'
version
:
'
1.0'
paths
:
/solution
:
get
:
tags
:
-
'
Solution'
summary
:
'
Get
a
List
of
solution'
description
:
'
Have
to
be
accepted
or
mentor.
As
an
accepted
only
own
solutions
can
be
seen.'
operationId
:
'
getAllSolution'
responses
:
'
200'
:
description
:
OK
content
:
application/json
:
schema
:
type
:
'
array'
items
:
$ref
:
'
#/components/schemas/Solution'
post
:
tags
:
-
'
Solution'
summary
:
'
Create
a
solution'
description
:
'
Have
to
be
accepted
or
mentor.
As
an
accepted
only
own
own
solution
can
be
made.'
operationId
:
'
createSolution'
requestBody
:
content
:
application/json
:
schema
:
$ref
:
'
#/components/schemas/Solution'
responses
:
'
200'
:
description
:
OK
content
:
application/json
:
schema
:
$ref
:
'
#/components/schemas/Solution'
/solution/id/{id}
:
get
:
tags
:
-
'
Solution'
summary
:
'
Get
a
solution
by
ID'
description
:
'
Have
to
be
accepted
or
mentor.
As
an
accepted
only
own
solutions
can
be
get.'
operationId
:
'
getSolution'
responses
:
'
200'
:
description
:
OK
content
:
application/json
:
schema
:
$ref
:
'
#/components/schemas/Solution'
put
:
tags
:
-
'
Solution'
summary
:
'
Update
a
solution
by
ID'
description
:
'
Have
to
be
accepted
or
mentor.
As
an
accepted
only
own
solutions
can
be
get.
After
deadline
cant
make
new
solution
as
accepted.'
operationId
:
'
updateOneSolution'
requestBody
:
content
:
application/json
:
schema
:
$ref
:
'
#/components/schemas/Solution'
responses
:
'
200'
:
description
:
OK
content
:
application/json
:
schema
:
$ref
:
'
#/components/schemas/Solution'
delete
:
tags
:
-
'
Solution'
summary
:
'
Delete
a
solution
by
ID'
description
:
'
Have
to
be
accepted
or
mentor.
As
an
accepted
only
own
solutions
can
be
delted.
After
deadline
cant
make
new
solution
as
accepted.'
operationId
:
'
deleteSolution'
responses
:
'
200'
:
description
:
OK
content
:
application/json
:
schema
:
$ref
:
'
#/components/schemas/Solution'
components
:
schemas
:
Solution
:
type
:
object
properties
:
task
:
type
:
string
description
:
cuid of the task
title
:
type
:
string
description
:
type
:
string
file
:
type
:
string
creator
:
type
:
string
description
:
schacc of the user
comments
:
type
:
array
items
:
type
:
string
description
:
cuid of each comment
isAccepted
:
type
:
boolean
default
:
false
required
:
-
task
-
title
-
description
-
creator
-
isAccepted
src/resources/solution/solutionModel.js
View file @
ea728345
...
...
@@ -17,7 +17,6 @@ const SolutionSchema = new mongoose.Schema(
},
file
:
{
type
:
String
,
required
:
true
,
},
creator
:
{
type
:
String
,
...
...
@@ -27,7 +26,6 @@ const SolutionSchema = new mongoose.Schema(
{
type
:
mongoose
.
Schema
.
Types
.
ObjectId
,
ref
:
'
comment
'
,
required
:
true
,
},
],
isAccepted
:
{
...
...
src/resources/solution/solutionRouter.js
View file @
ea728345
...
...
@@ -4,17 +4,17 @@ const { isLoggedIn, isAcceptedOrMentor } = require('../../middlewares/auth')
const
router
=
Router
()
// /api/
item
// /api/
v1/solution
router
.
route
(
'
/
'
)
.
get
(
isLoggedIn
,
isAcceptedOrMentor
,
controllers
.
default
.
getMany
)
.
post
(
isLoggedIn
,
isAcceptedOrMentor
,
controllers
.
default
.
createOne
)
// /api/
item
/:id
// /api/
v1/solution/id
/:id
router
.
route
(
'
/:id
'
)
.
route
(
'
/
id/
:id
'
)
.
get
(
isLoggedIn
,
isAcceptedOrMentor
,
controllers
.
default
.
getOne
)
.
delete
(
isLoggedIn
,
isAcceptedOrMentor
,
controllers
.
default
.
notSupported
)
.
put
(
isLoggedIn
,
isAcceptedOrMentor
,
controllers
.
default
.
notSupported
)
.
delete
(
isLoggedIn
,
isAcceptedOrMentor
,
controllers
.
default
.
notSupported
)
exports
.
default
=
router
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment