Unverified Commit b68151cb authored by Menethil's avatar Menethil Committed by GitHub
Browse files

Merge pull request #1 from linlinjava/master

update
parents 126d027a 02679509
......@@ -7,9 +7,9 @@ spring.datasource.druid.url=jdbc:mysql://localhost:3306/litemall?useUnicode=true
spring.datasource.druid.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.druid.username=litemall
spring.datasource.druid.password=litemall123456
spring.datasource.druid.initial-size=50
spring.datasource.druid.max-active=100
spring.datasource.druid.min-idle=20
spring.datasource.druid.initial-size=10
spring.datasource.druid.max-active=50
spring.datasource.druid.min-idle=10
spring.datasource.druid.max-wait=60000
spring.datasource.druid.pool-prepared-statements=true
spring.datasource.druid.max-pool-prepared-statement-per-connection-size=20
......@@ -26,6 +26,7 @@ logging.level.org.mybatis=ERROR
logging.level.org.linlinjava.litemall.db=ERROR
logging.level.org.linlinjava.litemall=DEBUG
# 开发者应该设置成自己的域名
org.linlinjava.litemall.os.address=www.example.com
org.linlinjava.litemall.os.port=80
\ No newline at end of file
# 开发者应该设置成自己的域名,必须附带http或者https
# 开发者可以查看OsStorageController.generateUrl
org.linlinjava.litemall.os.address=https://www.example.com
org.linlinjava.litemall.os.port=443
\ No newline at end of file
......@@ -10,6 +10,10 @@
<version>0.1.0</version>
</parent>
<properties>
<docker.image.prefix>litemall</docker.image.prefix>
</properties>
<dependencies>
<dependency>
......@@ -35,6 +39,22 @@
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
......@@ -53,6 +73,24 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.4.13</version>
<configuration>
<imageName>${docker.image.prefix}/${project.artifactId}</imageName>
<dockerDirectory>src/main/docker</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
</configuration>
</plugin>
</plugins>
</build>
......
FROM java
MAINTAINER tiger <tiger@microsoul.com>
ADD /litemall-wx-api-0.1.0.jar //
ENTRYPOINT java -jar /litemall-wx-api-0.1.0.jar
\ No newline at end of file
......@@ -69,7 +69,7 @@ public class WxAuthController {
List<LitemallUser> userList =userService.queryByUsername(username);
LitemallUser user = null;
if(userList.size() > 1){
return ResponseUtil.fail502();
return ResponseUtil.serious();
}
else if(userList.size() == 0){
return ResponseUtil.badArgumentValue();
......@@ -147,11 +147,13 @@ public class WxAuthController {
user.setWeixinOpenid(openId);
user.setAvatar(userInfo.getAvatarUrl());
user.setNickname(userInfo.getNickName());
user.setGender(userInfo.getGender() == 1 ? "男" : "女");
user.setUserLevel("普通用户");
user.setStatus("可用");
user.setGender(userInfo.getGender());
user.setUserLevel((byte)0);
user.setStatus((byte)0);
user.setLastLoginTime(LocalDateTime.now());
user.setLastLoginIp(IpUtil.client(request));
user.setAddTime(LocalDateTime.now());
userService.add(user);
}
else{
......@@ -232,11 +234,12 @@ public class WxAuthController {
user.setWeixinOpenid("");
user.setAvatar("https://yanxuan.nosdn.127.net/80841d741d7fa3073e0ae27bf487339f.jpg?imageView&quality=90&thumbnail=64x64");
user.setNickname(username);
user.setGender("未知");
user.setUserLevel("普通用户");
user.setStatus("可用");
user.setGender((byte)0);
user.setUserLevel((byte)0);
user.setStatus((byte)0);
user.setLastLoginTime(LocalDateTime.now());
user.setLastLoginIp(IpUtil.client(request));
user.setAddTime(LocalDateTime.now());
userService.add(user);
......
......@@ -32,8 +32,6 @@ public class WxCartController {
private LitemallGoodsSpecificationService goodsSpecificationService;
@Autowired
private LitemallAddressService addressService;
@Autowired
private LitemallCouponService apiCouponService;
/**
* 购物车
......@@ -65,10 +63,10 @@ public class WxCartController {
BigDecimal checkedGoodsAmount = new BigDecimal(0.00);
for (LitemallCart cart : cartList) {
goodsCount += cart.getNumber();
goodsAmount = goodsAmount.add(cart.getRetailPrice().multiply(new BigDecimal(cart.getNumber())));
goodsAmount = goodsAmount.add(cart.getPrice().multiply(new BigDecimal(cart.getNumber())));
if (cart.getChecked()) {
checkedGoodsCount += cart.getNumber();
checkedGoodsAmount = checkedGoodsAmount.add(cart.getRetailPrice().multiply(new BigDecimal(cart.getNumber())));
checkedGoodsAmount = checkedGoodsAmount.add(cart.getPrice().multiply(new BigDecimal(cart.getNumber())));
}
}
Map<String, Object> cartTotal = new HashMap<>();
......@@ -127,32 +125,16 @@ public class WxCartController {
LitemallCart existCart = cartService.queryExist(goodsId, productId, userId);
if(existCart == null){
//取得规格的信息,判断规格库存
if(product == null || number > product.getGoodsNumber() ){
if(product == null || number > product.getNumber() ){
return ResponseUtil.fail(400, "库存不足");
}
Integer[] ids = product.getGoodsSpecificationIds();
String goodsSpecificationValue = null;
for(Integer id : ids){
LitemallGoodsSpecification goodsSpecification = goodsSpecificationService.findById(id);
if(goodsSpecification == null || !goodsSpecification.getGoodsId().equals(goodsId)){
return ResponseUtil.badArgument();
}
if(goodsSpecificationValue == null){
goodsSpecificationValue = goodsSpecification.getValue();
}
else {
goodsSpecificationValue = goodsSpecificationValue + " " + goodsSpecification.getValue();
}
}
cart.setId(null);
cart.setGoodsSn(goods.getGoodsSn());
cart.setGoodsName((goods.getName()));
cart.setPicUrl(goods.getPrimaryPicUrl());
cart.setRetailPrice(product.getRetailPrice());
cart.setGoodsSpecificationIds(product.getGoodsSpecificationIds());
cart.setGoodsSpecificationValues(goodsSpecificationValue);
cart.setPicUrl(goods.getPicUrl());
cart.setPrice(product.getPrice());
cart.setSpecifications(product.getSpecifications());
cart.setUserId(userId);
cart.setChecked(true);
cartService.add(cart);
......@@ -160,7 +142,7 @@ public class WxCartController {
else{
//取得规格的信息,判断规格库存
int num = existCart.getNumber() + number;
if(num > product.getGoodsNumber()){
if(num > product.getNumber()){
return ResponseUtil.fail(400, "库存不足");
}
existCart.setNumber((short)num);
......@@ -215,32 +197,16 @@ public class WxCartController {
LitemallCart existCart = cartService.queryExist(goodsId, productId, userId);
if(existCart == null){
//取得规格的信息,判断规格库存
if(product == null || number > product.getGoodsNumber() ){
if(product == null || number > product.getNumber() ){
return ResponseUtil.fail(400, "库存不足");
}
Integer[] ids = product.getGoodsSpecificationIds();
String goodsSpecificationValue = null;
for(Integer id : ids){
LitemallGoodsSpecification goodsSpecification = goodsSpecificationService.findById(id);
if(goodsSpecification == null || !goodsSpecification.getGoodsId().equals(goodsId)){
return ResponseUtil.badArgument();
}
if(goodsSpecificationValue == null){
goodsSpecificationValue = goodsSpecification.getValue();
}
else {
goodsSpecificationValue = goodsSpecificationValue + " " + goodsSpecification.getValue();
}
}
cart.setId(null);
cart.setGoodsSn(goods.getGoodsSn());
cart.setGoodsName((goods.getName()));
cart.setPicUrl(goods.getPrimaryPicUrl());
cart.setRetailPrice(product.getRetailPrice());
cart.setGoodsSpecificationIds(product.getGoodsSpecificationIds());
cart.setGoodsSpecificationValues(goodsSpecificationValue);
cart.setPicUrl(goods.getPicUrl());
cart.setPrice(product.getPrice());
cart.setSpecifications(product.getSpecifications());
cart.setUserId(userId);
cart.setChecked(true);
cartService.add(cart);
......@@ -248,7 +214,7 @@ public class WxCartController {
else{
//取得规格的信息,判断规格库存
int num = number;
if(num > product.getGoodsNumber()){
if(num > product.getNumber()){
return ResponseUtil.fail(400, "库存不足");
}
existCart.setNumber((short)num);
......@@ -307,7 +273,7 @@ public class WxCartController {
//取得规格的信息,判断规格库存
LitemallProduct product = productService.findById(productId);
if(product == null || product.getGoodsNumber() < number){
if(product == null || product.getNumber() < number){
return ResponseUtil.fail(403, "库存不足");
}
......@@ -498,7 +464,7 @@ public class WxCartController {
}
BigDecimal checkedGoodsPrice = new BigDecimal(0.00);
for (LitemallCart cart : checkedGoodsList) {
checkedGoodsPrice = checkedGoodsPrice.add(cart.getRetailPrice().multiply(new BigDecimal(cart.getNumber())));
checkedGoodsPrice = checkedGoodsPrice.add(cart.getPrice().multiply(new BigDecimal(cart.getNumber())));
}
// 根据订单商品总价计算运费,满88则免运费,否则8元;
......
......@@ -29,7 +29,7 @@ public class WxCollectController {
* 用户收藏列表
*
* @param userId 用户ID
* @param typeId 类型ID
* @param type 类型,如果是0则是商品收藏,如果是1则是专题收藏
* 目前没有使用
* @param page 分页页数
* @param size 分页大小
......@@ -47,31 +47,31 @@ public class WxCollectController {
* 失败则 { errno: XXX, errmsg: XXX }
*/
@GetMapping("list")
public Object list(@LoginUser Integer userId, Integer typeId,
public Object list(@LoginUser Integer userId, Byte type,
@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "size", defaultValue = "10") Integer size) {
if(userId == null){
return ResponseUtil.unlogin();
}
if(typeId == null){
if(type == null){
return ResponseUtil.badArgument();
}
List<LitemallCollect> collectList = collectService.queryByType(userId, typeId, page, size);
int count = collectService.countByType(userId, typeId);
List<LitemallCollect> collectList = collectService.queryByType(userId, type, page, size);
int count = collectService.countByType(userId, type);
int totalPages = (int) Math.ceil((double) count / size);
List<Object> collects = new ArrayList<>(collectList.size());
for(LitemallCollect collect : collectList){
Map<String, Object> c = new HashMap();
c.put("id", collect.getId());
c.put("typeId", collect.getTypeId());
c.put("type", collect.getType());
c.put("valueId", collect.getValueId());
LitemallGoods goods = goodsService.findById(collect.getValueId());
c.put("name", goods.getName());
c.put("goodsBrief", goods.getGoodsBrief());
c.put("listPicUrl", goods.getListPicUrl());
c.put("brief", goods.getBrief());
c.put("picUrl", goods.getPicUrl());
c.put("retailPrice", goods.getRetailPrice());
collects.add(c);
......@@ -109,13 +109,13 @@ public class WxCollectController {
return ResponseUtil.badArgument();
}
Integer typeId = JacksonUtil.parseInteger(body, "typeId");
Byte type = JacksonUtil.parseByte(body, "type");
Integer valueId = JacksonUtil.parseInteger(body, "valueId");
if(!ObjectUtils.allNotNull(typeId, valueId)){
if(!ObjectUtils.allNotNull(type, valueId)){
return ResponseUtil.badArgument();
}
LitemallCollect collect = collectService.queryByTypeAndValue(userId, typeId, valueId);
LitemallCollect collect = collectService.queryByTypeAndValue(userId, type, valueId);
String handleType = null;
if(collect != null){
......@@ -127,7 +127,7 @@ public class WxCollectController {
collect = new LitemallCollect();
collect.setUserId(userId);
collect.setValueId(valueId);
collect.setTypeId(typeId);
collect.setType(type);
collect.setAddTime(LocalDateTime.now());
collectService.add(collect);
}
......
......@@ -3,7 +3,6 @@ package org.linlinjava.litemall.wx.web;
import org.apache.commons.lang3.ObjectUtils;
import org.linlinjava.litemall.db.domain.LitemallComment;
import org.linlinjava.litemall.db.service.LitemallCommentService;
import org.linlinjava.litemall.db.service.LitemallCouponService;
import org.linlinjava.litemall.db.service.LitemallUserService;
import org.linlinjava.litemall.core.util.ResponseUtil;
import org.linlinjava.litemall.wx.annotation.LoginUser;
......@@ -26,8 +25,6 @@ public class WxCommentController {
@Autowired
private LitemallUserService userService;
@Autowired
private LitemallCouponService couponService;
@Autowired
private UserInfoService userInfoService;
/**
......@@ -66,8 +63,8 @@ public class WxCommentController {
/**
* 评论数量
*
* @param typeId 类型ID。 如果是0,则查询商品评论;如果是1,则查询专题评论。
* @param valueId 商品或专题ID。如果typeId是0,则是商品ID;如果typeId是1,则是专题ID。
* @param type 类型ID。 如果是0,则查询商品评论;如果是1,则查询专题评论。
* @param valueId 商品或专题ID。如果type是0,则是商品ID;如果type是1,则是专题ID。
* @return 评论数量
* 成功则
* {
......@@ -82,9 +79,9 @@ public class WxCommentController {
* 失败则 { errno: XXX, errmsg: XXX }
*/
@GetMapping("count")
public Object count(Byte typeId, Integer valueId) {
int allCount = commentService.count(typeId, valueId, 0, 0, 0);
int hasPicCount = commentService.count(typeId, valueId, 1, 0, 0);
public Object count(Byte type, Integer valueId) {
int allCount = commentService.count(type, valueId, 0, 0, 0);
int hasPicCount = commentService.count(type, valueId, 1, 0, 0);
Map<String, Object> data = new HashMap();
data.put("allCount", allCount);
data.put("hasPicCount", hasPicCount);
......@@ -94,8 +91,8 @@ public class WxCommentController {
/**
* 评论列表
*
* @param typeId 类型ID。 如果是0,则查询商品评论;如果是1,则查询专题评论。
* @param valueId 商品或专题ID。如果typeId是0,则是商品ID;如果typeId是1,则是专题ID。
* @param type 类型ID。 如果是0,则查询商品评论;如果是1,则查询专题评论。
* @param valueId 商品或专题ID。如果type是0,则是商品ID;如果type是1,则是专题ID。
* @param showType 显示类型。如果是0,则查询全部;如果是1,则查询有图片的评论。
* @param page 分页页数
* @param size 分页大小
......@@ -114,15 +111,15 @@ public class WxCommentController {
* 失败则 { errno: XXX, errmsg: XXX }
*/
@GetMapping("list")
public Object list(Byte typeId, Integer valueId, Integer showType,
public Object list(Byte type, Integer valueId, Integer showType,
@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "size", defaultValue = "10") Integer size) {
if(!ObjectUtils.allNotNull(typeId, valueId, showType)){
if(!ObjectUtils.allNotNull(type, valueId, showType)){
return ResponseUtil.badArgument();
}
List<LitemallComment> commentList = commentService.query(typeId, valueId, showType, page, size);
int count = commentService.count(typeId, valueId, showType, page, size);
List<LitemallComment> commentList = commentService.query(type, valueId, showType, page, size);
int count = commentService.count(type, valueId, showType, page, size);
List<Map<String, Object>> commentVoList = new ArrayList<>(commentList.size());
for(LitemallComment comment : commentList){
......
......@@ -97,8 +97,8 @@ public class WxFootprintController {
LitemallGoods goods = goodsService.findById(footprint.getGoodsId());
c.put("name", goods.getName());
c.put("goodsBrief", goods.getGoodsBrief());
c.put("listPicUrl", goods.getListPicUrl());
c.put("brief", goods.getBrief());
c.put("picUrl", goods.getPicUrl());
c.put("retailPrice", goods.getRetailPrice());
footprintVoList.add(c);
......
......@@ -5,7 +5,6 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.linlinjava.litemall.db.domain.*;
import org.linlinjava.litemall.db.service.*;
import org.linlinjava.litemall.db.util.SortUtil;
import org.linlinjava.litemall.core.util.ResponseUtil;
import org.linlinjava.litemall.wx.annotation.LoginUser;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -48,8 +47,6 @@ public class WxGoodsController {
@Autowired
private LitemallSearchHistoryService searchHistoryService;
@Autowired
private LitemallCouponService apiCouponService;
@Autowired
private LitemallCartService cartService;
@Autowired
private LitemallGoodsSpecificationService goodsSpecificationService;
......@@ -182,14 +179,14 @@ public class WxGoodsController {
LitemallCategory parent = null;
List<LitemallCategory> children = null;
if(cur.getParentId() == 0){
if(cur.getPid() == 0){
parent = cur;
children = categoryService.queryByPid(cur.getId());
cur = children.get(0);
}
else{
parent = categoryService.findById(cur.getParentId());
children = categoryService.queryByPid(cur.getParentId());
parent = categoryService.findById(cur.getPid());
children = categoryService.queryByPid(cur.getPid());
}
Map<String, Object> data = new HashMap<>();
data.put("currentCategory", cur);
......@@ -229,14 +226,12 @@ public class WxGoodsController {
* 失败则 { errno: XXX, errmsg: XXX }
*/
@GetMapping("list")
public Object list(Integer categoryId, Integer brandId, String keyword, Integer isNew, Integer isHot,
public Object list(Integer categoryId, Integer brandId, String keyword, Boolean isNew, Boolean isHot,
@LoginUser Integer userId,
@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "size", defaultValue = "10") Integer size,
String sort, String order) {
String sortWithOrder = SortUtil.goodsSort(sort, order);
//添加到搜索历史
if (userId != null && !StringUtils.isNullOrEmpty(keyword)) {
LitemallSearchHistory searchHistoryVo = new LitemallSearchHistory();
......@@ -248,8 +243,8 @@ public class WxGoodsController {
}
//查询列表数据
List<LitemallGoods> goodsList = goodsService.querySelective(categoryId, brandId, keyword, isHot, isNew, page, size, sortWithOrder);
int total = goodsService.countSelective(categoryId, brandId, keyword, isHot, isNew, page, size, sortWithOrder);
List<LitemallGoods> goodsList = goodsService.querySelective(categoryId, brandId, keyword, isHot, isNew, page, size, sort, order);
int total = goodsService.countSelective(categoryId, brandId, keyword, isHot, isNew, page, size, sort, order);
// 查询商品所属类目列表。
List<Integer> goodsCatIds = goodsService.getCatIds(brandId, keyword, isHot, isNew);
......
......@@ -57,7 +57,7 @@ public class WxHomeController {
public Object index() {
Map<String, Object> data = new HashMap<>();
List<LitemallAd> banner = adService.queryByApid(1);
List<LitemallAd> banner = adService.queryIndex();
data.put("banner", banner);
List<LitemallCategory> channel = categoryService.queryChannel();
......@@ -84,7 +84,14 @@ public class WxHomeController {
l2List.add(catL2.getId());
}
List<LitemallGoods> categoryGoods = goodsService.queryByCategory(l2List, 0, 5);
List<LitemallGoods> categoryGoods = null;
if(l2List.size() == 0){
categoryGoods = new ArrayList<>();
}
else{
categoryGoods = goodsService.queryByCategory(l2List, 0, 5);
}
Map catGoods = new HashMap();
catGoods.put("id", catL1.getId());
catGoods.put("name", catL1.getName());
......
......@@ -125,7 +125,7 @@ public class WxOrderController {
@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "size", defaultValue = "10") Integer size) {
if (userId == null) {
return ResponseUtil.fail401();
return ResponseUtil.unlogin();
}
if (showType == null) {
showType = 0;
......@@ -186,10 +186,10 @@ public class WxOrderController {
@GetMapping("detail")
public Object detail(@LoginUser Integer userId, Integer orderId) {
if (userId == null) {
return ResponseUtil.fail401();
return ResponseUtil.unlogin();
}
if (orderId == null) {
return ResponseUtil.fail402();
return ResponseUtil.badArgument();
}
// 订单信息
......@@ -222,9 +222,9 @@ public class WxOrderController {
orderGoodsVo.put("goodsId", orderGoods.getGoodsId());
orderGoodsVo.put("goodsName", orderGoods.getGoodsName());
orderGoodsVo.put("number", orderGoods.getNumber());
orderGoodsVo.put("retailPrice", orderGoods.getRetailPrice());
orderGoodsVo.put("retailPrice", orderGoods.getPrice());
orderGoodsVo.put("picUrl", orderGoods.getPicUrl());
orderGoodsVo.put("goodsSpecificationValues", orderGoods.getGoodsSpecificationValues());
orderGoodsVo.put("goodsSpecificationValues", orderGoods.getSpecifications());
orderGoodsVoList.add(orderGoodsVo);
}
......@@ -284,7 +284,7 @@ public class WxOrderController {
}
BigDecimal checkedGoodsPrice = new BigDecimal(0.00);
for (LitemallCart checkGoods : checkedGoodsList) {
checkedGoodsPrice = checkedGoodsPrice.add(checkGoods.getRetailPrice().multiply(new BigDecimal(checkGoods.getNumber())));
checkedGoodsPrice = checkedGoodsPrice.add(checkGoods.getPrice().multiply(new BigDecimal(checkGoods.getNumber())));
}
// 根据订单商品总价计算运费,满88则免运费,否则8元;
......@@ -337,10 +337,10 @@ public class WxOrderController {
orderGoods.setProductId(cartGoods.getProductId());
orderGoods.setGoodsName(cartGoods.getGoodsName());
orderGoods.setPicUrl(cartGoods.getPicUrl());
orderGoods.setRetailPrice(cartGoods.getRetailPrice());
orderGoods.setPrice(cartGoods.getPrice());
orderGoods.setNumber(cartGoods.getNumber());
orderGoods.setGoodsSpecificationIds(cartGoods.getGoodsSpecificationIds());
orderGoods.setGoodsSpecificationValues(cartGoods.getGoodsSpecificationValues());
orderGoods.setSpecifications(cartGoods.getSpecifications());
orderGoods.setAddTime(LocalDateTime.now());
// 添加订单商品表项
orderGoodsService.add(orderGoods);
......@@ -354,11 +354,11 @@ public class WxOrderController {
Integer productId = checkGoods.getProductId();
LitemallProduct product = productService.findById(productId);
Integer remainNumber = product.getGoodsNumber() - checkGoods.getNumber();
Integer remainNumber = product.getNumber() - checkGoods.getNumber();
if (remainNumber < 0) {
throw new RuntimeException("下单的商品货品数量大于库存量");
}
product.setGoodsNumber(remainNumber);
product.setNumber(remainNumber);
productService.updateById(product);
}
} catch (Exception ex) {
......@@ -424,8 +424,8 @@ public class WxOrderController {
for (LitemallOrderGoods orderGoods : orderGoodsList) {
Integer productId = orderGoods.getProductId();
LitemallProduct product = productService.findById(productId);
Integer number = product.getGoodsNumber() + orderGoods.getNumber();
product.setGoodsNumber(number);
Integer number = product.getNumber() + orderGoods.getNumber();
product.setNumber(number);
productService.updateById(product);
}
} catch (Exception ex) {
......@@ -488,9 +488,12 @@ public class WxOrderController {
// TODO 更有意义的显示名称
orderRequest.setBody("litemall小商场-订单测试支付");
// 元转成分
// 这里仅支付1分
// TODO 这里1分钱需要改成实际订单金额
orderRequest.setTotalFee(1);
Integer fee = 1;
// 这里演示仅支付1分
// 实际项目取消下面两行注释
// BigDecimal actualPrice = order.getActualPrice();
// fee = actualPrice.multiply(new BigDecimal(100)).intValue();
orderRequest.setTotalFee(fee);
// TODO 用户IP地址
orderRequest.setSpbillCreateIp("123.12.12.123");
......
......@@ -87,7 +87,7 @@ public class WxTopicController {
@GetMapping("related")
public Object related(Integer id) {
if(id == null){
return ResponseUtil.fail402();
return ResponseUtil.badArgument();
}
List<LitemallTopic> topicRelatedList = topicService.queryRelatedList(id, 0, 4);
......
......@@ -7,9 +7,9 @@ spring.datasource.druid.url=jdbc:mysql://localhost:3306/litemall?useUnicode=true
spring.datasource.druid.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.druid.username=litemall
spring.datasource.druid.password=litemall123456
spring.datasource.druid.initial-size=50
spring.datasource.druid.max-active=100
spring.datasource.druid.min-idle=20
spring.datasource.druid.initial-size=10
spring.datasource.druid.max-active=50
spring.datasource.druid.min-idle=10
spring.datasource.druid.max-wait=60000
spring.datasource.druid.pool-prepared-statements=true
spring.datasource.druid.max-pool-prepared-statement-per-connection-size=20
......
......@@ -7,9 +7,9 @@ spring.datasource.druid.url=jdbc:mysql://localhost:3306/litemall?useUnicode=true
spring.datasource.druid.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.druid.username=litemall
spring.datasource.druid.password=litemall123456
spring.datasource.druid.initial-size=50
spring.datasource.druid.max-active=100
spring.datasource.druid.min-idle=20
spring.datasource.druid.initial-size=10
spring.datasource.druid.max-active=50
spring.datasource.druid.min-idle=10
spring.datasource.druid.max-wait=60000
spring.datasource.druid.pool-prepared-statements=true
spring.datasource.druid.max-pool-prepared-statement-per-connection-size=20
......
spring:
datasource:
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://${MYSQL_HOST}:3306/${MYSQL_DATABASE}?useUnicode=true&amp;characterEncoding=utf-8
username: ${MYSQL_USERNAME}
password: ${MYSQL_PASSWORD}
type: com.alibaba.druid.pool.DruidDataSource
wx:
app-id: ${WX_APP_ID}
app-secret: ${WX_APP_SECRET}
mch-id: ${WX_MCH_ID}
mch-key: ${WX_MCH_KEY}
notify-url: ${WX_NOTIFY_URL}
\ No newline at end of file
......@@ -7,9 +7,9 @@ spring.datasource.druid.url=jdbc:mysql://localhost:3306/litemall?useUnicode=true
spring.datasource.druid.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.druid.username=litemall
spring.datasource.druid.password=litemall123456
spring.datasource.druid.initial-size=50
spring.datasource.druid.max-active=100
spring.datasource.druid.min-idle=20
spring.datasource.druid.initial-size=10
spring.datasource.druid.max-active=50
spring.datasource.druid.min-idle=10
spring.datasource.druid.max-wait=60000
spring.datasource.druid.pool-prepared-statements=true
spring.datasource.druid.max-pool-prepared-statement-per-connection-size=20
......
spring.profiles.active=prod
spring.profiles.active=dev
server.port=8082
logging.level.org.linlinjava.litemall.wx.Application=DEBUG
......@@ -2,7 +2,7 @@
<view class="brand-list" >
<navigator url="../brandDetail/brandDetail?id={{item.id}}" class="item" wx:for="{{brandList}}" wx:key="id">
<view class="img-bg">
<image src="{{item.appListPicUrl}}" background-size="cover"></image>
<image src="{{item.picUrl}}" background-size="cover"></image>
</view>
<view class="txt-box">
<view class="line">
......
<view class="container">
<view class="brand-info">
<view class="name">
<image class="img" src="{{brand.appListPicUrl}}" background-size="cover"></image>
<image class="img" src="{{brand.picUrl}}" background-size="cover"></image>
<view class="info-box">
<view class="info">
<text class="txt">{{brand.name}}</text>
......@@ -10,7 +10,7 @@
</view>
</view>
<view class="desc">
{{brand.simpleDesc}}
{{brand.desc}}
</view>
</view>
......@@ -18,7 +18,7 @@
<view class="b">
<block wx:for="{{goodsList}}" wx:key="id" wx:for-index="iindex" wx:for-item="iitem">
<navigator class="item {{iindex % 2 == 0 ? 'item-b' : ''}}" url="../goods/goods?id={{iitem.id}}">
<image class="img" src="{{iitem.listPicUrl}}" background-size="cover"></image>
<image class="img" src="{{iitem.picUrl}}" background-size="cover"></image>
<text class="name">{{iitem.name}}</text>
<text class="price">¥{{iitem.retailPrice}}</text>
</navigator>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment