-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: abstract DB Adapter #112
base: master
Are you sure you want to change the base?
Conversation
Current coverage is 88.45% (diff: 90.21%)@@ master #112 diff @@
==========================================
Files 36 38 +2
Lines 744 823 +79
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 663 728 +65
- Misses 81 95 +14
Partials 0 0
|
…n Redis and the whole code
code was linted, docker script was adapted to MS Windows
…odule, new remapMeta util, upda
…; actions: remove, requestPassw
ну да, всему виной actions/register, а он пока на операционном столе |
@stainwoortsel относительно ошибок ремаппинг мы будем делать не каждый раз после каждого метода, а 1 раз во время ответа, есть возможность добавить функцию https://github.com/makeomatic/mservice/blob/master/src/plugins/amqp.js#L84-L94 |
} | ||
|
||
module.exports.User = new UserModel(storage.User); | ||
module.exports.Attempts = new AttemptsHelper(storage.Attempts); | ||
module.exports.Tokens = new TokensHelper(storage.Tokens); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
можно сократить и просто писать
exports.User = ...
exports.Attempts = ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
То есть Attempts и Tokens в классы не оборачивать?
Можно, но этж типа абстракция ) мало ли чего мы захотим вписать в методы по дефолту
Плюс оно обеспечивает требование по наличию в "стороже" нужных методов на этапе (типа) компиляции.
...ну не компиляции, но ошибка сразу найдется -- я к чему ) конечно, тесты -- дело святое, но так на ошибку наткнешься сразу и носом, еще на уровне линтера
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
да не, я имею ввиду не нужно писать module.exports.SMTH =
пиши просто exports.SMTH =
-module.exports.User = new UserModel(storage.User);
+exports.User = new UserModel(storage.User);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onComplete -- это, я так понимаю, в настройках defaults.js, в разделе amqp?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Все верно. Либо можем добавить хуки специальные в mservice по аналогии с hapi.js - там неплохо сделано, но это уже позже
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
да не, я имею ввиду не нужно писать module.exports.SMTH =
пиши просто exports.SMTH =
а... ок )
…rage, model/usermodel
Так.. вижу branch conflict, но ветки я пока не мёржу.
|
chmod +x $DIR/.bin/docker-compose | ||
COMPOSE=$(which docker-compose) | ||
# COMPOSE=$(which docker-compose) | ||
COMPOSE="c:/dev/docker/docker-compose.exe" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ну да, так тесты и пройдут)
course, the key is in an abstraction. the user model abstraction now allows to make such operation
No description provided.