Skip to content

Commit

Permalink
fix: use optional fields in department
Browse files Browse the repository at this point in the history
  • Loading branch information
suyuan32 committed May 12, 2024
1 parent ec014ea commit 65b9e33
Show file tree
Hide file tree
Showing 8 changed files with 174 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ PROJECT_I18N=true

# Swagger type, support yml,json | Swagger 文件类型,支持yml,json
SWAGGER_TYPE=json
`

# Ent enabled features | Ent 启用的官方特性
ENT_FEATURE=sql/execquery,intercept,sql/modifier

Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0m
github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo=
github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk=
github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8=
Expand Down
30 changes: 30 additions & 0 deletions rpc/ent/department/where.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 24 additions & 9 deletions rpc/ent/department_create.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 54 additions & 0 deletions rpc/ent/department_update.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions rpc/ent/migrate/schema.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

57 changes: 57 additions & 0 deletions rpc/ent/mutation.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions rpc/ent/schema/department.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ func (Department) Fields() []ent.Field {
Comment("Parents' IDs | 父级列表").
Annotations(entsql.WithComments(true)),
field.String("leader").
Comment("Department leader | 部门负责人").
Comment("Department leader | 部门负责人").Optional().
Annotations(entsql.WithComments(true)),
field.String("phone").
Comment("Leader's phone number | 负责人电话").
Comment("Leader's phone number | 负责人电话").Optional().
Annotations(entsql.WithComments(true)),
field.String("email").
Comment("Leader's email | 部门负责人电子邮箱").
Comment("Leader's email | 部门负责人电子邮箱").Optional().
Annotations(entsql.WithComments(true)),
field.String("remark").Optional().
Comment("Remark | 备注").
Expand Down

0 comments on commit 65b9e33

Please sign in to comment.