Revert "feat(controller): 完善基础控制器及默认页面渲染"
This reverts commit 37c78d9a4e.
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
package admin
|
||||
|
||||
import "github.com/gin-gonic/gin"
|
||||
|
||||
type BaseController struct {
|
||||
}
|
||||
|
||||
func (con BaseController) Success(c *gin.Context) {
|
||||
c.String(200, "成功")
|
||||
}
|
||||
func (con BaseController) Error(c *gin.Context) {
|
||||
c.String(200, "失败")
|
||||
}
|
||||
@@ -3,11 +3,10 @@ package admin
|
||||
import "github.com/gin-gonic/gin"
|
||||
|
||||
type UserController struct {
|
||||
BaseController
|
||||
}
|
||||
|
||||
func (con UserController) Index(c *gin.Context) {
|
||||
con.Success(c)
|
||||
c.String(200, "管理员用户列表")
|
||||
}
|
||||
|
||||
func (con UserController) Show(c *gin.Context) {
|
||||
|
||||
@@ -8,7 +8,7 @@ type DefaultController struct {
|
||||
}
|
||||
|
||||
func (con DefaultController) Index(c *gin.Context) {
|
||||
c.HTML(200, "pages/index", gin.H{})
|
||||
c.String(200, "首页")
|
||||
}
|
||||
func (con DefaultController) Article(c *gin.Context) {
|
||||
c.String(200, "文章详情")
|
||||
|
||||
Reference in New Issue
Block a user