Skip to content

Commit

Permalink
* [user] fix user create api
Browse files Browse the repository at this point in the history
  • Loading branch information
ysicing committed Sep 19, 2024
1 parent 0b3a6b1 commit a7b41aa
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 21 deletions.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ Zentao API client enabling Go programs to interact with Zentao in a simple and u

- [x] Token
- [x] 用户(User)
- [x] 获取我的个人信息(Token)
- [x] 获取用户信息
- [x] 获取我的个人信息
- [x] 删除用户
- [x] 创建用户
- [x] 修改用户信息
- [x] 获取用户列表
- [x] 获取用户信息
- [x] 项目集(Programs)
- [x] 获取项目集列表
- [x] 修改项目集
Expand Down Expand Up @@ -126,12 +126,11 @@ import "github.com/easysoft/go-zentao/v20/zentao"
> 推荐本地部署
```bash
# 部署方式: docker compose -f hack/zentao.yml up -d
地址: https://zentao20.demo.qucheng.cc
账号: demo/quickon4You
#部署方式:
docker compose -f hack/docker-compose.yml up -d
```

## TODO

- [ ] 优化代码 & 添加单元测试
- [ ] 支持内置页面接口

2 changes: 1 addition & 1 deletion example/products/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func main() {
zt, err := zentao.NewBasicAuthClient(
"admin",
"jaege1ugh4ooYip7",
zentao.WithBaseURL("https://zentao-easysoft.cloud.okteto.net"),
zentao.WithBaseURL("http://127.0.0.1"),
zentao.WithDevMode(),
zentao.WithDumpAll(),
zentao.WithoutProxy(),
Expand Down
2 changes: 1 addition & 1 deletion example/productsplans/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func main() {
zt, err := zentao.NewBasicAuthClient(
"admin",
"jaege1ugh4ooYip7",
zentao.WithBaseURL("https://zentao-easysoft.cloud.okteto.net"),
zentao.WithBaseURL("http://127.0.0.1"),
zentao.WithDevMode(),
zentao.WithDumpAll(),
zentao.WithoutProxy(),
Expand Down
2 changes: 1 addition & 1 deletion example/programs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func main() {
zt, err := zentao.NewBasicAuthClient(
"admin",
"jaege1ugh4ooYip7",
zentao.WithBaseURL("https://zentao-easysoft.cloud.okteto.net"),
zentao.WithBaseURL("http://127.0.0.1"),
zentao.WithDevMode(),
zentao.WithDumpAll(),
zentao.WithoutProxy(),
Expand Down
2 changes: 1 addition & 1 deletion example/projects/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func main() {
zt, err := zentao.NewBasicAuthClient(
"admin",
"jaege1ugh4ooYip7",
zentao.WithBaseURL("https://zentao-easysoft.cloud.okteto.net"),
zentao.WithBaseURL("http://127.0.0.1"),
zentao.WithDevMode(),
zentao.WithDumpAll(),
zentao.WithoutProxy(),
Expand Down
2 changes: 1 addition & 1 deletion example/stories/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func main() {
zt, err := zentao.NewBasicAuthClient(
"admin",
"jaege1ugh4ooYip7",
zentao.WithBaseURL("https://zentao-easysoft.cloud.okteto.net"),
zentao.WithBaseURL("http://127.0.0.1"),
zentao.WithDevMode(),
zentao.WithDumpAll(),
zentao.WithoutProxy(),
Expand Down
3 changes: 2 additions & 1 deletion example/user/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func main() {
zt, err := zentao.NewBasicAuthClient(
"admin",
"jaege1ugh4ooYip7",
zentao.WithBaseURL("http://172.77.77.12"),
zentao.WithBaseURL("http://127.0.0.1"),
zentao.WithDevMode(),
zentao.WithDumpAll(),
zentao.WithoutProxy(),
Expand All @@ -45,6 +45,7 @@ func main() {
Account: fmt.Sprintf("abc%d%d", time.Now().Minute(), time.Now().Second()), // 不超过30位且字母、数字或下划线
Password: "demo11111111x.x",
Realname: fmt.Sprintf("abc%d%d", time.Now().Minute(), time.Now().Second()),
Gender: zentao.ManGender,
})
if err != nil {
log.Fatal(err)
Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
module github.com/easysoft/go-zentao/v20

go 1.21
toolchain go1.22.5
go 1.22.0

toolchain go1.23.1

require (
github.com/davecgh/go-spew v1.1.1
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions zentao/programs.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ type ProgramsMeta struct {
type ProgramsBody struct {
ID int `json:"id"`
Project int `json:"project"`
Model string `json:"model"`
Model string `json:"model,omitempty"`
Type string `json:"type"`
Lifetime string `json:"lifetime"`
Budget string `json:"budget"`
Budgetunit string `json:"budgetUnit"`
Budget string `json:"budget"` // 预算
Budgetunit string `json:"budgetUnit"` //预算币种(CNY/USD)
Attribute string `json:"attribute"`
Percent int `json:"percent"`
Milestone string `json:"milestone"`
Expand Down
9 changes: 5 additions & 4 deletions zentao/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ type UserMeta struct {
}

type UserCreateMeta struct {
Account string `json:"account"`
Password string `json:"password"`
Realname string `json:"realname,omitempty"`
Visions string `json:"visions,omitempty"`
Account string `json:"account"`
Password string `json:"password"`
Realname string `json:"realname,omitempty"`
Visions string `json:"visions,omitempty"` // 研发综合界面 rnd, 运营管理界面 lite) 默认是rnd
Gender UserGender `json:"gender"`
}

type SelfMsg struct {
Expand Down

0 comments on commit a7b41aa

Please sign in to comment.