Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
ff7d5381
Z
zentaoatf
项目概览
易企天创
/
zentaoatf
10 个月 前同步成功
通知
11
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
3
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zentaoatf
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
3
Issue
3
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
ff7d5381
编写于
9月 03, 2019
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
code refactoring for exe logic
上级
f491a807
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
45 addition
and
6 deletion
+45
-6
res/messages_en.json
res/messages_en.json
+10
-0
res/messages_zh.json
res/messages_zh.json
+10
-0
src/service/zentao/account.go
src/service/zentao/account.go
+4
-2
src/service/zentao/testcase.go
src/service/zentao/testcase.go
+11
-4
src/utils/stdin/stdin.go
src/utils/stdin/stdin.go
+10
-0
未找到文件。
res/messages_en.json
浏览文件 @
ff7d5381
...
...
@@ -21,6 +21,16 @@
"message"
:
"result"
,
"translation"
:
"result"
},
{
"id"
:
"want_to_continue"
,
"message"
:
""
,
"translation"
:
"Do you want to continue[Y/n]?"
},
{
"id"
:
"case_update_confirm"
,
"message"
:
""
,
"translation"
:
"Will update case as below:
\n
Title: %s"
},
{
"id"
:
"enter_dir"
,
"message"
:
"enter dir"
,
...
...
res/messages_zh.json
浏览文件 @
ff7d5381
...
...
@@ -21,6 +21,16 @@
"message"
:
"result"
,
"translation"
:
"结果"
},
{
"id"
:
"want_to_continue"
,
"message"
:
""
,
"translation"
:
"确认继续[Y/n]?"
},
{
"id"
:
"case_update_confirm"
,
"message"
:
""
,
"translation"
:
"以下用例信息将被更新:
\n
标题: %s"
},
{
"id"
:
"enter_dir"
,
"message"
:
"enter dir"
,
...
...
src/service/zentao/account.go
浏览文件 @
ff7d5381
...
...
@@ -25,8 +25,10 @@ func Login(baseUrl string, account string, password string) bool {
var
log
string
_
,
ok
=
client
.
PostStr
(
url
,
params
)
if
ok
{
log
=
i118Utils
.
I118Prt
.
Sprintf
(
"success_to_login"
)
logUtils
.
PrintToCmd
(
log
,
-
1
)
if
vari
.
Verbose
{
log
=
i118Utils
.
I118Prt
.
Sprintf
(
"success_to_login"
)
logUtils
.
PrintToCmd
(
log
,
-
1
)
}
}
else
{
log
=
i118Utils
.
I118Prt
.
Sprintf
(
"fail_to_login"
)
logUtils
.
PrintToCmd
(
log
,
color
.
FgRed
)
...
...
src/service/zentao/testcase.go
浏览文件 @
ff7d5381
...
...
@@ -8,6 +8,7 @@ import (
configUtils
"github.com/easysoft/zentaoatf/src/utils/config"
i118Utils
"github.com/easysoft/zentaoatf/src/utils/i118"
logUtils
"github.com/easysoft/zentaoatf/src/utils/log"
stdinUtils
"github.com/easysoft/zentaoatf/src/utils/stdin"
"github.com/easysoft/zentaoatf/src/utils/zentao"
"sort"
"strconv"
...
...
@@ -217,10 +218,16 @@ func CommitCase(caseId int, title string) {
uri
:=
fmt
.
Sprintf
(
"testcase-edit-%d.json"
,
caseId
)
requestObj
:=
map
[
string
]
interface
{}{
"title"
:
title
}
url
:=
config
.
Url
+
uri
_
,
ok
=
client
.
PostObject
(
url
,
requestObj
)
var
yes
bool
logUtils
.
PrintToStdOut
(
"
\n
"
+
i118Utils
.
I118Prt
.
Sprintf
(
"case_update_confirm"
,
title
),
-
1
)
stdinUtils
.
InputForBool
(
&
yes
,
"want_to_continue"
)
if
ok
{
logUtils
.
PrintToStdOut
(
i118Utils
.
I118Prt
.
Sprintf
(
"success_to_commit_case"
,
caseId
)
+
"
\n
"
,
-
1
)
if
yes
{
url
:=
config
.
Url
+
uri
_
,
ok
=
client
.
PostObject
(
url
,
requestObj
)
if
ok
{
logUtils
.
PrintToStdOut
(
i118Utils
.
I118Prt
.
Sprintf
(
"success_to_commit_case"
,
caseId
)
+
"
\n
"
,
-
1
)
}
}
}
src/utils/stdin/stdin.go
浏览文件 @
ff7d5381
...
...
@@ -117,6 +117,16 @@ func InputForInt(in *string, entity string) {
*
in
=
getInput
(
"
\\
d+"
,
"enter_id"
,
i118Utils
.
I118Prt
.
Sprintf
(
entity
))
}
func
InputForBool
(
in
*
bool
,
entity
string
)
{
str
:=
getInput
(
"(yes|no|y|n)"
,
i118Utils
.
I118Prt
.
Sprintf
(
entity
),
""
)
if
str
!=
"n"
&&
str
!=
"no"
{
*
in
=
true
}
else
{
*
in
=
false
}
}
func
getInput
(
regx
string
,
fmtStr
string
,
params
...
interface
{})
string
{
var
ret
string
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录