Skip to content

Commit

Permalink
feat: add start time to event
Browse files Browse the repository at this point in the history
  • Loading branch information
litsynp committed Dec 3, 2024
1 parent 3acbf1e commit e8f0369
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/server/handler/event_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func NewEventHandler(authService service.AuthService) *EventHandler {
func generateDummyEvent() event.ShortTermView {
profileImageURL := "https://cdn.pixabay.com/photo/2015/10/05/22/37/blank-profile-picture-973460_1280.png"
now := time.Now()
startAt := now.AddDate(0, 0, 1)
maxParticipants := 3
return event.ShortTermView{
BaseView: event.BaseView{
Expand All @@ -51,6 +52,7 @@ func generateDummyEvent() event.ShortTermView {
Topics: []event.EventTopic{event.ETC},
MaxParticipants: &maxParticipants,
GenderCondition: "all",
StartAt: &startAt,
CreatedAt: now,
UpdatedAt: now,
},
Expand Down
4 changes: 4 additions & 0 deletions internal/domain/event/request.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package event

import "time"

type CreateRequest struct {
BaseCreateRequest
RecurringPeriod *EventRecurringPeriod `json:"recurringPeriod,omitempty"`
Expand All @@ -14,6 +16,7 @@ type BaseCreateRequest struct {
Topics []EventTopic `json:"topics"`
MaxParticipants *int `json:"maxParticipants,omitempty"`
GenderCondition string `json:"genderCondition" enums:"male,female,all"`
StartAt *time.Time `json:"startAt,omitempty"`
}

type ShortTermCreateRequest struct {
Expand All @@ -38,6 +41,7 @@ type BaseUpdateRequest struct {
Topics []EventTopic `json:"topics"`
MaxParticipants *int `json:"maxParticipants,omitempty"`
GenderCondition string `json:"genderCondition" enums:"male,female,all"`
StartAt *time.Time `json:"startAt,omitempty"`
}

type ShortTermUpdateRequest struct {
Expand Down
1 change: 1 addition & 0 deletions internal/domain/event/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type BaseView struct {
Topics []EventTopic `json:"topics"`
MaxParticipants *int `json:"maxParticipants,omitempty"`
GenderCondition string `json:"genderCondition"`
StartAt *time.Time `json:"startAt,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
Expand Down

0 comments on commit e8f0369

Please sign in to comment.