15
15
from logger import create_log
16
16
from model import Work , Edition
17
17
from model .postgres .collection import COLLECTION_EDITIONS
18
+ from ..decorators import deprecated
18
19
19
20
logger = create_log (__name__ )
20
21
@@ -58,6 +59,7 @@ def decorator(*args, **kwargs):
58
59
59
60
60
61
@collection .route ('' , methods = ['POST' ])
62
+ @deprecated ('This endpoint is deprecated please use /collections instead.' )
61
63
@collections .route ('' , methods = ['POST' ])
62
64
@validateToken
63
65
def collectionCreate (user = None ):
@@ -141,6 +143,7 @@ def _validateAutoCollectionDef(autoDef: dict) -> str:
141
143
142
144
143
145
@collection .route ('/replace/<uuid>' , methods = ['POST' ])
146
+ @deprecated ('This endpoint is deprecated please use /collections/replace/<uuid> instead.' )
144
147
@collections .route ('/replace/<uuid>' , methods = ['POST' ])
145
148
@validateToken
146
149
def collectionReplace (uuid , user = None ):
@@ -193,6 +196,7 @@ def collectionReplace(uuid, user=None):
193
196
return APIUtils .formatOPDS2Object (201 , opdsFeed )
194
197
195
198
@collection .route ('/update/<uuid>' , methods = ['POST' ])
199
+ @deprecated ('This endpoint is deprecated please use /collections/update/<uuid> instead.' )
196
200
@collections .route ('/update/<uuid>' , methods = ['POST' ])
197
201
@validateToken
198
202
def collectionUpdate (uuid , user = None ):
@@ -263,6 +267,7 @@ def collectionUpdate(uuid, user=None):
263
267
264
268
265
269
@collection .route ('/<uuid>' , methods = ['GET' ])
270
+ @deprecated ('This endpoint is deprecated please use /collections/<uuid> instead.' )
266
271
@collections .route ('/<uuid>' , methods = ['GET' ])
267
272
def get_collection (uuid ):
268
273
logger .info (f'Getting collection with id { uuid } ' )
@@ -296,6 +301,7 @@ def get_collection(uuid):
296
301
return APIUtils .formatResponseObject (500 , response_type , { 'message' : f'Unable to get collection with id { uuid } ' })
297
302
298
303
@collection .route ('/<uuid>' , methods = ['DELETE' ])
304
+ @deprecated ('This endpoint is deprecated please use /collections/<uuid> instead.' )
299
305
@collections .route ('/<uuid>' , methods = ['DELETE' ])
300
306
@validateToken
301
307
def collectionDelete (uuid , user = None ):
@@ -317,6 +323,7 @@ def collectionDelete(uuid, user=None):
317
323
return (jsonify ({'message' : 'Deleted {}' .format (uuid )}), 200 )
318
324
319
325
@collection .route ('/delete/<uuid>' , methods = ['DELETE' ])
326
+ @deprecated ('This endpoint is deprecated please use /collections/delete/<uuid> instead.' )
320
327
@collections .route ('/delete/<uuid>' , methods = ['DELETE' ])
321
328
@validateToken
322
329
def collectionDeleteWorkEdition (uuid , user = None ):
@@ -362,6 +369,7 @@ def collectionDeleteWorkEdition(uuid, user=None):
362
369
363
370
364
371
@collection .route ('/list' , methods = ['GET' ])
372
+ @deprecated ('This endpoint is deprecated please use /collections instead.' )
365
373
@collections .route ('' , methods = ['GET' ])
366
374
def get_collections ():
367
375
logger .info ('Getting all collections' )
0 commit comments