depromeet / street-drop-server Goto Github PK
View Code? Open in Web Editor NEWStreetDrop πΆ Location based music sharing social service
Home Page: http://docs.street-drop.com
StreetDrop πΆ Location based music sharing social service
Home Page: http://docs.street-drop.com
Refactor to use GeomUtil
μμ΄ν λ±λ‘ APIμμ ItemRequestDTOμ λν 리ν©ν λ§ μ§ν
μνλ¦¬ν° κ΄λ ¨νμΌ coreμμ api λͺ¨λλ‘ μ΄λ
adminμͺ½μμλ λ€λ₯Έ μνλ¦¬ν° μ€μ μ¬μ©
ResponseDTO Setting
[] ResponseDTO Setting
Fix non-nullable content when posting item
Content validation failed - if no content
Returns isLike and itemLikeCount
Changing project structure with multi-modules
Jacocoμ Codecovλ₯Ό μ΄μ©ν ν μ€νΈ μλν(CI)
Don't need test - setup
Gradle Latest vesrion not support java 20.
so downgrade to java version to 19
https://docs.gradle.org/current/userguide/compatibility.html#java
Don't Need test, Just setup
1μ°¨ MVPμ μλ μ’μμ κΈ°λ₯ ꡬν
change Test dir for Intergration test
- unit
- intergration
μμ΄ν λλμ Villageλ₯Ό μ°Ύμ§ λͺ»νλ λ¬Έμ ν΄κ²°
μμ΄ν λλμ μ₯λ₯΄λ₯Ό μ μ₯νλλ‘ μΆκ°
The Following shoud be passed
@DisplayName("μ§μλ³ λλ μμ΄ν
κ°μ μ‘°ν")
@Test
void VillageItemCountTest() throws Exception {
var VillageName = "μ’
λ‘ꡬ μ¬μ§λ";
var villageItemCountResponseDto = new VillageItemCountResponseDto(1);
given(villageItemService.count(VillageName)).willReturn(villageItemCountResponseDto);
var response = mvc.perform(
get("/village-items/count")
.param("villageName", VillageName)
);
response.andExpect(status().isOk())
.andExpect(jsonPath("$.numberOfDroppedMusic").value(1));
}
swagger controller setting
dont't need test, this is infra setup
Add User Profile Image Upload feature
AWS Config μ μ± μ νκΈ°
add insert_sample_data.sql
no testing required
μ£Όλ³μ μμ΄ν λ€μ μ’ν μ‘°ν - poi μ©λ
@DisplayName("[GET] λ΄ μ£Όλ³ λλ μμ΄ν
poi μ‘°ν")
@Nested
class GetNearItemPointsTest {
@Nested
@DisplayName("μ§μλ³ λλ μμ΄ν
κ°μ μ‘°ν μ±κ³΅")
class Success {
double latitude;
double longitude;
@BeforeEach
void setUp() {
latitude = 37.123456;
longitude = 127.123456;
}
@DisplayName("μ§μλ³ λλ μμ΄ν
κ°μ μ‘°ν μ±κ³΅ - 2κ° μ‘°ν μ±κ³΅, 거리 μ‘°ν X")
@Test
void getNearItemPointsTest() throws Exception {
PoiResponseDto.PoiDto poiResponseDto1 = new PoiResponseDto.PoiDto(1L, "/butter1.jpg", 37.123454, 127.123456);
PoiResponseDto.PoiDto poiResponseDto2 = new PoiResponseDto.PoiDto(2L, "/karina2.jpg", 37.123436, 127.123466);
PoiResponseDto poiResponseDto = new PoiResponseDto(List.of(poiResponseDto1, poiResponseDto2));
given(itemService.getNearItemPoints(any(NearItemRequestDto.class))).willReturn(poiResponseDto);
var response = mvc.perform(
get("/items")
.param("latitude", String.valueOf(latitude))
.param("longitude", String.valueOf(longitude))
);
response.andExpect(status().isOk())
.andExpect(jsonPath("$.poi").isArray())
.andExpect(jsonPath("$.poi[0].itemId").value(1L))
.andExpect(jsonPath("$.poi[0].albumCover").value("/butter1.jpg"))
.andExpect(jsonPath("$.poi[0].latitude").value(37.123454))
.andExpect(jsonPath("$.poi[0].longitude").value(127.123456))
.andExpect(jsonPath("$.poi[1].itemId").value(2L))
.andExpect(jsonPath("$.poi[1].albumCover").value("/karina2.jpg"))
.andExpect(jsonPath("$.poi[1].latitude").value(37.123436))
.andExpect(jsonPath("$.poi[1].longitude").value(127.123466));
}
@DisplayName("μ§μλ³ λλ μμ΄ν
κ°μ μ‘°ν μ±κ³΅ - 0κ° μ‘°ν μ±κ³΅")
@Test
void getNearItemPointsTest2() throws Exception {
PoiResponseDto poiResponseDto = new PoiResponseDto(List.of());
given(itemService.getNearItemPoints(any(NearItemRequestDto.class))).willReturn(poiResponseDto);
var response = mvc.perform(
get("/items")
.param("latitude", String.valueOf(latitude))
.param("longitude", String.valueOf(longitude))
);
response.andExpect(status().isOk())
.andExpect(jsonPath("$.poi").isArray())
.andExpect(jsonPath("$.poi").isEmpty());
}
@DisplayName("μ§μλ³ λλ μμ΄ν
κ°μ μ‘°ν μ±κ³΅ - 1κ° μ‘°ν μ±κ³΅, λ²μ μ§μ ")
@Test
void getNearItemPointsTest3() throws Exception {
PoiResponseDto.PoiDto poiResponseDto1 = new PoiResponseDto.PoiDto(1L, "/butter1.jpg", 37.123454, 127.123456);
PoiResponseDto poiResponseDto = new PoiResponseDto(List.of(poiResponseDto1));
given(itemService.getNearItemPoints(any(NearItemRequestDto.class))).willReturn(poiResponseDto);
var response = mvc.perform(
get("/items")
.param("latitude", String.valueOf(latitude))
.param("longitude", String.valueOf(longitude))
.param("distance", String.valueOf(1000))
);
response.andExpect(status().isOk())
.andExpect(jsonPath("$.poi").isArray())
.andExpect(jsonPath("$.poi[0].itemId").value(1L))
.andExpect(jsonPath("$.poi[0].albumCover").value("/butter1.jpg"))
.andExpect(jsonPath("$.poi[0].latitude").value(37.123454))
.andExpect(jsonPath("$.poi[0].longitude").value(127.123456));
}
}
@Nested
@DisplayName("μ§μλ³ λλ μμ΄ν
κ°μ μ‘°ν μ€ν¨")
class Fail {
@DisplayName("Latitude μ ν¨μ± κ²μ¬ μ€ν¨ - κ°μ΄ μλ κ²½μ°")
@Test
void getNearItemPointsFail1() throws Exception {
NearItemRequestDto nearItemRequestDto = new NearItemRequestDto();
nearItemRequestDto.setLongitude(127.123456);
var response = mvc.perform(
get("/items")
.param("longitude", String.valueOf(nearItemRequestDto.getLongitude()))
);
response.andExpect(status().isBadRequest())
.andExpect(jsonPath("$.message").value("Latitude is required"));
}
@DisplayName("Latitude μ ν¨μ± κ²μ¬ μ€ν¨ - λ²μμ λ§μ§ μλ κ²½μ°")
@Test
void getNearItemPointsFail2() throws Exception {
NearItemRequestDto nearItemRequestDto = new NearItemRequestDto();
nearItemRequestDto.setLatitude(1000.0);
nearItemRequestDto.setLongitude(127.123456);
var response = mvc.perform(
get("/items")
.param("latitude", String.valueOf(nearItemRequestDto.getLatitude()))
.param("longitude", String.valueOf(nearItemRequestDto.getLongitude()))
);
response.andExpect(status().isBadRequest())
.andExpect(jsonPath("$.message").value("Not valid latitude, must be between -90 and 90"));
}
@DisplayName("Longitude μ ν¨μ± κ²μ¬ μ€ν¨ - κ°μ΄ μλ κ²½μ°")
@Test
void getNearItemPointsFail3() throws Exception {
NearItemRequestDto nearItemRequestDto = new NearItemRequestDto();
nearItemRequestDto.setLatitude(37.123456);
var response = mvc.perform(
get("/items")
.param("latitude", String.valueOf(nearItemRequestDto.getLatitude()))
);
response.andExpect(status().isBadRequest())
.andExpect(jsonPath("$.message").value("Longitude is required"));
}
@DisplayName("Longitude μ ν¨μ± κ²μ¬ μ€ν¨ - λ²μμ λ§μ§ μλ κ²½μ°")
@Test
void getNearItemPointsFail4() throws Exception {
NearItemRequestDto nearItemRequestDto = new NearItemRequestDto();
nearItemRequestDto.setLatitude(37.123456);
nearItemRequestDto.setLongitude(1000.0);
var response = mvc.perform(
get("/items")
.param("latitude", String.valueOf(nearItemRequestDto.getLatitude()))
.param("longitude", String.valueOf(nearItemRequestDto.getLongitude()))
);
response.andExpect(status().isBadRequest())
.andExpect(jsonPath("$.message").value("Not valid longitude, must be between -180 and 180"));
}
}
}
add search api for cache and Auto-renew access tokens
λλ©μΈκ°μ μμ‘΄μ± μ κ±°
Development of API for Item Drop
Add genre entity
song
table and genre
table are M:N relationshipsong_genre
table is join table for song
table and genre
tableno testing required
Refactor common.controller to apis in api module
{
[
{
"itemId": 1,
"user": {
"nickname" : "νλ¦°",
"profileImage" : "λ§ν¬νμ",
"musicApp" : "youtubemusic"
},
"location": {
"address": "μ±λꡬ μ±μ1κ° 1λ"
},
"music": {
"title": "νμ
보μ΄",
"artist": "λ΄μ§μ€",
"albumImage": "λ§ν¬νμ"
"genre": [
"Rock",
"K-pop"
]
},
"content": "λ¨μΉμ΄λ 카리λ μκΈ°νλ€κ° μΈμ΄ μ° νΌλ€",
"createdAt": "yyyy-MM-dd HH:mm:ss:SSS"
}
]
}
{
"items": [
{
"itemId": 1,
"user": {
"nickname" : "νλ¦°",
"profileImage" : "λ§ν¬νμ",
"musicApp" : "youtubemusic"
},
"location": {
"address": "μ±λꡬ μ±μ1κ° 1λ"
},
"music": {
"title": "νμ
보μ΄",
"artist": "λ΄μ§μ€",
"albumImage": "λ§ν¬νμ"
"genre": [
"Rock",
"K-pop"
]
},
"content": "λ¨μΉμ΄λ 카리λ μκΈ°νλ€κ° μΈμ΄ μ° νΌλ€",
"createdAt": "yyyy-MM-dd HH:mm:ss:SSS"
}
]
}
Remove Unnecessary /test
endpoint
No need Test
μν°ν° ν΄λμ€λ₯Ό μΆκ°ν©λλ€.
Music domain migration to mongo db
Add Kakao Login
λλμ idfvκ° νμΈνμ¬ μ¬μ©μ λΆλ₯ μ²λ¦¬
Github Action, Docker, DockerHub Using Street Drop API CD Set up
No need Test, Setup
BaseTimeEntity, ResponseDto setting
don't need test, this is common code setup
μλ² λͺ¨λν°λ§μ μν νλ‘λ©ν μ°μ€, κ·ΈλΌνλ μΈν
No need Test
Add Test Code for Item Detail API
Prometheus, Grafana Setting
Refactor to multi modules
structure
no need to test
redis cluster setup using docker-compose
don't need test, this is infra setup
μ€μ¨κ±° μλ² url μΈν
no need test, configuration
Internal Server Error Slack Alarm
Add Test Code for Item Drop API
Headerμ λ΄κΈ΄ idfvκ° λ°μμ μ μ μμ± λ° μ 보 κ°μ Έμ€λ μΈν°μ ν° κ°λ°
MongoDB λ‘κ·Έ νμ©μ μν logbackμ mongodb appender μΆκ°
No need Test
Handling pagination for Items POI retrieval API(#35) and Items detail retrieval API(#31)
Advantages of pagination is to prevent slow API response due to returning a large amount of data at once.
In the project, an infinite scroll (front and back) was implemented.
Raises the question of when to make additional calls beyond the [.. , 19, 20, 1, 2, 3, ...] format, such as [21, 22, ..].
νκ΅ μ§μμ 보 κ°μ§κ³ μλ SQL μμ±
No need Test
μλ² λ΄λΆμλ¬, Internal Server μ¬λ μλ¦Ό μΆκ°
No need test, Infra
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.