mirror of
https://gitee.com/freshday/radar.git
synced 2025-12-26 07:16:26 +08:00
修改插件管理类PluginManager,解决bean不能注入问题
This commit is contained in:
parent
eefa7eedc1
commit
8e9931da1c
@ -3,19 +3,23 @@ package com.pgmmers.radar.service.impl.engine.plugin;
|
||||
import com.pgmmers.radar.service.data.MobileInfoService;
|
||||
import com.pgmmers.radar.service.engine.PluginServiceV2;
|
||||
import com.pgmmers.radar.service.engine.vo.Location;
|
||||
import com.pgmmers.radar.service.impl.util.BeanUtils;
|
||||
import com.pgmmers.radar.vo.data.MobileInfoVO;
|
||||
import com.pgmmers.radar.vo.model.PreItemVO;
|
||||
import java.util.Map;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* author: wangcheng Date: 2020/5/19 Time: 上午11:46 Description:
|
||||
*/
|
||||
@Component
|
||||
public class MOBILE2LOCATION implements PluginServiceV2 {
|
||||
|
||||
@Autowired
|
||||
private MobileInfoService mobileInfoService;
|
||||
|
||||
@Override
|
||||
public Integer key() {
|
||||
return 5;
|
||||
@ -42,7 +46,9 @@ public class MOBILE2LOCATION implements PluginServiceV2 {
|
||||
if (!StringUtils.isEmpty(mobile) && mobile.length() == 11) {
|
||||
mobile = mobile.substring(0, 7);
|
||||
}
|
||||
MobileInfoVO vo = BeanUtils.getBean(MobileInfoService.class).getMobileInfoByMobile(mobile);
|
||||
// 注入bean后不需通过BeanUtils.getBean获取实列
|
||||
// MobileInfoVO vo = BeanUtils.getBean(MobileInfoService.class).getMobileInfoByMobile(mobile);
|
||||
MobileInfoVO vo = mobileInfoService.getMobileInfoByMobile(mobile);
|
||||
Location location = new Location();
|
||||
if (vo != null) {
|
||||
location.setProvince(vo.getProvince());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user