Skip to content

Commit

Permalink
gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
sleeg00 committed Mar 17, 2024
2 parents 29c64a2 + 786f278 commit 7789608
Show file tree
Hide file tree
Showing 14 changed files with 271 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ build/
!**/src/test/**/build/
/src/main/resources/application.yml
/src/test/resources/application.yml
<<<<<<< HEAD
/src/main/resources/templates/secret/AuthKey_2Y9664DW2T.p8
=======
/src/main/resources/templates/secret/.p8
>>>>>>> aea347125278b8318ff91f76045a9a2d7fb0c828

### STS ###
.apt_generated
Expand Down
78 changes: 78 additions & 0 deletions application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
gpt :
model: gpt-3.5-turbo
api:
key: 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
url: https://api.openai.com/v1/chat/completions
baseUrl : https://just-s3.s3.ap-northeast-2.amazonaws.com/
server:
port: 9000
cloud:
aws:
credentials:
accessKey: AKIA2PIR5NDYRVE3NDUN
secretKey: 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
region: ap-northeast-2
bucketName: just-s3
stack:
auto: false
spring:
mvc:
pathmatch:
matching-strategy: ant_path_matcher #Swagger 문제로 추가함 ㅇㅇ
jackson:
default-property-inclusion: non-null
## # -> #까지 뭔지 알아오기 (해석하고 발표하시길)
datasource: ## 뭔지 알아오기
hikari:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://13.209.213.191:3306/just?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC&characterEncoding=UTF-8
username: admin
password: 334334334!
connection-timeout: 15000 #30초 설정
maximum-pool-size: 150 #150개 설정

security:
oauth2:
client:
registration:
kakao:
client-id: 55ec14b78e17e978a4a3b64971060784
redirect-uri: http://13.209.213.191:9000/api/kakao/access_token
client-authentication-method: POST
client-secret: QREhvyjJygyPKlqkJtSFc91GUlvBqA5K
authorization-grant-type: authorization_code
scope:
- account_email
- profile_nickname
client_name: Kakao
provider:
kakao:
authorization-uri: https://kauth.kakao.com/oauth/authorize
token-uri: https://kauth.kakao.com/oauth/token
user-info-uri: https://kapi.kakao.com/v2/user/me
user-name-attribute: id
## #->해석해오기
jpa:
database: mysql
database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
generate-ddl: true
open-in-view: false
hibernate:
ddl-auto: validate
## - >필수로 마스터 해오기
naming:
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
use-new-id-generator-mappings: true
properties:
hibernate:
show_sql: false
format_sql: true
enable_lazy_load_no_trans: true

server-add: 13.209.213.191
api-url: https://kauth.kakao.com/oauth/authorize?client_id=55ec14b78e17e978a4a3b64971060784&redirect_uri=http://13.209.213.191:9000/api/kakao/access_token&response_type=code

jwt:
header: Authorization
secret: QREhvyjJygyPKlqkJtSFc91GUlvBqA5KaijdfijAIfj41jkjiUIJHI3ji123AasdhfuAUSLNJUIGh098587KJMGKN134JBN8
token-validity-in-seconds: 86400
10 changes: 10 additions & 0 deletions src/main/generated/com/example/just/Mapper/MemberMapperImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,18 @@

