Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zendata
提交
a346fe3e
Z
zendata
项目概览
易企天创
/
zendata
9 个月 前同步成功
通知
17
Star
2
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zendata
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
a346fe3e
编写于
8月 11, 2020
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix issue#3345
上级
5a4d8efe
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
15 addition
and
10 deletion
+15
-10
src/action/generator.go
src/action/generator.go
+9
-2
src/service/request.go
src/service/request.go
+1
-3
src/utils/vari/var.go
src/utils/vari/var.go
+1
-1
src/zd.go
src/zd.go
+4
-4
未找到文件。
src/action/generator.go
浏览文件 @
a346fe3e
...
@@ -76,7 +76,14 @@ func Print(rows [][]string, format string, table string, colIsNumArr []bool, fie
...
@@ -76,7 +76,14 @@ func Print(rows [][]string, format string, table string, colIsNumArr []bool, fie
col
=
stringUtils
.
AddPad
(
col
,
field
)
col
=
stringUtils
.
AddPad
(
col
,
field
)
}
}
lineForText
=
lineForText
+
col
if
j
>
0
&&
vari
.
Human
{
lineForText
=
strings
.
TrimRight
(
lineForText
,
"
\t
"
)
col
=
strings
.
TrimLeft
(
col
,
"
\t
"
)
lineForText
=
lineForText
+
"
\t
"
+
col
}
else
{
lineForText
=
lineForText
+
col
}
row
=
append
(
row
,
col
)
row
=
append
(
row
,
col
)
rowXml
.
Cols
=
append
(
rowXml
.
Cols
,
col
)
rowXml
.
Cols
=
append
(
rowXml
.
Cols
,
col
)
...
@@ -106,7 +113,7 @@ func printTextHeader(fields []string) {
...
@@ -106,7 +113,7 @@ func printTextHeader(fields []string) {
for
idx
,
field
:=
range
fields
{
for
idx
,
field
:=
range
fields
{
headerLine
+=
field
headerLine
+=
field
if
idx
<
len
(
fields
)
-
1
{
if
idx
<
len
(
fields
)
-
1
{
headerLine
+=
vari
.
HeadSep
headerLine
+=
"
\t
"
}
}
}
}
...
...
src/service/request.go
浏览文件 @
a346fe3e
...
@@ -10,7 +10,7 @@ import (
...
@@ -10,7 +10,7 @@ import (
)
)
func
ParseRequestParams
(
req
*
http
.
Request
)
(
defaultFile
,
yamlFile
,
fields
string
,
count
int
,
func
ParseRequestParams
(
req
*
http
.
Request
)
(
defaultFile
,
yamlFile
,
fields
string
,
count
int
,
human
string
,
format
,
table
string
,
decode
bool
,
input
,
output
string
)
{
format
,
table
string
,
decode
bool
,
input
,
output
string
)
{
query
:=
req
.
URL
.
Query
()
query
:=
req
.
URL
.
Query
()
defaultFile
=
GetRequestParams
(
query
,
"default"
,
"d"
)
defaultFile
=
GetRequestParams
(
query
,
"default"
,
"d"
)
...
@@ -25,8 +25,6 @@ func ParseRequestParams(req *http.Request) (defaultFile, yamlFile, fields string
...
@@ -25,8 +25,6 @@ func ParseRequestParams(req *http.Request) (defaultFile, yamlFile, fields string
format
=
constant
.
FormatJson
format
=
constant
.
FormatJson
table
=
""
table
=
""
human
=
GetRequestParams
(
query
,
"human"
,
"H"
)
if
req
.
Method
==
http
.
MethodPost
{
if
req
.
Method
==
http
.
MethodPost
{
// save to files
// save to files
req
.
ParseForm
()
req
.
ParseForm
()
...
...
src/utils/vari/var.go
浏览文件 @
a346fe3e
...
@@ -22,7 +22,7 @@ var (
...
@@ -22,7 +22,7 @@ var (
Total
int
Total
int
WithHead
bool
WithHead
bool
H
eadSep
string
H
uman
bool
Trim
bool
Trim
bool
Recursive
bool
Recursive
bool
...
...
src/zd.go
浏览文件 @
a346fe3e
...
@@ -90,8 +90,8 @@ func main() {
...
@@ -90,8 +90,8 @@ func main() {
flagSet
.
StringVar
(
&
md5
,
"md5"
,
""
,
""
)
flagSet
.
StringVar
(
&
md5
,
"md5"
,
""
,
""
)
flagSet
.
StringVar
(
&
vari
.
HeadSep
,
"H"
,
""
,
""
)
flagSet
.
BoolVar
(
&
vari
.
Human
,
"H"
,
false
,
""
)
flagSet
.
StringVar
(
&
vari
.
HeadSep
,
"human"
,
""
,
""
)
flagSet
.
BoolVar
(
&
vari
.
Human
,
"human"
,
false
,
""
)
flagSet
.
BoolVar
(
&
decode
,
"D"
,
false
,
""
)
flagSet
.
BoolVar
(
&
decode
,
"D"
,
false
,
""
)
flagSet
.
BoolVar
(
&
decode
,
"decode"
,
false
,
""
)
flagSet
.
BoolVar
(
&
decode
,
"decode"
,
false
,
""
)
...
@@ -183,7 +183,7 @@ func toGen() {
...
@@ -183,7 +183,7 @@ func toGen() {
}
else
if
vari
.
RunMode
==
constant
.
RunModeParse
{
}
else
if
vari
.
RunMode
==
constant
.
RunModeParse
{
action
.
ParseSql
(
input
,
output
)
action
.
ParseSql
(
input
,
output
)
}
else
if
vari
.
RunMode
==
constant
.
RunModeGen
{
}
else
if
vari
.
RunMode
==
constant
.
RunModeGen
{
if
vari
.
H
eadSep
!=
""
{
if
vari
.
H
uman
{
vari
.
WithHead
=
true
vari
.
WithHead
=
true
}
}
...
@@ -230,7 +230,7 @@ func StartServer() {
...
@@ -230,7 +230,7 @@ func StartServer() {
func
DataHandler
(
writer
http
.
ResponseWriter
,
req
*
http
.
Request
)
{
func
DataHandler
(
writer
http
.
ResponseWriter
,
req
*
http
.
Request
)
{
action
.
HttpWriter
=
writer
action
.
HttpWriter
=
writer
defaultFile
,
configFile
,
fields
,
count
,
vari
.
HeadSep
,
defaultFile
,
configFile
,
fields
,
count
,
format
,
table
,
decode
,
input
,
output
=
service
.
ParseRequestParams
(
req
)
format
,
table
,
decode
,
input
,
output
=
service
.
ParseRequestParams
(
req
)
if
decode
{
if
decode
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录