5
5
6
6
import io .quarkus .security .Authenticated ;
7
7
import org .eclipse .microprofile .jwt .JsonWebToken ;
8
- import org .lfenergy .compas .scl .data .model .SclType ;
9
8
import org .lfenergy .compas .scl .data .model .Version ;
10
9
import org .lfenergy .compas .scl .data .rest .UserInfoProperties ;
11
10
import org .lfenergy .compas .scl .data .rest .v1 .model .*;
12
11
import org .lfenergy .compas .scl .data .service .CompasSclDataService ;
12
+ import org .lfenergy .compas .scl .extensions .model .SclFileType ;
13
13
import org .slf4j .Logger ;
14
14
import org .slf4j .LoggerFactory ;
15
15
@@ -44,7 +44,7 @@ public CompasSclDataResource(CompasSclDataService compasSclDataService) {
44
44
@ POST
45
45
@ Consumes (MediaType .APPLICATION_XML )
46
46
@ Produces (MediaType .APPLICATION_XML )
47
- public CreateResponse create (@ PathParam (TYPE_PATH_PARAM ) SclType type ,
47
+ public CreateResponse create (@ PathParam (TYPE_PATH_PARAM ) SclFileType type ,
48
48
@ Valid CreateRequest request ) {
49
49
String who = jsonWebToken .getClaim (userInfoProperties .who ());
50
50
LOGGER .trace ("Username used for Who {}" , who );
@@ -58,7 +58,7 @@ public CreateResponse create(@PathParam(TYPE_PATH_PARAM) SclType type,
58
58
@ GET
59
59
@ Path ("/list" )
60
60
@ Produces (MediaType .APPLICATION_XML )
61
- public ListResponse list (@ PathParam (TYPE_PATH_PARAM ) SclType type ) {
61
+ public ListResponse list (@ PathParam (TYPE_PATH_PARAM ) SclFileType type ) {
62
62
var response = new ListResponse ();
63
63
response .setItems (compasSclDataService .list (type ));
64
64
return response ;
@@ -67,7 +67,7 @@ public ListResponse list(@PathParam(TYPE_PATH_PARAM) SclType type) {
67
67
@ GET
68
68
@ Path ("/{" + ID_PATH_PARAM + "}/versions" )
69
69
@ Produces (MediaType .APPLICATION_XML )
70
- public VersionsResponse listVersionsByUUID (@ PathParam (TYPE_PATH_PARAM ) SclType type ,
70
+ public VersionsResponse listVersionsByUUID (@ PathParam (TYPE_PATH_PARAM ) SclFileType type ,
71
71
@ PathParam (ID_PATH_PARAM ) UUID id ) {
72
72
var response = new VersionsResponse ();
73
73
response .setItems (compasSclDataService .listVersionsByUUID (type , id ));
@@ -77,7 +77,7 @@ public VersionsResponse listVersionsByUUID(@PathParam(TYPE_PATH_PARAM) SclType t
77
77
@ GET
78
78
@ Path ("/{" + ID_PATH_PARAM + "}" )
79
79
@ Produces (MediaType .APPLICATION_XML )
80
- public GetResponse findByUUID (@ PathParam (TYPE_PATH_PARAM ) SclType type ,
80
+ public GetResponse findByUUID (@ PathParam (TYPE_PATH_PARAM ) SclFileType type ,
81
81
@ PathParam (ID_PATH_PARAM ) UUID id ) {
82
82
var response = new GetResponse ();
83
83
response .setSclData (compasSclDataService .findByUUID (type , id ));
@@ -87,7 +87,7 @@ public GetResponse findByUUID(@PathParam(TYPE_PATH_PARAM) SclType type,
87
87
@ GET
88
88
@ Path ("/{" + ID_PATH_PARAM + "}/{" + VERSION_PATH_PARAM + "}" )
89
89
@ Produces (MediaType .APPLICATION_XML )
90
- public GetResponse findByUUIDAndVersion (@ PathParam (TYPE_PATH_PARAM ) SclType type ,
90
+ public GetResponse findByUUIDAndVersion (@ PathParam (TYPE_PATH_PARAM ) SclFileType type ,
91
91
@ PathParam (ID_PATH_PARAM ) UUID id ,
92
92
@ PathParam (VERSION_PATH_PARAM ) Version version ) {
93
93
var response = new GetResponse ();
@@ -99,7 +99,7 @@ public GetResponse findByUUIDAndVersion(@PathParam(TYPE_PATH_PARAM) SclType type
99
99
@ Path ("/{" + ID_PATH_PARAM + "}" )
100
100
@ Consumes (MediaType .APPLICATION_XML )
101
101
@ Produces (MediaType .APPLICATION_XML )
102
- public UpdateResponse update (@ PathParam (TYPE_PATH_PARAM ) SclType type ,
102
+ public UpdateResponse update (@ PathParam (TYPE_PATH_PARAM ) SclFileType type ,
103
103
@ PathParam (ID_PATH_PARAM ) UUID id ,
104
104
@ Valid UpdateRequest request ) {
105
105
String who = jsonWebToken .getClaim (userInfoProperties .who ());
@@ -114,15 +114,15 @@ public UpdateResponse update(@PathParam(TYPE_PATH_PARAM) SclType type,
114
114
@ DELETE
115
115
@ Path ("/{" + ID_PATH_PARAM + "}" )
116
116
@ Produces (MediaType .APPLICATION_XML )
117
- public void deleteAll (@ PathParam (TYPE_PATH_PARAM ) SclType type ,
117
+ public void deleteAll (@ PathParam (TYPE_PATH_PARAM ) SclFileType type ,
118
118
@ PathParam (ID_PATH_PARAM ) UUID id ) {
119
119
compasSclDataService .delete (type , id );
120
120
}
121
121
122
122
@ DELETE
123
123
@ Path ("/{" + ID_PATH_PARAM + "}/{" + VERSION_PATH_PARAM + "}" )
124
124
@ Produces (MediaType .APPLICATION_XML )
125
- public void deleteVersion (@ PathParam (TYPE_PATH_PARAM ) SclType type ,
125
+ public void deleteVersion (@ PathParam (TYPE_PATH_PARAM ) SclFileType type ,
126
126
@ PathParam (ID_PATH_PARAM ) UUID id ,
127
127
@ PathParam (VERSION_PATH_PARAM ) Version version ) {
128
128
compasSclDataService .delete (type , id , version );
0 commit comments