提交 056c859f 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

update for service message

上级 fe3a4548
......@@ -103,11 +103,11 @@
},
{
"id": "server_request",
"translation": "\nGot %s request %s."
"translation": "\nGot %s request %s. "
},
{
"id": "server_response",
"translation": "\nCreate %d records in %d sec."
"translation": "Create %d records in %d sec."
},
{
"id": "excel_data",
......
......@@ -94,11 +94,11 @@
},
{
"id": "server_request",
"translation": "\n收到%s请求 %s."
"translation": "\n收到%s请求 %s"
},
{
"id": "server_response",
"translation": "生成%d条记录,耗时%d秒"
"translation": "生成%d条记录,耗时%d秒"
},
{
"id": "excel_data",
......
......@@ -120,7 +120,7 @@ fields:
- field: field_use_excel # 从excel数据源里面取数据。
from: system.address.v1.china # 从data/system/address/v1.xlsx文件中读取名为china的工作簿。
select: city # 查询city字段。
where: state like '%山东%' # 条件是省份包含山东。
where: state like '%山东%' # 条件是省份包含山东。
postfix: "\t"
- field: field_with_children # 嵌套字段
......
......@@ -46,7 +46,7 @@ func Generate(defaultFile string, configFile string, total int, fieldsToExportSt
entTime := time.Now().Unix()
if vari.RunMode == constant.RunModeServerRequest {
logUtils.PrintToWithColor(i118Utils.I118Prt.Sprintf("server_response", len(rows), entTime - startTime), color.FgCyan)
logUtils.PrintTo(i118Utils.I118Prt.Sprintf("server_response", len(rows), entTime - startTime))
}
}
......
......@@ -55,6 +55,10 @@ func PrintTo(str string) {
output := color.Output
fmt.Fprint(output, str+"\n")
}
func PrintToWithoutNewLine(str string) {
output := color.Output
fmt.Fprint(output, str)
}
func PrintToWithColor(msg string, attr color.Attribute) {
output := color.Output
......
......@@ -242,7 +242,7 @@ func DataHandler(writer http.ResponseWriter, req *http.Request) {
fmt.Fprintln(writer, vari.JsonResp)
} else if defaultFile != "" || configFile != "" {
vari.RunMode = constant.RunModeServerRequest
logUtils.PrintTo(i118Utils.I118Prt.Sprintf("server_request", req.Method, req.URL))
logUtils.PrintToWithoutNewLine(i118Utils.I118Prt.Sprintf("server_request", req.Method, req.URL))
toGen()
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册