1
0
Files
omc_api/src/modules/common/controller/index.go
2023-10-16 20:04:08 +08:00

29 lines
620 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package controller
import (
"fmt"
"ems.agt/src/framework/config"
"ems.agt/src/framework/vo/result"
"github.com/gin-gonic/gin"
)
// 实例化控制层 IndexController 结构体
var NewIndex = &IndexController{}
// 路由主页
//
// PATH /
type IndexController struct{}
// 根路由
//
// GET /
func (s *IndexController) Handler(c *gin.Context) {
name := config.Get("framework.name").(string)
version := config.Get("framework.version").(string)
str := "欢迎使用%s后台管理框架当前版本%s请通过前端管理地址访问。"
c.JSON(200, result.OkMsg(fmt.Sprintf(str, name, version)))
}