MSP-1068 refactor customization controller
This commit is contained in:
1 parent
208dbe7b58
commit
7be37bc52d
1 file changed
+15
-6
@@ -1,11 +1,20 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"github.com/integration-system/isp-lib/v2/config"
|
||||
"google.golang.org/grpc/metadata"
|
||||
"msp-admin-service/conf"
|
||||
)
|
||||
|
||||
type Customization struct {
|
||||
uiCfg conf.UIDesign
|
||||
}
|
||||
|
||||
func NewCustomization(uiCfg conf.UIDesign) Customization {
|
||||
return Customization{
|
||||
uiCfg: uiCfg,
|
||||
}
|
||||
}
|
||||
|
||||
// GetUIDesign
|
||||
// @Tags user
|
||||
// @Summary Получение внешнего вида
|
||||
// @Description Получение внешнего вида (палитра и наименование) админ-интерфейса
|
||||
@@ -13,9 +22,9 @@ import (
|
||||
// @Produce json
|
||||
// @Param X-AUTH-ADMIN header string true "Токен администратора"
|
||||
// @Success 200 {object} conf.UIDesign
|
||||
// @Failure 400 {object} structure.GrpcError "Невалидный токен"
|
||||
// @Failure 500 {object} structure.GrpcError
|
||||
// @Failure 400 {object} domain.GrpcError "Невалидный токен"
|
||||
// @Failure 500 {object} domain.GrpcError
|
||||
// @Router /user/get_design [POST]
|
||||
func GetUIDesign(_ metadata.MD) (conf.UIDesign, error) {
|
||||
return config.GetRemote().(*conf.RemoteConfig).UiDesign, nil
|
||||
func (c Customization) GetUIDesign() (conf.UIDesign, error) {
|
||||
return c.uiCfg, nil
|
||||
}
|
||||
Reference in new issue
Block a user