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
9a63e9ea
Commit
9a63e9ea
authored
Dec 19, 2024
by
Ли Джен Сеп
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#5
Добавил удаление пробела
parent
6ed9bec4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
message.controller.ts
service/src/message/message.controller.ts
+2
-2
message.service.ts
service/src/message/message.service.ts
+2
-2
No files found.
service/src/message/message.controller.ts
View file @
9a63e9ea
...
@@ -6,7 +6,7 @@ import { CreateMessageDto } from './dto/create-message.dto';
...
@@ -6,7 +6,7 @@ import { CreateMessageDto } from './dto/create-message.dto';
export
class
MessageController
{
export
class
MessageController
{
constructor
(
private
readonly
messageService
:
MessageService
)
{}
constructor
(
private
readonly
messageService
:
MessageService
)
{}
@
Post
(
'encode'
)
@
Post
(
'
/
encode'
)
encodeMessage
(@
Body
()
createMessageDto
:
CreateMessageDto
):
{
encodeMessage
(@
Body
()
createMessageDto
:
CreateMessageDto
):
{
encoded
:
string
;
encoded
:
string
;
}
{
}
{
...
@@ -15,7 +15,7 @@ export class MessageController {
...
@@ -15,7 +15,7 @@ export class MessageController {
return
{
encoded
};
return
{
encoded
};
}
}
@
Post
(
'decode'
)
@
Post
(
'
/
decode'
)
decodeMessage
(@
Body
()
createMessageDto
:
CreateMessageDto
):
{
decodeMessage
(@
Body
()
createMessageDto
:
CreateMessageDto
):
{
decoded
:
string
;
decoded
:
string
;
}
{
}
{
...
...
service/src/message/message.service.ts
View file @
9a63e9ea
...
@@ -4,10 +4,10 @@ import { Vigenere } from 'caesar-salad';
...
@@ -4,10 +4,10 @@ import { Vigenere } from 'caesar-salad';
@
Injectable
()
@
Injectable
()
export
class
MessageService
{
export
class
MessageService
{
encodeMessage
(
password
:
string
,
message
:
string
):
string
{
encodeMessage
(
password
:
string
,
message
:
string
):
string
{
return
Vigenere
.
Cipher
(
password
).
crypt
(
message
);
return
Vigenere
.
Cipher
(
password
.
trim
()
).
crypt
(
message
);
}
}
decodeMessage
(
password
:
string
,
message
:
string
):
string
{
decodeMessage
(
password
:
string
,
message
:
string
):
string
{
return
Vigenere
.
Decipher
(
password
).
crypt
(
message
);
return
Vigenere
.
Decipher
(
password
.
trim
()
).
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