package com.younike.server.controller;

import com.younike.common.core.controller.BaseController;
import com.younike.common.core.domain.AjaxResult;
import com.younike.framework.config.ServerAccess;
import com.younike.system.service.ISysConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 服务人员配置
 *
 * @author dail
 * @date 2022-02-16
 */
@RestController
@RequestMapping("/server/sysConfig")
public class ServerSysConfigController extends BaseController {

    @Autowired
    private ISysConfigService sysConfigService;


    /**
     * 根据参数键名查询参数值
     */
    @ServerAccess
    @GetMapping(value = "/getByConfigKey/{configKey}")
    public AjaxResult getByConfigKey(@PathVariable String configKey) {
        return AjaxResult.success(sysConfigService.selectConfigByKey(configKey));
    }
}
