@Resource(name = "s1")
Interface1 interface1; //正常启动
一个接口对应一个实现类:
例:
1.接口:
public interface BuyerService {
//查询订单详情
OrderDTO getOrderOne(String openid,String orderId);
//取消订单
OrderDTO cancelOrder(String openid,String orderId);
}
1.1对应的实现类为:
public class BuyerServiceImpl implements BuyerService {
@Override
public OrderDTO getOrderOne(String openid, String orderId) {
return checkOrderOwner(openid,orderId);
}
@Override
public OrderDTO cancelOrder(String openid, String orderId) {
OrderDTO orderDTO = checkOrderOwner(openid,orderId);
if(orderDTO == null){
log.error("【取消订单】 查不到该订单,orderId={}",orderId);
throw new SellException(ResultEnum.ORDER_NOT_EXIST);
}
return orderSer