licailing 5 år sedan
förälder
incheckning
574e9fd613
25 ändrade filer med 142 tillägg och 123 borttagningar
  1. 1 1
      src/main/java/com/izouma/dingdong/domain/Coupon.java
  2. 4 5
      src/main/java/com/izouma/dingdong/domain/merchant/Goods.java
  3. 3 3
      src/main/java/com/izouma/dingdong/domain/merchant/Merchant.java
  4. 7 0
      src/main/java/com/izouma/dingdong/repo/ChatRepo.java
  5. 5 0
      src/main/java/com/izouma/dingdong/repo/CouponRepo.java
  6. 0 1
      src/main/java/com/izouma/dingdong/repo/merchant/GoodsSpecificationRepo.java
  7. 17 9
      src/main/java/com/izouma/dingdong/service/ChatService.java
  8. 7 2
      src/main/java/com/izouma/dingdong/service/CouponService.java
  9. 4 4
      src/main/java/com/izouma/dingdong/service/OrderInfoService.java
  10. 2 1
      src/main/java/com/izouma/dingdong/service/merchant/MerchantService.java
  11. 1 1
      src/main/java/com/izouma/dingdong/service/merchant/MerchantSettingsService.java
  12. 0 7
      src/main/java/com/izouma/dingdong/service/merchant/SalesService.java
  13. 0 12
      src/main/java/com/izouma/dingdong/service/rider/RiderService.java
  14. 12 0
      src/main/java/com/izouma/dingdong/service/rider/RiderSignService.java
  15. 9 4
      src/main/java/com/izouma/dingdong/web/CouponController.java
  16. 1 1
      src/main/java/com/izouma/dingdong/web/merchant/GoodsController.java
  17. 8 8
      src/main/vue/src/views/merchant/GoodsList.vue
  18. 1 1
      src/main/vue/src/views/user/UserList.vue
  19. 0 16
      src/test/java/com/izouma/dingdong/KsherTest.java
  20. 0 31
      src/test/java/com/izouma/dingdong/TimeTest.java
  21. 34 0
      src/test/java/com/izouma/dingdong/contorller/CouponControllerTest.java
  22. 0 1
      src/test/java/com/izouma/dingdong/contorller/MoneyRecordTest.java
  23. 12 9
      src/test/java/com/izouma/dingdong/repo/ChatRepoTest.java
  24. 14 5
      src/test/java/com/izouma/dingdong/service/ChatServiceTest.java
  25. 0 1
      src/test/java/com/izouma/dingdong/service/ShoppingCartServiceTest.java

+ 1 - 1
src/main/java/com/izouma/dingdong/domain/Coupon.java

@@ -44,7 +44,7 @@ public class Coupon extends BaseEntity implements Serializable {
     private Long merchantId;
 
     //优惠券描述
-    private String description;
+//    private String description;
 
     //用于限制优惠券类别
 //    @ApiModelProperty(value = "类别Id")

+ 4 - 5
src/main/java/com/izouma/dingdong/domain/merchant/Goods.java

@@ -35,11 +35,6 @@ public class Goods extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "简介", name = "introduction")
     private String introduction;
 
-//    @Column(columnDefinition = "text")
-//    @Convert(converter = StringArrayConverter.class)
-//    @ApiModelProperty(value = "图片", name = "img")
-//    private List<String> img;
-
     @ApiModelProperty(value = "图片", name = "img")
     private String img;
 
@@ -110,4 +105,8 @@ public class Goods extends BaseEntity implements Serializable {
 
     @ApiModelProperty(value = "人气")
     private Boolean popularity;
+
+    @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.DETACH)
+    @JoinColumn(name = "merchantId", insertable = false, updatable = false, foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
+    private Merchant merchant;
 }

+ 3 - 3
src/main/java/com/izouma/dingdong/domain/merchant/Merchant.java

@@ -81,9 +81,9 @@ public class Merchant extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "成立时间", name = "established")
     private LocalDateTime establishTime;
 
