parent
6bd7a99a83
commit
5fab6f7b6c
@ -1,12 +1,22 @@
|
||||
package com.fjp.lc.test.service;
|
||||
|
||||
import com.cyl.ums.service.MemberCartService;
|
||||
import com.ruoyi.RuoYiApplication;
|
||||
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.ActiveProfiles;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, classes = RuoYiApplication.class)
|
||||
@ActiveProfiles("dev")
|
||||
public class ServiceTest {
|
||||
|
||||
@Autowired
|
||||
private MemberCartService memberCartService;
|
||||
@Test
|
||||
public void test1() {
|
||||
memberCartService.mineCartNum();
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,28 @@
|
||||
package com.cyl.h5.controller;
|
||||
|
||||
import com.cyl.pms.domain.ProductCategory;
|
||||
import com.cyl.ums.service.MemberCartService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/h5/cart")
|
||||
public class CartController {
|
||||
@Autowired
|
||||
private MemberCartService memberCartService;
|
||||
|
||||
/**
|
||||
* 当前用户的购物车商品数量
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("goodscount")
|
||||
public ResponseEntity<Integer> allCategories() {
|
||||
return ResponseEntity.ok(memberCartService.mineCartNum());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package com.cyl.h5.pojo.vo;
|
||||
|
||||
import com.cyl.pms.domain.Brand;
|
||||
import com.cyl.pms.domain.Product;
|
||||
import com.cyl.pms.domain.Sku;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ProductDetail {
|
||||
private Product product;
|
||||
private List<Sku> skus;
|
||||
private Brand brand;
|
||||
}
|
||||
Loading…
Reference in new issue