2020-05-04 01:16:54 +00:00
|
|
|
const profile_routes = {
|
|
|
|
prefix: '/api/v1/profile',
|
|
|
|
|
|
|
|
middleware: [
|
2020-05-17 04:55:08 +00:00
|
|
|
'auth:APIRoute',
|
2020-05-04 01:16:54 +00:00
|
|
|
],
|
|
|
|
|
|
|
|
get: {
|
|
|
|
'/:user_id': [ // user_id | 'me'
|
2020-05-17 04:55:08 +00:00
|
|
|
['middleware::api:Permission', { check: 'v1:profile:get' }],
|
2020-05-04 01:16:54 +00:00
|
|
|
'controller::api:v1:Profile.fetch',
|
|
|
|
],
|
2020-09-02 13:27:09 +00:00
|
|
|
'/:user_id/notify': [ // user_id | 'me'
|
|
|
|
['middleware::api:Permission', { check: 'v1:profile:get' }],
|
|
|
|
'controller::api:v1:Profile.fetch_notify',
|
|
|
|
],
|
2020-05-19 03:55:08 +00:00
|
|
|
'/:user_id/photo': [
|
|
|
|
['middleware::api:Permission', { check: 'v1:profile:photo:get' }],
|
|
|
|
'controller::api:v1:Profile.get_photo',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
|
|
|
post: {
|
|
|
|
'/:user_id/photo': [
|
|
|
|
['middleware::api:Permission', { check: 'v1:profile:photo:update' }],
|
|
|
|
['middleware::upload:UploadFile', { tag: 'v1:profile:photo' }],
|
|
|
|
'controller::api:v1:Profile.update_photo',
|
|
|
|
],
|
2020-09-02 13:27:09 +00:00
|
|
|
'/:user_id/notify/test': [ // user_id | 'me'
|
|
|
|
['middleware::api:Permission', { check: 'v1:profile:get' }],
|
|
|
|
'controller::api:v1:Profile.test_notify',
|
|
|
|
],
|
2020-05-04 01:16:54 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
patch: {
|
|
|
|
'/:user_id': [ // user_id | 'me'
|
2020-05-17 04:55:08 +00:00
|
|
|
['middleware::api:Permission', { check: 'v1:profile:update' }],
|
2020-05-04 01:16:54 +00:00
|
|
|
'controller::api:v1:Profile.update',
|
|
|
|
],
|
2020-09-02 13:27:09 +00:00
|
|
|
'/:user_id/notify': [ // user_id | 'me'
|
|
|
|
['middleware::api:Permission', { check: 'v1:profile:update' }],
|
|
|
|
'controller::api:v1:Profile.update_notify',
|
|
|
|
],
|
2020-05-04 01:16:54 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = exports = profile_routes
|