-    @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.DETACH)
-    @JoinColumn(name = "userId", insertable = false, updatable = false, foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
-    private User user;
+//    @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.DETACH)
+//    @JoinColumn(name = "userId", insertable = false, updatable = false, foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
+//    private User user;
 
     @ApiModelProperty(value = "经度", name = "longitude")
     private Double longitude;

+ 7 - 0
src/main/java/com/izouma/dingdong/repo/ChatRepo.java

@@ -11,7 +11,14 @@ public interface ChatRepo extends JpaRepository<Chat, Long>, JpaSpecificationExe
     //按聊天框查找
     List<Chat> findAllBySendUserIdAndReceiveUserId(Long sendUserId, Long receiveUserId);
 
+    //按发送人接收人 或接收人发送人查找
+    List<Chat> findAllBySendUserIdAndReceiveUserIdOrReceiveUserIdAndSendUserIdOrderByIdDesc(Long sendUserId, Long receiveUserId, Long receiveUserId2, Long sendUserId2);
+
+    //按发送人接收人 或接收人发送人查找 只查找最新的一条
+    Chat findFirstBySendUserIdAndReceiveUserIdOrReceiveUserIdAndSendUserIdOrderByIdDesc(Long sendUserId, Long receiveUserId, Long receiveUserId2, Long sendUserId2);
+
     //按个人查找
     List<Chat> findAllBySendUserIdOrReceiveUserId(Long userId, Long userId2);
 
+
 }

+ 5 - 0
src/main/java/com/izouma/dingdong/repo/CouponRepo.java

@@ -1,10 +1,14 @@
 package com.izouma.dingdong.repo;
 
 import com.izouma.dingdong.domain.Coupon;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.jpa.domain.Specification;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
 import org.springframework.data.jpa.repository.Modifying;
 import org.springframework.data.jpa.repository.Query;
+import org.springframework.lang.Nullable;
 
 
 import javax.transaction.Transactional;
@@ -20,4 +24,5 @@ public interface CouponRepo extends JpaRepository<Coupon, Long>, JpaSpecificatio
 
     List<Coupon> findAllByMerchantIdNullAndEnabledTrue();
 
+
 }

+ 0 - 1
src/main/java/com/izouma/dingdong/repo/merchant/GoodsSpecificationRepo.java

@@ -13,7 +13,6 @@ public interface GoodsSpecificationRepo extends JpaRepository<GoodsSpecification
     //按商品ID查询
     List<GoodsSpecification> findAllByGoodsId(Long goodsId);
 
-    void deleteByGoodsId(Long goodsId);
 
     List<GoodsSpecification> findAllByGoodsIdAndParentIsNull(Long goodsId);
 

+ 17 - 9
src/main/java/com/izouma/dingdong/service/ChatService.java

@@ -36,20 +36,28 @@ public class ChatService {
         if (CollUtil.isEmpty(sends)) {
             return null;
         }
-
-        return sends.stream().map(s ->
-                this.showChat(s, userId).get(0)
-        ).collect(Collectors.toList());
+//        return sends.stream().map(s ->
+//               this.showChat(s, userId).get(0)
+//        ).collect(Collectors.toList());
+        List<ChatDTO> dto = new ArrayList<>();
+        sends.forEach(s ->
+                dto.add(
+                        this.toDto(
+                                chatRepo.findFirstBySendUserIdAndReceiveUserIdOrReceiveUserIdAndSendUserIdOrderByIdDesc(s, userId, s, userId)
+                        )));
+        return dto;
     }
 
     /*
     显示两个人之间的具体对话
      */
     public List<ChatDTO> showChat(Long userOne, Long userTwo) {
-        List<Chat> sendChats = chatRepo.findAllBySendUserIdAndReceiveUserId(userOne, userTwo);
-        List<Chat> receiveChats = chatRepo.findAllBySendUserIdAndReceiveUserId(userTwo, userOne);
-        sendChats.addAll(receiveChats);
-        sendChats.sort((a, b) -> b.getId().compareTo(a.getId()));
+//        List<Chat> sendChats = chatRepo.findAllBySendUserIdAndReceiveUserId(userOne, userTwo);
+//        List<Chat> receiveChats = chatRepo.findAllBySendUserIdAndReceiveUserId(userTwo, userOne);
+//        sendChats.addAll(receiveChats);
+        List<Chat> sendChats =
+                chatRepo.findAllBySendUserIdAndReceiveUserIdOrReceiveUserIdAndSendUserIdOrderByIdDesc(userOne, userTwo, userOne, userTwo);
+//        sendChats.sort((a, b) -> b.getId().compareTo(a.getId()));
         return sendChats.stream().map(this::toDto).collect(Collectors.toList());
     }
 
