Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
H
Homework83_M11
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ли Джен Сеп
Homework83_M11
Commits
f3bcb19d
Commit
f3bcb19d
authored
Dec 19, 2024
by
rahmanenko alexandr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#2
выполнил задание переделал путь
parent
37608698
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
20 deletions
+29
-20
package-lock.json
service/package-lock.json
+22
-0
package.json
service/package.json
+1
-0
message.controller.ts
service/src/message/message.controller.ts
+1
-1
message.service.ts
service/src/message/message.service.ts
+5
-19
No files found.
service/package-lock.json
View file @
f3bcb19d
...
...
@@ -14,6 +14,7 @@
"@nestjs/core"
:
"^10.0.0"
,
"@nestjs/mapped-types"
:
"*"
,
"@nestjs/platform-express"
:
"^10.0.0"
,
"caesar-salad"
:
"^2.1.0"
,
"class-transformer"
:
"^0.5.1"
,
"class-validator"
:
"^0.14.1"
,
"reflect-metadata"
:
"^0.2.0"
,
...
...
@@ -3206,6 +3207,18 @@
"node"
:
">= 0.8"
}
},
"node_modules/caesar-salad"
:
{
"version"
:
"2.1.0"
,
"resolved"
:
"https://registry.npmjs.org/caesar-salad/-/caesar-salad-2.1.0.tgz"
,
"integrity"
:
"sha512-ul2EGpFSv9ftddddOo/2PkzTlbEFbdgBtc7ESpEend/Kf26/eG2e25vUuG9TL4nc+lZgnSMnc4SRgE1o7086DQ=="
,
"license"
:
"MIT"
,
"dependencies"
:
{
"char-buffer"
:
"^1.0.0||^2.0.0"
},
"engines"
:
{
"node"
:
">=8.0"
}
},
"node_modules/call-bind"
:
{
"version"
:
"1.0.8"
,
"resolved"
:
"https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz"
,
...
...
@@ -3311,6 +3324,15 @@
"url"
:
"https://github.com/chalk/chalk?sponsor=1"
}
},
"node_modules/char-buffer"
:
{
"version"
:
"2.0.0"
,
"resolved"
:
"https://registry.npmjs.org/char-buffer/-/char-buffer-2.0.0.tgz"
,
"integrity"
:
"sha512-VhQ0Lv1guSq/VfUM2nmEQiqLyD/bPtGh0zAMNqP9fjnI1wNbOU1Bv1xEh0tEdxhieatZfmaCw08lhzNEyeHpkQ=="
,
"license"
:
"MIT"
,
"engines"
:
{
"node"
:
">=8"
}
},
"node_modules/char-regex"
:
{
"version"
:
"1.0.2"
,
"resolved"
:
"https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz"
,
...
...
service/package.json
View file @
f3bcb19d
...
...
@@ -25,6 +25,7 @@
"@nestjs/core"
:
"^10.0.0"
,
"@nestjs/mapped-types"
:
"*"
,
"@nestjs/platform-express"
:
"^10.0.0"
,
"caesar-salad"
:
"^2.1.0"
,
"class-transformer"
:
"^0.5.1"
,
"class-validator"
:
"^0.14.1"
,
"reflect-metadata"
:
"^0.2.0"
,
...
...
service/src/message/message.controller.ts
View file @
f3bcb19d
...
...
@@ -2,7 +2,7 @@ import { Controller, Post, Body } from '@nestjs/common';
import
{
MessageService
}
from
'./message.service'
;
import
{
CreateMessageDto
}
from
'./dto/create-message.dto'
;
@
Controller
(
'message'
)
@
Controller
()
export
class
MessageController
{
constructor
(
private
readonly
messageService
:
MessageService
)
{}
...
...
service/src/message/message.service.ts
View file @
f3bcb19d
import
{
Injectable
}
from
'@nestjs/common'
;
import
{
CreateMessageDto
}
from
'./dto/create-message.dto'
;
import
{
UpdateMessageDto
}
from
'./dto/update-message.dto'
;
import
{
Vigenere
}
from
'caesar-salad'
;
@
Injectable
()
export
class
MessageService
{
[
x
:
string
]:
any
;
create
(
createMessageDto
:
CreateMessageDto
)
{
return
'This action adds a new message'
;
encodeMessage
(
password
:
string
,
message
:
string
):
string
{
return
Vigenere
.
Cipher
(
password
).
crypt
(
message
);
}
findAll
()
{
return
`This action returns all message`
;
}
findOne
(
id
:
number
)
{
return
`This action returns a #
${
id
}
message`
;
}
update
(
id
:
number
,
updateMessageDto
:
UpdateMessageDto
)
{
return
`This action updates a #
${
id
}
message`
;
}
remove
(
id
:
number
)
{
return
`This action removes a #
${
id
}
message`
;
decodeMessage
(
password
:
string
,
message
:
string
):
string
{
return
Vigenere
.
Decipher
(
password
).
crypt
(
message
);
}
}
Write
Preview
Markdown
is supported
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