system_setting_controller.go 1.4 KB
package controllers

import (
	"github.com/linmadan/egglib-go/web/beego"
	"gitlab.fjmaimaimai.com/allied-creation/allied-creation-basic/pkg/application/systemSetting/command"
	"gitlab.fjmaimaimai.com/allied-creation/allied-creation-basic/pkg/application/systemSetting/query"
	"gitlab.fjmaimaimai.com/allied-creation/allied-creation-basic/pkg/application/systemSetting/service"
)

type SystemSettingController struct {
	beego.BaseController
}

func (controller *SystemSettingController) UpdateSystemSetting() {
	systemSettingService := service.NewSystemSettingService(nil)
	updateSystemSettingCommand := &command.UpdateSystemSettingCommand{}
	controller.Unmarshal(updateSystemSettingCommand)
	data, err := systemSettingService.UpdateSystemSetting(updateSystemSettingCommand)
	controller.Response(data, err)
}

func (controller *SystemSettingController) GetSystemSetting() {
	systemSettingService := service.NewSystemSettingService(nil)
	getSystemSettingQuery := &query.GetSystemSettingQuery{}
	controller.Unmarshal(getSystemSettingQuery)
	data, err := systemSettingService.GetSystemSetting(getSystemSettingQuery)
	controller.Response(data, err)
}

func (controller *SystemSettingController) ListSystemSetting() {
	systemSettingService := service.NewSystemSettingService(nil)
	listSystemSettingQuery := &query.ListSystemSettingQuery{}
	data, err := systemSettingService.ListSystemSetting(listSystemSettingQuery)
	controller.Response(data, err)
}