Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
8a781b1
Merge pull request #65 from prdoit/feature/backlog
Taehun88 Feb 1, 2025
f73be6a
Merge pull request #67 from prdoit/develop
Taehun88 Feb 2, 2025
e45848c
feat:create & patch burndown api
Taehun88 Feb 2, 2025
f53eab1
feat:create & patch burndown api
Taehun88 Feb 2, 2025
7ea2b77
Merge pull request #68 from prdoit/feature/backlog
Taehun88 Feb 2, 2025
eb994e9
Merge pull request #69 from prdoit/develop
Taehun88 Feb 2, 2025
0602361
fix:add error message
Taehun88 Feb 2, 2025
f1ae5b8
Merge pull request #70 from prdoit/feature/content
Taehun88 Feb 2, 2025
31c9e35
fix:add error message
Taehun88 Feb 2, 2025
6fa9517
fix:add error message
Taehun88 Feb 2, 2025
655d610
Merge pull request #71 from prdoit/feature/content
Taehun88 Feb 2, 2025
8f0eb61
fix: change request parameter
Taehun88 Feb 3, 2025
f6cdc1c
Merge pull request #73 from prdoit/feature/content
Taehun88 Feb 3, 2025
73bcb22
fix: change request parameter
Taehun88 Feb 3, 2025
2df7bda
Merge pull request #74 from prdoit/feature/content
Taehun88 Feb 3, 2025
9969a66
refactor
Taehun88 Feb 3, 2025
812dcef
Merge pull request #75 from prdoit/refactor
Taehun88 Feb 3, 2025
7742568
Merge pull request #76 from prdoit/develop
Taehun88 Feb 3, 2025
99bf1ed
refactor
Taehun88 Feb 3, 2025
f24b405
Merge pull request #77 from prdoit/refactor
Taehun88 Feb 3, 2025
3092b17
asdf
Taehun88 Feb 4, 2025
46d04ba
bugfix
Taehun88 Feb 4, 2025
5d276b8
Merge pull request #78 from prdoit/develop
Taehun88 Feb 4, 2025
44c343a
refactor
Taehun88 Feb 4, 2025
ac6ff86
Merge branch 'develop' into refactor
Taehun88 Feb 4, 2025
fb5726a
Merge pull request #79 from prdoit/refactor
Taehun88 Feb 4, 2025
d5f5640
refactor
Taehun88 Feb 4, 2025
6b18b5e
refactor
Taehun88 Feb 4, 2025
20d88fb
Merge pull request #81 from prdoit/refactor
Taehun88 Feb 4, 2025
3d17afc
Merge pull request #82 from prdoit/develop
Taehun88 Feb 4, 2025
dfa29ae
bugfix
Taehun88 Feb 4, 2025
8fbfe1a
bugfix
Taehun88 Feb 4, 2025
d53ee0d
Merge branch 'develop' of https://github.com/prdoit/backend into develop
pureumq Feb 5, 2025
ff9cd2e
feat
pureumq Feb 5, 2025
5e6231f
feat/login
pureumq Feb 5, 2025
d787c98
Merge pull request #84 from prdoit/feature/login
pureumq Feb 5, 2025
04aab8f
feat:get backlog
Taehun88 Feb 5, 2025
cd6dd7b
Merge pull request #83 from prdoit/develop
Taehun88 Feb 5, 2025
cbcced5
fix:add iteration
Taehun88 Feb 5, 2025
6562609
fix:add iteration
Taehun88 Feb 5, 2025
14b800c
fix:add iteration
Taehun88 Feb 5, 2025
5045183
refactor: 불필요한 코드 정리
goobyeongwoo Feb 5, 2025
8c212dd
check
Taehun88 Feb 5, 2025
cb9c1cf
Merge pull request #87 from prdoit/develop
Taehun88 Feb 5, 2025
3b5ebff
add database
Taehun88 Feb 5, 2025
ff0d8b5
Merge pull request #88 from prdoit/develop
Taehun88 Feb 5, 2025
302e204
Merge branch 'develop' into feature/survey
Taehun88 Feb 5, 2025
114bfe1
Merge pull request #89 from prdoit/feature/survey
Taehun88 Feb 5, 2025
1e06eb0
develop
Taehun88 Feb 6, 2025
03c222e
docker test
Taehun88 Feb 6, 2025
e1a351a
docker test
Taehun88 Feb 6, 2025
da9366f
docker test
Taehun88 Feb 6, 2025
d885c63
Merge pull request #92 from prdoit/feature/content
Taehun88 Feb 6, 2025
3d0e749
Merge pull request #93 from prdoit/develop
Taehun88 Feb 6, 2025
a4072fa
feat: CRUD content & get content detail
Taehun88 Feb 9, 2025
1a07743
fix bug
Taehun88 Feb 9, 2025
ee6281e
fix bug
Taehun88 Feb 9, 2025
fc367f8
fix bug
Taehun88 Feb 9, 2025
2bc87d3
Merge pull request #94 from prdoit/feature/content
Taehun88 Feb 9, 2025
1c09754
feat: user searching function
Taehun88 Feb 10, 2025
458a6cb
Merge pull request #95 from prdoit/feature/content
Taehun88 Feb 10, 2025
0105fd3
feat: user searching function
Taehun88 Feb 10, 2025
21c1820
add repo
Taehun88 Feb 11, 2025
36ef3e7
Merge pull request #96 from prdoit/feature/content
Taehun88 Feb 11, 2025
7c46b09
feat: add user content
Taehun88 Feb 11, 2025
56d9b26
Merge pull request #97 from prdoit/develop
Taehun88 Feb 11, 2025
079b388
feat community function
Taehun88 Feb 11, 2025
d2292f1
Merge pull request #98 from prdoit/develop
Taehun88 Feb 11, 2025
041efe5
feat:community id search & find id & change password
Taehun88 Feb 12, 2025
0eef002
feat:community id search & find id & change password
Taehun88 Feb 12, 2025
aa242cc
fix : bug fix
Taehun88 Feb 12, 2025
3e06dbc
fix : bug fix
Taehun88 Feb 12, 2025
9a86010
fix : bug fix
Taehun88 Feb 12, 2025
b060c65
Merge pull request #100 from prdoit/feature/community
Taehun88 Feb 12, 2025
b866168
fix : bug fix
Taehun88 Feb 12, 2025
5c8a577
Merge pull request #101 from prdoit/feature/community
Taehun88 Feb 12, 2025
5af7592
Merge pull request #102 from prdoit/develop
Taehun88 Feb 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
run: docker login -u ${{secrets.DOCKER_USERNAME}} -p ${{secrets.DOCKER_PASSWORD}}

