-
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 #5 from AppJam-27th/gayeong
chore: git error
- Loading branch information
Showing
6 changed files
with
45 additions
and
25 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
28 changes: 11 additions & 17 deletions
28
src/main/java/appJam/hackerton/appjam_27/domain/time/controller/TimeController.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 |
---|---|---|
@@ -1,30 +1,24 @@ | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.ModelAttribute; | ||
import org.springframework.web.bind.annotation.PatchMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
package appJam.hackerton.appjam_27.domain.time.controller; | ||
|
||
import appJam.hackerton.appjam_27.domain.time.dto.req.TimeReq; | ||
import appJam.hackerton.appjam_27.domain.time.service.TimeService; | ||
import appJam.hackerton.appjam_27.global.response.Response; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import appJam.hackerton.appjam_27.domain.time.service.TimeService; | ||
import appJam.hackerton.appjam_27.global.response.ResponseData; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
import java.sql.Time; | ||
import java.util.List; | ||
|
||
@RestController | ||
@RequestMapping("/time") | ||
@RequiredArgsConstructor | ||
public class TimeController { | ||
private final TimeService timeService; | ||
|
||
@GetMapping("/{time}") | ||
public ResponseData<Time> saveTime(@PathVariable("time") String time, @PathVariable("uid") Long userId) { | ||
Time savedTime = timeService.saveTime(userId, time); | ||
// 응답으로 적절히 ResponseData를 리턴해야 합니다. | ||
return new ResponseData<Time>(savedTime); | ||
@PostMapping() | ||
public Response saveTime( | ||
@RequestBody TimeReq timeReq | ||
) { | ||
return timeService.saveTime(timeReq); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/appJam/hackerton/appjam_27/domain/time/dto/req/TimeReq.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,7 @@ | ||
package appJam.hackerton.appjam_27.domain.time.dto.req; | ||
|
||
public record TimeReq( | ||
String userId, | ||
Long time | ||
) { | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/java/appJam/hackerton/appjam_27/domain/time/dto/res/TimeRes.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,6 @@ | ||
package appJam.hackerton.appjam_27.domain.time.dto.res; | ||
|
||
public record TimeRes ( | ||
|
||
){ | ||
} |
5 changes: 3 additions & 2 deletions
5
src/main/java/appJam/hackerton/appjam_27/domain/time/repository/TimeRepository.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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
import java.sql.Time; | ||
package appJam.hackerton.appjam_27.domain.time.repository; | ||
|
||
import appJam.hackerton.appjam_27.domain.time.entity.TimeEntity; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface TimeRepository extends TimeEntity<Time, Long> { | ||
public interface TimeRepository extends JpaRepository<TimeEntity, Long> { | ||
|
||
} |
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