增加casdoor的接口

This commit is contained in:
ayflying
2025-09-18 11:04:27 +08:00
parent 70a5b3db89
commit 6f3555a14f
6 changed files with 101 additions and 1 deletions

32
service/casdoor.go Normal file
View File

@@ -0,0 +1,32 @@
// ================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// You can delete these comments if you wish manually maintain this interface file.
// ================================================================================
package service
import (
"github.com/casdoor/casdoor-go-sdk/casdoorsdk"
)
type (
ICasdoor interface {
Load(endpoint string, clientId string, clientSecret string, certificate string, organizationName string, applicationName string)
New() *casdoorsdk.Client
}
)
var (
localCasdoor ICasdoor
)
func Casdoor() ICasdoor {
if localCasdoor == nil {
panic("implement not found for interface ICasdoor, forgot register?")
}
return localCasdoor
}
func RegisterCasdoor(i ICasdoor) {
localCasdoor = i
}