Skip to content

этап 3#3

Open
Siustoster wants to merge 4 commits intomainfrom
feature_rating_events
Open

этап 3#3
Siustoster wants to merge 4 commits intomainfrom
feature_rating_events

Conversation

@Siustoster
Copy link
Owner

No description provided.

Copy link

@ErkinKasymaliev ErkinKasymaliev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

привет, оставил комменты

@Setter
@AllArgsConstructor
@NoArgsConstructor
public class Mark {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

лучше Rate - семантически вернее будет, следовательно надо везде поменять RateService, RateRepo ...

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

исправлено

@Transactional
public void deleteMark(int userId, int eventId) {
Mark mark = markRepository.findOneByEvaluator_IdAndEvent_Id(userId, eventId);
;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

лишнее

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Убрал

public void deleteMark(int userId, int eventId) {
Mark mark = markRepository.findOneByEvaluator_IdAndEvent_Id(userId, eventId);
;
if (mark != null) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (mark == null) {
   return;
}
Event event = eventService.getEvent(eventId);
User initiator = userService.getUser(event.getInitiator().getId());
...

@Transactional
public void putMark(int userId, int eventId, Boolean score) {
Mark mark = markRepository.findOneByEvaluator_IdAndEvent_Id(userId, eventId);
;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

лишнее

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Убрал

initiator.setRating(initiator.getRating() + Constants.CHANGING_RATING_WHEN_CHANGING_MARK);
}
mark.setScore(score);
eventService.save(event);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eventService.save(event);
markRepository.save(mark);
userService.saveUser(initiator);

это дублируется в else.
давайте вынесем за if-else в конец метода

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

исправлено

Copy link

@ErkinKasymaliev ErkinKasymaliev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

поправьте комменты (они стилистические) и можете мержить.
Работа принята!
Поздравляю вас с окончанием курса! Скорейшего вам выхода на коммерческую разработку и стремительного роста!

}

@Transactional
public void putMark(int userId, int eventId, Boolean score) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

putRate

}

@Transactional
public void deleteMark(int userId, int eventId) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deleteRate

public void putMark(int userId, int eventId, Boolean score) {
Mark mark = markRepository.findOneByEvaluator_IdAndEvent_Id(userId, eventId);
;
Rate mark = rateRepository.findOneByEvaluator_IdAndEvent_Id(userId, eventId);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rate rate уберите отовсюду mark

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants