Skip to content

Commit 2dd13be

Browse files
committed
Merge conflict resolved
2 parents a60a455 + ca304f7 commit 2dd13be

File tree

79 files changed

+1570
-443
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+1570
-443
lines changed

โ€Ž.github/workflows/deploy.ymlโ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
aws-region: ${{ secrets.AWS_REGION }}
7777
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
7878
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
79-
instance-ids: "i-0e27758b937bcc047"
79+
instance-ids: "i-050af13cf2c3bc98a"
8080
working-directory: /
8181
comment: Deploy
8282
command: |

โ€Žbuild.gradle.ktsโ€Ž

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ dependencies {
7676
// Spring Security OAuth2
7777
implementation ("org.springframework.security:spring-security-oauth2-client:6.4.2") // Or the version you're using
7878
implementation ("org.springframework.security:spring-security-oauth2-core:6.4.2") // Or the version you're using
79+
80+
implementation("org.springframework.boot:spring-boot-starter-actuator")
81+
7982
}
8083

8184
tasks.withType<Test> {

โ€Žsrc/main/java/cmf/commitField/CommitFieldApplication.javaโ€Ž

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@
77

88
@SpringBootApplication
99
@EnableJpaAuditing
10-
// ์Šค์ผ€์ฅด๋ง ํ™œ์„ฑํ™”
11-
// ํ…Œ์ŠคํŠธ์‹œ์—๋งŒ ์ฃผ์„ ํ’€๊ธฐ
1210
@EnableScheduling
13-
public class CommitFieldApplication {
11+
public class
12+
CommitFieldApplication {
1413
public static void main(String[] args) {
1514
SpringApplication.run(CommitFieldApplication.class, args);
1615
}
17-
1816
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package cmf.commitField.domain.File.service;
2+
3+
import org.springframework.boot.context.properties.ConfigurationProperties;
4+
import org.springframework.stereotype.Component;
5+
6+
//@Configuration
7+
@Component
8+
@ConfigurationProperties(prefix = "custom.file")
9+
public class FileProperties {
10+
private String uploadDir;
11+
12+
public String getUploadDir() {
13+
return uploadDir;
14+
}
15+
16+
public void setUploadDir(String uploadDir) {
17+
this.uploadDir = uploadDir;
18+
}
19+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package cmf.commitField.domain.File.service;
2+
3+
import org.springframework.stereotype.Service;
4+
import org.springframework.web.multipart.MultipartFile;
5+
6+
import java.io.IOException;
7+
import java.nio.file.Files;
8+
import java.nio.file.Path;
9+
import java.nio.file.Paths;
10+
import java.nio.file.StandardCopyOption;
11+
12+
@Service
13+
public class FileService {
14+
15+
// resources/static/uploads ํด๋” ๊ฒฝ๋กœ
16+
private final String UPLOAD_DIR = "src/main/resources/static/uploads"; // ์ƒ๋Œ€ ๊ฒฝ๋กœ
17+
18+
// ํŒŒ์ผ ์ €์žฅ ๋ฉ”์†Œ๋“œ
19+
public String saveFile(MultipartFile file) throws IOException {
20+
// ํŒŒ์ผ ์ด๋ฆ„์„ ์œ ๋‹ˆํฌํ•˜๊ฒŒ ์ƒ์„ฑ
21+
String filename = System.currentTimeMillis() + "_" + file.getOriginalFilename();
22+
23+
// ํŒŒ์ผ ๊ฒฝ๋กœ ์ƒ์„ฑ
24+
Path path = Paths.get(UPLOAD_DIR, filename); // static/uploads ํด๋”์— ์ €์žฅ
25+
26+
// ๋””๋ ‰ํ† ๋ฆฌ๊ฐ€ ์กด์žฌํ•˜์ง€ ์•Š์œผ๋ฉด ์ƒ์„ฑ
27+
Files.createDirectories(path.getParent());
28+
29+
// ํŒŒ์ผ ์ €์žฅ
30+
Files.copy(file.getInputStream(), path, StandardCopyOption.REPLACE_EXISTING);
31+
32+
// ์ €์žฅ๋œ ํŒŒ์ผ์˜ URL ๋ฐ˜ํ™˜ (์›น์—์„œ ์ ‘๊ทผํ•  ์ˆ˜ ์žˆ๋Š” ๊ฒฝ๋กœ)
33+
return "/uploads/" + filename; // ํด๋ผ์ด์–ธํŠธ๊ฐ€ ์ ‘๊ทผํ•  ์ˆ˜ ์žˆ๋Š” URL ๋ฐ˜ํ™˜
34+
}
35+
}
36+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package cmf.commitField.domain.Timer.controller;
2+
3+
import org.springframework.web.bind.annotation.RestController;
4+
5+
@RestController
6+
public class TimerController {
7+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package cmf.commitField.domain.Timer.dto;
2+
3+
import lombok.Getter;
4+
import lombok.Setter;
5+
6+
import java.time.LocalDateTime;
7+
8+
@Getter
9+
@Setter
10+
public class TimerDto {
11+
private LocalDateTime startTime;
12+
private LocalDateTime endTime;
13+
private String totalTime;
14+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package cmf.commitField.domain.Timer.entity;
2+
3+
import cmf.commitField.domain.user.entity.User;
4+
import jakarta.persistence.GeneratedValue;
5+
import jakarta.persistence.GenerationType;
6+
import jakarta.persistence.Id;
7+
import lombok.AllArgsConstructor;
8+
import lombok.Getter;
9+
import lombok.NoArgsConstructor;
10+
import lombok.Setter;
11+
12+
import java.time.LocalDateTime;
13+
14+
@Getter
15+
@Setter
16+
@NoArgsConstructor
17+
@AllArgsConstructor
18+
public class Timer {
19+
@Id
20+
@GeneratedValue(strategy = GenerationType.IDENTITY)
21+
private Long id;
22+
23+
private User user;
24+
private LocalDateTime startTime;
25+
private LocalDateTime endTime;
26+
private String totalTime;
27+
28+
// ํƒ€์ด๋จธ ์ข…๋ฃŒ ๋ฉ”์„œ๋“œ
29+
public void stop(LocalDateTime endTime, String totalTime) {
30+
this.endTime = endTime;
31+
this.totalTime = totalTime;
32+
}
33+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package cmf.commitField.domain.Timer.service;
2+
3+
import org.springframework.stereotype.Service;
4+
5+
@Service
6+
public class TimerService {
7+
8+
}

src/main/java/cmf/commitField/domain/admin/controller/ApiV1PetImgController.java renamed to src/main/java/cmf/commitField/domain/admin/admin/controller/ApiV1PetImgController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package cmf.commitField.domain.admin.controller;
1+
package cmf.commitField.domain.admin.admin.controller;
22

33
import cmf.commitField.global.aws.s3.S3Service;
44
import lombok.RequiredArgsConstructor;

0 commit comments

Comments
ย (0)