restore things lost in merge ffs
This commit is contained in:
@ -1,12 +1,10 @@
|
||||
package mops.gruppen2.controller;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.github.javafaker.Faker;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import mops.gruppen2.domain.ProductSwaggerExample;
|
||||
import mops.gruppen2.domain.event.AddUserEvent;
|
||||
import mops.gruppen2.service.SerializationService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -24,7 +22,7 @@ public class SwaggerAPIController {
|
||||
private final List<ProductSwaggerExample> products = new ArrayList<>();
|
||||
private final SerializationService serializationService;
|
||||
|
||||
public SwaggerAPIControllerExample(SerializationService serializationService) {
|
||||
public SwaggerAPIController(SerializationService serializationService) {
|
||||
this.serializationService = serializationService;
|
||||
}
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@ package mops.gruppen2.service;
|
||||
|
||||
import mops.gruppen2.domain.Exceptions.EventException;
|
||||
import mops.gruppen2.domain.Group;
|
||||
import mops.gruppen2.domain.event.CreateGroupEvent;
|
||||
import mops.gruppen2.domain.event.Event;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@ -29,4 +30,16 @@ public class GroupService {
|
||||
|
||||
return newGroup;
|
||||
}
|
||||
|
||||
public Group buildGroupFromEvent(CreateGroupEvent createGroupEvent) {
|
||||
Group newGroup = new Group();
|
||||
|
||||
try {
|
||||
newGroup.applyEvent(createGroupEvent);
|
||||
} catch (EventException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return newGroup;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user