Skip to content

Commit

Permalink
event slot addition
Browse files Browse the repository at this point in the history
  • Loading branch information
sugan0tech committed Mar 21, 2024
1 parent d3b874d commit ed1ca38
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/in/ac/skcet/event_manager/event/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class Event {
private Integer eventId;
private String title;
private String description;
private Location location = Location.DEFAULT;
private Date fromDate;
private Date endDate;
private String classCode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public Event convert(EventCommand eventCommand) {
.title(eventCommand.getTitle())
.classCode(eventCommand.getClassCode())
.description(eventCommand.getDescription())
.location(eventCommand.getLocation())
.fromDate(fromDate)
.endDate(endDate).build();
} catch (ParseException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class EventCommand {
private String title;
private String description;
private String classCode;
private Location location;
private String fromDate;
private String endDate;

Expand Down
27 changes: 27 additions & 0 deletions src/main/java/in/ac/skcet/event_manager/event/Location.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package in.ac.skcet.event_manager.event;

public enum Location {
EXTERNAL,
REMOTE,
KRISHNA_HALL,
BS01,
BS02,
BS03,
BS04,
SEMINAR_HALL,
CONFERENCE_HALL,
JB_LAB,
AK_LAB;

// Default value
public static final Location DEFAULT = EXTERNAL;

public static Location fromString(String text) {
for (Location location : Location.values()) {
if (location.name().equalsIgnoreCase(text)) {
return location;
}
}
return null;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package in.ac.skcet.event_manager.on_duty;

import in.ac.skcet.event_manager.event.Event;
import lombok.*;
import org.bson.types.Binary;
import org.springframework.data.mongodb.core.mapping.Document;
Expand Down

0 comments on commit ed1ca38

Please sign in to comment.