-
Notifications
You must be signed in to change notification settings - Fork 1
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 #88 from gutanbug/dev
fix: 전체 팀 조회에서 팀원 조회도 가능하도록 수정
- Loading branch information
Showing
9 changed files
with
187 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,41 @@ | ||
# renew-sw-mentoring | ||
<h2>2024 멘토멘티 관리 사이트를 위한 백엔드 레포지토리</h2> | ||
|
||
2024년도 신입생 / 재학생 멘토멘티 프로그램을 진행하면서 미션 수행하는 걸 쉽게 확인하기 위한 토이 프로젝트입니다. | ||
|
||
<사진예시> | ||
|
||
<h3>기능</h3> | ||
<p> | ||
<ul> | ||
< 미션 > | ||
<li>미션 전체 조회</li> | ||
<li>미션 상세 조회</li> | ||
</ul> | ||
</p> | ||
|
||
<p> | ||
<ul> | ||
< 공지사항 / 미션 인증 게시판 > | ||
<li>게시글 전체 조회</li> | ||
<li>게시글 상세 조회</li> | ||
<li>게시글 수정 , 삭제</li> | ||
<li>댓글, 대댓글</li> | ||
</ul> | ||
</p> | ||
|
||
<p> | ||
<ul> | ||
< 기타 > | ||
<li>로그인, 회원가입</li> | ||
<li>팀 상세 조회, 팀 전체 조회</li> | ||
<li>닉네임 변경, 비밀번호 변경</li> | ||
</ul> | ||
</p> | ||
|
||
<h3>아키텍처</h3> | ||
<img width="609" alt="image" src="https://github.com/gutanbug/renew-sw-mentoring/assets/112674303/97a9db3c-1017-479c-8a6b-4f35e9a3ec86"> | ||
|
||
|
||
<h3>ERD</h3> | ||
<img width="579" alt="image" src="https://github.com/gutanbug/renew-sw-mentoring/assets/112674303/be6a2062-e2e2-4f90-bf67-a3a774edc80a"> | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.renew.sw.mentoring.util; | ||
|
||
public class EntityUtil { | ||
|
||
public static <T> void injectId(Class<T> clazz, T obj, Long id) { | ||
FieldReflector.inject(clazz, obj, "id", id); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/test/java/com/renew/sw/mentoring/util/FieldReflector.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,25 @@ | ||
package com.renew.sw.mentoring.util; | ||
|
||
import java.lang.reflect.Field; | ||
|
||
public class FieldReflector { | ||
public static <T> void inject(Class<T> clazz, T obj, String fieldName, Object value) { | ||
try { | ||
Field field = clazz.getDeclaredField(fieldName); | ||
field.setAccessible(true); | ||
field.set(obj, value); | ||
} catch (NoSuchFieldException | IllegalAccessException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
|
||
public static <T, R> R get(Class<T> clazz, T obj, String fieldName) { | ||
try { | ||
Field field = clazz.getDeclaredField(fieldName); | ||
field.setAccessible(true); | ||
return (R) field.get(obj); | ||
} catch (NoSuchFieldException | IllegalAccessException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
} |
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,20 @@ | ||
package com.renew.sw.mentoring.util; | ||
|
||
import java.util.Random; | ||
import java.util.UUID; | ||
|
||
public class RandomGen { | ||
private static final Random RANDOM = new Random(); | ||
|
||
public static long nextLong() { | ||
return RANDOM.nextLong(); | ||
} | ||
|
||
public static int nextInt() { | ||
return RANDOM.nextInt(); | ||
} | ||
|
||
public static String nextUUID() { | ||
return UUID.randomUUID().toString(); | ||
} | ||
} |