router.js
999 Bytes
/**
* 文章router
* @author: leo <qi.li@yoho.cn>
* @date: 23/06/2017
*/
const express = require('express');
const router = express.Router(); // eslint-disable-line
const auth = require('../../doraemon/middleware/auth');
const article = require('./controllers/article');
const y100 = require('./controllers/y100');
router.post('/like', article.like);
router.get('/list', article.list);
router.get('/y100list', y100.y100List);
router.get('/y100randomlist', y100.y100RandomList);
router.get('/y100detail', y100.y100Detail);
router.get('/listNoImg', article.listNoImg);
router.get('/listNoUser', article.listNoUser);
router.post('/publish', auth, article.publish);
router.post('/saveScore', article.publishWithNoImg);
router.get('/listScore', article.listWithUser);
router.get('/querySingle', article.querySingle);
router.get('/queryByCodeName', article.queryByCodeName);
router.get('/queryById', article.queryById);
router.get('/queryByUserId', article.queryByUserId);
module.exports = router;