增加api注册(按照接口约束的模式)
This commit is contained in:
26
gin/api/api.go
Normal file
26
gin/api/api.go
Normal file
@ -0,0 +1,26 @@
|
||||
// Package gin ...
|
||||
//
|
||||
// Description : 便捷的相关API处理
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
//
|
||||
// Date : 2021-03-26 2:06 下午
|
||||
package api
|
||||
|
||||
import "github.com/gin-gonic/gin"
|
||||
|
||||
// IApi 每一个接口的实现约束
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
//
|
||||
// Date : 2:08 下午 2021/3/26
|
||||
type IApi interface {
|
||||
// GetMethod 接口请求方法
|
||||
GetMethod() string
|
||||
// GetURI 接口URI
|
||||
GetURI() string
|
||||
// GetMiddleWareList 使用的中间件列表
|
||||
GetMiddleWareList() []gin.HandlerFunc
|
||||
// 处理的handler
|
||||
GetHandler() gin.HandlerFunc
|
||||
}
|
Reference in New Issue
Block a user