15
15
import org .springframework .web .server .ResponseStatusException ;
16
16
17
17
import com .ase .angelos_kb_backend .dto .angelos .AngelosChatResponse ;
18
- import com .ase .angelos_kb_backend .dto .eunomnia .MailCredentialsDTO ;
19
- import com .ase .angelos_kb_backend .dto .eunomnia .MailCredentialsResponseDTO ;
20
- import com .ase .angelos_kb_backend .dto .eunomnia .MailResponseRequestDTO ;
21
- import com .ase .angelos_kb_backend .dto .eunomnia .MailStatusDTO ;
22
- import com .ase .angelos_kb_backend .dto .eunomnia .MailThreadRequestDTO ;
18
+ import com .ase .angelos_kb_backend .dto .eunomia .MailCredentialsDTO ;
19
+ import com .ase .angelos_kb_backend .dto .eunomia .MailCredentialsResponseDTO ;
20
+ import com .ase .angelos_kb_backend .dto .eunomia .MailResponseRequestDTO ;
21
+ import com .ase .angelos_kb_backend .dto .eunomia .MailStatusDTO ;
22
+ import com .ase .angelos_kb_backend .dto .eunomia .MailThreadRequestDTO ;
23
23
import com .ase .angelos_kb_backend .service .AngelosService ;
24
- import com .ase .angelos_kb_backend .service .EunomniaService ;
24
+ import com .ase .angelos_kb_backend .service .EunomiaService ;
25
25
import com .ase .angelos_kb_backend .service .OrganisationService ;
26
26
import com .ase .angelos_kb_backend .service .StudyProgramService ;
27
27
import com .ase .angelos_kb_backend .util .JwtUtil ;
@@ -35,17 +35,17 @@ public class MailController {
35
35
private final OrganisationService organisationService ;
36
36
private final StudyProgramService studyProgramService ;
37
37
private final JwtUtil jwtUtil ;
38
- private final EunomniaService eunomniaService ;
38
+ private final EunomiaService eunomiaService ;
39
39
private final AngelosService angelosService ;
40
40
41
41
@ Value ("${app.max-message-length}" )
42
42
private int maxMessageLength ;
43
43
44
- public MailController (OrganisationService organisationService , StudyProgramService studyProgramService , JwtUtil jwtUtil , EunomniaService eunomniaService , AngelosService angelosService ) {
44
+ public MailController (OrganisationService organisationService , StudyProgramService studyProgramService , JwtUtil jwtUtil , EunomiaService eunomiaService , AngelosService angelosService ) {
45
45
this .jwtUtil = jwtUtil ;
46
46
this .organisationService = organisationService ;
47
47
this .studyProgramService = studyProgramService ;
48
- this .eunomniaService = eunomniaService ;
48
+ this .eunomiaService = eunomiaService ;
49
49
this .angelosService = angelosService ;
50
50
}
51
51
@@ -71,7 +71,7 @@ public ResponseEntity<Void> setCredentials(
71
71
List <String > studyPrograms = studyProgramService .getAllStudyProgramsByOrgId (orgId ).stream ().map (sp -> sp .getName ()).toList ();
72
72
dto .setStudyPrograms (studyPrograms );
73
73
74
- success = eunomniaService .startThread (orgId , dto );
74
+ success = eunomiaService .startThread (orgId , dto );
75
75
}
76
76
77
77
if (success ) {
@@ -103,7 +103,7 @@ public ResponseEntity<MailCredentialsResponseDTO> getCredentials(
103
103
@ PostMapping ("/deactivate" )
104
104
public ResponseEntity <Void > deactivate (@ RequestHeader ("Authorization" ) String token ) {
105
105
Long orgId = jwtUtil .extractOrgId (token .replace ("Bearer " , "" ));
106
- boolean success = eunomniaService .stopThread (orgId );
106
+ boolean success = eunomiaService .stopThread (orgId );
107
107
if (success ) {
108
108
organisationService .setMailStatus (orgId , MailStatus .INACTIVE );
109
109
return ResponseEntity .ok ().build ();
@@ -121,7 +121,7 @@ public ResponseEntity<MailStatusDTO> getStatus(@RequestHeader("Authorization") S
121
121
Long orgId = jwtUtil .extractOrgId (token .replace ("Bearer " , "" ));
122
122
123
123
MailStatusDTO statusDto = new MailStatusDTO ();
124
- MailStatus status = eunomniaService .getStatus (orgId ).getStatus ();
124
+ MailStatus status = eunomiaService .getStatus (orgId ).getStatus ();
125
125
126
126
statusDto .setStatus (status );
127
127
organisationService .setMailStatus (orgId , status );
@@ -137,7 +137,7 @@ public ResponseEntity<AngelosChatResponse> ask(
137
137
@ RequestHeader ("x-api-key" ) String apiKey ,
138
138
@ RequestBody MailResponseRequestDTO request ) {
139
139
140
- if (eunomniaService .verifyAPIKey (apiKey )) {
140
+ if (eunomiaService .verifyAPIKey (apiKey )) {
141
141
if (request .getMessage () != null && request .getMessage ().length () > maxMessageLength ) {
142
142
throw new ResponseStatusException (
143
143
HttpStatus .BAD_REQUEST ,
0 commit comments