package com.dcs.hnyz.controller;

import com.dcs.common.core.controller.BaseController;
import com.dcs.common.core.domain.AjaxResult;
import com.dcs.hnyz.cache.CacheCenter;
import com.dcs.hnyz.domain.vo.EquipmentParamFormVo;
import com.dcs.hnyz.service.IConfigurationPageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * ConfigurationPageController
 * 组态页面相关接口
 * @author: hmy
 * @date: 2025/5/29 17:25
 */
@RestController
@RequestMapping("/hnyz/configuration")
public class ConfigurationPageController extends BaseController {
    @Resource
    private IConfigurationPageService configurationPageService;

    /**
     * 更新组态页面配置
     * @param pageCode 页面编码
     * @param configMap 配置结构
     * @return
     */
    @PostMapping("/config/{pageCode}")
    public AjaxResult updateZTPageConfig(@PathVariable String pageCode, @RequestBody Map<String, List<String>> configMap) {
        configurationPageService.updateZTPageDeviceConfig(pageCode, configMap);
        return success();
    }

}
