Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0b96d1c

Browse files
authored
Merge pull requestglennliao#18 from glennliao/dev
## 0.2.0-beta2
2 parentsc11c6b3 +e8d753e commit0b96d1c

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

‎drivers/framework_goframe/gf.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ func (gf *GF) Bind(group *ghttp.RouterGroup, mode ...Mode) {
4545
iflen(mode)==0 {
4646
mode= []Mode{InDataMode}
4747
}
48-
group.POST("/get",gf.commonResponse(gf.Get,mode[0]))
49-
group.POST("/post",gf.commonResponse(gf.Post,mode[0]))
50-
group.POST("/head",gf.commonResponse(gf.Head,mode[0]))
51-
group.POST("/put",gf.commonResponse(gf.Put,mode[0]))
52-
group.POST("/delete",gf.commonResponse(gf.Delete,mode[0]))
48+
group.POST("/get",gf.CommonResponse(gf.Get,mode[0]))
49+
group.POST("/post",gf.CommonResponse(gf.Post,mode[0]))
50+
group.POST("/head",gf.CommonResponse(gf.Head,mode[0]))
51+
group.POST("/put",gf.CommonResponse(gf.Put,mode[0]))
52+
group.POST("/delete",gf.CommonResponse(gf.Delete,mode[0]))
5353
}
5454

5555
func (gf*GF)Get(ctx context.Context,req model.Map) (res model.Map,errerror) {
@@ -76,7 +76,7 @@ func (gf *GF) Delete(ctx context.Context, req model.Map) (res model.Map, err err
7676
returnact.Result()
7777
}
7878

79-
func (gf*GF)commonResponse(handlerfunc(ctx context.Context,req model.Map) (res model.Map,errerror),modeMode)func(req*ghttp.Request) {
79+
func (gf*GF)CommonResponse(handlerfunc(ctx context.Context,req model.Map) (res model.Map,errerror),modeMode)func(req*ghttp.Request) {
8080
returnfunc(req*ghttp.Request) {
8181
metaRes:=&gmap.ListMap{}
8282
code:=200

‎query/node_query.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func (q *queryNode) parse() {
9494
return
9595
}
9696

97-
n.primaryTableKey=n.Key
97+
n.primaryTableKey=filepath.Base(n.Path)
9898

9999
iflen(refKeyMap)>0 {// 需要引用别处
100100
n.refKeyMap=make(map[string]NodeRef)

‎query/node_struct.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"github.com/glennliao/apijson-go/consts"
55
"github.com/glennliao/apijson-go/model"
66
"github.com/gogf/gf/v2/errors/gerror"
7+
"path/filepath"
78
"strings"
89
)
910

@@ -18,6 +19,10 @@ func newStructNode(n *Node) *structNode {
1819
func (h*structNode)parse() {
1920
n:=h.node
2021

22+
for_,childNode:=rangen.children {
23+
childNode.parse()
24+
}
25+
2126
ifn.isList {// []节点
2227

2328
hasPrimary:=false// 是否存在主查询表
@@ -35,7 +40,7 @@ func (h *structNode) parse() {
3540
}
3641

3742
hasPrimary=true
38-
n.primaryTableKey=child.Key
43+
n.primaryTableKey=filepath.Base(child.Key)
3944
child.page=n.page
4045

4146
}
@@ -46,9 +51,6 @@ func (h *structNode) parse() {
4651
}
4752
}
4853

49-
for_,childNode:=rangen.children {
50-
childNode.parse()
51-
}
5254
}
5355

5456
func (h*structNode)fetch() {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp