增加api注册(按照接口约束的模式)

This commit is contained in:
2021-03-26 14:52:49 +08:00
parent 957ba155df
commit 0817fa0ab8
2 changed files with 82 additions and 0 deletions

26
gin/api/api.go Normal file
View 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
}