mirror of
https://github.com/APIParkLab/APIPark.git
synced 2026-06-26 16:01:56 +08:00
首次提交APIPark代码,面向开源
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"github.com/eolinker/go-common/autowire"
|
||||
"github.com/gin-gonic/gin"
|
||||
"reflect"
|
||||
)
|
||||
|
||||
type ICommonController interface {
|
||||
Version(ctx *gin.Context) (string, string, error)
|
||||
}
|
||||
|
||||
func init() {
|
||||
autowire.Auto[ICommonController](func() reflect.Value {
|
||||
return reflect.ValueOf(new(imlCommonController))
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"github.com/APIParkLab/APIPark/common/version"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
var _ ICommonController = (*imlCommonController)(nil)
|
||||
|
||||
type imlCommonController struct{}
|
||||
|
||||
func (i imlCommonController) Version(ctx *gin.Context) (string, string, error) {
|
||||
return version.Version, version.BuildTime, nil
|
||||
}
|
||||
Reference in New Issue
Block a user