From 7f828657ad892d5c5dff6f1b4043bbae3d0238c0 Mon Sep 17 00:00:00 2001 From: kkazuya Date: Thu, 17 Sep 2026 14:09:06 +0900 Subject: [PATCH] =?UTF-8?q?[ADD]=20Allocation,=20Course=E3=81=AEModel?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=97=E3=81=BE=E3=81=97=E3=81=9F?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/domain/model/AllocationModel.java | 14 ++++++++++ .../demo/app/domain/model/CourseModel.java | 28 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 src/main/java/com/example/demo/app/domain/model/AllocationModel.java create mode 100644 src/main/java/com/example/demo/app/domain/model/CourseModel.java 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(); + } +}