package com.dk.mdm.controller.mst;

import com.dk.common.response.ResponseResultVO;
import com.dk.mdm.model.pojo.mst.SettingValue;
import com.dk.common.service.BaseService;
import com.dk.mdm.model.vo.mst.SettingValueVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
import com.dk.mdm.service.mst.SettingValueService;

import java.util.Map;

@Api(tags = "系统参数API接口")
@RestController
@RequestMapping("/mst/setting_value")
public class SettingValueController {

    public BaseService<SettingValue> getService() {
        return settingValueService;
    }

    @Autowired
    private SettingValueService settingValueService;

    /**
     * @desc : 获取系统参数
     * @author : 姜永辉
     * @date : 2024/2/26 10:36
     */
    @ApiOperation(
            value = "获取系统参数",
            notes = "获取系统参数"
    )
    @PostMapping("get_setting_value")
    public ResponseResultVO<Map<String, Object>> getSettingValue(@RequestBody Map<String, Object> param) {
        return settingValueService.getSettingValue(param);
    }


    /**
     * @desc : 批量修改系统参数
     * @author : 姜永辉
     * @date : 2023/1/5 9:39
     */
    @ApiOperation(value = "批量修改敏感信息", notes = "批量修改敏感信息")
    @PostMapping({"update_batch"})
    public ResponseResultVO<?> updateBatch(@RequestBody SettingValueVO vo) {
        return settingValueService.updateBatch(vo);
    }
}
