diff --git a/src/main/java/com/example/demo/app/domain/model/AllocationModel.java b/src/main/java/com/example/demo/app/domain/model/AllocationModel.java new file mode 100644 index 0000000..1f6a9c1 --- /dev/null +++ b/src/main/java/com/example/demo/app/domain/model/AllocationModel.java @@ -0,0 +1,14 @@ +package com.example.demo.app.domain.model; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public class AllocationModel { + + private Long categoryId; + private Long courseId; + private Integer allocationRatio; + +} diff --git a/src/main/java/com/example/demo/app/domain/model/CourseModel.java b/src/main/java/com/example/demo/app/domain/model/CourseModel.java new file mode 100644 index 0000000..e9e8014 --- /dev/null +++ b/src/main/java/com/example/demo/app/domain/model/CourseModel.java @@ -0,0 +1,28 @@ +package com.example.demo.app.domain.model; + +import java.util.List; + +import com.example.demo.app.infra.entity.CourseEntity; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public class CourseModel { + + private Long courseId; + private String courseName; + private String description; + + public static CourseModel convertFrom(CourseEntity courseEntity) { + return new CourseModel( + courseEntity.getCourseId(), + courseEntity.getCourseName(), + courseEntity.getDescription()); + } + + public static List convertFrom(List courseEntityList) { + return courseEntityList.stream().map(CourseModel::convertFrom).toList(); + } +}