Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat : master 브랜치에 dev_backend 배포 #28

Merged
merged 24 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
8b8d6aa
feat : 여행 일정 저장 + db 수정
Dayon-Hong Feb 13, 2024
6e6d243
Merge pull request #18 from tukcomCD2024/backend/feature/schedule-db
Dayon-Hong Feb 13, 2024
29f695c
fix : Schedule 과 ScheduleDetail로 파일 고정
Dayon-Hong Feb 24, 2024
40e120f
Merge pull request #20 from tukcomCD2024/backend/feature/schedule-db
Dayon-Hong Feb 24, 2024
ba6b079
fix: Schedule 파일 이동
yo0oni Feb 24, 2024
05c4990
Merge pull request #21 from tukcomCD2024/backend/feature/openai-api-10
yo0oni Feb 24, 2024
5d04b2a
feat: 스케줄관련 CRUD + S3연결 + 글로벌에러설정
Dayon-Hong Feb 25, 2024
4047476
dev_backend 로 main 브랜치 Update deploy.yml
Dayon-Hong Feb 25, 2024
b831492
Merge pull request #23 from tukcomCD2024/backend/feature/schedule-db
yo0oni Feb 25, 2024
ef06f65
feat: ec2 public ip 3306 적용 및 ddl-auto 수정
yo0oni Feb 25, 2024
b47392d
Merge pull request #26 from tukcomCD2024/backend/feature/ec2-mysql-24
yo0oni Feb 25, 2024
15d48ee
dev_backend 로 main 브랜치 Update deploy.yml
Dayon-Hong Feb 25, 2024
8128bb2
feat: 스케줄관련 CRUD + S3연결 + 글로벌에러설정
Dayon-Hong Feb 25, 2024
445efa3
feat: ec2 public ip 3306 적용 및 ddl-auto 수정
yo0oni Feb 25, 2024
0bdc823
Auto stash before checking out "origin/dev_backend"
yo0oni Feb 25, 2024
44a9b9c
fix: 불필요한 코드 삭제
yo0oni Feb 25, 2024
ef16dbd
Merge branch 'backend/feature/ec2-mysql-24' into dev_backend
yo0oni Feb 25, 2024
2579316
Merge branch 'backend/feature/openai-api-10' into dev_backend
yo0oni Feb 25, 2024
ba03a51
hotfix : 주석 + update로 변경
Dayon-Hong Feb 25, 2024
46467c0
fix: gitignore 수정
yo0oni Feb 25, 2024
e355c10
hotfix : member API url 수정
Dayon-Hong Feb 25, 2024
a4b4a8e
fix : 안쓰는 코드 삭제
Dayon-Hong Feb 25, 2024
7ac5306
Merge pull request #27 from tukcomCD2024/backend/feature/25-amadeus-api
Dayon-Hong Feb 25, 2024
b439c08
Update README.md
yo0oni Feb 26, 2024
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
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Build and Deploy to EC2

on:
push:
branches: [ "master" ]
branches: [ "dev_backend" ]
pull_request:
branches: [ "master" ]
branches: [ "dev_backend" ]

defaults:
run:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@ $RECYCLE.BIN/
.gradle
**/build/
!src/**/build/
.idea/sonarlint


# Ignore Gradle GUI config
gradle-app.setting
Expand Down
2 changes: 2 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,22 @@
# ISP
# ✈️ 여행어때
여행 계획부터 추억까지 함께하는 서비스

<br>

