CoreID/app/routing/routers/api/v1/system.routes.js

35 lines
962 B
JavaScript
Raw Permalink Normal View History

2020-08-13 02:27:51 +00:00
const system_routes = {
prefix: '/api/v1/system',
middleware: [
'auth:APIRoute'
],
get: {
'/announcements': [
['middleware::api:Permission', { check: 'v1:system:announcements:list' }],
'controller::api:v1:System.get_announcements',
],
'/announcements/:id': [
['middleware::api:Permission', { check: 'v1:system:announcements:get' }],
'controller::api:v1:System.get_announcement',
],
},
post: {
'/announcements': [
['middleware::api:Permission', { check: 'v1:system:announcements:create'}],
'controller::api:v1:System.create_announcement',
],
},
delete: {
'/announcements/:id': [
['middleware::api:Permission', { check: 'v1:system:announcements:delete' }],
'controller::api:v1:System.delete_announcement',
],
},
}
module.exports = exports = system_routes