File tree Expand file tree Collapse file tree 7 files changed +13
-19
lines changed
Expand file tree Collapse file tree 7 files changed +13
-19
lines changed Original file line number Diff line number Diff line change 11package dics
22
33import (
4+ "github.com/crowdeco/skeleton/dics/modules"
45 "github.com/sarulabs/dingo/v4"
56)
67
@@ -21,5 +22,9 @@ func (p *Provider) Load() error {
2122 return err
2223 }
2324
25+ if err := p .AddDefSlice (modules .Todo ); err != nil {
26+ return err
27+ }
28+
2429 return nil
2530}
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ require (
99 github.com/fatih/color v1.10.0
1010 github.com/gadelkareem/cachita v0.2.1
1111 github.com/gertd/go-pluralize v0.1.7
12+ github.com/go-ozzo/ozzo-validation/v4 v4.3.0
1213 github.com/golang/protobuf v1.4.3
1314 github.com/google/go-cmp v0.5.4 // indirect
1415 github.com/google/uuid v1.1.5
Original file line number Diff line number Diff line change @@ -41,6 +41,8 @@ github.com/ThreeDotsLabs/watermill-amqp v1.1.0/go.mod h1:Qbu3JDlr6vIOxHJjhfsSHsr
4141github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc /go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc =
4242github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf /go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0 =
4343github.com/antihax/optional v1.0.0 /go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY =
44+ github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496 h1:zV3ejI06GQ59hwDQAvmK1qxOQGB3WuVTRoY0okPTAv0 =
45+ github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496 /go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg =
4446github.com/aws/aws-sdk-go v1.35.20 /go.mod h1:tlPOdRjfxPBpNIwqDj61rmsnA85v9jc0Ps9+muhnW+k =
4547github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 /go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q =
4648github.com/beorn7/perks v1.0.0 /go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8 =
@@ -88,6 +90,8 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2
8890github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4 /go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8 =
8991github.com/go-kit/kit v0.8.0 /go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as =
9092github.com/go-logfmt/logfmt v0.3.0 /go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE =
93+ github.com/go-ozzo/ozzo-validation/v4 v4.3.0 h1:byhDUpfEwjsVQb1vBunvIjh2BHQ9ead57VkAEY4V+Es =
94+ github.com/go-ozzo/ozzo-validation/v4 v4.3.0 /go.mod h1:2NKgrcHl3z6cJs+3Oo940FPRiTzuqKbvfrL2RxCj6Ew =
9195github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs =
9296github.com/go-sql-driver/mysql v1.5.0 /go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg =
9397github.com/go-stack/stack v1.8.0 /go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY =
Original file line number Diff line number Diff line change @@ -18,8 +18,7 @@ func (d *Elasticsearch) Handle(event interface{}) {
1818 e := event .(* events.ModelEvent )
1919
2020 m := e .Data .(configs.Model )
21- query := elastic .NewBoolQuery ()
22- query .Must (elastic .NewTermQuery ("Id" , e .Id ))
21+ query := elastic .NewMatchQuery ("ID" , e .Id )
2322 result , _ := d .Elasticsearch .Search ().Index (m .TableName ()).Query (query ).Do (d .Context )
2423 for _ , hit := range result .Hits .Hits {
2524 d .Elasticsearch .Delete ().Index (m .TableName ()).Id (hit .Id ).Do (d .Context )
Original file line number Diff line number Diff line change @@ -19,8 +19,7 @@ func (u *Elasticsearch) Handle(event interface{}) {
1919 e := event .(* events.ModelEvent )
2020
2121 m := e .Data .(configs.Model )
22- query := elastic .NewBoolQuery ()
23- query .Must (elastic .NewTermQuery ("Id" , e .Id ))
22+ query := elastic .NewMatchQuery ("ID" , e .Id )
2423 result , _ := u .Elasticsearch .Search ().Index (m .TableName ()).Query (query ).Do (u .Context )
2524 for _ , hit := range result .Hits .Hits {
2625 u .Elasticsearch .Delete ().Index (m .TableName ()).Id (hit .Id ).Do (u .Context )
Original file line number Diff line number Diff line change 11modules :
2+ - module:todo
Original file line number Diff line number Diff line change 133133 "in" : " query" ,
134134 "required" : false ,
135135 "type" : " string"
136- },
137- {
138- "name" : " title" ,
139- "in" : " query" ,
140- "required" : false ,
141- "type" : " string"
142136 }
143137 ],
144138 "tags" : [
173167 "in" : " query" ,
174168 "required" : false ,
175169 "type" : " string"
176- },
177- {
178- "name" : " title" ,
179- "in" : " query" ,
180- "required" : false ,
181- "type" : " string"
182170 }
183171 ],
184172 "tags" : [
297285 },
298286 "name" : {
299287 "type" : " string"
300- },
301- "title" : {
302- "type" : " string"
303288 }
304289 }
305290 },
You can’t perform that action at this time.
0 commit comments