Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
569 additions
and
178 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
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 +1,3 @@ | ||
Dan Mikita | ||
Dan McCracken | ||
Carlus Henry |
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
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,15 @@ | ||
package com.ioextendedgr.web; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; | ||
import org.springframework.context.annotation.ComponentScan; | ||
|
||
@ComponentScan(basePackages = {"com.ioextendedgr.web"}) | ||
@EnableAutoConfiguration | ||
public class Application { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(Application.class, args); | ||
} | ||
|
||
} |
25 changes: 21 additions & 4 deletions
25
src/main/java/com/ioextendedgr/web/controller/ConferenceController.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
29 changes: 29 additions & 0 deletions
29
src/main/java/com/ioextendedgr/web/controller/ConferenceSessionController.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,29 @@ | ||
package com.ioextendedgr.web.controller; | ||
|
||
import java.util.Collection; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import com.ioextendedgr.web.service.ConferenceService; | ||
import com.ioextendedgr.web.viewDto.ConferenceSessionView; | ||
|
||
@RestController | ||
@RequestMapping("/api") | ||
public class ConferenceSessionController { | ||
|
||
@Autowired | ||
private ConferenceService conferenceService; | ||
|
||
@RequestMapping("/conferenceSession") | ||
public Collection<ConferenceSessionView> findAllConferenceSessions() { | ||
return conferenceService.findAllConferenceSessions(); | ||
} | ||
|
||
@RequestMapping("/conferenceSession/{id}") | ||
public ConferenceSessionView findConferenceSessionById(@PathVariable("id") Long id) { | ||
return conferenceService.findConferenceSessionById(id); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
src/main/java/com/ioextendedgr/web/controller/PresenterController.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,29 @@ | ||
package com.ioextendedgr.web.controller; | ||
|
||
import java.util.Collection; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import com.ioextendedgr.web.service.ConferenceService; | ||
import com.ioextendedgr.web.viewDto.PresenterView; | ||
|
||
@RestController | ||
@RequestMapping("/api") | ||
public class PresenterController { | ||
|
||
@Autowired | ||
private ConferenceService conferenceService; | ||
|
||
@RequestMapping("/presenter") | ||
public Collection<PresenterView> findAllPresenters() { | ||
return conferenceService.findAllPresenters(); | ||
} | ||
|
||
@RequestMapping("/presenter/{id}") | ||
public PresenterView findPresenterById(@PathVariable("id") Long id) { | ||
return conferenceService.findPresenterById(id); | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
src/main/java/com/ioextendedgr/web/service/ConferenceService.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,47 @@ | ||
package com.ioextendedgr.web.service; | ||
|
||
import java.util.Collection; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Component; | ||
|
||
import com.ioextendedgr.web.util.StubFactory; | ||
import com.ioextendedgr.web.viewDto.ConferenceSessionView; | ||
import com.ioextendedgr.web.viewDto.ConferenceView; | ||
import com.ioextendedgr.web.viewDto.PresenterView; | ||
|
||
@Component | ||
public class ConferenceService { | ||
|
||
@Autowired | ||
private StubFactory stubFactory; | ||
|
||
public Collection<ConferenceView> findAllConferences() { | ||
return stubFactory.findAllConferences(); | ||
} | ||
|
||
public ConferenceView findConferenceById(Long id) { | ||
return stubFactory.findConferenceById(id); | ||
} | ||
|
||
public Collection<PresenterView> findAllPresenters() { | ||
return stubFactory.findAllPresenters(); | ||
} | ||
|
||
public PresenterView findPresenterById(Long id) { | ||
return stubFactory.findPresenterById(id); | ||
} | ||
|
||
public Collection<ConferenceSessionView> findAllConferenceSessions() { | ||
return stubFactory.findAllConferenceSessions(); | ||
} | ||
|
||
public ConferenceSessionView findConferenceSessionById(Long id) { | ||
return stubFactory.findConferenceSessionById(id); | ||
} | ||
|
||
public Collection<ConferenceSessionView> findConferenceSessionsByConferenceId(Long id) { | ||
return stubFactory.findConferenceSessionsByConferenceId(id); | ||
} | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/com/ioextendedgr/web/util/DateTimeISO8601Serializer.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,26 @@ | ||
package com.ioextendedgr.web.util; | ||
|
||
import java.io.IOException; | ||
import java.text.SimpleDateFormat; | ||
import java.util.Date; | ||
|
||
import com.fasterxml.jackson.core.JsonGenerator; | ||
import com.fasterxml.jackson.core.JsonProcessingException; | ||
import com.fasterxml.jackson.databind.JsonSerializer; | ||
import com.fasterxml.jackson.databind.SerializerProvider; | ||
|
||
public class DateTimeISO8601Serializer extends JsonSerializer<Date> { | ||
|
||
@Override | ||
public void serialize(Date value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { | ||
if (value == null) { | ||
jgen.writeString(""); | ||
return; | ||
} | ||
|
||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); | ||
String formattedDate = formatter.format(value); | ||
jgen.writeString(formattedDate); | ||
} | ||
|
||
} |
Oops, something went wrong.