package com.fzm.mall.server.front.system.controller;


import com.fzm.mall.server.front.base.ResponseVO;
import com.fzm.mall.server.front.constant.MallResponseEnum;
import com.fzm.mall.server.front.goods.model.Banner;
import com.fzm.mall.server.front.system.model.SysConfig;
import com.fzm.mall.server.front.system.service.ISysConfigService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 系统配置表 前端控制器
 * </p>
 *
 * @author fzm
 * @since 2021-03-02
 */
@RestController
@RequestMapping("/sys-config")
public class SysConfigController {

    @Autowired
    private ISysConfigService sysConfigService;

    @ApiOperation(value = "获取logo")
    @PostMapping("/without/getLogo")
    public ResponseVO<String> getLogo(){
        String key = "coin_logo";
        SysConfig sys = sysConfigService.getByKey(key);
        if(sys==null){
            return new ResponseVO<>(MallResponseEnum.SUCCESS,"");
        }
        return new ResponseVO<>(MallResponseEnum.SUCCESS,sys.getDictValue());
    }
}
