package com.dcs.hnyz.controller;

import com.dcs.common.core.controller.BaseController;
import com.dcs.common.core.domain.AjaxResult;
import com.dcs.hnyz.service.IConfigurationPageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
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
 */
@Api(tags = "组态页面相关接口")
@RestController
@RequestMapping("/hnyz/configuration")
public class ConfigurationPageController extends BaseController {
    @Resource
    private IConfigurationPageService configurationPageService;

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

}