- name: Make docker image
run: docker build -f DockerFile -t ${{secrets.DOCKER_USERNAME}}/prdoit:latest .
run: docker build --no-cache -f DockerFile -t ${{secrets.DOCKER_USERNAME}}/prdoit:latest .

- name: Push docker image
run: docker push ${{secrets.DOCKER_USERNAME}}/prdoit:latest
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ out/
.vscode/

### Application Files ###
application.properties
application.properties

.DS_Store
5 changes: 3 additions & 2 deletions src/main/java/com/example/prdoit/config/BacklogEnum.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@
@Getter
public enum BacklogEnum {

BACKLOG_NOT_YET(0, "Not Yet"),
BACKLOG_TODO(1, "To Do"),
BACKLOG_IN_PROGRESS(2, "In Progress"),
BACKLOG_DONE(3, "Done");

private final int code;
private final String description;

public static BacklogEnum getBacklogEnum(int code){
public static String getBacklogEnum(int code){
for(BacklogEnum backlogEnum : values()){
if(backlogEnum.code == code){
return backlogEnum;
return backlogEnum.getDescription();
}
}
return null;
Expand Down
18 changes: 18 additions & 0 deletions src/main/java/com/example/prdoit/config/WebConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.example.prdoit.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.nio.file.Watchable;

@Configuration
public class WebConfig implements WebMvcConfigurer {

@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("http://prdoit-s3-bucket.s3-website.ap-northeast-2.amazonaws.com")
.allowedMethods("GET", "POST", "PUT", "DELETE");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
package com.example.prdoit.controller;

import com.example.prdoit.dto.community.CommunityPatchDto;
import com.example.prdoit.dto.community.CommunityRequestDto;
import com.example.prdoit.exception.CustomException;
import com.example.prdoit.service.community.CommunityService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@Slf4j
@RequiredArgsConstructor
@CrossOrigin(origins = "*", allowedHeaders = "*")
@RequestMapping("/community")
public class CommunityController {

private final CommunityService communityService;

@PostMapping()
public ResponseEntity<Object> postCommunity(@RequestBody CommunityRequestDto communityRequestDto) {
log.info("[CommunityController] 글 작성 시작");
try{
communityService.postCommunity(communityRequestDto);
return ResponseEntity.ok("글 작성에 성공했습니다.");
} catch (CustomException e) {
log.error(e.getMessage());
return ResponseEntity.badRequest().body(e.getMessage());
} catch (RuntimeException e) {
log.error(e.getMessage());
return ResponseEntity.internalServerError().body("글 작성에 실패했습니다.");
}
}

@GetMapping()
public ResponseEntity<Object> getCommunity(@RequestParam(value = "query", required = false, defaultValue = "all") String query,
@RequestParam(value = "tag", required = false, defaultValue = "") String tag,
@RequestParam(value = "userId", required = false, defaultValue = "") String userId,
@RequestParam(value = "size", required = false, defaultValue = "10") int size,
@RequestParam(value = "page", required = false, defaultValue = "1") int page) {
log.info("[CommunityController] 글 목록 조회 시작");
try{
return ResponseEntity.ok(communityService.getCommunityList(query, tag, userId, size, page));
} catch (CustomException e) {
log.error(e.getMessage());
return ResponseEntity.badRequest().body(e.getMessage());
} catch (RuntimeException e) {
log.error(e.getMessage());
return ResponseEntity.internalServerError().body("글 목록 조회에 실패했습니다.");
}
}

@PatchMapping()
public ResponseEntity<Object> patchCommunity(@RequestBody CommunityPatchDto communityPatchDto) {
log.info("[CommunityController] 글 수정 시작");
try{
communityService.patchCommunity(communityPatchDto);
return ResponseEntity.ok("글 수정에 성공했습니다.");
} catch (CustomException e) {
log.error(e.getMessage());
return ResponseEntity.badRequest().body(e.getMessage());
} catch (RuntimeException e) {
log.error(e.getMessage());
return ResponseEntity.internalServerError().body("글 수정에 실패했습니다.");
}
}

@DeleteMapping("/{communityId}")
public ResponseEntity<Object> deleteCommunity(@PathVariable String communityId) {
log.info("[CommunityController] 글 삭제 시작");
try{
communityService.deleteCommunity(communityId);
return ResponseEntity.ok("글 삭제에 성공했습니다.");
} catch (CustomException e) {
log.error(e.getMessage());
return ResponseEntity.badRequest().body(e.getMessage());
} catch (RuntimeException e) {
log.error(e.getMessage());
return ResponseEntity.internalServerError().body("글 삭제에 실패했습니다.");
}
}

@GetMapping("/{communityId}")
public ResponseEntity<Object> getCommunityDetail(@PathVariable String communityId) {
log.info("[CommunityController] 글 상세 조회 시작");
try{
return ResponseEntity.ok(communityService.getCommunityDetail(communityId));
} catch (CustomException e) {
log.error(e.getMessage());
return ResponseEntity.badRequest().body(e.getMessage());
} catch (RuntimeException e) {
log.error(e.getMessage());
return ResponseEntity.internalServerError().body("글 상세 조회에 실패했습니다.");
}
}

}
100 changes: 100 additions & 0 deletions src/main/java/com/example/prdoit/controller/ContentController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
package com.example.prdoit.controller;

import com.example.prdoit.dto.content.ContentRequestDto;
import com.example.prdoit.dto.content.ContentUpdateDto;
import com.example.prdoit.exception.CustomException;
import com.example.prdoit.service.content.ContentService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@Slf4j
@CrossOrigin(origins = "*", allowedHeaders = "*")
@RequestMapping("/content")
@RequiredArgsConstructor
public class ContentController {

private final ContentService contentService;

@GetMapping()
public ResponseEntity<Object> getAllContent(@RequestParam(value = "query", required = false, defaultValue = "all") String query,
@RequestParam(value = "level", required = false, defaultValue = "-1") int level,
@RequestParam(value = "userId", required = false, defaultValue = "") String userId,
@RequestParam(value = "size", required = false, defaultValue = "5") int size,
@RequestParam(value = "page", required = false, defaultValue = "1") int page) {
try{
if(level == -1 && userId.isEmpty()){
return ResponseEntity.ok(contentService.getContentQuery(query, size, page));
} else if(userId.isEmpty()){
return ResponseEntity.ok(contentService.getContentQueryWithLevel(query, level, size, page));
} else {
return ResponseEntity.ok(contentService.getContentWithUserId(userId, query, level, size, page));
}
} catch (CustomException e) {
log.error("[getAllContent] 컨텐츠 조회 실패", e);
return ResponseEntity.badRequest().body(e.getMessage());
} catch (Exception e) {
log.error("[getAllContent] 컨텐츠 조회 실패", e);
return ResponseEntity.internalServerError().body("컨텐츠 조회에 실패했습니다.");
}
}

@PostMapping()
public ResponseEntity<Object> postContent(@RequestBody ContentRequestDto contentRequestDto) {
try {
contentService.postContent(contentRequestDto);
return ResponseEntity.ok("컨텐츠 등록에 성공했습니다.");
} catch (CustomException e) {
log.error("[postContent] 컨텐츠 등록 실패", e);
return ResponseEntity.badRequest().body(e.getMessage());
} catch (Exception e) {
log.error("[postContent] 컨텐츠 등록 실패", e);
return ResponseEntity.internalServerError().body("컨텐츠 등록에 실패했습니다.");
}
}

@PatchMapping()
public ResponseEntity<Object> updateContent(@RequestBody ContentUpdateDto contentUpdateDto) {
try {
contentService.updateContent(contentUpdateDto);
return ResponseEntity.ok("컨텐츠 수정에 성공했습니다.");
} catch (CustomException e) {
log.error("[updateContent] 컨텐츠 수정 실패", e);
return ResponseEntity.badRequest().body(e.getMessage());
} catch (Exception e) {
log.error("[updateContent] 컨텐츠 수정 실패", e);
return ResponseEntity.internalServerError().body("컨텐츠 수정에 실패했습니다.");
}
}

@GetMapping("/{contentId}")
public ResponseEntity<Object> getContentDetail(@PathVariable String contentId) {
try {
return ResponseEntity.ok(contentService.getContentDetail(contentId));
} catch (CustomException e) {
log.error("[getContentDetail] 컨텐츠 상세 조회 실패", e);
return ResponseEntity.badRequest().body(e.getMessage());
} catch (Exception e) {
log.error("[getContentDetail] 컨텐츠 상세 조회 실패", e);
return ResponseEntity.internalServerError().body("컨텐츠 상세 조회에 실패했습니다.");
}
}

@GetMapping("/total/{userId}")
public ResponseEntity<Object> getTotalContent(@PathVariable String userId,
@RequestParam(value = "size", required = false, defaultValue = "5") int size,
@RequestParam(value = "page", required = false, defaultValue = "1") int page) {
try {
return ResponseEntity.ok(contentService.getTotalContent(userId, size, page));
} catch (CustomException e) {
log.error("[getTotalContent] 총 컨텐츠 조회 실패", e);
return ResponseEntity.badRequest().body(e.getMessage());
} catch (Exception e) {
log.error("[getTotalContent] 총 컨텐츠 조회 실패", e);
return ResponseEntity.internalServerError().body("총 컨텐츠 조회에 실패했습니다.");
}
}

}
Loading