## 📱 Figma
![image](https://github.com/tukcomCD2024/ISP/assets/77226122/8cb21faa-be37-4d51-b5fc-cdbee0df9baf)

<br>

## 📂 ERD
![image](https://github.com/tukcomCD2024/ISP/assets/77226122/7928c2df-6278-464a-8d1a-8e763dd6e73a)


<br>

## 👫🏻 Members
| 김수현<br/>([@ksh-g001](https://github.com/ksh-g001)) | 김지윤<br/>([@yo0oni](https://github.com/yo0oni)) | 홍다연<br/>([@Dayeon-Hong](https://github.com/Dayeon-Hong)) |
|:---------------------------------------------------------------------------------------------------------------------------:|:---------------------------------------------------------------------------------------------------------------------------:|:---------------------------------------------------------------------------------------------------------------------------:|
| <img width="140px" src="https://github.com/tukcomCD2024/ISP/assets/77226122/36bdcdb0-c88f-463d-acb2-abd8db0a0cb0"/> | <img width="140px" src="https://github.com/tukcomCD2024/ISP/assets/77226122/a4da7789-2497-42dc-969a-a8af2cb0795c"/> | <img width="140px" src="https://github.com/tukcomCD2024/ISP/assets/77226122/c1598761-04b5-4a68-84e4-91be2cceb058"/> |
| `Android` | `Backend` | `Backend` |
<br>
129 changes: 129 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
### Java template
# Compiled class file
*.class
.env
.idea/
.gradle/

# Log file
*.log
.DS_Store
/.DS_Store
# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### Gradle template
.gradle
**/build/
!src/**/build/
.idea/sonarlint

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# Cache of project
.gradletasknamecache

# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties


.idea/misc.xml

*.lock

.idea/

.env
/.env
3 changes: 3 additions & 0 deletions backend/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ dependencies {
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'

//AWS
implementation 'io.awspring.cloud:spring-cloud-starter-aws:2.4.2'

}

tasks.named('test') {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.isp.backend.domain.country.entity;

import com.isp.backend.domain.schedule.entity.Schedule;
import jakarta.persistence.*;
import lombok.*;

import java.util.List;

@Getter
@AllArgsConstructor
@Entity
@Builder
@NoArgsConstructor
@Table(name="country")
public class Country {

@Id
@Column(name = "id", unique = true, nullable = false)
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@Column(name = "nation")
private String nation;

@Column(name = "city")
private String city;

@Column(name = "imageUrl")
private String imageUrl;

@OneToMany (mappedBy = "country")
private List<Schedule> schedules;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.isp.backend.domain.country.repository;

import com.isp.backend.domain.country.entity.Country;
import org.springframework.data.jpa.repository.JpaRepository;

public interface CountryRepository extends JpaRepository<Country,Long> {

Country findIdByCity (String city); // 여행나라 이름으로 id 찾기

Country findCountryById (Long countryId); //

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,12 @@
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/members")
@RequestMapping("/api/member")
@RequiredArgsConstructor
public class MemberController {

private final MemberService memberService;

@GetMapping("/test")
public String testEndpoint() {
return "Test endpoint response";
}


/**
* 로그인 API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import java.util.Optional;

public interface MemberRepository extends JpaRepository<Member, String> {
public interface MemberRepository extends JpaRepository<Member, Long> {

Optional<Member> findByUidAndActivatedIsTrue(String Uid);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.isp.backend.domain.receipt.entity;

import com.isp.backend.domain.schedules.entity.Schedules;
import com.isp.backend.global.common.BaseEntity;
import jakarta.persistence.*;
import lombok.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,93 @@
package com.isp.backend.domain.schedule.controller;

import com.isp.backend.domain.schedule.dto.ScheduleListResponseDTO;
import com.isp.backend.domain.schedule.dto.ScheduleRequestDTO;
import com.isp.backend.domain.schedule.dto.ScheduleResponseDTO;
import com.isp.backend.domain.schedule.dto.ScheduleSaveRequestDTO;
import com.isp.backend.domain.schedule.entity.Schedule;
import com.isp.backend.domain.schedule.service.ScheduleService;
import com.isp.backend.global.security.CustomUserDetails;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/schedule")
@RequiredArgsConstructor
public class ScheduleController {
}

private final ScheduleService scheduleService;

/**
* 여행 일정 생성형 API
*/
@PostMapping("/")
public ResponseEntity<ScheduleResponseDTO> createSchedule(@RequestBody ScheduleRequestDTO scheduleRequestDTO) {

ScheduleResponseDTO scheduleResponseDTO = scheduleService.createSchedule(scheduleRequestDTO);
return ResponseEntity.ok(scheduleResponseDTO);
}


/**
* 여행 일정 저장 API
*/
@PostMapping("/save")
public ResponseEntity<Void> saveSchedule(@AuthenticationPrincipal CustomUserDetails customUserDetails,
@RequestBody ScheduleSaveRequestDTO requestDTO) {
scheduleService.saveSchedule(customUserDetails.getUsername(), requestDTO);
return ResponseEntity.ok().build();
}


/**
* 여행 일정 목록 조회 API
*/
@GetMapping("/list")
public ResponseEntity<List<ScheduleListResponseDTO>> getScheduleList(@AuthenticationPrincipal CustomUserDetails userDetails) {
String uid = userDetails.getUsername();
List<ScheduleListResponseDTO> scheduleList = scheduleService.getScheduleList(uid);
return ResponseEntity.ok(scheduleList);
}

/**
* 여행 일정 상세 조회 API
*/
@GetMapping("/detail/{scheduleId}")
public ResponseEntity<ScheduleSaveRequestDTO> getScheduleDetail(@AuthenticationPrincipal CustomUserDetails userDetails,
@PathVariable Long scheduleId) {
String uid = userDetails.getUsername();
ScheduleSaveRequestDTO scheduleDetail = scheduleService.getScheduleDetail(uid, scheduleId);
return ResponseEntity.ok(scheduleDetail);
}

/**
* 여행 일정 삭제 API
*/
@DeleteMapping("/{scheduleId}")
public ResponseEntity<Void> deleteSchedule(@AuthenticationPrincipal CustomUserDetails userDetails,
@PathVariable Long scheduleId) {
String uid = userDetails.getUsername();
scheduleService.deleteSchedule(uid, scheduleId);
return ResponseEntity.ok().build();
}


/**
* 여행 일정 수정 API
*/
@PutMapping("/update/{scheduleId}")
public ResponseEntity<ScheduleSaveRequestDTO> updateSchedule(@AuthenticationPrincipal CustomUserDetails userDetails,
@PathVariable Long scheduleId,
@RequestBody ScheduleSaveRequestDTO requestDTO) {
ScheduleSaveRequestDTO updatedSchedule = scheduleService.updateSchedule(userDetails.getUsername(), scheduleId, requestDTO);
// return ResponseEntity.ok().build(); == public void로
return ResponseEntity.ok(updatedSchedule);
}


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.isp.backend.domain.schedule.dto;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.List;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class DailyScheduleDTO {

private String date; // 일정 날짜

private List<ScheduleDetailDTO> schedules; // 해당 날짜의 일정 목록

}
Loading
Loading