Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: change entity date type
Browse files Browse the repository at this point in the history
barabobBOB committed Apr 15, 2024
1 parent 9ebf00f commit d525b4d
Showing 2 changed files with 21 additions and 19 deletions.
24 changes: 13 additions & 11 deletions internal/domain/sos_post/sos_post.go
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ import (
"github.com/pet-sitter/pets-next-door-api/internal/domain/media"
"github.com/pet-sitter/pets-next-door-api/internal/domain/pet"
"github.com/pet-sitter/pets-next-door-api/internal/infra/database"
"time"
)

type CareType string
@@ -39,9 +40,9 @@ type SosPost struct {
CarerGender CarerGender `field:"carer_gender"`
RewardType RewardType `field:"reward_type"`
ThumbnailID int `field:"thumbnail_id"`
CreatedAt string `field:"created_at"`
UpdatedAt string `field:"updated_at"`
DeletedAt string `field:"deleted_at"`
CreatedAt time.Time `field:"created_at"`
UpdatedAt time.Time `field:"updated_at"`
DeletedAt time.Time `field:"deleted_at"`
}

type SosPostList struct {
@@ -62,8 +63,9 @@ type SosPostInfo struct {
CarerGender CarerGender `field:"carerGender" json:"carerGender"`
RewardType RewardType `field:"rewardType" json:"rewardType"`
ThumbnailID int `field:"thumbnailId" json:"thumbnailId"`
CreatedAt string `field:"createdAt" json:"createdAt"`
UpdatedAt string `field:"updatedAt" json:"updatedAt"`
CreatedAt time.Time `field:"createdAt" json:"createdAt"`
UpdatedAt time.Time `field:"updatedAt" json:"updatedAt"`
DeletedAt time.Time `field:"deletedAt" json:"deletedAt"`
}

type SosPostInfoList struct {
@@ -83,12 +85,12 @@ func NewSosPostInfoList(page int, size int) *SosPostInfoList {
}

type SosDates struct {
ID int `field:"id" json:"id"`
DateStartAt string `field:"date_start_at" json:"date_start_at"`
DateEndAt string `field:"date_end_at" json:"date_end_at"`
CreatedAt string `field:"created_at" json:"created_at"`
UpdatedAt string `field:"updated_at" json:"updated_at"`
DeletedAt string `field:"deleted_at" json:"deleted_at"`
ID int `field:"id" json:"id"`
DateStartAt string `field:"date_start_at" json:"date_start_at"`
DateEndAt string `field:"date_end_at" json:"date_end_at"`
CreatedAt time.Time `field:"created_at" json:"created_at"`
UpdatedAt time.Time `field:"updated_at" json:"updated_at"`
DeletedAt time.Time `field:"deleted_at" json:"deleted_at"`
}

type SosDatesList []*SosDates
16 changes: 8 additions & 8 deletions internal/domain/sos_post/view.go
Original file line number Diff line number Diff line change
@@ -81,8 +81,8 @@ func (p *SosPost) ToWriteSosPostView(
CarerGender: p.CarerGender,
RewardType: p.RewardType,
ThumbnailID: p.ThumbnailID,
CreatedAt: p.CreatedAt,
UpdatedAt: p.UpdatedAt,
CreatedAt: p.CreatedAt.String(),
UpdatedAt: p.UpdatedAt.String(),
}
}

@@ -125,8 +125,8 @@ func (p *SosPost) ToFindSosPostView(
CarerGender: p.CarerGender,
RewardType: p.RewardType,
ThumbnailID: p.ThumbnailID,
CreatedAt: p.CreatedAt,
UpdatedAt: p.UpdatedAt,
CreatedAt: p.CreatedAt.String(),
UpdatedAt: p.UpdatedAt.String(),
}
}

@@ -171,8 +171,8 @@ func (p *SosPostInfo) ToFindSosPostInfoView(
CarerGender: p.CarerGender,
RewardType: p.RewardType,
ThumbnailID: p.ThumbnailID,
CreatedAt: p.CreatedAt,
UpdatedAt: p.UpdatedAt,
CreatedAt: p.CreatedAt.String(),
UpdatedAt: p.UpdatedAt.String(),
}
}

@@ -228,8 +228,8 @@ func (p *SosPost) ToUpdateSosPostView(
CarerGender: p.CarerGender,
RewardType: p.RewardType,
ThumbnailID: p.ThumbnailID,
CreatedAt: p.CreatedAt,
UpdatedAt: p.UpdatedAt,
CreatedAt: p.CreatedAt.String(),
UpdatedAt: p.UpdatedAt.String(),
}
}

0 comments on commit d525b4d

Please sign in to comment.