PMT-9: Anlegen des Employee Services #5

Merged
SZUT-Dominik merged 8 commits from task/PMT-9-anlegen-des-employ-service into trunk 2024-09-30 12:37:00 +00:00
Showing only changes of commit a2cb7e6a59 - Show all commits

View file

@ -0,0 +1,37 @@
package de.hmmh.pmt.employee;
import de.hmmh.pmt.auth.JwtToken;
import de.hmmh.pmt.employee.api.EmployeeControllerApi;
import de.hmmh.pmt.employee.api.QualificationControllerApi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class ApiClientFactory {
@Autowired
private ApiClient apiClient;
@Autowired
private JwtToken apiToken;
@Autowired
private EmployeeControllerApi employee;
@Autowired
private QualificationControllerApi qualification;
public EmployeeControllerApi getEmployeeApi() {
prepareApiClient();
employee.setApiClient(apiClient);
return employee;
}
public QualificationControllerApi getQualificationApi() {
prepareApiClient();
qualification.setApiClient(apiClient);
return qualification;
}
private void prepareApiClient() {
apiClient.setAccessToken(apiToken.getToken());
apiClient.setBasePath("https://employee.szut.dev");
}
}