Newer
Older
package de.ozgcloud.admin.setting;
import org.springframework.stereotype.Service;
import de.ozgcloud.admin.setting.postfach.PostfachSettingBody;
private static final String POSTFACH_SETTING_ITEM_NAME = "Postfach";
private final SettingRepository repository;
private final SettingMapper mapper;
public AlfaSettingDTO getAlfaSettingDTO() {
var postfachData = getSettingWithPostfachFromDb();
return mapper.mapAlfaPostfach(AlfaSettingDTO.builder(), postfachData).build();
public VorgangManagerSettingDTO getVorgangManagerSettingDTO() {
var postfachData = getSettingWithPostfachFromDb();
return mapper.mapVorgangManagerPostfach(VorgangManagerSettingDTO.builder(), postfachData).build();
var postfach = repository.findOneByName(POSTFACH_SETTING_ITEM_NAME);
return postfach.isPresent() ? (PostfachSettingBody) postfach.get().getSettingBody() : PostfachSettingBody.builder().build();