6 changed files with 78 additions and 3 deletions
@ -0,0 +1,15 @@ |
|||
package cn.chjyj.szwh.service; |
|||
|
|||
import cn.chjyj.szwh.bean.OrderGoodsDetail; |
|||
|
|||
/** |
|||
* 订单产品服务接口 |
|||
*/ |
|||
public interface OrderGoodsDetailService { |
|||
/** |
|||
* 查询明细 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
OrderGoodsDetail getOrderGoodsById(Integer id); |
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
package cn.chjyj.szwh.service.impl; |
|||
|
|||
import cn.chjyj.szwh.bean.OrderGoodsDetail; |
|||
import cn.chjyj.szwh.mapper.OrderGoodsDetailMapper; |
|||
import cn.chjyj.szwh.service.OrderGoodsDetailService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
@Service |
|||
public class OrderGoodsDetailServiceImpl implements OrderGoodsDetailService { |
|||
@Autowired |
|||
private OrderGoodsDetailMapper orderGoodsDetailMapper; |
|||
@Override |
|||
public OrderGoodsDetail getOrderGoodsById(Integer id) { |
|||
return orderGoodsDetailMapper.getOrderGoodsDetailById(id); |
|||
} |
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
package cn.chjyj.szwh.mapper; |
|||
|
|||
import cn.chjyj.szwh.bean.OrderGoodsDetail; |
|||
import org.junit.Test; |
|||
import org.junit.runner.RunWith; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.boot.test.context.SpringBootTest; |
|||
import org.springframework.test.context.junit4.SpringRunner; |
|||
|
|||
import static org.junit.Assert.*; |
|||
|
|||
@SpringBootTest |
|||
@RunWith(SpringRunner.class) |
|||
public class OrderGoodsDetailMapperTest { |
|||
@Autowired |
|||
private OrderGoodsDetailMapper orderGoodsDetailMapper; |
|||
@Test |
|||
public void getOrderGoodsDetailById() { |
|||
int id=1; |
|||
OrderGoodsDetail orderGoodsDetail = orderGoodsDetailMapper.getOrderGoodsDetailById(id); |
|||
System.out.println(orderGoodsDetail.getGoodsImage()); |
|||
} |
|||
} |
|||
Loading…
Reference in new issue