package ip.black.list.service.protocol;

import ip.black.list.service.api.dto.IpBlackListDto;
import ip.black.list.service.api.protocol.IpBlackListDubboService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by niuqinghua on 2017/2/27.
 */
@Service("ipBlackListDubboService")
public class IpBlackListDubboServiceImpl implements IpBlackListDubboService {

    public void add(IpBlackListDto ipBlackListDto) {

    }

    public void remove(IpBlackListDto ipBlackListDto) {

    }

    public boolean isInIpBlackList(String appId, String ip) {
        return false;
    }

    public List<String> list(IpBlackListDto ipBlackListDto) {
        return null;
    }
}

@@ -154,16 +154,219 @@
 ervice;%0A
+import ip.black.list.service.domain.IpBlackList;%0Aimport ip.black.list.service.service.IpBlackListService;%0Aimport org.dozer.DozerBeanMapper;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0A
 import o
@@ -600,120 +600,541 @@
    p
-ublic void add(IpBlackListDto ipBlackListDto) %7B%0A%0A    %7D%0A%0A    public void remove(IpBlackListDto ipBlackListDto) %7B%0A
+rivate static final DozerBeanMapper dozerBeanMapper = new DozerBeanMapper();%0A%0A    @Autowired%0A    private IpBlackListService ipBlackListService;%0A%0A    public void add(IpBlackListDto ipBlackListDto) %7B%0A        IpBlackList ipBlackList = dozerBeanMapper.map(ipBlackListDto, IpBlackList.class);%0A        ipBlackListService.add(ipBlackList);%0A    %7D%0A%0A    public void remove(IpBlackListDto ipBlackListDto) %7B%0A        IpBlackList ipBlackList = dozerBeanMapper.map(ipBlackListDto, IpBlackList.class);%0A        ipBlackListService.remove(ipBlackList);
 %0A   
@@ -1218,13 +1218,53 @@
 urn 
-false
+ipBlackListService.isInIpBlackList(appId, ip)
 ;%0A  
@@ -1342,19 +1342,141 @@
     
-return null
+IpBlackList ipBlackList = dozerBeanMapper.map(ipBlackListDto, IpBlackList.class);%0A        return ipBlackListService.list(ipBlackList)
 ;%0A  

add code for service