forked from JNU-econovation/jnu-wiki-be
-
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 #1 from jminkkk/jminkkk
버전 맞추기
- Loading branch information
Showing
120 changed files
with
5,905 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Manifest-Version: 1.0 | ||
Main-Class: com.timcooki.jnuwiki.JnuwikiApplication | ||
|
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,2 +1,30 @@ | ||
# JNU-wiki | ||
2023년 1학기 에코노베이션 Tim Cooki 팀의 < JNU-wiki > 프로젝트 | ||
# 🍪 팀쿠키 | ||
|쿠키(BE)|몰리(BE)|가여니(FE)|또리(FE)|루트(AOS)| | ||
|------|---|---|---|--| | ||
|<img width="200" alt="스크린샷 2023-09-27 오전 11 44 41" src="https://github.com/JNU-econovation/gikhub/assets/102847513/47f9eb46-b7e4-4e25-8f7d-75585ddad749">|<img src = https://github.com/JNU-econovation/gikhub/assets/102847513/22c19f61-bd41-460e-bc66-8dad6c774a87 width = 200>|<img src = https://github.com/JNU-econovation/gikhub/assets/102847513/182d0fbc-dfff-40eb-8032-4a9f88d14b6c width = 200>|<img width="200" alt="스크린샷 2023-09-27 오전 11 44 25" src="https://github.com/JNU-econovation/gikhub/assets/102847513/2433c9ce-22cf-433d-b96c-8189d46dfb23">|<img src = https://github.com/JNU-econovation/gikhub/assets/102847513/d6109dbb-446a-4bb2-b2ce-947c8521bbba width = 200>| | ||
|
||
## 프로젝트 기간 | ||
|
||
Version 1 : 2023.03.06 ~ 진행 중 | ||
|
||
## 배포 주소 | ||
|
||
진행중... | ||
|
||
## 프로젝트 소개 | ||
|
||
적은 학교정보에 지친 용봉이들을 위한 경험 기반의 위키 서비스 | ||
+ 지도를 이용한 어디서든 이용 가능한 ✨전대위키 | ||
|
||
<div align=center> | ||
<br> | ||
<img src="https://img.shields.io/badge/java-007396?style=for-the-badge&logo=java&logoColor=white"> | ||
<img src="https://img.shields.io/badge/mysql-4479A1?style=for-the-badge&logo=mysql&logoColor=white"> | ||
<img src="https://img.shields.io/badge/spring-6DB33F?style=for-the-badge&logo=spring&logoColor=white"> | ||
<img src="https://img.shields.io/badge/apache tomcat-F8DC75?style=for-the-badge&logo=apachetomcat&logoColor=white"> | ||
<br> | ||
<br> | ||
<img src="https://img.shields.io/badge/github-181717?style=for-the-badge&logo=github&logoColor=white"> | ||
<img src="https://img.shields.io/badge/git-F05032?style=for-the-badge&logo=git&logoColor=white"> | ||
<br> | ||
</div> |
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,16 @@ | ||
### PR 타입(하나 이상의 PR 타입을 선택해주세요) | ||
|
||
- [ ] 기능 추가 | ||
- [ ] 기능 수정 | ||
- [ ] 기능 삭제 | ||
- [ ] 리팩토링 | ||
- [ ] 버그 수정 | ||
- [ ] 의존성, 환경 변수, 빌드 관련 코드 업데이트 | ||
|
||
### 작업 사항 | ||
|
||
- 작업 사항 | ||
|
||
### 관련 이슈 | ||
|
||
closes # |
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
24 changes: 24 additions & 0 deletions
24
src/main/java/com/timcooki/jnuwiki/configuration/SwaggerConfig.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,24 @@ | ||
package com.timcooki.jnuwiki.configuration; | ||
|
||
import io.swagger.v3.oas.models.Components; | ||
import io.swagger.v3.oas.models.OpenAPI; | ||
import io.swagger.v3.oas.models.info.Info; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
public class SwaggerConfig { | ||
@Bean | ||
public OpenAPI openAPI(){ | ||
return new OpenAPI() | ||
.components(new Components()) | ||
.info(apiInfo()); | ||
} | ||
|
||
private Info apiInfo(){ | ||
return new Info() | ||
.title("전대위키") | ||
.description("전대위키 API문서") | ||
.version("0.0.1"); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/com/timcooki/jnuwiki/domain/docs/DTO/request/ContentEditReqDTO.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,14 @@ | ||
package com.timcooki.jnuwiki.domain.docs.DTO.request; | ||
|
||
|
||
import lombok.Builder; | ||
|
||
public record ContentEditReqDTO( | ||
String docsContent | ||
) { | ||
@Builder | ||
public ContentEditReqDTO { | ||
|
||
} | ||
} | ||
|
16 changes: 16 additions & 0 deletions
16
src/main/java/com/timcooki/jnuwiki/domain/docs/DTO/request/FindAllReqDTO.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,16 @@ | ||
package com.timcooki.jnuwiki.domain.docs.DTO.request; | ||
|
||
import com.timcooki.jnuwiki.domain.docs.entity.DocsLocation; | ||
import lombok.Builder; | ||
|
||
public record FindAllReqDTO( | ||
Double rightLat, | ||
Double rightLng, | ||
Double leftLat, | ||
Double leftLng | ||
) { | ||
@Builder | ||
public FindAllReqDTO{ | ||
|
||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/com/timcooki/jnuwiki/domain/docs/DTO/response/ContentEditResDTO.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,17 @@ | ||
package com.timcooki.jnuwiki.domain.docs.DTO.response; | ||
|
||
import lombok.Builder; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
public record ContentEditResDTO( | ||
Long id, | ||
String docsContent, | ||
String docsModifiedAt | ||
) { | ||
@Builder | ||
public ContentEditResDTO { | ||
|
||
} | ||
} | ||
|
22 changes: 22 additions & 0 deletions
22
src/main/java/com/timcooki/jnuwiki/domain/docs/DTO/response/InfoEditResDTO.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,22 @@ | ||
package com.timcooki.jnuwiki.domain.docs.DTO.response; | ||
|
||
import com.timcooki.jnuwiki.domain.docs.entity.DocsLocation; | ||
import com.timcooki.jnuwiki.domain.docsRequest.entity.DocsCategory; | ||
import lombok.Builder; | ||
import java.time.LocalDateTime; | ||
|
||
public record InfoEditResDTO( | ||
Long docsId, | ||
String docsName, | ||
String docsCategory, | ||
DocsLocation docsLocation, | ||
String docsContent, | ||
String docsModifiedAt | ||
) { | ||
@Builder | ||
public InfoEditResDTO { | ||
|
||
} | ||
} | ||
|
||
|
15 changes: 15 additions & 0 deletions
15
src/main/java/com/timcooki/jnuwiki/domain/docs/DTO/response/ListReadResDTO.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,15 @@ | ||
package com.timcooki.jnuwiki.domain.docs.DTO.response; | ||
|
||
import lombok.Builder; | ||
|
||
import java.util.List; | ||
|
||
public record ListReadResDTO( | ||
List<OneOfListReadResDTO> docsList, | ||
int totalPages | ||
) { | ||
@Builder | ||
public ListReadResDTO { | ||
} | ||
} | ||
|
20 changes: 20 additions & 0 deletions
20
src/main/java/com/timcooki/jnuwiki/domain/docs/DTO/response/NewApproveResDTO.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,20 @@ | ||
package com.timcooki.jnuwiki.domain.docs.DTO.response; | ||
|
||
import com.timcooki.jnuwiki.domain.docs.entity.DocsLocation; | ||
import com.timcooki.jnuwiki.domain.docsRequest.entity.DocsCategory; | ||
import lombok.Builder; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
public record NewApproveResDTO( | ||
Long id, | ||
String docsName, | ||
String docsCategory, | ||
DocsLocation docsLocation, | ||
String docsCreatedAt | ||
){ | ||
@Builder | ||
public NewApproveResDTO { | ||
|
||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/com/timcooki/jnuwiki/domain/docs/DTO/response/OneOfListReadResDTO.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,17 @@ | ||
package com.timcooki.jnuwiki.domain.docs.DTO.response; | ||
|
||
import com.timcooki.jnuwiki.domain.docs.entity.DocsLocation; | ||
import lombok.Builder; | ||
|
||
public record OneOfListReadResDTO( | ||
Long docsId, | ||
String docsName, | ||
String docsCategory, | ||
DocsLocation docsLocation, | ||
boolean scrap | ||
|
||
) { | ||
@Builder | ||
public OneOfListReadResDTO { | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/com/timcooki/jnuwiki/domain/docs/DTO/response/ReadResDTO.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,28 @@ | ||
package com.timcooki.jnuwiki.domain.docs.DTO.response; | ||
|
||
import com.timcooki.jnuwiki.domain.docs.entity.DocsLocation; | ||
import com.timcooki.jnuwiki.domain.docsRequest.entity.DocsCategory; | ||
import com.timcooki.jnuwiki.domain.member.entity.Member; | ||
import lombok.Builder; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
public record ReadResDTO( | ||
Long id, | ||
String docsName, | ||
String docsCategory, | ||
DocsLocation docsLocation, | ||
String docsContent, | ||
String docsCreatedBy, | ||
String docsCreatedAt, | ||
boolean scrap | ||
) { | ||
@Builder | ||
public ReadResDTO { | ||
|
||
} | ||
} | ||
|
||
|
||
|
||
|
26 changes: 26 additions & 0 deletions
26
src/main/java/com/timcooki/jnuwiki/domain/docs/DTO/response/SearchReadResDTO.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,26 @@ | ||
package com.timcooki.jnuwiki.domain.docs.DTO.response; | ||
|
||
import com.timcooki.jnuwiki.domain.docs.entity.DocsLocation; | ||
import com.timcooki.jnuwiki.domain.docsRequest.entity.DocsCategory; | ||
import com.timcooki.jnuwiki.domain.member.entity.Member; | ||
import lombok.Builder; | ||
import org.springframework.data.annotation.CreatedDate; | ||
import org.springframework.data.annotation.LastModifiedDate; | ||
|
||
import javax.persistence.*; | ||
import java.time.LocalDateTime; | ||
|
||
public record SearchReadResDTO( | ||
Long docsId, | ||
String docsName, | ||
DocsLocation docsLocation, | ||
String docsContent, | ||
String createdBy, | ||
String createdAt, | ||
String docsCategory | ||
) { | ||
@Builder | ||
public SearchReadResDTO{ | ||
|
||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
src/main/java/com/timcooki/jnuwiki/domain/docs/controller/DocsController.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,52 @@ | ||
package com.timcooki.jnuwiki.domain.docs.controller; | ||
|
||
import com.timcooki.jnuwiki.domain.docs.DTO.request.ContentEditReqDTO; | ||
import com.timcooki.jnuwiki.domain.docs.DTO.request.FindAllReqDTO; | ||
import com.timcooki.jnuwiki.domain.docs.entity.DocsLocation; | ||
import com.timcooki.jnuwiki.domain.docs.service.DocsReadService; | ||
import com.timcooki.jnuwiki.domain.docs.service.DocsWriteService; | ||
import com.timcooki.jnuwiki.util.ApiUtils; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.data.domain.Pageable; | ||
import org.springframework.data.domain.Sort; | ||
import org.springframework.data.web.PageableDefault; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.security.core.annotation.AuthenticationPrincipal; | ||
import org.springframework.security.core.userdetails.UserDetails; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
@Slf4j | ||
public class DocsController { | ||
private final DocsReadService docsReadService; | ||
private final DocsWriteService docsWriteService; | ||
|
||
// 모든 문서 조회 - 최근 수정된 순으로 | ||
// 좌표 사이로 | ||
@GetMapping("/docs") | ||
public ResponseEntity<?> docsFindAll(@PageableDefault(size = 50, sort = "modifiedAt", direction = Sort.Direction.DESC) Pageable pageable | ||
, FindAllReqDTO findAllReqDTO) { | ||
|
||
return ResponseEntity.ok().body(ApiUtils.success(docsReadService.getDocsList(pageable, findAllReqDTO))); | ||
} | ||
|
||
// 문서 수정 | ||
@PutMapping("/docs/{docs_id}") | ||
public ResponseEntity<?> modifyDocs(@PathVariable Long docs_id, @RequestBody ContentEditReqDTO contentEditReqDTO) { | ||
return ResponseEntity.ok().body(ApiUtils.success(docsWriteService.updateDocs(docs_id, contentEditReqDTO))); | ||
} | ||
|
||
@GetMapping("/docs/{docs_id}") | ||
public ResponseEntity<?> docsFindOne(@PathVariable Long docs_id) { | ||
return ResponseEntity.ok().body(ApiUtils.success(docsReadService.getOneDocs(docs_id))); | ||
} | ||
|
||
@GetMapping("/docs/search") | ||
public ResponseEntity<?> docsSearch(@RequestParam(value = "search") String search) { | ||
|
||
return ResponseEntity.ok(ApiUtils.success(docsReadService.searchLike(search))); | ||
} | ||
} |
Oops, something went wrong.