Skip to content

Commit

Permalink
Merge pull request #362 from bounswe/change-muscle-groups-for-feedback
Browse files Browse the repository at this point in the history
Changed muscle groups for feedback
  • Loading branch information
oguzhekim authored Dec 16, 2024
2 parents c0c6dd6 + c269dc1 commit 8def347
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.group7.demo.dtos;

import com.group7.demo.models.enums.BodyPart;
import com.group7.demo.models.enums.FeedbackMuscle;
import lombok.Data;

@Data
Expand All @@ -10,7 +10,7 @@ public class FeedbackRequest {

private Long userId;

private BodyPart bodyPart;
private FeedbackMuscle feedbackMuscle;

private int weekNumber;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.group7.demo.dtos;

import com.group7.demo.models.enums.BodyPart;
import com.group7.demo.models.enums.FeedbackMuscle;
import lombok.Builder;
import lombok.Data;

Expand All @@ -16,7 +16,7 @@ public class FeedbackResponse {

private String username; // User's username

private BodyPart bodyPart;
private FeedbackMuscle feedbackMuscle;

private int weekNumber;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public FeedbackResponse mapToFeedbackResponse(Feedback feedback) {
.id(feedback.getId())
.trainingProgramTitle(feedback.getTrainingProgram().getTitle()) // Map training program title
.username(feedback.getUser().getUsername()) // Map user's username
.bodyPart(feedback.getBodyPart()) // Map body part
.feedbackMuscle(feedback.getFeedbackMuscle()) // Map body part
.weekNumber(feedback.getWeekNumber()) // Map week number
.workoutNumber(feedback.getWorkoutNumber()) // Map workout number
.exerciseNumber(feedback.getExerciseNumber()) // Map exercise number
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.group7.demo.models;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.group7.demo.models.enums.BodyPart;
import com.group7.demo.models.enums.FeedbackMuscle;
import jakarta.persistence.*;
import lombok.*;
import java.time.LocalDateTime;
Expand All @@ -28,7 +28,7 @@ public class Feedback {
private User user;

@Enumerated(EnumType.STRING)
private BodyPart bodyPart;
private FeedbackMuscle feedbackMuscle;

private int weekNumber;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.group7.demo.models.enums;

public enum FeedbackMuscle {
TRAPEZIUS,
UPPER_BACK,
LOWER_BACK,

/* Chest */
CHEST,

/* Arms */
BICEPS,
TRICEPS,
FOREARM,
BACK_DELTOIDS,
FRONT_DELTOIDS,

/* Abs */
ABS,
OBLIQUES,

/* Legs */
ADDUCTOR,
HAMSTRING,
QUADRICEPS,
ABDUCTORS,
CALVES,
GLUTEAL,

/* Head */
HEAD,
NECK
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public FeedbackResponse addFeedback(FeedbackRequest feedbackRequest, HttpServlet
Feedback feedback = Feedback.builder()
.trainingProgram(trainingProgram)
.user(user)
.bodyPart(feedbackRequest.getBodyPart())
.feedbackMuscle(feedbackRequest.getFeedbackMuscle())
.weekNumber(feedbackRequest.getWeekNumber())
.workoutNumber(feedbackRequest.getWorkoutNumber())
.exerciseNumber(feedbackRequest.getExerciseNumber())
Expand Down

0 comments on commit 8def347

Please sign in to comment.