Files
nms_cxy/src/modules/common/controller/index.go
2024-03-19 18:40:07 +08:00

30 lines
743 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"
"nms_cxy/src/framework/config"
"nms_cxy/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请通过前台地址访问。"
str := "Welcome to the %s Core Network Management Platform, current version: %s, please access via the frontend address."
c.JSON(200, result.OkMsg(fmt.Sprintf(str, name, version)))
}