package com.hz.pm.api.meeting.controller;

import com.hz.pm.api.meeting.entity.enumeration.MeetingSettingsTypeEnum;
import com.hz.pm.api.meeting.entity.req.MeetingSettingsSaveReq;
import com.hz.pm.api.meeting.manage.MeetingSettingsManage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author WendyYang
 * @since 2023-12-27
 */
@Api(tags = "会议配置管理")
@RestController
@AllArgsConstructor
@RequestMapping("/api/v1/meeting/settings")
public class MeetingSettingsController {

    private final MeetingSettingsManage meetingSettingsManage;

    @GetMapping("/{settingsType}")
    @ApiOperation("获取配置详情")
    public MeetingSettingsSaveReq getSettings(@PathVariable MeetingSettingsTypeEnum settingsType) {
        return meetingSettingsManage.getSettings(settingsType);
    }

    @PostMapping("/save")
    @ApiOperation("保存配置")
    public void saveSettings(@RequestBody MeetingSettingsSaveReq req) {
        meetingSettingsManage.saveSettings(req);
    }

}
