44 "context"
55 "fmt"
66 "github.com/glennliao/apijson-go"
7- "github.com/glennliao/apijson-go/action"
87 "github.com/glennliao/apijson-go/model"
98 "github.com/gogf/gf/v2/container/gmap"
109 "github.com/gogf/gf/v2/errors/gerror"
@@ -55,9 +54,6 @@ func (gf *GF) Bind(group *ghttp.RouterGroup, mode ...Mode) {
5554
5655func (gf * GF ) Get (ctx context.Context , req model.Map ) (res model.Map , err error ) {
5756 q := gf .apijson .NewQuery (ctx , req )
58- q .NoAccessVerify = gf .apijson .Config ().Access .NoVerify
59- q .AccessCondition = gf .apijson .Config ().Access .ConditionFunc
60- q .Config = gf .apijson .Config ()
6157 return q .Result ()
6258}
6359
@@ -66,29 +62,17 @@ func (gf *GF) Head(ctx context.Context, req model.Map) (res model.Map, err error
6662}
6763
6864func (gf * GF ) Post (ctx context.Context , req model.Map ) (res model.Map , err error ) {
69- act := action .New (ctx , http .MethodPost , req , gf .apijson .Config ().RequestConfig )
70- act .NoAccessVerify = gf .apijson .Config ().Access .NoVerify
71- act .DbFieldStyle = gf .apijson .Config ().DbFieldStyle
72- act .JsonFieldStyle = gf .apijson .Config ().JsonFieldStyle
73- act .Functions = gf .apijson .Config ().Functions
65+ act := gf .apijson .NewAction (ctx , http .MethodPost , req )
7466 return act .Result ()
7567}
7668
7769func (gf * GF ) Put (ctx context.Context , req model.Map ) (res model.Map , err error ) {
78- act := action .New (ctx , http .MethodPut , req , gf .apijson .Config ().RequestConfig )
79- act .NoAccessVerify = gf .apijson .Config ().Access .NoVerify
80- act .DbFieldStyle = gf .apijson .Config ().DbFieldStyle
81- act .JsonFieldStyle = gf .apijson .Config ().JsonFieldStyle
82- act .Functions = gf .apijson .Config ().Functions
70+ act := gf .apijson .NewAction (ctx , http .MethodPut , req )
8371 return act .Result ()
8472}
8573
8674func (gf * GF ) Delete (ctx context.Context , req model.Map ) (res model.Map , err error ) {
87- act := action .New (ctx , http .MethodDelete , req , gf .apijson .Config ().RequestConfig )
88- act .NoAccessVerify = gf .apijson .Config ().Access .NoVerify
89- act .DbFieldStyle = gf .apijson .Config ().DbFieldStyle
90- act .JsonFieldStyle = gf .apijson .Config ().JsonFieldStyle
91- act .Functions = gf .apijson .Config ().Functions
75+ act := gf .apijson .NewAction (ctx , http .MethodDelete , req )
9276 return act .Result ()
9377}
9478
0 commit comments