From 0f9f698f536e27a7b42cc10a4e272dc9e1d16164 Mon Sep 17 00:00:00 2001 From: public_host Date: Tue, 20 Apr 2021 17:09:25 +0800 Subject: [PATCH] fix --- hasaki-gen-crud/template.go | 6 ++++-- main.go | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/hasaki-gen-crud/template.go b/hasaki-gen-crud/template.go index 49e1101..0ae3e97 100644 --- a/hasaki-gen-crud/template.go +++ b/hasaki-gen-crud/template.go @@ -124,9 +124,11 @@ func (TempLowHead3A60 *Temp3A60) Delete() (err error) { // ----------------------------temp------------------------------------ -func InitializationHttpCrudPrefixHigHead3A60Temp3A60(router *hskgin.GinHelper) { +func InitializationHttpCrudPrefixHigHead3A60Temp3A60(router *hskgin.GinHelper, authoritys ...func(ctx *hskgin.GinContextHelper)) { var authority = func(ctx *hskgin.GinContextHelper) { - //todo 权限控制 + } + if len(authoritys) > 0 { + authority = authoritys[0] } router.Any("/Prefix3A60/TempLowHead3A60/get", func(ctx *hskgin.GinContextHelper) { diff --git a/main.go b/main.go index 14ce9a6..3389c93 100644 --- a/main.go +++ b/main.go @@ -35,5 +35,6 @@ func (myTestr3 *MyTestr3) getXorm() *xorm.Engine { func main() { t := &MyTestr3{} + InitializationHttpCrudAdminMyTestr3() t.Data() }