Browse Source

:frog: 前后端统一驼峰式,改为通过反射构造VO

nnkwrik 6 năm trước cách đây
mục cha
commit
2af401743a
29 tập tin đã thay đổi với 135 bổ sung198 xóa
  1. 0 1
      goods-service/pom.xml
  2. 1 1
      goods-service/src/main/java/io/github/nnkwrik/goodsservice/cache/BrowseCache.java
  3. 4 4
      goods-service/src/main/java/io/github/nnkwrik/goodsservice/controller/IndexController.java
  4. 1 1
      goods-service/src/main/java/io/github/nnkwrik/goodsservice/model/vo/inner/BannerVo.java
  5. 1 1
      goods-service/src/main/java/io/github/nnkwrik/goodsservice/model/vo/inner/CategoryVo.java
  6. 1 1
      goods-service/src/main/java/io/github/nnkwrik/goodsservice/model/vo/inner/ChannelVo.java
  7. 6 6
      goods-service/src/main/java/io/github/nnkwrik/goodsservice/model/vo/inner/CommentVo.java
  8. 1 1
      goods-service/src/main/java/io/github/nnkwrik/goodsservice/model/vo/inner/GalleryVo.java
  9. 4 4
      goods-service/src/main/java/io/github/nnkwrik/goodsservice/model/vo/inner/GoodsDetailVo.java
  10. 4 4
      goods-service/src/main/java/io/github/nnkwrik/goodsservice/model/vo/inner/GoodsSimpleVo.java
  11. 15 17
      goods-service/src/main/java/io/github/nnkwrik/goodsservice/service/impl/GoodsServiceImpl.java
  12. 8 8
      goods-service/src/main/java/io/github/nnkwrik/goodsservice/service/impl/IndexServiceImpl.java
  13. 1 1
      goods-service/src/main/java/io/github/nnkwrik/goodsservice/service/impl/SearchServiceImpl.java
  14. 4 4
      goods-service/src/main/java/io/github/nnkwrik/goodsservice/service/impl/UserServiceImpl.java
  15. 57 87
      goods-service/src/main/java/io/github/nnkwrik/goodsservice/util/PO2VO.java
  16. 1 1
      wx-front/pages/catalog/catalog.wxml
  17. 1 1
      wx-front/pages/category/category.wxml
  18. 1 1
      wx-front/pages/category/category.wxss
  19. 12 12
      wx-front/pages/goods/goods.wxml
  20. 3 3
      wx-front/pages/index/index.wxml
  21. 1 1
      wx-front/pages/search/search.wxml
  22. 2 3
      wx-front/pages/ucenter/bought/bought.wxml
  23. 0 7
      wx-front/pages/ucenter/bought/bought.wxss
  24. 2 3
      wx-front/pages/ucenter/collect/collect.wxml
  25. 0 7
      wx-front/pages/ucenter/collect/collect.wxss
  26. 2 3
      wx-front/pages/ucenter/posted/posted.wxml
  27. 0 6
      wx-front/pages/ucenter/posted/posted.wxss
  28. 2 3
      wx-front/pages/ucenter/sold/sold.wxml
  29. 0 6
      wx-front/pages/ucenter/sold/sold.wxss

+ 0 - 1
goods-service/pom.xml

@@ -83,7 +83,6 @@
         </dependency>
 
 
-
     </dependencies>
 
     <dependencyManagement>

+ 1 - 1
goods-service/src/main/java/io/github/nnkwrik/goodsservice/cache/BrowseCache.java

