package com.vrv.paw.axiswebservices;

import org.springframework.web.context.ContextLoader;
import org.springframework.web.context.WebApplicationContext;

import com.vrv.paw.domain.Area;
import com.vrv.paw.service.AreaService;

public class AreaWebService {

  //这里用的是最笨的方法,用代码实例化
private static WebApplicationContext context = ContextLoader.getCurrentWebApplicationContext(); AreaService areaService = (AreaService) context.getBean("areaService"); public String getAreaCode(String araeIP) { Area area = areaService.queryAreaByServerIp(araeIP); String areaCode = area != null ? area.getCode() : ""; return areaCode; } }

 

相关文章:

  • 2021-07-14
  • 2021-11-30
  • 2021-11-07
  • 2022-12-23
  • 2022-12-23
  • 2021-10-24
  • 2021-08-02
  • 2021-04-25
猜你喜欢
  • 2022-12-23
  • 2021-10-12
  • 2021-11-23
  • 2021-06-05
  • 2022-12-23
  • 2021-08-17
相关资源
相似解决方案