package jnpf.doclibrary.service.impl;

import cn.hutool.json.JSONObject;
import jnpf.doclibrary.mapper.CommonConfigMapper;
import jnpf.doclibrary.service.DataReportService;
import jnpf.entity.CommonConfig;
import jnpf.util.ConstantUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 数据报表服务实现
 *
 * @author yanwenfu
 * @create 2024-07-19
 */
@Service
public class DataReportServiceImpl implements DataReportService {

    @Resource
    private CommonConfigMapper commonConfigMapper;

    @Override
    public JSONObject getDataReportUrlConfig() {

        String jsonStr = commonConfigMapper.getDataReportUrlConfig(ConstantUtil.CONFIG_DATA_REPORT);
        if (StringUtils.isNotEmpty(jsonStr)) {
            return new JSONObject(jsonStr);
        }
        return null;
    }
}
