接口
public interface HelloService {
/**
* 返回true表示使用这个实现类来执行
*/
default boolean match(String s) {
return false;
}
String sayHello();
}
两个实现类
@Service
public class HeyHelloServiceImpl implements HelloService {
@Override
public String sayHello() {
return "hey";
}
@Override
public boolean match(String s) {
return "hey".equals(s);
}
}
@Service
public