package camel_oil

import (
	"context"

	"github.com/gogf/gf/v2/errors/gcode"
	"kami/api/camel_oil/v1"
	"kami/internal/errHandler"
	"kami/internal/service"
)

func (c *ControllerV1) UpdateSettings(ctx context.Context, req *v1.UpdateSettingsReq) (res *v1.UpdateSettingsRes, err error) {
	_, err = service.SysAuth().LoginOnlyIFrame(ctx)
	if err != nil {
		err = errHandler.WrapError(ctx, gcode.CodeNotAuthorized, err, "权限不足")
		return
	}
	return service.CamelOil().UpdateSettings(ctx, req)
}
