34 lines
818 B
Go
34 lines
818 B
Go
// Package controller 控制器层
|
|
package controller
|
|
|
|
import (
|
|
"server/common"
|
|
"server/modules/api/service"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
type AppConfigController struct {
|
|
service *service.AppConfigService
|
|
}
|
|
|
|
func NewAppConfigController() *AppConfigController {
|
|
return &AppConfigController{service: service.NewAppConfigService()}
|
|
}
|
|
|
|
func (ctrl *AppConfigController) RegisterRoutes(r *gin.RouterGroup) {
|
|
group := r.Group("/open")
|
|
group.GET("/app/config", ctrl.GetConfig)
|
|
}
|
|
|
|
// GetConfig 获取小程序配置
|
|
// @Summary 获取小程序配置
|
|
// @Tags 对外接口
|
|
// @Produce json
|
|
// @Success 200 {object} common.Response
|
|
// @Router /open/app/config [get]
|
|
func (ctrl *AppConfigController) GetConfig(c *gin.Context) {
|
|
data := ctrl.service.GetConfig()
|
|
common.Success(c, data)
|
|
}
|