@@ -82,7 +90,7 @@ public class ChatService {
 
         User send = userRepo.findById(chat.getSendUserId()).orElseThrow(new BusinessException("无用户"));
         dto.setSendAvatar(send.getAvatar());
-        dto.setReceiveNickname(send.getNickname());
+        dto.setSendNickname(send.getNickname());
         return dto;
     }
 }

+ 7 - 2
src/main/java/com/izouma/dingdong/service/CouponService.java

@@ -34,8 +34,13 @@ public class CouponService {
     }
 
     public CouponDTO toDTO(Coupon coupon) {
-        CouponDTO dto = new CouponDTO();
-        BeanUtil.copyProperties(coupon, dto);
+        CouponDTO dto = CouponDTO.builder()
+                .amount(coupon.getAmount())
+                .endDate(coupon.getEndDate())
+                .fullAmount(coupon.getFullAmount())
+                .name(coupon.getName())
+                .startDate(coupon.getStartDate())
+                .build();
         if (coupon.getFullAmount() == null) {
             dto.setDescription("无使用限制");
         } else {

+ 4 - 4
src/main/java/com/izouma/dingdong/service/OrderInfoService.java

@@ -465,10 +465,10 @@ public class OrderInfoService {
                 dto.setRiderName(r.getUser().getNickname());
             });
         }
-//        dto.setNickname(orderInfo.getUser().getNickname());
-        userRepo.findById(orderInfo.getUserId()).ifPresent(u -> dto.setNickname(u.getNickname()));
-//        dto.setMerchantShowName(orderInfo.getMerchant().getShowName());
-        merchantRepo.findById(orderInfo.getMerchantId()).ifPresent(m -> dto.setMerchantShowName(m.getShowName()));
+        dto.setNickname(orderInfo.getUser().getNickname());
+//        userRepo.findById(orderInfo.getUserId()).ifPresent(u -> dto.setNickname(u.getNickname()));
+        dto.setMerchantShowName(orderInfo.getMerchant().getShowName());
+//        merchantRepo.findById(orderInfo.getMerchantId()).ifPresent(m -> dto.setMerchantShowName(m.getShowName()));
 
         return dto;
     }

+ 2 - 1
src/main/java/com/izouma/dingdong/service/merchant/MerchantService.java

