-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 from U2DJ2/backend-main
[BE] main branch 병합
- Loading branch information
Showing
98 changed files
with
4,144 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
backend/src/main/java/moim_today/application/moim/MoimService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package moim_today.application.moim; | ||
|
||
import moim_today.dto.moim.*; | ||
import org.springframework.web.multipart.MultipartFile; | ||
|
||
public interface MoimService { | ||
|
||
void createPublicMoim(final long memberId, final long universityId, | ||
final PublicMoimAppendRequest publicMoimAppendRequest); | ||
|
||
void createPrivateMoim(final long memberId, final long universityId, | ||
final PrivateMoimAppendRequest privateMoimAppendRequest); | ||
|
||
UploadMoimImageResponse uploadMoimImage(final MultipartFile file); | ||
|
||
MoimDetailResponse getMoimDetail(final long moimId); | ||
|
||
void updateMoim(final long memberId, final MoimUpdateRequest moimUpdateRequest); | ||
} |
60 changes: 60 additions & 0 deletions
60
backend/src/main/java/moim_today/application/moim/MoimServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package moim_today.application.moim; | ||
|
||
import moim_today.dto.moim.*; | ||
import moim_today.implement.file.FileUploader; | ||
import moim_today.implement.moim.MoimAppender; | ||
import moim_today.implement.moim.MoimFinder; | ||
import moim_today.implement.moim.MoimUpdater; | ||
import moim_today.persistence.entity.moim.moim.MoimJpaEntity; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.web.multipart.MultipartFile; | ||
|
||
import static moim_today.global.constant.FileTypeConstant.MOIM_IMAGE; | ||
|
||
@Service | ||
public class MoimServiceImpl implements MoimService{ | ||
|
||
private final MoimAppender moimAppender; | ||
private final FileUploader fileUploader; | ||
private final MoimFinder moimFinder; | ||
private final MoimUpdater moimUpdater; | ||
|
||
public MoimServiceImpl(final MoimAppender moimAppender, | ||
final FileUploader fileUploader, | ||
final MoimFinder moimFinder, | ||
final MoimUpdater moimUpdater) { | ||
this.moimAppender = moimAppender; | ||
this.fileUploader = fileUploader; | ||
this.moimFinder = moimFinder; | ||
this.moimUpdater = moimUpdater; | ||
} | ||
|
||
@Override | ||
public void createPublicMoim(final long memberId, final long universityId, | ||
final PublicMoimAppendRequest publicMoimAppendRequest) { | ||
moimAppender.createPublicMoim(memberId, universityId, publicMoimAppendRequest); | ||
} | ||
|
||
@Override | ||
public void createPrivateMoim(final long memberId, final long universityId, | ||
final PrivateMoimAppendRequest privateMoimAppendRequest) { | ||
moimAppender.createPrivateMoim(memberId, universityId, privateMoimAppendRequest); | ||
} | ||
|
||
@Override | ||
public UploadMoimImageResponse uploadMoimImage(final MultipartFile file) { | ||
String imageUrl = fileUploader.uploadFile(MOIM_IMAGE.value(), file); | ||
return UploadMoimImageResponse.from(imageUrl); | ||
} | ||
|
||
@Override | ||
public MoimDetailResponse getMoimDetail(final long moimId) { | ||
MoimJpaEntity moimJpaEntity = moimFinder.getById(moimId); | ||
return MoimDetailResponse.from(moimJpaEntity); | ||
} | ||
|
||
@Override | ||
public void updateMoim(final long memberId, final MoimUpdateRequest moimUpdateRequest) { | ||
moimUpdater.updateMoim(memberId, moimUpdateRequest); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
backend/src/main/java/moim_today/application/schedule/ScheduleService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,26 @@ | ||
package moim_today.application.schedule; | ||
|
||
import moim_today.dto.schedule.ScheduleCreateRequest; | ||
import moim_today.dto.schedule.ScheduleResponse; | ||
import moim_today.dto.schedule.ScheduleUpdateRequest; | ||
import moim_today.dto.schedule.TimeTableRequest; | ||
|
||
import java.time.LocalDate; | ||
import java.time.YearMonth; | ||
import java.util.List; | ||
|
||
|
||
public interface ScheduleService { | ||
|
||
List<ScheduleResponse> findAllByWeekly(final long memberId, final LocalDate startDate); | ||
|
||
List<ScheduleResponse> findAllByMonthly(final long memberId, final YearMonth yearMonth); | ||
|
||
void fetchTimeTable(final long memberId, final TimeTableRequest timeTableRequest); | ||
|
||
void createSchedule(final long memberId, final ScheduleCreateRequest scheduleCreateRequest); | ||
|
||
void updateSchedule(final long memberId, final ScheduleUpdateRequest scheduleUpdateRequest); | ||
|
||
void deleteSchedule(final long memberId, final long scheduleId); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
backend/src/main/java/moim_today/domain/department/Department.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package moim_today.domain.department; | ||
|
||
import moim_today.persistence.entity.department.DepartmentJpaEntity; | ||
import moim_today.persistence.entity.university.UniversityJpaEntity; | ||
|
||
import java.util.*; | ||
|
||
public record Department( | ||
long universityId, | ||
String departmentName | ||
) { | ||
|
||
public static List<DepartmentJpaEntity> toEntities(final Map<String, Set<String>> universityAndDepartments, | ||
final List<UniversityJpaEntity> universityJpaEntities) { | ||
Map<Long, Set<String>> existingUniversities = convertToUnivIdAndDepartments(universityAndDepartments, universityJpaEntities); | ||
List<DepartmentJpaEntity> departmentJpaEntities = new ArrayList<>(); | ||
|
||
for (Map.Entry<Long, Set<String>> entrySet : existingUniversities.entrySet()) { | ||
for (String departmentName : entrySet.getValue()) { | ||
departmentJpaEntities.add(DepartmentJpaEntity.builder() | ||
.universityId(entrySet.getKey()) | ||
.departmentName(departmentName) | ||
.build()); | ||
} | ||
} | ||
return departmentJpaEntities; | ||
} | ||
|
||
private static Map<Long, Set<String>> convertToUnivIdAndDepartments(final Map<String, Set<String>> universityAndDepartments, | ||
final List<UniversityJpaEntity> universityJpaEntities) { | ||
Map<Long, Set<String>> existingUniversities = new HashMap<>(); | ||
|
||
universityJpaEntities.stream() | ||
.forEach(universityJpaEntity -> { | ||
existingUniversities.put(universityJpaEntity.getId(), universityAndDepartments.get(universityJpaEntity.getUniversityName())); | ||
}); | ||
|
||
return existingUniversities; | ||
} | ||
|
||
} |
6 changes: 6 additions & 0 deletions
6
backend/src/main/java/moim_today/domain/moim/DisplayStatus.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package moim_today.domain.moim; | ||
|
||
public enum DisplayStatus { | ||
|
||
PUBLIC, PRIVATE | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,6 @@ | |
|
||
// todo 정기 모임 카테고리 세부사항 추가 | ||
public enum MoimCategory { | ||
|
||
STUDY, TEAM_PROJECT | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.