@@ -55,7 +55,7 @@ public class BrowseCache {
         AtomicInteger browseCount = cache.getIfPresent(goodsId);
         if (browseCount != null) {
             count = browseCount.incrementAndGet();
-            if (count > 10) {
+            if (count > 5) {
                 //手动移除缓存,让他触发removalListener,刷新数据库
                 cache.invalidate(goodsId);
             }

+ 4 - 4
goods-service/src/main/java/io/github/nnkwrik/goodsservice/controller/IndexController.java

@@ -59,17 +59,17 @@ public class IndexController {
                                 @RequestBody CommentVo comment,
                                 @JWT(required = true) JWTUser user) {
         if (StringUtils.isEmpty(user.getOpenId()) ||
-                StringUtils.isEmpty(comment.getReply_user_id()) ||
+                StringUtils.isEmpty(comment.getReplyUserId()) ||
                 StringUtils.isEmpty(comment.getContent()) ||
-                comment.getReply_comment_id() == null) {
+                comment.getReplyCommentId() == null) {
             String msg = "用户发表评论失败,信息不完整";
             log.info(msg);
             return Response.fail(Response.COMMENT_INFO_INCOMPLETE,msg);
         }
 
-        indexService.addComment(goodsId, user.getOpenId(), comment.getReply_comment_id(), comment.getReply_user_id(), comment.getContent());
+        indexService.addComment(goodsId, user.getOpenId(), comment.getReplyCommentId(), comment.getReplyUserId(), comment.getContent());
 
-        log.info("用户添加评论:用户id=【{}】,回复评论id=【{}】,回复内容=【{}】", user.getOpenId(),comment.getReply_comment_id(),comment.getReply_user_name());
+        log.info("用户添加评论:用户id=【{}】,回复评论id=【{}】,回复内容=【{}】", user.getOpenId(),comment.getReplyCommentId(),comment.getReplyUserName());
         return Response.ok();
 
     }

+ 1 - 1
goods-service/src/main/java/io/github/nnkwrik/goodsservice/model/vo/inner/BannerVo.java

@@ -9,6 +9,6 @@ import lombok.Data;
 @Data
 public class BannerVo {
     private Integer id;
-    private String image_url;
+    private String imageUrl;
     private String link;
 }

+ 1 - 1
goods-service/src/main/java/io/github/nnkwrik/goodsservice/model/vo/inner/CategoryVo.java

@@ -16,6 +16,6 @@ import java.util.List;
 public class CategoryVo {
     private Integer id;
     private String name;
-    private String wap_banner_url;
+    private String iconUrl;
     private List<CategoryVo> subCategoryList;
 }

+ 1 - 1
goods-service/src/main/java/io/github/nnkwrik/goodsservice/model/vo/inner/ChannelVo.java

@@ -11,5 +11,5 @@ public class ChannelVo {
     private Integer id;
     private String name;
     private String url;
-    private String icon_url;
+    private String iconUrl;
 }

+ 6 - 6
goods-service/src/main/java/io/github/nnkwrik/goodsservice/model/vo/inner/CommentVo.java

@@ -12,14 +12,14 @@ import java.util.List;
 @Data
 public class CommentVo {
     private Integer id;
-    private Integer goods_id;
-    private String user_id;
-    private Integer reply_comment_id;
-    private String reply_user_id;
+    private Integer goodsId;
+    private String userId;
+    private Integer replyCommentId;
+    private String replyUserId;
     private String content;
-    private String create_time;
+    private String createTime;
 
     private SimpleUser simpleUser;
-    private String reply_user_name;
+    private String replyUserName;
     private List<CommentVo> replyList;
 }

+ 1 - 1
goods-service/src/main/java/io/github/nnkwrik/goodsservice/model/vo/inner/GalleryVo.java

@@ -9,5 +9,5 @@ import lombok.Data;
 @Data
 public class GalleryVo {
     private Integer id;
-    private String img_url;
+    private String imgUrl;
 }

+ 4 - 4
goods-service/src/main/java/io/github/nnkwrik/goodsservice/model/vo/inner/GoodsDetailVo.java

@@ -10,10 +10,10 @@ import lombok.Data;
 @Data
 public class GoodsDetailVo extends GoodsSimpleVo {
 
-    private String goods_brief;
-    private Double market_price;
-    private Integer want_count;
-    private Integer browse_count;
+    private String desc;
+    private Double marketPrice;
+    private Integer wantCount;
+    private Integer browseCount;
 
     private Double postage;
     private String region;

+ 4 - 4
goods-service/src/main/java/io/github/nnkwrik/goodsservice/model/vo/inner/GoodsSimpleVo.java

@@ -10,9 +10,9 @@ import lombok.Data;
 public class GoodsSimpleVo {
     private Integer id;
     private String name;
-    private String list_pic_url;
+    private String primaryPicUrl;
     private Double price;
-    private Boolean is_selling;
-    private String sold_time;
-    private String last_edit;
+    private Boolean isSelling;
+    private String soldTime;
+    private String lastEdit;
 }

+ 15 - 17
goods-service/src/main/java/io/github/nnkwrik/goodsservice/service/impl/GoodsServiceImpl.java

@@ -6,7 +6,6 @@ import io.github.nnkwrik.common.dto.SimpleUser;
 import io.github.nnkwrik.goodsservice.client.UserClient;
 import io.github.nnkwrik.goodsservice.dao.CategoryMapper;
 import io.github.nnkwrik.goodsservice.dao.GoodsMapper;
-import io.github.nnkwrik.goodsservice.dao.OtherMapper;
 import io.github.nnkwrik.goodsservice.model.po.Category;
 import io.github.nnkwrik.goodsservice.model.po.Goods;
 import io.github.nnkwrik.goodsservice.model.po.GoodsComment;
@@ -41,12 +40,11 @@ public class GoodsServiceImpl implements GoodsService {
     private UserClient userClient;
 
 
-
     @Override
     public CategoryPageVo getGoodsAndBrotherCateById(int id, int page, int size) {
 
         List<Category> brotherCategory = categoryMapper.findBrotherCategory(id);
-        List<CategoryVo> brotherCategoryVo = PO2VO.convertList(PO2VO.category, brotherCategory);
+        List<CategoryVo> brotherCategoryVo = PO2VO.convertList(brotherCategory, CategoryVo.class);
         CategoryPageVo vo = getGoodsByCateId(id, page, size);
         vo.setBrotherCategory(brotherCategoryVo);
 
@@ -58,7 +56,7 @@ public class GoodsServiceImpl implements GoodsService {
         //紧跟在这个方法后的第一个MyBatis 查询方法会被进行分页
         PageHelper.startPage(page, size);
         List<Goods> simpleGoods = goodsMapper.findSimpleGoodsByCateId(id);
-        List<GoodsSimpleVo> goodsSimpleVo = PO2VO.convertList(PO2VO.goodsSimple, simpleGoods);
+        List<GoodsSimpleVo> goodsSimpleVo = PO2VO.convertList(simpleGoods, GoodsSimpleVo.class);
 
         return new CategoryPageVo(null, goodsSimpleVo);
     }
@@ -66,7 +64,7 @@ public class GoodsServiceImpl implements GoodsService {
     @Override
     public GoodsDetailVo getGoodsDetail(int id) {
         Goods detailGoods = goodsMapper.findDetailGoodsByGoodsId(id);
-        GoodsDetailVo goodsDetailVo = PO2VO.convert(PO2VO.goodsDetail, detailGoods);
+        GoodsDetailVo goodsDetailVo = PO2VO.convert(detailGoods, GoodsDetailVo.class);
 
         Response<SimpleUser> response = userClient.getSimpleUser(detailGoods.getSellerId());
         if (response.getErrno() == Response.USER_IS_NOT_EXIST) {
@@ -85,7 +83,7 @@ public class GoodsServiceImpl implements GoodsService {
     @Override
     public List<GalleryVo> getGoodsGallery(int goodsId) {
         List<GoodsGallery> gallery = goodsMapper.findGalleryByGoodsId(goodsId);
-        List<GalleryVo> galleryVo = PO2VO.convertList(PO2VO.gallery, gallery);
+        List<GalleryVo> galleryVo = PO2VO.convertList(gallery, GalleryVo.class);
 
         return galleryVo;
     }
@@ -104,7 +102,7 @@ public class GoodsServiceImpl implements GoodsService {
             simpleGoods = goodsMapper.findSimpleGoodsInSameParentCate(goodsId);
         }
 
-        List<GoodsSimpleVo> goodsSimpleVo = PO2VO.convertList(PO2VO.goodsSimple, simpleGoods);
+        List<GoodsSimpleVo> goodsSimpleVo = PO2VO.convertList(simpleGoods, GoodsSimpleVo.class);
         return new GoodsRelatedVo(goodsSimpleVo);
     }
 
@@ -120,15 +118,15 @@ public class GoodsServiceImpl implements GoodsService {
         Set<String> userIdSet = new HashSet<>();
         List<CommentVo> voList = baseComment.stream()
                 .map(base -> {
-                    CommentVo baseVo = PO2VO.convert(PO2VO.comment, base);
-                    userIdSet.add(baseVo.getUser_id());
+                    CommentVo baseVo = PO2VO.convert(base, CommentVo.class);
+                    userIdSet.add(baseVo.getUserId());
                     return baseVo;
                 }).map(baseVo -> {
                     //查找回复评论的评论
                     List<GoodsComment> replyComment = goodsMapper.findReplyComment(baseVo.getId());
-                    List<CommentVo> replyCommentVo = PO2VO.convertList(PO2VO.comment, replyComment);
+                    List<CommentVo> replyCommentVo = PO2VO.convertList(replyComment, CommentVo.class);
                     replyCommentVo.stream()
-                            .forEach(reply -> userIdSet.add(reply.getUser_id()));
+                            .forEach(reply -> userIdSet.add(reply.getUserId()));
                     baseVo.setReplyList(replyCommentVo);
                     return baseVo;
                 })
@@ -156,17 +154,17 @@ public class GoodsServiceImpl implements GoodsService {
     }
 
     private CommentVo setUser4Comment(Map<String, SimpleUser> simpleUserMap, CommentVo comment) {
-        SimpleUser userDTO = simpleUserMap.get(comment.getUser_id());
+        SimpleUser userDTO = simpleUserMap.get(comment.getUserId());
         if (userDTO == null) {
             comment.setSimpleUser(unknownUser());
         } else {
             comment.setSimpleUser(userDTO);
         }
-        SimpleUser replyUserDTO = simpleUserMap.get(comment.getReply_user_id());
-        if (replyUserDTO == null){
-            comment.setReply_user_name("用户不存在");
-        }else {
-            comment.setReply_user_name(replyUserDTO.getNickName());
+        SimpleUser replyUserDTO = simpleUserMap.get(comment.getReplyUserId());
+        if (replyUserDTO == null) {
+            comment.setReplyUserName("用户不存在");
+        } else {
+            comment.setReplyUserName(replyUserDTO.getNickName());
         }
         return comment;
     }

+ 8 - 8
goods-service/src/main/java/io/github/nnkwrik/goodsservice/service/impl/IndexServiceImpl.java

@@ -35,18 +35,18 @@ public class IndexServiceImpl implements IndexService {
     public IndexVO getIndex() {
         //广告
         List<Ad> adList = otherMapper.findAd();
-        List<BannerVo> bannerVoList = PO2VO.convertList(PO2VO.banner, adList);
+        List<BannerVo> bannerVoList = PO2VO.convertList(adList, BannerVo.class);
 
         //分类
         List<Channel> channelList = otherMapper.findChannel();
-        List<ChannelVo> channelVoList = PO2VO.convertList(PO2VO.channel, channelList);
+        List<ChannelVo> channelVoList = PO2VO.convertList(channelList, ChannelVo.class);
 
         //推荐商品
         int pageNum = 1;
         int pageSize = 10;
         PageHelper.startPage(pageNum, pageSize);
         List<Goods> goodsList = goodsMapper.findSimpleGoods();
-        List<GoodsSimpleVo> goodsSimpleVOList = PO2VO.convertList(PO2VO.goodsSimple, goodsList);
+        List<GoodsSimpleVo> goodsSimpleVOList = PO2VO.convertList(goodsList, GoodsSimpleVo.class);
 
         return new IndexVO(goodsSimpleVOList, bannerVoList, channelVoList);
     }
@@ -58,8 +58,8 @@ public class IndexServiceImpl implements IndexService {
         List<Category> subCategory = categoryMapper.findSubCategory(currentCate.getId());
 
 
-        List<CategoryVo> mainCategoryVo = PO2VO.convertList(PO2VO.category, mainCategory);
-        List<CategoryVo> subCategoryVo = PO2VO.convertList(PO2VO.category, subCategory);
+        List<CategoryVo> mainCategoryVo = PO2VO.convertList(mainCategory, CategoryVo.class);
+        List<CategoryVo> subCategoryVo = PO2VO.convertList(subCategory, CategoryVo.class);
         CategoryVo currentCategoryVo =
                 new CategoryVo(currentCate.getId(), currentCate.getName(), currentCate.getIconUrl(), subCategoryVo);
 
@@ -69,9 +69,9 @@ public class IndexServiceImpl implements IndexService {
     @Override
     public CatalogVo getCatalogById(int id) {
         List<Category> subCategory = categoryMapper.findSubCategory(id);
-        List<CategoryVo> subCategoryVo = PO2VO.convertList(PO2VO.category, subCategory);
+        List<CategoryVo> subCategoryVo = PO2VO.convertList(subCategory, CategoryVo.class);
         Category currentCategory = categoryMapper.findCategoryById(id);
-        CategoryVo currentCategoryVo = PO2VO.convert(PO2VO.category, currentCategory);
+        CategoryVo currentCategoryVo = PO2VO.convert(currentCategory, CategoryVo.class);
         currentCategoryVo.setSubCategoryList(subCategoryVo);
 
         return new CatalogVo(null, currentCategoryVo);
@@ -79,7 +79,7 @@ public class IndexServiceImpl implements IndexService {
 
     @Override
     public void addComment(int goodsId, String userId, int replyCommentId, String replyUserId, String content) {
-        otherMapper.addComment(goodsId,userId,replyCommentId,replyUserId,content);
+        otherMapper.addComment(goodsId, userId, replyCommentId, replyUserId, content);
     }
 
     @Override

+ 1 - 1
goods-service/src/main/java/io/github/nnkwrik/goodsservice/service/impl/SearchServiceImpl.java

@@ -29,7 +29,7 @@ public class SearchServiceImpl implements SearchService {
     public List<GoodsSimpleVo> searchByKeyword(String keyword, int page, int size) {
         PageHelper.startPage(page, size);
         List<Goods> goodsList = searchMapper.findGoodsByKeyword(keyword);
-        return PO2VO.convertList(PO2VO.goodsSimple, goodsList);
+        return PO2VO.convertList(goodsList,GoodsSimpleVo.class);
     }
 
     @Override

+ 4 - 4
goods-service/src/main/java/io/github/nnkwrik/goodsservice/service/impl/UserServiceImpl.java

@@ -38,26 +38,26 @@ public class UserServiceImpl implements UserService {
     public List<GoodsSimpleVo> getUserCollectList(String userId) {
         List<Goods> goodsList = userMapper.getUserCollect(userId);
 
-        return PO2VO.convertList(PO2VO.goodsSimple,goodsList);
+        return PO2VO.convertList(goodsList, GoodsSimpleVo.class);
     }
 
     @Override
     public List<GoodsSimpleVo> getUserBought(String buyerId) {
         List<Goods> goodsList = userMapper.getUserBought(buyerId);
-        return PO2VO.convertList(PO2VO.goodsSimple,goodsList);
+        return PO2VO.convertList(goodsList, GoodsSimpleVo.class);
     }
 
     @Override
     public List<GoodsSimpleVo> getUserSold(String sellerId) {
         List<Goods> goodsList = userMapper.getUserSold(sellerId);
-        return PO2VO.convertList(PO2VO.goodsSimple,goodsList);
+        return PO2VO.convertList(goodsList, GoodsSimpleVo.class);
 
     }
 
     @Override
     public List<GoodsSimpleVo> getUserPosted(String userId) {
         List<Goods> goodsList = userMapper.getUserPosted(userId);
-        return PO2VO.convertList(PO2VO.goodsSimple,goodsList);
+        return PO2VO.convertList(goodsList, GoodsSimpleVo.class);
     }
 
 

+ 57 - 87
goods-service/src/main/java/io/github/nnkwrik/goodsservice/util/PO2VO.java

@@ -1,112 +1,82 @@
 package io.github.nnkwrik.goodsservice.util;
 
-import io.github.nnkwrik.goodsservice.model.po.*;
-import io.github.nnkwrik.goodsservice.model.vo.inner.*;
 import org.springframework.beans.BeanUtils;
+import org.springframework.beans.BeanWrapper;
+import org.springframework.beans.BeanWrapperImpl;
 
+import java.beans.PropertyDescriptor;
 import java.text.SimpleDateFormat;
+import java.util.Date;
 import java.util.List;
-import java.util.function.Function;
 import java.util.stream.Collectors;
 
 /**
- * TODO 后期前后端全改成camel
- *
+ * po转vo
  * @author nnkwrik
  * @date 18/11/15 18:00
  */
 public class PO2VO {
 
-    public static Function<Category, CategoryVo> category =
-            po -> {
-                CategoryVo vo = new CategoryVo();
-                BeanUtils.copyProperties(po, vo);
-                //手动拷贝和po不相同的属性。
-                vo.setWap_banner_url(po.getIconUrl());
-                return vo;
-            };
-
-    public static Function<Channel, ChannelVo> channel =
-            po -> {
-                ChannelVo vo = new ChannelVo();
-                BeanUtils.copyProperties(po, vo);
-                vo.setIcon_url(po.getIconUrl());
-                return vo;
-            };
-
-    public static Function<Ad, BannerVo> banner =
-            po -> {
-                BannerVo vo = new BannerVo();
-                BeanUtils.copyProperties(po, vo);
-                vo.setImage_url(po.getImageUrl());
-                return vo;
-            };
-
-    public static Function<Goods, GoodsSimpleVo> goodsSimple =
-            po -> {
-                GoodsSimpleVo vo = new GoodsSimpleVo();
-                BeanUtils.copyProperties(po, vo);
-                vo.setList_pic_url(po.getPrimaryPicUrl());
-                vo.setIs_selling(po.getIsSelling());
-                //Date转String
-                if (po.getLastEdit() != null) {
-                    SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm");
-                    vo.setLast_edit(formatter.format(po.getLastEdit()));
-                }
+    /**
+     * po转vo
+     * @param po
+     * @param voClass vo的类型
+     * @param <T>
+     * @param <R>
+     * @return
+     */
+    public static <T, R> R convert(T po, Class<R> voClass) {
+        R vo = null;
+        try {
+            vo = voClass.newInstance();
+            BeanUtils.copyProperties(po, vo);
+            PO2VO.checkDate(po, vo);
+        } catch (Exception e) {
+            e.printStackTrace();
+
+        }
+        return vo;
+    }
 
-                if (po.getSoldTime() != null) {
-                    SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm");
-                    vo.setSold_time(formatter.format(po.getSoldTime()));
-                }
-                return vo;
-            };
+    /**
+     * poList转voList
+     * @param poList
+     * @param voClass vo的类型
+     * @param <T>
+     * @param <R>
+     * @return
+     */
+    public static <T, R> List<R> convertList(List<T> poList, Class<R> voClass) {
+        return poList.stream()
+                .map(po -> PO2VO.convert(po, voClass)).collect(Collectors.toList());
+    }
 
-    public static Function<Goods, GoodsDetailVo> goodsDetail =
-            po -> {
-                GoodsSimpleVo simpleVo = convert(goodsSimple, po);
-                GoodsDetailVo vo = new GoodsDetailVo();
-                BeanUtils.copyProperties(simpleVo, vo);
-                vo.setGoods_brief(po.getDesc());
-                vo.setMarket_price(po.getMarketPrice());
-                vo.setWant_count(po.getWantCount());
-                vo.setBrowse_count(po.getBrowseCount());
 
-                BeanUtils.copyProperties(po, vo);
-                return vo;
-            };
+    /**
+     * 把po中的Date对象转换成String,并对vo进行赋值
+     *
+     * @param po
+     * @param vo
+     * @param <T>
+     * @param <R>
+     */
+    private static <T, R> void checkDate(T po, R vo) {
+        BeanWrapper poWrapper = new BeanWrapperImpl(po);
+        BeanWrapper voWrapper = new BeanWrapperImpl(vo);
 
-    public static Function<GoodsGallery, GalleryVo> gallery =
-            po -> {
-                GalleryVo vo = new GalleryVo();
-                BeanUtils.copyProperties(po, vo);
-                vo.setImg_url(po.getImgUrl());
-                return vo;
-            };
 
-    public static Function<GoodsComment, CommentVo> comment =
-            po -> {
-                CommentVo vo = new CommentVo();
-                BeanUtils.copyProperties(po, vo);
-                vo.setGoods_id(po.getGoodsId());
-                vo.setUser_id(po.getUserId());
-                vo.setReply_comment_id(po.getReplyCommentId());
-                vo.setReply_user_id(po.getReplyUserId());
-                if (po.getCreateTime() != null) {
-                    SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm");
-                    vo.setCreate_time(formatter.format(po.getCreateTime()));
-                }
+        for (PropertyDescriptor pd : poWrapper.getPropertyDescriptors()) {
+            Object date;
+            if (pd.getPropertyType() == Date.class
+                    && (date = poWrapper.getPropertyValue(pd.getDisplayName())) != null) {
 
-                return vo;
-            };
+                SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm");
+                String formatted = formatter.format(date);
 
-    public static <T, R> R convert(Function<T, R> converter, T po) {
-        return converter.apply(po);
-    }
+                voWrapper.setPropertyValue(pd.getDisplayName(), formatted);
 
-    public static <T, R> List<R> convertList(Function<T, R> converter, List<T> poList) {
-        return poList.stream()
-                .map(converter).collect(Collectors.toList());
+            }
+        }
     }
 
-
 }

+ 1 - 1
wx-front/pages/catalog/catalog.wxml

@@ -20,7 +20,7 @@
         </view>
         <view class="bd">
             <navigator url="/pages/category/category?id={{item.id}}" class="item {{(index+1) % 3 == 0 ? 'last' : ''}}" wx:for="{{currentCategory.subCategoryList}}" wx:key="{{item.id}}">
-                <image class="icon" src="{{item.wap_banner_url}}"></image>
+                <image class="icon" src="{{item.iconUrl}}"></image>
                 <text class="txt">{{item.name}}</text>
             </navigator>
         </view>

+ 1 - 1
wx-front/pages/category/category.wxml

@@ -12,7 +12,7 @@
     <view class="cate-item">
         <view class="b">
             <navigator class="item {{(iindex + 1) % 2 == 0 ? 'item-b' : ''}}"   url="/pages/goods/goods?id={{iitem.id}}" wx:for="{{goodsList}}" wx:for-item="iitem" wx:for-index="iindex" >
-                <image class="img" src="{{iitem.list_pic_url}}" background-size="cover"></image>
+                <image class="img" src="{{iitem.primaryPicUrl}}" background-size="cover"></image>
                 <text class="name">{{iitem.name}}</text>
                 <text class="price">¥{{iitem.price}}</text>
             </navigator>

+ 1 - 1
wx-front/pages/category/category.wxss

@@ -35,7 +35,7 @@
 
 .cate-nav .item.active .name{
     color: #000;
-    border-bottom: 2px solid #fd9f06;
+    border-bottom: 2px solid #f94b4b;
 }
 
 .cate-item{

+ 12 - 12
wx-front/pages/goods/goods.wxml

@@ -1,11 +1,11 @@
 <view class="container">
   <swiper class="goodsimgs" indicator-dots="true" autoplay="true" interval="3000" duration="1000">
     <swiper-item wx:for="{{gallery}}" wx:key="{{item.id}}">
-      <image src="{{item.img_url}}" background-size="cover"></image>
+      <image src="{{item.imgUrl}}" background-size="cover"></image>
     </swiper-item>
   </swiper>
   <view class="location-time">
-    <view class="icon time">最后编辑:{{goods.last_edit}}</view>
+    <view class="icon time">最后编辑:{{goods.lastEdit}}</view>
     <view class="icon location">地点:{{goods.region}}</view>
   </view>
   <view class="goods-info">
@@ -13,11 +13,11 @@
       <text class="name">{{goods.name}}</text>
       <view class='flex'>
         <text class="price">¥{{goods.price}}</text>
-        <view wx:if='{{!goods.is_selling}}' class='tag'>已出售</view>
+        <view wx:if='{{!goods.isSelling}}' class='tag'>已出售</view>
       </view>
-      <text wx:if="{{goods.market_price}}" class="market-price">原价 : ¥{{goods.market_price}}</text>
+      <text wx:if="{{goods.marketPrice}}" class="market-price">原价 : ¥{{goods.marketPrice}}</text>
 
-      <text class="desc">{{goods.goods_brief}}</text>
+      <text class="desc">{{goods.desc}}</text>
       <!-- <view class="brand" wx:if="{{brand.name}}">
         <navigator url="../brandDetail/brandDetail?id={{brand.brandId}}">
           <text>{{brand.name}}</text>
@@ -36,8 +36,8 @@
 
     </view>
     <view class="t">
-      <view class="tag">{{goods.want_count}}人想要</view>
-      <view class="tag">浏览 {{goods.browse_count}}</view>
+      <view class="tag">{{goods.wantCount}}人想要</view>
+      <view class="tag">浏览 {{goods.browseCount}}</view>
     </view>
   </view>
 
@@ -110,7 +110,7 @@
                 <image src="{{item.simpleUser.avatarUrl}}"></image>
                 <text>{{item.simpleUser.nickName}}</text>
               </view>
-              <view class="time">{{item.create_time}}</view>
+              <view class="time">{{item.createTime}}</view>
             </view>
             <view class="content">
               {{item.content}}
@@ -123,10 +123,10 @@
                 <image src="{{iitem.simpleUser.avatarUrl}}"></image>
                 <text>{{iitem.simpleUser.nickName}}</text>
               </view>
-              <view class="time">{{iitem.create_time}}</view>
+              <view class="time">{{iitem.createTime}}</view>
             </view>
             <view class="reply-content">
-              回复@{{iitem.reply_user_name}}:{{iitem.content}}
+              回复@{{iitem.replyUserName}}:{{iitem.content}}
             </view>
           </view>
 
@@ -192,7 +192,7 @@
     <view class="b">
       <view class="item" wx:for="{{relatedGoods}}" wx:key="{{item.id}}">
         <navigator url="/pages/goods/goods?id={{item.id}}">
-          <image class="img" src="{{item.list_pic_url}}" background-size="cover"></image>
+          <image class="img" src="{{item.primaryPicUrl}}" background-size="cover"></image>
           <text class="name">{{item.name}}</text>
           <text class="price">¥{{item.price}}</text>
         </navigator>
@@ -277,6 +277,6 @@
     </view>
   </view> -->
   <!-- <view class="c">立即购买</view> -->
-  <view class="r" wx:if='{{!goods.is_selling}}' bindtap="addToCart">该商品已出售</view>
+  <view class="r" wx:if='{{!goods.isSelling}}' bindtap="addToCart">该商品已出售</view>
   <view class="r" wx:else bindtap="addToCart">想要</view>
 </view>

+ 3 - 3
wx-front/pages/index/index.wxml

@@ -3,7 +3,7 @@
   <swiper class="banner" indicator-dots="true" autoplay="true" interval="3000" duration="1000">
     <swiper-item wx:for="{{banner}}" wx:key="{{item.id}}">
       <navigator url="{{item.link}}">
-        <image src="{{item.image_url}}" background-size="cover"></image>
+        <image src="{{item.imageUrl}}" background-size="cover"></image>
       </navigator>
     </swiper-item>
 
@@ -12,7 +12,7 @@
   <!-- 首页分类 -->
   <view class="m-menu">
     <navigator class="item" url="{{item.url}}" wx:for="{{channel}}" wx:key="{{item.id}}">
-      <image src="{{item.icon_url}}" background-size="cover"></image>
+      <image src="{{item.iconUrl}}" background-size="cover"></image>
       <text>{{item.name}}</text>
     </navigator>
     <navigator open-type="reLaunch" class="item" url="/pages/catalog/catalog">
@@ -35,7 +35,7 @@
     <view class="b">
       <view class="item" wx:for="{{indexGoods}}" wx:for-index="index" wx:for-item="item" wx:key="{{item.id}}">
         <navigator url="../goods/goods?id={{item.id}}">
-          <image class="img" src="{{item.list_pic_url}}" background-size="cover"></image>
+          <image class="img" src="{{item.primaryPicUrl}}" background-size="cover"></image>
           <text class="name">{{item.name}}</text>
           <text class="price">¥{{item.price}}</text>
         </navigator>

+ 1 - 1
wx-front/pages/search/search.wxml

@@ -54,7 +54,7 @@
     <view class="cate-item">
       <view class="b">
         <navigator class="item {{(iindex + 1) % 2 == 0 ? 'item-b' : ''}}" url="/pages/goods/goods?id={{iitem.id}}" wx:for="{{goodsList}}" wx:for-item="iitem" wx:for-index="iindex">
-          <image class="img" src="{{iitem.list_pic_url}}" background-size="cover"></image>
+          <image class="img" src="{{iitem.primaryPicUrl}}" background-size="cover"></image>
           <text class="name">{{iitem.name}}</text>
           <text class="price">¥{{iitem.price}}</text>
         </navigator>

+ 2 - 3
wx-front/pages/ucenter/bought/bought.wxml

@@ -1,13 +1,12 @@
 <view class="container">
   <view class="collect-list" wx:if='{{boughtList.length}}'>
     <view class="item" bindtap="openGoods" wx:for="{{boughtList}}" wx:key="{{item.id}}" data-index="{{index}}">
-      <image class="img" src="{{item.list_pic_url}}"></image>
+      <image class="img" src="{{item.primaryPicUrl}}"></image>
       <view class="info">
         <view class="name">{{item.name}}</view>
-        <view class="subtitle">{{item.goods_brief}}</view>
         <view class="flex">
           <view class="price">¥{{item.price}}</view>
-          <view class='time'>购买于 :{{item.sold_time}}</view>
+          <view class='time'>购买于 : {{item.soldTime}}</view>
         </view>
       </view>
     </view>

+ 0 - 7
wx-front/pages/ucenter/bought/bought.wxss

@@ -51,13 +51,6 @@ page {
   line-height: 40rpx;
 }
 
-.item .info .subtitle {
-  margin-top: 8rpx;
-  font-size: 24rpx;
-  color: #888;
-  line-height: 40rpx;
-}
-
 .item .info .price {
   margin-top: 8rpx;
   font-size: 28rpx;

+ 2 - 3
wx-front/pages/ucenter/collect/collect.wxml

@@ -1,13 +1,12 @@
 <view class="container">
   <view class="collect-list" wx:if='{{collectList.length}}'>
     <view class="item" bindtap="openGoods" bindtouchstart="touchStart" bindtouchend="touchEnd" wx:for="{{collectList}}" wx:key="{{item.id}}" data-index="{{index}}">
-      <image class="img" src="{{item.list_pic_url}}"></image>
+      <image class="img" src="{{item.primaryPicUrl}}"></image>
       <view class="info">
         <view class="name">{{item.name}}</view>
-        <view class="subtitle">{{item.goods_brief}}</view>
         <view class="flex">
           <view class="price">¥{{item.price}}</view>
-          <view class='tag' wx:if='{{!item.is_selling}}'>已出售</view>
+          <view class='tag' wx:if='{{!item.isSelling}}'>已出售</view>
         </view>
       </view>
     </view>

+ 0 - 7
wx-front/pages/ucenter/collect/collect.wxss

@@ -52,13 +52,6 @@ page{
 }
 
 
-.item .info .subtitle{
-  margin-top: 8rpx;
-  font-size: 24rpx;
-  color: #888;
-  line-height: 40rpx;
-}
-
 .item .info .price{
   margin-top: 8rpx;
   font-size: 28rpx;

+ 2 - 3
wx-front/pages/ucenter/posted/posted.wxml

@@ -1,13 +1,12 @@
 <view class="container">
   <view class="collect-list" wx:if='{{postedList.length}}'>
     <view class="item" bindtap="openGoods" wx:for="{{postedList}}" wx:key="{{item.id}}" data-index="{{index}}">
-      <image class="img" src="{{item.list_pic_url}}"></image>
+      <image class="img" src="{{item.primaryPicUrl}}"></image>
       <view class="info">
         <view class="name">{{item.name}}</view>
-        <view class="subtitle">{{item.goods_brief}}</view>
         <view class="flex">
           <view class="price">¥{{item.price}}</view>
-          <view class='time'>最后编辑 :{{item.last_edit}}</view>
+          <view class='time'>最后编辑:{{item.lastEdit}}</view>
         </view>
       </view>
     </view>

+ 0 - 6
wx-front/pages/ucenter/posted/posted.wxss

@@ -51,12 +51,6 @@ page {
   line-height: 40rpx;
 }
 
-.item .info .subtitle {
-  margin-top: 8rpx;
-  font-size: 24rpx;
-  color: #888;
-  line-height: 40rpx;
-}
 
 .item .info .price {
   margin-top: 8rpx;

+ 2 - 3
wx-front/pages/ucenter/sold/sold.wxml

@@ -1,13 +1,12 @@
 <view class="container">
   <view class="collect-list" wx:if='{{soldList.length}}'>
     <view class="item" bindtap="openGoods" wx:for="{{soldList}}" wx:key="{{item.id}}" data-index="{{index}}">
-      <image class="img" src="{{item.list_pic_url}}"></image>
+      <image class="img" src="{{item.primaryPicUrl}}"></image>
       <view class="info">
         <view class="name">{{item.name}}</view>
-        <view class="subtitle">{{item.goods_brief}}</view>
         <view class="flex">
           <view class="price">¥{{item.price}}</view>
-          <view class='time'>出售于 :{{item.sold_time}}</view>
+          <view class='time'>出售于 : {{item.soldTime}}</view>
         </view>
       </view>
     </view>

+ 0 - 6
wx-front/pages/ucenter/sold/sold.wxss

@@ -51,12 +51,6 @@ page {
   line-height: 40rpx;
 }
 
-.item .info .subtitle {
-  margin-top: 8rpx;
-  font-size: 24rpx;
-  color: #888;
-  line-height: 40rpx;
-}
 
 .item .info .price {
   margin-top: 8rpx;