Skip to content

Commit

Permalink
[#6] fix: timeInfo 잘못된 타입컬럼 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
sss4920 committed Sep 23, 2024
1 parent 1568804 commit 0625d3f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package dev.office.networkoffice.gathering.controller.dto.request;

import java.time.LocalDateTime;

import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.security.core.parameters.P;

Expand All @@ -24,8 +26,8 @@ public record GatheringDto(
Double y,
String date,

String startTime,
String endTime
LocalDateTime startTime,
LocalDateTime endTime
) {
public PlaceInfo placeInfoConstructor(){
return PlaceInfo.setPlaceInfo(place,detailPlace,si,dong,gu,x,y);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package dev.office.networkoffice.gathering.controller.dto.request;

import java.time.LocalDateTime;

import dev.office.networkoffice.gathering.entity.PlaceInfo;
import dev.office.networkoffice.gathering.entity.TimeInfo;

Expand All @@ -19,8 +21,8 @@ public record GatheringModifyDto(
Double y,
String date,

String startTime,
String endTime
LocalDateTime startTime,
LocalDateTime endTime


) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package dev.office.networkoffice.gathering.entity;

import java.sql.Time;
import java.time.LocalDateTime;

import org.springframework.format.annotation.DateTimeFormat;

Expand All @@ -18,23 +18,21 @@ public class TimeInfo {
@Column(name = "date")
private String date;

@DateTimeFormat()
@Column(name = "start_time")
private String startTime;
@DateTimeFormat()
@Column(name = "end_time")
private String endTime;

@DateTimeFormat(iso = DateTimeFormat.ISO.TIME)
private LocalDateTime startTime;

@Column(name = "end_time")
@DateTimeFormat(iso = DateTimeFormat.ISO.TIME)
private LocalDateTime endTime;

private TimeInfo(String date, String startTime , String endTime) {
private TimeInfo(String date, LocalDateTime startTime , LocalDateTime endTime) {
this.date = date;
this.startTime = startTime;
this.endTime = endTime;
}

public static TimeInfo setTimeInfo(String date, String startTime , String endTime) {
public static TimeInfo setTimeInfo(String date, LocalDateTime startTime , LocalDateTime endTime) {
return new TimeInfo(date, startTime, endTime);
}
}

0 comments on commit 0625d3f

Please sign in to comment.