2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 17:17:13 +08:00

feat: 添加 PHP FPM 配置的操作接口

This commit is contained in:
耗子
2024-03-15 17:22:52 +08:00
parent 70d65b2b2c
commit 08d906e27c
3 changed files with 30 additions and 2 deletions

View File

@@ -76,6 +76,24 @@ func (r *PHPController) SaveConfig(ctx http.Context) http.Response {
return controllers.Success(ctx, nil)
}
func (r *PHPController) GetFPMConfig(ctx http.Context) http.Response {
config, err := r.service.GetFPMConfig()
if err != nil {
return controllers.Error(ctx, http.StatusInternalServerError, err.Error())
}
return controllers.Success(ctx, config)
}
func (r *PHPController) SaveFPMConfig(ctx http.Context) http.Response {
config := ctx.Request().Input("config")
if err := r.service.SaveFPMConfig(config); err != nil {
return controllers.Error(ctx, http.StatusInternalServerError, err.Error())
}
return controllers.Success(ctx, nil)
}
func (r *PHPController) Load(ctx http.Context) http.Response {
load, err := r.service.Load()
if err != nil {