@Generated(
value = "org.mapstruct.ap.MappingProcessor",
<<<<<<< HEAD
date = "2024-03-13T13:37:51+0900",
comments = "version: 1.5.3.Final, compiler: IncrementalProcessingEnvironment from gradle-language-java-7.2.jar, environment: Java 11.0.11 (AdoptOpenJDK)"
=======
<<<<<<< HEAD
date = "2024-03-17T14:02:16+0900",
comments = "version: 1.5.3.Final, compiler: IncrementalProcessingEnvironment from gradle-language-java-7.2.jar, environment: Java 11.0.21 (Oracle Corporation)"
=======
date = "2024-03-14T18:31:05+0900",
comments = "version: 1.5.3.Final, compiler: IncrementalProcessingEnvironment from gradle-language-java-7.2.jar, environment: Java 11.0.11 (AdoptOpenJDK)"
>>>>>>> 1873eda5ea1d8642f1745319bf607ddf3962b063
>>>>>>> aea347125278b8318ff91f76045a9a2d7fb0c828
)
@Component
public class MemberMapperImpl implements MemberMapper {
Expand Down
10 changes: 10 additions & 0 deletions src/main/generated/com/example/just/Mapper/PostMapperImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,18 @@

@Generated(
value = "org.mapstruct.ap.MappingProcessor",
<<<<<<< HEAD
date = "2024-03-13T13:37:51+0900",
comments = "version: 1.5.3.Final, compiler: IncrementalProcessingEnvironment from gradle-language-java-7.2.jar, environment: Java 11.0.11 (AdoptOpenJDK)"
=======
<<<<<<< HEAD
date = "2024-03-17T14:02:15+0900",
comments = "version: 1.5.3.Final, compiler: IncrementalProcessingEnvironment from gradle-language-java-7.2.jar, environment: Java 11.0.21 (Oracle Corporation)"
=======
date = "2024-03-14T18:31:05+0900",
comments = "version: 1.5.3.Final, compiler: IncrementalProcessingEnvironment from gradle-language-java-7.2.jar, environment: Java 11.0.11 (AdoptOpenJDK)"
>>>>>>> 1873eda5ea1d8642f1745319bf607ddf3962b063
>>>>>>> aea347125278b8318ff91f76045a9a2d7fb0c828
)
@Component
public class PostMapperImpl implements PostMapper {
Expand Down
88 changes: 88 additions & 0 deletions src/main/java/com/example/just/Admin/AdminController.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@
import com.example.just.Dao.HashTag;
import com.example.just.Dao.Member;
import com.example.just.Dao.Post;
<<<<<<< HEAD
import com.example.just.Repository.HashTagMapRepository;
import com.example.just.Response.ResponseUpdateHashtagsDto;
import com.example.just.Repository.CommentRepository;
import com.example.just.Repository.HashTagRepository;
import com.example.just.Repository.MemberRepository;
import com.example.just.Repository.PostRepository;
import com.example.just.Service.ResponsePost;
=======
import com.example.just.Repository.*;
import com.example.just.Response.ResponseUpdateHashtagsDto;
import com.example.just.Service.*;
>>>>>>> aea347125278b8318ff91f76045a9a2d7fb0c828
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -20,9 +26,14 @@
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
<<<<<<< HEAD
import com.example.just.Service.MemberService;
import com.example.just.Service.CommentService;
import com.example.just.Service.PostService;
=======

import java.util.Collections;
>>>>>>> aea347125278b8318ff91f76045a9a2d7fb0c828
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
Expand All @@ -43,24 +54,51 @@ public class AdminController {
private CommentRepository commentRepository;
@Autowired
private MemberRepository memberRepository;
<<<<<<< HEAD


@Autowired
private PostRepository postRepository;
=======
>>>>>>> aea347125278b8318ff91f76045a9a2d7fb0c828
@Autowired
private HashTagRepository hashTagRepository;
@Autowired
private HashTagMapRepository hashTagMapRepository;
<<<<<<< HEAD

@ApiOperation(value = "멤버 리스트 불러옴 admin페이지에서 members 페이지로 이동할때")
@Operation(summary = "members리스트 뽑는다", description = "\n admin페이지->members페이지-> 리스트 리턴")
=======
@Autowired
private HashTagESRepository hashTagESRepository;
@Autowired
private BlameService blameService;

@ApiOperation(value = "멤버 리스트 불러옴 admin 페이지에서 members 페이지로 이동할때")
@Operation(summary = "members 리스트 뽑는다", description = "\n admin 페이지->members 페이지-> 리스트 리턴")
>>>>>>> aea347125278b8318ff91f76045a9a2d7fb0c828
@GetMapping("/members")
public ResponseEntity<List<Member>> memberList() {
List<Member> members = memberService.findMembers();
return new ResponseEntity<>(members, HttpStatus.OK);
}


<<<<<<< HEAD
=======
@ApiOperation(value = "신고받은 멤버 조회")
@Operation(summary = "신고받은 멤버 조회", description = "\n 신고받은 횟수가 0보다 큰 멤버 조회")
@GetMapping("/reported-members")
public ResponseEntity<List<Member>> getReportedMembers() {
// 1 이상의 신고를 받은 멤버만 조회
ResponseEntity<List<Member>> reportedMembersResponse = blameService.getBlamedList("member");
List<Member> reportedMembers = reportedMembersResponse.getBody();
return new ResponseEntity<>(reportedMembers, HttpStatus.OK);
}


>>>>>>> aea347125278b8318ff91f76045a9a2d7fb0c828
@ApiOperation(value = "멤버페이지에서 회원 삭제 기능 ")
@Operation(summary = "회원 삭제", description = "\n member_id 헤더로 받고 데이터베이스 비교 후 회원 삭제")
@DeleteMapping("/members/{member_id}")
Expand All @@ -72,8 +110,13 @@ public ResponseEntity drop(@PathVariable Long member_id) {
return new ResponseEntity<>("해당 회원이 존재하지 않습니다.", HttpStatus.BAD_REQUEST);
}

<<<<<<< HEAD
@ApiOperation(value = "comments페이지에서 comment 리스트 불러옴")
@Operation(summary = "comments리스트", description = "\n admin페이지 -> comments->페이지로 return하여 리스트 뽑")
=======
@ApiOperation(value = "comments 페이지에서 comment 리스트 불러옴")
@Operation(summary = "comments 리스트", description = "\n admin 페이지 -> comments->페이지로 return 하여 리스트 뽑")
>>>>>>> aea347125278b8318ff91f76045a9a2d7fb0c828
@GetMapping("/comments")
public ResponseEntity<List<Comment>> commentList() {
List<Comment> comments = commentService.getAllComments();
Expand All @@ -82,26 +125,42 @@ public ResponseEntity<List<Comment>> commentList() {

//댓글 삭제
@ApiOperation(value = "댓글 아이디와 멤버 아이디 비교 후 삭제 ")
<<<<<<< HEAD
@Operation(summary = "댓글 삭제", description = "\n comment_id, member_id 헤더로 받고 데이터베이스 비교 후 회원 삭제")
@DeleteMapping("/comments/{comment_id}/{member_id}")
=======
@Operation(summary = "댓글 삭제", description = "\n comment_id, 헤더로 받고 데이터베이스 비교 후 회원 삭제")
@DeleteMapping("/comments/{comment_id}/")
>>>>>>> aea347125278b8318ff91f76045a9a2d7fb0c828
public ResponseEntity<String> deleteComment(@PathVariable Long comment_id) {
Comment comment = commentRepository.findById(comment_id)
.orElseThrow(() -> new RuntimeException("부모 댓글이 존재하지 않습니다."));
List<Comment> children = comment.getChildren();
if (children != null) {
<<<<<<< HEAD
for (Comment child : children) {
commentRepository.delete(child);
}
=======
commentRepository.deleteAll(children);
>>>>>>> aea347125278b8318ff91f76045a9a2d7fb0c828
}
commentRepository.deleteById(comment_id);
return ResponseEntity.ok("ok");
}


<<<<<<< HEAD
@ApiOperation(value = "게시물 리스트 불러옴 posts페이지에서")
@Operation(summary = "게시글 리스트", description = "\n admin 페이지-> posts페이지-> return하여 post list 출력")
@GetMapping("/posts")
public ResponseEntity<List<Post>> postList() {
=======
@ApiOperation(value = "게시물 리스트 불러옴 posts 페이지에서")
@Operation(summary = "게시글 리스트", description = "\n admin 페이지-> posts 페이지-> return 하여 post list 출력")
@GetMapping("/posts")
public ResponseEntity<List<Post>> PostList() {
>>>>>>> aea347125278b8318ff91f76045a9a2d7fb0c828
List<Post> posts = postService.getAllPostList();
return new ResponseEntity<>(posts, HttpStatus.OK);
}
Expand All @@ -116,6 +175,7 @@ public ResponsePost deletePost(@PathVariable Long post_id) throws NotFoundExcept
ResponsePost responsePost = new ResponsePost(post_id, "삭제 완료");
return responsePost;
}
<<<<<<< HEAD
/*
@ApiOperation(value = "포스트페이지 해시태그 수정 ")
@Operation(summary = "해시태그 수정", description = "\n hashtag_id 헤더로 받고 내용을 수정하면 새로운 해시태그를 생성하여 저장 ex) id_101 -> id_104로")
Expand Down Expand Up @@ -158,3 +218,31 @@ public ResponseEntity<?> updateHashtags(@PathVariable Long hashtag_id, @RequestB
}


=======

@ApiOperation(value = "포스트페이지 해시태그 수정 ")
@Operation(summary = "해시태그 수정", description = "\n hashtag_id 헤더로 받고 내용을 수정하면 새로운 해시태그를 생성하여 저장 ex) id_101 -> id_104로")
@PutMapping("/hashtags/{hashtag_id}")
public ResponseEntity<?> updateHashTag(@PathVariable Long hashtag_id, @RequestBody String newName) {
Optional<HashTag> optionalHashTag = hashTagRepository.findById(hashtag_id);

if (!optionalHashTag.isPresent()) {
return ResponseEntity.notFound().build();
}

HashTag hashTag = optionalHashTag.get();
hashTag.setName(newName);
hashTagRepository.save(hashTag);

return ResponseEntity.ok("해시태그 내용이 성공적으로 수정되었습니다.");
}
/*
*/
}





>>>>>>> aea347125278b8318ff91f76045a9a2d7fb0c828
3 changes: 3 additions & 0 deletions src/main/java/com/example/just/Controller/GptController.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ public List<String> chat(@RequestBody GptRequestDto prompt) {
return gptService.getTag(prompt);
}

<<<<<<< HEAD
/*
*/
=======
>>>>>>> aea347125278b8318ff91f76045a9a2d7fb0c828
}
20 changes: 20 additions & 0 deletions src/main/java/com/example/just/Controller/SearchController.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@ public class SearchController {
@GetMapping("/get/search/post")
@Operation(summary = "게시글 내용 검색", description = "해당 keyword를 content에 포함하는 게시글 검색\n태그검색구현시 추후 변경 가능")
@ApiResponses(value = {
<<<<<<< HEAD
@ApiResponse(responseCode = "400", description = "{\n"
+ " \"message\": \"로그인 후 검색가능합니다.\"\n"
=======
@ApiResponse(responseCode = "404", description = "{\n"
+ " \"message\": \"로그인 후 검색가능합니다.\", \"페이지를 초과하엿습니다.\"\n"
>>>>>>> aea347125278b8318ff91f76045a9a2d7fb0c828
+ "}")
})
public ResponseEntity getPosts(@RequestParam String keyword,@RequestParam int page, HttpServletRequest request) {
Expand All @@ -44,8 +49,13 @@ public ResponseEntity getPosts(@RequestParam String keyword,@RequestParam int pa
@GetMapping("/get/search/tag")
@Operation(summary = "태그로 게시 검색", description = "해당 태그와 일치하는 값을 가진 게시글 검색\n")
@ApiResponses(value = {
<<<<<<< HEAD
@ApiResponse(responseCode = "400", description = "{\n"
+ " \"message\": \"로그인 후 검색가능합니다.\"\n"
=======
@ApiResponse(responseCode = "404", description = "{\n"
+ " \"message\": \"로그인 후 검색가능합니다.\", \"페이지를 초과하엿습니다.\"\n"
>>>>>>> aea347125278b8318ff91f76045a9a2d7fb0c828
+ "}")
})
public ResponseEntity getTagPost(@RequestParam String keyword,@RequestParam int page, HttpServletRequest request) {
Expand All @@ -54,7 +64,17 @@ public ResponseEntity getTagPost(@RequestParam String keyword,@RequestParam int

@GetMapping("/get/search/auto/tag")
@Operation(summary = "태그 자동완성", description = "해당 keyword를 포함하는 태그 전체 검색\n 자음만으로는 검색불가무조건 모음까지 합친 글자로만 검색가능\n ex) ㅇ -> 검색불가\n 연-> 연애,연구")
<<<<<<< HEAD
public ResponseEntity getAutoTag(@RequestParam(required = false, defaultValue = "") String keyword) {
return searchService.getAutoTag(keyword);
=======
@ApiResponses(value = {
@ApiResponse(responseCode = "404", description = "{\n"
+ " \"message\": \"태그가 존재하지 않습니다.\", \"페이지를 초과하엿습니다.\"\n"
+ "}")
})
public ResponseEntity getAutoTag(@RequestParam(required = false, defaultValue = "") String keyword,@RequestParam int page) {
return searchService.getAutoTag(keyword,page-1);
>>>>>>> aea347125278b8318ff91f76045a9a2d7fb0c828
}
}
4 changes: 4 additions & 0 deletions src/main/java/com/example/just/JustApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,8 @@ public static void main(String[] args) {
SpringApplication.run(JustApplication.class, args);
}

<<<<<<< HEAD
}
=======
}
>>>>>>> aea347125278b8318ff91f76045a9a2d7fb0c828
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

import com.example.just.Document.HashTagDocument;
import java.util.List;
<<<<<<< HEAD
=======

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
>>>>>>> aea347125278b8318ff91f76045a9a2d7fb0c828
import org.springframework.data.domain.Sort;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.data.repository.CrudRepository;
Expand Down
Loading

0 comments on commit 7789608

Please sign in to comment.