mirror of
https://github.com/APIParkLab/APIPark.git
synced 2026-06-04 10:13:53 +08:00
52 lines
1.6 KiB
Go
52 lines
1.6 KiB
Go
package system_apikey
|
|
|
|
import (
|
|
system_apikey "github.com/APIParkLab/APIPark/module/system-apikey"
|
|
system_apikey_dto "github.com/APIParkLab/APIPark/module/system-apikey/dto"
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
var _ IAPIKeyController = new(imlAPIKeyController)
|
|
|
|
type imlAPIKeyController struct {
|
|
apikeyModule system_apikey.IAPIKeyModule `autowired:""`
|
|
}
|
|
|
|
func (i *imlAPIKeyController) MyAPIKeysByService(ctx *gin.Context, serviceId string, appId string) ([]*system_apikey_dto.AuthorizationItem, error) {
|
|
if serviceId != "" {
|
|
return i.apikeyModule.MyAPIKeysByService(ctx, serviceId)
|
|
}
|
|
if appId != "" {
|
|
return i.apikeyModule.MyAPIKeysByApp(ctx, appId)
|
|
}
|
|
return nil, nil
|
|
}
|
|
|
|
func (i *imlAPIKeyController) MyAPIKeys(ctx *gin.Context) ([]*system_apikey_dto.SimpleItem, error) {
|
|
return i.apikeyModule.MyAPIKeys(ctx)
|
|
}
|
|
|
|
func (i *imlAPIKeyController) Create(ctx *gin.Context, input *system_apikey_dto.Create) error {
|
|
return i.apikeyModule.Create(ctx, input)
|
|
}
|
|
|
|
func (i *imlAPIKeyController) Update(ctx *gin.Context, id string, input *system_apikey_dto.Update) error {
|
|
return i.apikeyModule.Update(ctx, id, input)
|
|
}
|
|
|
|
func (i *imlAPIKeyController) Delete(ctx *gin.Context, id string) error {
|
|
return i.apikeyModule.Delete(ctx, id)
|
|
}
|
|
|
|
func (i *imlAPIKeyController) Get(ctx *gin.Context, id string) (*system_apikey_dto.APIKey, error) {
|
|
return i.apikeyModule.Get(ctx, id)
|
|
}
|
|
|
|
func (i *imlAPIKeyController) Search(ctx *gin.Context, keyword string) ([]*system_apikey_dto.Item, error) {
|
|
return i.apikeyModule.Search(ctx, keyword)
|
|
}
|
|
|
|
func (i *imlAPIKeyController) SimpleList(ctx *gin.Context) ([]*system_apikey_dto.SimpleItem, error) {
|
|
return i.apikeyModule.SimpleList(ctx)
|
|
}
|