| 123456789101112131415161718192021222324252627 |
- package com.izouma.walkchina.service;
- import com.izouma.walkchina.domain.SystemVariable;
- import com.izouma.walkchina.exception.ServiceException;
- import com.izouma.walkchina.repo.SystemVariableRepository;
- import lombok.extern.slf4j.Slf4j;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Service;
- @Service
- @Slf4j
- public class SystemVariableService {
- @Autowired
- private SystemVariableRepository systemVariableRepository;
- public String getStringVariable(String name) {
- log.info("getStringVariable {}", name);
- SystemVariable variable = systemVariableRepository.findByName(name);
- if (variable == null) {
- log.error("systemVariable {} is null", name);
- throw new ServiceException("不存在");
- }
- return variable.getValue();
- }
- }
|