Skip to content

Commit

Permalink
Merge pull request #7 from suyuan32/dev
Browse files Browse the repository at this point in the history
chore: regen by tools v1.5.9
  • Loading branch information
suyuan32 authored Jun 16, 2023
2 parents f84a3f7 + 28d6725 commit 7aaab39
Show file tree
Hide file tree
Showing 18 changed files with 920 additions and 630 deletions.
22 changes: 11 additions & 11 deletions desc/task.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ syntax = "proto3";
// Task message

message TaskInfo {
uint64 id = 1;
int64 created_at = 2;
int64 updated_at = 3;
uint32 status = 4;
string name = 5;
string task_group = 6;
string cron_expression = 7;
string pattern = 8;
string payload = 9;
optional uint64 id = 1;
optional int64 created_at = 2;
optional int64 updated_at = 3;
optional uint32 status = 4;
optional string name = 5;
optional string task_group = 6;
optional string cron_expression = 7;
optional string pattern = 8;
optional string payload = 9;
}

message TaskListResp {
Expand All @@ -22,8 +22,8 @@ message TaskListResp {
message TaskListReq {
uint64 page = 1;
uint64 page_size = 2;
string name = 3;
string task_group = 4;
optional string name = 3;
optional string task_group = 4;
}


Expand Down
14 changes: 8 additions & 6 deletions desc/tasklog.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ syntax = "proto3";
// TaskLog message

message TaskLogInfo {
uint64 id = 1;
int64 started_at = 4;
int64 finished_at = 5;
uint32 result = 6;
optional uint64 id = 1;
optional int64 created_at = 2;
optional int64 updated_at = 3;
optional int64 started_at = 4;
optional int64 finished_at = 5;
optional uint32 result = 6;
}

message TaskLogListResp {
Expand All @@ -17,8 +19,8 @@ message TaskLogListResp {
message TaskLogListReq {
uint64 page = 1;
uint64 page_size = 2;
uint64 task_id = 3;
uint32 result = 4;
optional uint64 task_id = 3;
optional uint32 result = 4;
}


Expand Down
221 changes: 221 additions & 0 deletions ent/set_not_nil.go

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

28 changes: 0 additions & 28 deletions ent/template/not_empty_update.tmpl

This file was deleted.

26 changes: 26 additions & 0 deletions ent/template/set_not_nil.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{{/* gotype: entgo.io/ent/entc/gen.Graph */}}


{{ define "set_not_nil" }}

{{/* Add the base header for the generated file */}}
{{ $pkg := base $.Config.Package }}
{{ template "header" $ }}

{{/* Loop over all updaters and implement the "SetNotNil" method for all optional fields */}}
{{ range $n := $.Nodes }}
{{ range $f := $n.MutableFields }}
{{ $set := print "Set" $f.StructField }}

{{ range $updater := list $n.UpdateName $n.UpdateOneName $n.CreateName}}
// set field if value's pointer is not nil.
func ({{ $n.Receiver }} *{{ $updater }}) SetNotNil{{ $f.StructField }}(value *{{ $f.Type }}) *{{ $updater }} {
if value != nil {
return {{ $n.Receiver }}.{{ $set }}(*value)
}
return {{ $n.Receiver }}
}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
18 changes: 9 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ module github.com/suyuan32/simple-admin-job

go 1.20

replace github.com/zeromicro/go-zero v1.5.2 => github.com/suyuan32/simple-admin-tools v1.5.8
replace github.com/zeromicro/go-zero v1.5.3 => github.com/suyuan32/simple-admin-tools v1.5.9

require (
entgo.io/ent v0.12.3
github.com/hibiken/asynq v0.24.1
github.com/pkg/errors v0.9.1
github.com/suyuan32/simple-admin-common v1.0.7
github.com/zeromicro/go-zero v1.5.2
github.com/suyuan32/simple-admin-common v1.0.8
github.com/zeromicro/go-zero v1.5.3
google.golang.org/grpc v1.55.0
google.golang.org/protobuf v1.30.0
)
Expand Down Expand Up @@ -54,7 +54,7 @@ require (
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.18 // indirect
github.com/mattn/go-sqlite3 v1.14.16 // indirect
github.com/mattn/go-sqlite3 v1.14.17 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect
Expand All @@ -63,7 +63,7 @@ require (
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/nicksnyder/go-i18n/v2 v2.2.1 // indirect
github.com/openzipkin/zipkin-go v0.4.1 // indirect
github.com/pelletier/go-toml/v2 v2.0.7 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/prometheus/client_golang v1.15.1 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
Expand Down Expand Up @@ -105,11 +105,11 @@ require (
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/api v0.26.3 // indirect
k8s.io/apimachinery v0.28.0-alpha.0 // indirect
k8s.io/apimachinery v0.28.0-alpha.1 // indirect
k8s.io/client-go v0.26.3 // indirect
k8s.io/klog/v2 v2.90.1 // indirect
k8s.io/kube-openapi v0.0.0-20230327201221-f5883ff37f0c // indirect
k8s.io/utils v0.0.0-20230313181309-38a27ef9d749 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230524182850-78281498afbb // indirect
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
Expand Down
Loading

0 comments on commit 7aaab39

Please sign in to comment.