gin路由分组 路由文件抽离
gin自定义控制器 实现控制器的继承
This commit is contained in:
18
controller/api/apiController.go
Normal file
18
controller/api/apiController.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package api
|
||||
|
||||
import "github.com/gin-gonic/gin"
|
||||
|
||||
type IndexController struct {
|
||||
}
|
||||
|
||||
func (con IndexController) Index(c *gin.Context) {
|
||||
c.String(200, "API接口")
|
||||
}
|
||||
|
||||
func (con IndexController) User(c *gin.Context) {
|
||||
c.String(200, "用户信息")
|
||||
}
|
||||
|
||||
func (con IndexController) Plist(c *gin.Context) {
|
||||
c.String(200, "用户列表")
|
||||
}
|
||||
Reference in New Issue
Block a user