cw-egg-boilerplate-simple
Advanced tools
Comparing version 1.0.8 to 1.0.9
@@ -19,3 +19,3 @@ { | ||
"dependencies": { | ||
"cw-logger": "^1.1.4", | ||
"cw-logger2": "^2.0.1", | ||
"debug": "^3.1.0", | ||
@@ -22,0 +22,0 @@ "egg": "^2.0.0", |
@@ -0,0 +0,0 @@ 'ues strict'; |
@@ -0,0 +0,0 @@ { |
@@ -0,0 +0,0 @@ const mysql = require('promise-mysql2'); |
@@ -0,0 +0,0 @@ const mysql = require('promise-mysql2'); |
@@ -0,0 +0,0 @@ const { Controller } = require('egg'); |
@@ -0,0 +0,0 @@ const { Controller } = require('egg'); |
@@ -21,6 +21,7 @@ const { Controller } = require('egg'); | ||
}; | ||
const page = ctx.query.page || 1; | ||
const newsList = await ctx.service.news.list(page); | ||
ctx.body = [dataList, newsList]; | ||
const page = ctx.query.page || 1; | ||
await ctx.render('list.tpl', dataList); | ||
// const newsList = await ctx.service.news.list(page); | ||
// ctx.body = [dataList, newsList]; | ||
} | ||
}; |
@@ -0,0 +0,0 @@ const { Controller } = require('egg'); |
@@ -1,2 +0,2 @@ | ||
const cwlogCreator = require('cw-logger'); | ||
const Cwlogger = require('cw-logger2'); | ||
@@ -46,3 +46,3 @@ module.exports = { | ||
lconfig.bunyan.categorys = Object.keys(cs).map(k => cs[k]); | ||
const log = cwlogCreator(lconfig); | ||
const log = new Cwlogger(lconfig); | ||
this.cwLog = log; | ||
@@ -52,3 +52,3 @@ | ||
const name = `${c.name}Logger`; | ||
this[name] = log[c.name]; | ||
this[name] = log.getLogger(c.name); | ||
}); | ||
@@ -72,2 +72,2 @@ | ||
} | ||
}; | ||
}; |
@@ -1,2 +0,2 @@ | ||
const cwlogCreator = require('cw-logger'); | ||
const Cwlogger = require('cw-logger2'); | ||
@@ -49,3 +49,3 @@ const CACHE = Symbol('Application#cache'); | ||
lconfig.bunyan.categorys = Object.keys(cs).map(k => cs[k]); | ||
const log = cwlogCreator(lconfig); | ||
const log = new Cwlogger(lconfig); | ||
this.cwLog = log; | ||
@@ -55,3 +55,3 @@ | ||
const name = `${c.name}Logger`; | ||
this[name] = log[c.name]; | ||
this[name] = log.getLogger(c.name); | ||
}); | ||
@@ -75,2 +75,2 @@ | ||
} | ||
}; | ||
}; |
module.exports = { | ||
prod(k, v) {} | ||
}; |
module.exports = { | ||
mockXX(k, v) {} | ||
}; |
@@ -0,0 +0,0 @@ const _ = require('lodash'); |
@@ -0,0 +0,0 @@ module.exports = { |
@@ -0,0 +0,0 @@ module.exports = { |
@@ -8,2 +8,3 @@ module.exports = (options, app) => async function apiResponse(ctx, next) { | ||
if (ctx.response.status === 404 && ctx.body === undefined) { | ||
// ctx.response.status = 404; // 手动设置 | ||
ctx.body = ctx.buildReturnObject( | ||
@@ -10,0 +11,0 @@ apiCode.retCodeEnum.success, |
const compress = require('koa-compress'); | ||
module.exports = compress; |
@@ -0,0 +0,0 @@ module.exports = (options, app) => async function errorHandler(ctx, next) { |
@@ -0,0 +0,0 @@ const isJSON = require('koa-is-json'); |
@@ -7,3 +7,3 @@ module.exports = (options, app) => async function report(ctx, next) { | ||
// 上报请求时间 | ||
ctx.cwLogger.info(`${ctx.url} <<== end request, ${Date.now() - startTime}ms`); | ||
ctx.cwLogger.info(`${ctx.url} <<== ${ctx.status} end request, ${Date.now() - startTime}ms`); | ||
}; |
@@ -0,0 +0,0 @@ module.exports = (options, app) => async function robot(ctx, next) { |
@@ -0,0 +0,0 @@ module.exports = (options, app) => async function validate(ctx, next) { |
@@ -0,0 +0,0 @@ module.exports = (app) => { |
@@ -0,0 +0,0 @@ const debug = require('debug')('update_cache'); |
@@ -0,0 +0,0 @@ const { Service } = require('egg'); |
@@ -0,0 +0,0 @@ const { Service } = require('egg'); |
@@ -0,0 +0,0 @@ const { Service } = require('egg'); |
@@ -0,0 +0,0 @@ const path = require('path'); |
@@ -0,0 +0,0 @@ module.exports = app => ({ |
@@ -0,0 +0,0 @@ module.exports = app => ({ |
@@ -0,0 +0,0 @@ module.exports = app => ({ |
@@ -0,0 +0,0 @@ module.exports = app => ({ |
@@ -0,0 +0,0 @@ module.exports = app => ({ |
{ | ||
"Email": "email" | ||
} |
{ | ||
"Email": "邮箱" | ||
} |
{ | ||
"Email": "郵箱" | ||
} |
@@ -0,0 +0,0 @@ const path = require('path'); |
@@ -0,0 +0,0 @@ const retCodeEnum = { |
@@ -0,0 +0,0 @@ module.exports = { |
@@ -0,0 +0,0 @@ { |
@@ -0,0 +0,0 @@ ## cw egg-sample |
@@ -0,0 +0,0 @@ const { |
@@ -0,0 +0,0 @@ const { |
@@ -0,0 +0,0 @@ const assert = require('assert'); |
@@ -0,0 +0,0 @@ // const assert = require('assert'); |
@@ -0,0 +0,0 @@ const { |
{ | ||
"name": "cw-egg-boilerplate-simple", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"description": "boilerplate for cw egg quickstart", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
64
10313
367731