Skip to content

Commit c293849

Browse files
committed
chore: wip
1 parent 01058f1 commit c293849

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

context.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,11 @@ func (p *Context) getTemplate(ctx *Context) (interface{}, error) {
637637
Bootstrap() interface{}
638638
}).Bootstrap()
639639

640+
// 初始化路由
641+
provider.(interface {
642+
LoadInitRoute() interface{}
643+
}).LoadInitRoute()
644+
640645
// 模版参数初始化
641646
provider.(interface {
642647
LoadInitData(ctx *Context) interface{}
@@ -647,11 +652,6 @@ func (p *Context) getTemplate(ctx *Context) (interface{}, error) {
647652
Init(ctx *Context) interface{}
648653
}).Init(ctx)
649654

650-
// 初始化路由
651-
provider.(interface {
652-
LoadInitRoute() interface{}
653-
}).LoadInitRoute()
654-
655655
// 加载自定义路由
656656
provider.(interface {
657657
Route() interface{}

template/admin/resource/actions/action.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,18 +93,18 @@ type Action struct {
9393
ShowOnDetailExtra bool `json:"showOnDetailExtra"` // 在详情页扩展栏展示
9494
}
9595

96-
// 初始化
97-
func (p *Action) Init(ctx *quark.Context) interface{} {
98-
return p
99-
}
100-
10196
// 初始化模板
10297
func (p *Action) LoadInitData(ctx *quark.Context) interface{} {
10398
p.ActionType = "ajax"
10499

105100
return p
106101
}
107102

103+
// 初始化
104+
func (p *Action) Init(ctx *quark.Context) interface{} {
105+
return p
106+
}
107+
108108
// 执行行为句柄
109109
func (p *Action) Handle(ctx *quark.Context, query *gorm.DB) error {
110110
return ctx.CJSONError("method not implemented")

template/admin/resource/searches/search.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ type Search struct {
1616
Api string `json:"api"`
1717
}
1818

19-
// 初始化
20-
func (p *Search) Init(ctx *quark.Context) interface{} {
21-
return p
22-
}
23-
2419
// 初始化模板
2520
func (p *Search) LoadInitData(ctx *quark.Context) interface{} {
2621
p.Component = "textField"
2722

2823
return p
2924
}
3025

26+
// 初始化
27+
func (p *Search) Init(ctx *quark.Context) interface{} {
28+
return p
29+
}
30+
3131
// 获取字段名
3232
func (p *Search) GetColumn(search interface{}) string {
3333
if p.Column == "" {

template/admin/resource/types/actioner.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import "github.com/quarkcloudio/quark-go/v3"
44

55
type Actioner interface {
66

7-
// 初始化
8-
Init(ctx *quark.Context) interface{}
9-
107
// 初始化模板
118
LoadInitData(ctx *quark.Context) interface{}
129

10+
// 初始化
11+
Init(ctx *quark.Context) interface{}
12+
1313
// 行为key
1414
GetUriKey(action interface{}) string
1515

0 commit comments

Comments
 (0)