package org.jeecg.modules.xcx.conf.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.xcx.conf.service.IConfService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags = "配置接口")
@Slf4j
@RestController
@RequestMapping("/conf")
public class ConfController {

    @Resource
    private IConfService confService;

    @ApiOperation(value = "客服")
    @GetMapping("/customer")
    public Result<?> getCustomer(){
        return confService.getCustomer();
    }

    @ApiOperation(value = "优惠活动")
    @GetMapping("/coupon")
    public Result<?> getCoupon(){
        return confService.getCoupon();
    }

    @ApiOperation("获取配置")
    @PostMapping("/one")
    public Result<?> getConf(String name){
        return confService.getConf(name);
    }
}
