New file |
| | |
| | | package controllers |
| | | |
| | | import ( |
| | | "webserver/extend/code" |
| | | "webserver/extend/config" |
| | | "webserver/extend/util" |
| | | "github.com/gin-gonic/gin" |
| | | ) |
| | | |
| | | type InfoController struct { |
| | | |
| | | } |
| | | |
| | | // @Summary 获取服务器名称 |
| | | // @Description 获取服务器名称 |
| | | // @Accept json |
| | | // @Produce json |
| | | // @Tags server |
| | | // @Success 200 {string} json "{"code":200, success:true, msg:"", data:""}" |
| | | // @Failure 500 {string} json "{"code":500, success:false, msg:"",data:""}" |
| | | // @Router /data/api-v/info/getServerName [get] |
| | | func (ic InfoController) GetServerName(c *gin.Context) { |
| | | serverName := config.Server.ServerName |
| | | if serverName == "" { |
| | | serverName = "视频分析智能计算节点" |
| | | } |
| | | m:=map[string]interface{}{ |
| | | "serverName": serverName, |
| | | } |
| | | util.ResponseFormat(c,code.Success,m) |
| | | } |