Skip to content
Snippets Groups Projects
Commit 5a76fb1a authored by OZGCloud's avatar OZGCloud
Browse files

add api endpoint for adding alfa notes

parent 113c3eb2
Branches
Tags
No related merge requests found
package de.ozgcloud.apilib.alfa;
import de.ozgcloud.apilib.vorgang.OzgCloudVorgangId;
public interface AlfaService {
/**
* Add a Notiz (note) to a Akte (file) of a Vorgang
*
* @param vorgangId Id for the Vorgang to add the note to it.
* @param text Content of the Note.
*/
public void addAktenNotiz(OzgCloudVorgangId vorgangId, String text);
}
package de.ozgcloud.apilib.alfa.dummy;
import de.ozgcloud.apilib.alfa.AlfaService;
import de.ozgcloud.apilib.vorgang.OzgCloudVorgangId;
import lombok.extern.java.Log;
@Log
public class DummyAlfaService implements AlfaService {
@Override
public void addAktenNotiz(OzgCloudVorgangId vorgangId, String text) {
// does nothing dummy implementation
LOG.info("Create Note on Alfa: " + text);
}
}
......@@ -5,6 +5,7 @@ import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;
import de.ozgcloud.apilib.alfa.AlfaService;
import de.ozgcloud.apilib.file.OzgCloudFileId;
import de.ozgcloud.apilib.file.OzgCloudFileService;
import de.ozgcloud.apilib.vorgang.OzgCloudVorgangId;
......@@ -13,17 +14,22 @@ import de.ozgcloud.apilib.vorgang.OzgCloudVorgangService;
@Component
class DemoRunner implements ApplicationListener<ContextRefreshedEvent> {
private static final OzgCloudVorgangId VORGANG_ID = OzgCloudVorgangId.from("64bfd6597a08cf6e8a5185c6");
@Autowired
private OzgCloudVorgangService vorgangService;
@Autowired
private OzgCloudFileService fileService;
@Autowired
private AlfaService alfaService;
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
System.out.println(vorgangService.getById(OzgCloudVorgangId.from("64bfd6597a08cf6e8a5185c6")));
System.out.println(vorgangService.getById(VORGANG_ID));
System.out.println(fileService.getFile(OzgCloudFileId.from("630363d5b5816c0d8efd6f19")));
alfaService.addAktenNotiz(VORGANG_ID, "Hello World!");
}
}
......@@ -11,6 +11,8 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;
import de.ozgcloud.apilib.alfa.AlfaService;
import de.ozgcloud.apilib.alfa.dummy.DummyAlfaService;
import de.ozgcloud.apilib.common.callcontext.DefaultOzgCloudCallContextProvider;
import de.ozgcloud.apilib.common.callcontext.OzgCloudCallContextAttachingInterceptor;
import de.ozgcloud.apilib.common.callcontext.OzgCloudCallContextProvider;
......@@ -72,4 +74,10 @@ public class OzgCloudClientAutoConfiguration {
OzgCloudCallContextProvider callContextProvider(ApplicationContext ctxt) {
return new DefaultOzgCloudCallContextProvider(ctxt);
}
@Bean
@ConditionalOnMissingBean
AlfaService alfaService() {
return new DummyAlfaService();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment