feat: 系统可暴露的配置信息

This commit is contained in:
TsMask
2023-10-25 17:05:03 +08:00
parent 633878f05a
commit 0d0ad90e1f
3 changed files with 69 additions and 2 deletions

View File

@@ -1,16 +1,23 @@
package controller
import (
"ems.agt/src/framework/vo/result"
commonService "ems.agt/src/modules/common/service"
"github.com/gin-gonic/gin"
)
// 实例化控制层 CommontController 结构体
var NewCommont = &CommontController{}
var NewCommont = &CommontController{
commontService: commonService.NewCommontImpl,
}
// 通用请求
//
// PATH /
type CommontController struct{}
type CommontController struct {
// 通用请求服务
commontService commonService.ICommont
}
// 哈希加密
//
@@ -18,3 +25,11 @@ type CommontController struct{}
func (s *CommontController) Hash(c *gin.Context) {
c.String(200, "commont Hash")
}
// 系统可暴露的配置信息
//
// GET /sysConf
func (s *CommontController) SysConfig(c *gin.Context) {
data := s.commontService.SystemConfigInfo()
c.JSON(200, result.OkData(data))
}