package com.wms_main.service.system.serviceImpl;

import com.wms_main.WmsMainApplication;
import com.wms_main.app.AppCommon;
import com.wms_main.dao.ITAppConfigService;
import com.wms_main.service.system.ISystemService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 系统服务接口实现
 */
@Service
@RequiredArgsConstructor
public class SystemServiceImpl implements ISystemService {
    /**
     * 应用共通数据
     */
    private final AppCommon appCommon;

    /**
     * 重启系统
     * @return 重启结果
     */
    @Override
    public boolean restartSystem() {
        try {
            WmsMainApplication.restart();
        } catch (Exception e) {
            return false;
        }
        return true;
    }

    /**
     * 重载配置
     * @return 重载结果
     */
    @Override
    public boolean reloadConfig() {
        return appCommon.initConfigMap();
    }
}
