-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
fengdebing
committed
Apr 6, 2018
0 parents
commit e5702b6
Showing
18 changed files
with
831 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.idea/ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
const Koa = require('koa'); | ||
const app = new Koa(); | ||
const router = require('./routes/main'); | ||
// const path = require('path'); | ||
const server = require('koa-static2'); | ||
// const views = require('koa-views'); | ||
|
||
// 静态资源目录对于相对入口文件index.js的路径 | ||
const staticPath = './public'; | ||
app.use(server(staticPath)); | ||
|
||
|
||
// 加载模板引擎 | ||
// app.use(views(path.join(__dirname, './public/views'), { | ||
// extension: 'ejs' | ||
// })); | ||
|
||
|
||
app.use(router.routes()) | ||
.use(router.allowedMethods()); | ||
app.listen(3000); | ||
console.log('[demo] start-quick is starting at port 3000'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
let DB = require('./../../utils/dbUtil'); | ||
|
||
const PostController = { | ||
|
||
async getList (ctx) { | ||
// let list = DB.select('posts','*'); | ||
// ctx.body = ; | ||
ctx.body = await DB.select('posts','*') ; | ||
}, | ||
|
||
async create () { | ||
|
||
}, | ||
|
||
async update () { | ||
|
||
}, | ||
|
||
async find () { | ||
|
||
}, | ||
|
||
async del () { | ||
|
||
}, | ||
|
||
}; | ||
|
||
|
||
module.exports = PostController; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const config = { | ||
|
||
port: 3001, | ||
|
||
database: { | ||
DATABASE: 'omblog_v2', | ||
USERNAME: 'root', | ||
PASSWORD: 'root', | ||
PORT: '3306', | ||
HOST: 'localhost', | ||
prefix: 'om_' | ||
} | ||
}; | ||
|
||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[ | ||
{ | ||
"id": 1, | ||
"p_id": 0, | ||
"name": "类别名称" | ||
}, | ||
{ | ||
"id": 2, | ||
"p_id": 1, | ||
"name": "类别名称" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[ | ||
{ | ||
"id": 1, | ||
"title": "标题", | ||
"content": "内容详情", | ||
"desc": "描述", | ||
"u_id": "提交的用户", | ||
"category_id": "所属目录", | ||
"tags": [], | ||
"type": "默认是0 只有后台可见,发布后1 删除 2", | ||
"published_at": "发布时间", | ||
"created_at": "创建时间", | ||
"deleted_at": "删除时间" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[ | ||
{ | ||
"id": 1, | ||
"tag_name": "javascript", | ||
"tag_desc": "描述" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
CREATE TABLE IF NOT EXISTS `user_info` ( | ||
`id` int(11) NOT NULL AUTO_INCREMENT, # 标签ID | ||
`tag_name` varchar(255) NOT NULL, # 标签名称 | ||
`tag_desc` varchar(255) DEFAULT '', # 标签描述 | ||
PRIMARY KEY (`id`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[ | ||
{ | ||
"id": 1, | ||
"email": "email", | ||
"username": "fdb", | ||
"password": "密码", | ||
"avatar": "" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
CREATE TABLE IF NOT EXISTS `user_info` ( | ||
`id` int(11) NOT NULL AUTO_INCREMENT, # 用户ID | ||
`email` varchar(255) NOT NULL, # 邮箱地址 | ||
`password` varchar(255) NOT NULL, # 密码 | ||
`nickname` varchar(255) DEFAULT NULL, # 用户昵称 | ||
`detail_info` longtext DEFAULT NULL, # 详细信息 | ||
`created_at` int(11) DEFAULT NULL, # 创建时间 | ||
`modified_at` int(11) DEFAULT NULL, # 修改时间 | ||
PRIMARY KEY (`id`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
Oops, something went wrong.