@@ -176,7 +176,8 @@ public class MerchantService {
         MerchantDTO dto = new MerchantDTO(merchant, merchantSettings);
         ObjUtils.merge(dto, merchantDTO);
 
-        User user = merchant.getUser();
+//        User user = merchant.getUser();
+        User user = userRepo.findById(merchant.getUserId()).orElseThrow(new BusinessException("无用户"));
         user.setAvatar(dto.getLogo());
         user.setPhone(dto.getPhone());
         user.setNickname(dto.getShowName());

+ 1 - 1
src/main/java/com/izouma/dingdong/service/merchant/MerchantSettingsService.java

@@ -236,7 +236,7 @@ public class MerchantSettingsService {
                 .stream()
                 .map(Goods::getId)
                 .collect(Collectors.toList());
-        collect.forEach(c -> goodsSpecificationRepo.deleteByGoodsId(c));
+        collect.forEach(c -> goodsSpecificationRepo.deleteAllByGoodsId(c));
         //删除商品
         goodsRepo.deleteAllByMerchantId(merchantId);
         //删除订单

+ 0 - 7
src/main/java/com/izouma/dingdong/service/merchant/SalesService.java

@@ -159,15 +159,8 @@ public class SalesService {
         if (!merchantClass.getIsOpen()) {
             return;
         }
-//        Set<Goods> goodsList = merchantClass.getGoodsList();
-//        goodsList.add(sales.getGoods());
-//        merchantClass.setGoodsList(goodsList);
-
         merchantClassificationService.saveOneGoods(merchantClass.getId(), sales.getGoodsId());
 
-//        String goodsId = merchantClass.getGoodsIds();
-//        goodsId = goodsId + "," + sales.getGoodsId();
-//        merchantClass.setGoodsIds(goodsId);
     }
 
 

+ 0 - 12
src/main/java/com/izouma/dingdong/service/rider/RiderService.java

@@ -303,18 +303,6 @@ public class RiderService {
         orderInfoRepo.save(orderInfo);
     }
 
-    /*
-    开始停止接单
-     */
-    public void stop(Long riderId) {
-//        Rider rider = riderRepo.findById(riderId).orElseThrow(new BusinessException("骑手"));
-        RiderSign riderSign = riderSignRepo.findByRiderIdAndTakingOrders(riderId, true);
-        if (ObjectUtil.isNotNull(riderSign)) {
-            riderSign.setTakingOrders(false);
-        }
-
-    }
-
     /*
     可不可以接货到付款订单
      */

+ 12 - 0
src/main/java/com/izouma/dingdong/service/rider/RiderSignService.java

@@ -1,5 +1,6 @@
 package com.izouma.dingdong.service.rider;
 
+import cn.hutool.core.util.ObjectUtil;
 import com.izouma.dingdong.domain.rider.RiderSign;
 import com.izouma.dingdong.repo.rider.RiderSignRepo;
 import lombok.AllArgsConstructor;
@@ -11,4 +12,15 @@ public class RiderSignService {
 
     private RiderSignRepo riderSignRepo;
 
+
+    /*
+    骑手开始停止接单
+    */
+    public void riderOrder(Long riderId,Boolean isStart) {
+        if (isStart){
+
+        }
+
+    }
+
 }

+ 9 - 4
src/main/java/com/izouma/dingdong/web/CouponController.java

@@ -18,7 +18,9 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 
 @RestController
@@ -43,13 +45,16 @@ public class CouponController extends BaseController {
     //@PreAuthorize("hasRole('ADMIN')")
     @GetMapping("/all")
     public Page<CouponDTO> all(PageQuery pageQuery) {
-        //return couponRepo.findAll(toSpecification(pageQuery,Coupon.class),toPageRequest(pageQuery));
-        List<Coupon> collect = couponRepo.findAll(toSpecification(pageQuery, Coupon.class))
+        Map<String, Object> query = pageQuery.getQuery();
+        query.put("enabled", true);
+        return couponRepo.findAll(toSpecification(pageQuery, Coupon.class), toPageRequest(pageQuery))
+                .map(couponService::toDTO);
+        /*List<CouponDTO> collect = couponRepo.findAll(toSpecification(pageQuery, Coupon.class))
                 .stream()
                 .filter(Coupon::getEnabled)
+                .map(couponService::toDTO)
                 .collect(Collectors.toList());
-        List<CouponDTO> dtos = collect.stream().map(couponService::toDTO).collect(Collectors.toList());
-        return new PageImpl<>(dtos, toPageRequest(pageQuery), pageQuery.getSize());
+        return new PageImpl<>(collect, toPageRequest(pageQuery), pageQuery.getSize());*/
     }
 
     @GetMapping("/get/{id}")

+ 1 - 1
src/main/java/com/izouma/dingdong/web/merchant/GoodsController.java

@@ -71,7 +71,7 @@ public class GoodsController extends BaseController {
     public void del(@PathVariable Long id) {
         goodsRepo.deleteById(id);
         //规格一并被删除
-        goodsSpecificationRepo.deleteByGoodsId(id);
+        goodsSpecificationRepo.deleteAllByGoodsId(id);
     }
 
     @GetMapping("/excel")

+ 8 - 8
src/main/vue/src/views/merchant/GoodsList.vue

@@ -32,7 +32,7 @@
             </el-table-column>
             <el-table-column prop="id" label="ID" width="80">
             </el-table-column>
-            <el-table-column prop="merchantId" label="商户ID"
+            <el-table-column prop="merchant.showName" label="商户名称"
             >
             </el-table-column>
             <el-table-column prop="name" label="名称"
@@ -49,9 +49,9 @@
                               :preview-src-list="picList(row.img)?picList(row.img):[]"></el-image>
                 </template>
             </el-table-column>
-            <el-table-column prop="inventory" label="库存"
+            <!--<el-table-column prop="inventory" label="库存"
             >
-            </el-table-column>
+            </el-table-column>-->
             <el-table-column prop="totalSales" label="总销量"
             >
                 <!--                    </el-table-column>
@@ -82,15 +82,15 @@
             <!--            <el-table-column prop="sort" label="排布"
                         >
                         </el-table-column>-->
-            <el-table-column prop="isFullReduction" label="满减"
+            <!--<el-table-column prop="isFullReduction" label="满减"
             >
                 <template slot-scope="{row}">
                     <el-tag :type="row.isFullReduction?'':'info'">{{row.isFullReduction}}</el-tag>
                 </template>
-            </el-table-column>
-            <el-table-column prop="week" label="时间"
+            </el-table-column>-->
+            <!--<el-table-column prop="week" label="时间"
             >
-            </el-table-column>
+            </el-table-column>-->
             <el-table-column prop="status" label="状态" :formatter="statusFormatter"
             >
             </el-table-column>
@@ -100,7 +100,7 @@
                     fixed="right"
                     min-width="150">
                 <template slot-scope="{row}">
-                    <!-- <el-button @click="editRow(row)" type="primary" size="mini" plain>编辑</el-button>-->
+                    <!-- <el-button @click="editRow(row)" type="primary" size="mini" plain>详情</el-button>-->
                     <el-button @click="take(row)" type="warning" size="mini" plain v-if="row.status === 'PASS'">
                         {{row.takeOff?'上架':'下架'}}
                     </el-button>

+ 1 - 1
src/main/vue/src/views/user/UserList.vue

@@ -50,7 +50,7 @@
                     <el-button @click="editRow(row)" type="primary" size="mini"
                         plain>详情</el-button>
                     <el-button @click="showAppraisal(row)"
-                               type="primary" plain>订单
+                               type="success" plain>订单
                     </el-button>
                 </template>
             </el-table-column>

+ 0 - 16
src/test/java/com/izouma/dingdong/KsherTest.java

@@ -1,16 +0,0 @@
-package com.izouma.dingdong;
-
-import com.izouma.dingdong.config.KsherPaySdk;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringRunner;
-
-@RunWith(SpringRunner.class)
-@SpringBootTest
-public class KsherTest {
-    @Test
-    public void test(){
-       // new KsherPaySdk();
-    }
-}

+ 0 - 31
src/test/java/com/izouma/dingdong/TimeTest.java

@@ -1,31 +0,0 @@
-package com.izouma.dingdong;
-
-
-import org.junit.Test;
-
-public class TimeTest {
-
-/*    @Test
-    public void test() {
-
-        int midTime = 2 * 60;
-
-        while (midTime > 0) {
-            midTime--;
-            long hh = midTime / 60 / 60 % 60;
-            long mm = midTime / 60 % 60;
-            long ss = midTime % 60;
-            System.out.println("还剩" + hh + "小时" + mm + "分钟" + ss + "秒");
-            try {
-                Thread.sleep(1000);
-
-            } catch (InterruptedException e) {
-                e.printStackTrace();
-            }
-        }
-        System.out.println("取消订单");
-
-
-    }*/
-
-}

+ 34 - 0
src/test/java/com/izouma/dingdong/contorller/CouponControllerTest.java

@@ -0,0 +1,34 @@
+package com.izouma.dingdong.contorller;
+
+import com.izouma.dingdong.dto.PageQuery;
+import com.izouma.dingdong.web.CouponController;
+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 java.util.HashMap;
+import java.util.Map;
+
+@SpringBootTest
+@RunWith(SpringRunner.class)
+public class CouponControllerTest {
+    @Autowired
+    private CouponController couponController;
+
+    @Test
+    public void test() {
+
+        long startTime = System.currentTimeMillis(); //获取开始时间
+        PageQuery pageQuery = new PageQuery();
+        pageQuery.setPage(0);
+        pageQuery.setSize(50);
+        pageQuery.setSearch(null);
+        pageQuery.setSort("");
+        couponController.all(pageQuery);
+        long endTime = System.currentTimeMillis(); //获取结束时间
+        System.out.println("程序运行时间:" + (endTime - startTime) + "ms"); //输出程序运行时间
+
+    }
+}

+ 0 - 1
src/test/java/com/izouma/dingdong/contorller/MoneyRecordTest.java

@@ -1,6 +1,5 @@
 package com.izouma.dingdong.contorller;
 
-import com.izouma.dingdong.domain.MoneyRecord;
 import com.izouma.dingdong.dto.PageQuery;
 import com.izouma.dingdong.enums.FinancialType;
 import com.izouma.dingdong.web.MoneyRecordController;

+ 12 - 9
src/test/java/com/izouma/dingdong/repo/ChatRepoTest.java

@@ -1,6 +1,5 @@
 package com.izouma.dingdong.repo;
 
-import cn.hutool.core.collection.CollUtil;
 import com.izouma.dingdong.domain.Chat;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -37,23 +36,27 @@ public class ChatRepoTest {
         Set<Long> reces = chats.stream().map(Chat::getReceiveUserId).collect(Collectors.toSet());
         sends.addAll(reces);
         sends.remove(82L);
-       // System.out.println(sends);
-
+        // System.out.println(sends);
         List<Chat> ch = new ArrayList<>();
-
         sends.forEach(s -> {
             List<Chat> c1 = chatRepo.findAllBySendUserIdAndReceiveUserId(s, 82L);
             List<Chat> c2 = chatRepo.findAllBySendUserIdAndReceiveUserId(82L, s);
             c1.addAll(c2);
-
-            c1.sort((a,b)->b.getId().compareTo(a.getId()));
+            c1.sort((a, b) -> b.getId().compareTo(a.getId()));
             //CollUtil.sort(c1,(a,b)->b.getId().compareTo(a.getId()));
-
             ch.add(c1.get(0));
         });
-
         System.out.println(ch);
-
         //System.out.println(chatRepo.findAllBySendUserIdOrReceiveUserId(82L,82L));
     }
+
+    @Test
+    public void test2() {
+//        System.out.println(chatRepo.findAllBySendUserIdAndReceiveUserId(2105L, 82L));
+//        System.out.println(chatRepo.findLastBySendUserIdAndReceiveUserId(2105L, 82L));
+//        System.out.println(chatRepo.findAllBySendUserIdOrReceiveUserId(2105L, 82L));
+//        System.out.println(chatRepo.findFirstBySendUserIdOrReceiveUserIdOrderByIdDesc(2105L, 82L));
+        System.out.println(chatRepo.findFirstBySendUserIdAndReceiveUserIdOrReceiveUserIdAndSendUserIdOrderByIdDesc(2105L,82L,82L,2105L));
+    }
+
 }

+ 14 - 5
src/test/java/com/izouma/dingdong/service/ChatServiceTest.java

@@ -1,5 +1,6 @@
 package com.izouma.dingdong.service;
 
+import com.izouma.dingdong.dto.PageQuery;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -13,17 +14,25 @@ public class ChatServiceTest {
     private ChatService chatService;
 
     @Test
-    public void test(){
-        System.out.println(chatService.my(174L));
+    public void test() {
+        long startTime = System.currentTimeMillis(); //获取开始时间
+        System.out.println(chatService.my(82L));
+        long endTime = System.currentTimeMillis(); //获取结束时间
+        System.out.println("程序运行时间:" + (endTime - startTime) + "ms"); //输出程序运行时间
+
     }
 
     @Test
-    public void testShow(){
-        System.out.println(chatService.showChat(82L, 200L));
+    public void testShow() {
+        long startTime = System.currentTimeMillis(); //获取开始时间
+        System.out.println(chatService.showChat(82L, 2105L));
+        long endTime = System.currentTimeMillis(); //获取结束时间
+        System.out.println("程序运行时间:" + (endTime - startTime) + "ms"); //输出程序运行时间
     }
 
     @Test
-    public void testDel(){
+    public void testDel() {
         chatService.delChat(174L);
     }
+
 }

+ 0 - 1
src/test/java/com/izouma/dingdong/service/ShoppingCartServiceTest.java

@@ -33,7 +33,6 @@ public class ShoppingCartServiceTest {
         OrderGoodsSpec add = orderGoodsSpecService.add(1258L, null, 1);
 
         // OrderGoodsSpec add = orderGoodsSpecRepo.findById(1318L).orElse(null);
-
         //System.out.println(shoppingCartService.save(83L, add));
     }