Commit a5c2aff4 authored by Junling Bu's avatar Junling Bu
Browse files

chore[后端服务]: 后端服务代码基于IDEA的reformat code工具格式化代码,但是mybatis generator生成的代码除外。

parent 556f269d
...@@ -2,12 +2,12 @@ package org.linlinjava.litemall.wx.web; ...@@ -2,12 +2,12 @@ package org.linlinjava.litemall.wx.web;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.linlinjava.litemall.core.util.JacksonUtil;
import org.linlinjava.litemall.core.util.ResponseUtil;
import org.linlinjava.litemall.db.domain.LitemallFootprint; import org.linlinjava.litemall.db.domain.LitemallFootprint;
import org.linlinjava.litemall.db.domain.LitemallGoods; import org.linlinjava.litemall.db.domain.LitemallGoods;
import org.linlinjava.litemall.db.service.LitemallFootprintService; import org.linlinjava.litemall.db.service.LitemallFootprintService;
import org.linlinjava.litemall.db.service.LitemallGoodsService; import org.linlinjava.litemall.db.service.LitemallGoodsService;
import org.linlinjava.litemall.core.util.JacksonUtil;
import org.linlinjava.litemall.core.util.ResponseUtil;
import org.linlinjava.litemall.wx.annotation.LoginUser; import org.linlinjava.litemall.wx.annotation.LoginUser;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
...@@ -33,30 +33,30 @@ public class WxFootprintController { ...@@ -33,30 +33,30 @@ public class WxFootprintController {
* 删除用户足迹 * 删除用户足迹
* *
* @param userId 用户ID * @param userId 用户ID
* @param body 请求内容, { footprintId: xxx } * @param body 请求内容, { footprintId: xxx }
* @return 删除操作结果 * @return 删除操作结果
* 成功则 { errno: 0, errmsg: '成功' } * 成功则 { errno: 0, errmsg: '成功' }
* 失败则 { errno: XXX, errmsg: XXX } * 失败则 { errno: XXX, errmsg: XXX }
*/ */
@PostMapping("delete") @PostMapping("delete")
public Object delete(@LoginUser Integer userId, @RequestBody String body) { public Object delete(@LoginUser Integer userId, @RequestBody String body) {
if(userId == null){ if (userId == null) {
return ResponseUtil.unlogin(); return ResponseUtil.unlogin();
} }
if(body == null){ if (body == null) {
return ResponseUtil.badArgument(); return ResponseUtil.badArgument();
} }
Integer footprintId = JacksonUtil.parseInteger(body, "footprintId"); Integer footprintId = JacksonUtil.parseInteger(body, "footprintId");
if(footprintId == null){ if (footprintId == null) {
return ResponseUtil.badArgument(); return ResponseUtil.badArgument();
} }
LitemallFootprint footprint = footprintService.findById(footprintId); LitemallFootprint footprint = footprintService.findById(footprintId);
if(footprint == null){ if (footprint == null) {
return ResponseUtil.badArgumentValue(); return ResponseUtil.badArgumentValue();
} }
if(!footprint.getUserId().equals(userId)){ if (!footprint.getUserId().equals(userId)) {
return ResponseUtil.badArgumentValue(); return ResponseUtil.badArgumentValue();
} }
...@@ -70,23 +70,23 @@ public class WxFootprintController { ...@@ -70,23 +70,23 @@ public class WxFootprintController {
* @param page 分页页数 * @param page 分页页数
* @param size 分页大小 * @param size 分页大小
* @return 用户足迹列表 * @return 用户足迹列表
* 成功则 * 成功则
* { * {
* errno: 0, * errno: 0,
* errmsg: '成功', * errmsg: '成功',
* data: * data:
* { * {
* footprintList: xxx, * footprintList: xxx,
* totalPages: xxx * totalPages: xxx
* } * }
* } * }
* 失败则 { errno: XXX, errmsg: XXX } * 失败则 { errno: XXX, errmsg: XXX }
*/ */
@GetMapping("list") @GetMapping("list")
public Object list(@LoginUser Integer userId, public Object list(@LoginUser Integer userId,
@RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "1") Integer page,
@RequestParam(defaultValue = "10") Integer size) { @RequestParam(defaultValue = "10") Integer size) {
if(userId == null){ if (userId == null) {
return ResponseUtil.unlogin(); return ResponseUtil.unlogin();
} }
...@@ -95,7 +95,7 @@ public class WxFootprintController { ...@@ -95,7 +95,7 @@ public class WxFootprintController {
int totalPages = (int) Math.ceil((double) count / size); int totalPages = (int) Math.ceil((double) count / size);
List<Object> footprintVoList = new ArrayList<>(footprintList.size()); List<Object> footprintVoList = new ArrayList<>(footprintList.size());
for(LitemallFootprint footprint : footprintList){ for (LitemallFootprint footprint : footprintList) {
Map<String, Object> c = new HashMap<String, Object>(); Map<String, Object> c = new HashMap<String, Object>();
c.put("id", footprint.getId()); c.put("id", footprint.getId());
c.put("goodsId", footprint.getGoodsId()); c.put("goodsId", footprint.getGoodsId());
......
...@@ -18,7 +18,6 @@ import org.springframework.web.bind.annotation.RequestParam; ...@@ -18,7 +18,6 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -106,10 +105,9 @@ public class WxGoodsController { ...@@ -106,10 +105,9 @@ public class WxGoodsController {
// 商品品牌商 // 商品品牌商
Integer brandId = info.getBrandId(); Integer brandId = info.getBrandId();
LitemallBrand brand = null; LitemallBrand brand = null;
if(brandId == 0){ if (brandId == 0) {
brand = new LitemallBrand(); brand = new LitemallBrand();
} } else {
else {
brand = brandService.findById(info.getBrandId()); brand = brandService.findById(info.getBrandId());
} }
......
package org.linlinjava.litemall.wx.web; package org.linlinjava.litemall.wx.web;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.linlinjava.litemall.core.express.ExpressService; import org.linlinjava.litemall.core.express.ExpressService;
import org.linlinjava.litemall.core.express.dao.ExpressInfo; import org.linlinjava.litemall.core.express.dao.ExpressInfo;
import org.linlinjava.litemall.core.util.ResponseUtil; import org.linlinjava.litemall.core.util.ResponseUtil;
...@@ -15,8 +17,6 @@ import org.springframework.web.bind.annotation.GetMapping; ...@@ -15,8 +17,6 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.ArrayList; import java.util.ArrayList;
......
...@@ -2,10 +2,10 @@ package org.linlinjava.litemall.wx.web; ...@@ -2,10 +2,10 @@ package org.linlinjava.litemall.wx.web;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.linlinjava.litemall.core.system.SystemConfig;
import org.linlinjava.litemall.core.util.ResponseUtil; import org.linlinjava.litemall.core.util.ResponseUtil;
import org.linlinjava.litemall.db.domain.*; import org.linlinjava.litemall.db.domain.*;
import org.linlinjava.litemall.db.service.*; import org.linlinjava.litemall.db.service.*;
import org.linlinjava.litemall.core.system.SystemConfig;
import org.linlinjava.litemall.wx.service.HomeCacheManager; import org.linlinjava.litemall.wx.service.HomeCacheManager;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
......
...@@ -12,7 +12,7 @@ public class WxIndexController { ...@@ -12,7 +12,7 @@ public class WxIndexController {
private final Log logger = LogFactory.getLog(WxIndexController.class); private final Log logger = LogFactory.getLog(WxIndexController.class);
@RequestMapping("/index") @RequestMapping("/index")
public Object index(){ public Object index() {
return ResponseUtil.ok("hello world, this is wx service"); return ResponseUtil.ok("hello world, this is wx service");
} }
......
...@@ -15,6 +15,7 @@ import org.linlinjava.litemall.core.express.dao.ExpressInfo; ...@@ -15,6 +15,7 @@ import org.linlinjava.litemall.core.express.dao.ExpressInfo;
import org.linlinjava.litemall.core.notify.NotifyService; import org.linlinjava.litemall.core.notify.NotifyService;
import org.linlinjava.litemall.core.notify.NotifyType; import org.linlinjava.litemall.core.notify.NotifyType;
import org.linlinjava.litemall.core.qcode.QCodeService; import org.linlinjava.litemall.core.qcode.QCodeService;
import org.linlinjava.litemall.core.system.SystemConfig;
import org.linlinjava.litemall.core.util.DateTimeUtil; import org.linlinjava.litemall.core.util.DateTimeUtil;
import org.linlinjava.litemall.core.util.JacksonUtil; import org.linlinjava.litemall.core.util.JacksonUtil;
import org.linlinjava.litemall.core.util.ResponseUtil; import org.linlinjava.litemall.core.util.ResponseUtil;
...@@ -23,7 +24,6 @@ import org.linlinjava.litemall.db.service.*; ...@@ -23,7 +24,6 @@ import org.linlinjava.litemall.db.service.*;
import org.linlinjava.litemall.db.util.OrderHandleOption; import org.linlinjava.litemall.db.util.OrderHandleOption;
import org.linlinjava.litemall.db.util.OrderUtil; import org.linlinjava.litemall.db.util.OrderUtil;
import org.linlinjava.litemall.wx.annotation.LoginUser; import org.linlinjava.litemall.wx.annotation.LoginUser;
import org.linlinjava.litemall.core.system.SystemConfig;
import org.linlinjava.litemall.wx.util.IpUtil; import org.linlinjava.litemall.wx.util.IpUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.PlatformTransactionManager;
...@@ -39,7 +39,6 @@ import javax.servlet.http.HttpServletResponse; ...@@ -39,7 +39,6 @@ import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.io.IOException; import java.io.IOException;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
...@@ -300,7 +299,7 @@ public class WxOrderController { ...@@ -300,7 +299,7 @@ public class WxOrderController {
// 收货地址 // 收货地址
LitemallAddress checkedAddress = addressService.findById(addressId); LitemallAddress checkedAddress = addressService.findById(addressId);
if(checkedAddress == null){ if (checkedAddress == null) {
return ResponseUtil.badArgument(); return ResponseUtil.badArgument();
} }
...@@ -416,7 +415,7 @@ public class WxOrderController { ...@@ -416,7 +415,7 @@ public class WxOrderController {
throw new RuntimeException("下单的商品货品数量大于库存量"); throw new RuntimeException("下单的商品货品数量大于库存量");
} }
product.setNumber(remainNumber); product.setNumber(remainNumber);
if(productService.updateById(product) == 0){ if (productService.updateById(product) == 0) {
throw new Exception("更新数据失败"); throw new Exception("更新数据失败");
} }
} }
...@@ -501,7 +500,7 @@ public class WxOrderController { ...@@ -501,7 +500,7 @@ public class WxOrderController {
// 设置订单已取消状态 // 设置订单已取消状态
order.setOrderStatus(OrderUtil.STATUS_CANCEL); order.setOrderStatus(OrderUtil.STATUS_CANCEL);
order.setEndTime(LocalDateTime.now()); order.setEndTime(LocalDateTime.now());
if(orderService.updateWithOptimisticLocker(order) == 0){ if (orderService.updateWithOptimisticLocker(order) == 0) {
throw new Exception("更新数据已失效"); throw new Exception("更新数据已失效");
} }
...@@ -512,7 +511,7 @@ public class WxOrderController { ...@@ -512,7 +511,7 @@ public class WxOrderController {
LitemallGoodsProduct product = productService.findById(productId); LitemallGoodsProduct product = productService.findById(productId);
Integer number = product.getNumber() + orderGoods.getNumber(); Integer number = product.getNumber() + orderGoods.getNumber();
product.setNumber(number); product.setNumber(number);
if(productService.updateById(product) == 0){ if (productService.updateById(product) == 0) {
throw new Exception("更新数据失败"); throw new Exception("更新数据失败");
} }
} }
...@@ -599,7 +598,7 @@ public class WxOrderController { ...@@ -599,7 +598,7 @@ public class WxOrderController {
return ResponseUtil.fail(403, "订单不能支付"); return ResponseUtil.fail(403, "订单不能支付");
} }
if(orderService.updateWithOptimisticLocker(order) == 0){ if (orderService.updateWithOptimisticLocker(order) == 0) {
return ResponseUtil.updatedDateExpired(); return ResponseUtil.updatedDateExpired();
} }
return ResponseUtil.ok(result); return ResponseUtil.ok(result);
...@@ -670,7 +669,7 @@ public class WxOrderController { ...@@ -670,7 +669,7 @@ public class WxOrderController {
// 因此,这里会重新读取数据库检查状态是否是订单自动取消,如果是则更新成支付状态。 // 因此,这里会重新读取数据库检查状态是否是订单自动取消,如果是则更新成支付状态。
order = orderService.findBySn(orderSn); order = orderService.findBySn(orderSn);
int updated = 0; int updated = 0;
if(OrderUtil.isAutoCancelStatus(order)){ if (OrderUtil.isAutoCancelStatus(order)) {
order.setPayId(payId); order.setPayId(payId);
order.setPayTime(LocalDateTime.now()); order.setPayTime(LocalDateTime.now());
order.setOrderStatus(OrderUtil.STATUS_PAY); order.setOrderStatus(OrderUtil.STATUS_PAY);
...@@ -678,7 +677,7 @@ public class WxOrderController { ...@@ -678,7 +677,7 @@ public class WxOrderController {
} }
// 如果updated是0,那么数据库更新失败 // 如果updated是0,那么数据库更新失败
if(updated == 0) { if (updated == 0) {
return WxPayNotifyResponse.fail("更新数据已失效"); return WxPayNotifyResponse.fail("更新数据已失效");
} }
} }
...@@ -756,7 +755,7 @@ public class WxOrderController { ...@@ -756,7 +755,7 @@ public class WxOrderController {
// 设置订单申请退款状态 // 设置订单申请退款状态
order.setOrderStatus(OrderUtil.STATUS_REFUND); order.setOrderStatus(OrderUtil.STATUS_REFUND);
if(orderService.updateWithOptimisticLocker(order) == 0){ if (orderService.updateWithOptimisticLocker(order) == 0) {
return ResponseUtil.updatedDateExpired(); return ResponseUtil.updatedDateExpired();
} }
...@@ -806,7 +805,7 @@ public class WxOrderController { ...@@ -806,7 +805,7 @@ public class WxOrderController {
order.setOrderStatus(OrderUtil.STATUS_CONFIRM); order.setOrderStatus(OrderUtil.STATUS_CONFIRM);
order.setConfirmTime(LocalDateTime.now()); order.setConfirmTime(LocalDateTime.now());
if(orderService.updateWithOptimisticLocker(order) == 0){ if (orderService.updateWithOptimisticLocker(order) == 0) {
return ResponseUtil.updatedDateExpired(); return ResponseUtil.updatedDateExpired();
} }
return ResponseUtil.ok(); return ResponseUtil.ok();
...@@ -865,8 +864,8 @@ public class WxOrderController { ...@@ -865,8 +864,8 @@ public class WxOrderController {
*/ */
@GetMapping("goods") @GetMapping("goods")
public Object goods(@LoginUser Integer userId, public Object goods(@LoginUser Integer userId,
@NotNull Integer orderId, @NotNull Integer orderId,
@NotNull Integer goodsId) { @NotNull Integer goodsId) {
if (userId == null) { if (userId == null) {
return ResponseUtil.unlogin(); return ResponseUtil.unlogin();
} }
...@@ -901,48 +900,48 @@ public class WxOrderController { ...@@ -901,48 +900,48 @@ public class WxOrderController {
} }
Integer orderGoodsId = JacksonUtil.parseInteger(body, "orderGoodsId"); Integer orderGoodsId = JacksonUtil.parseInteger(body, "orderGoodsId");
if(orderGoodsId == null){ if (orderGoodsId == null) {
return ResponseUtil.badArgument(); return ResponseUtil.badArgument();
} }
LitemallOrderGoods orderGoods = orderGoodsService.findById(orderGoodsId); LitemallOrderGoods orderGoods = orderGoodsService.findById(orderGoodsId);
if(orderGoods == null){ if (orderGoods == null) {
return ResponseUtil.badArgumentValue(); return ResponseUtil.badArgumentValue();
} }
Integer orderId = orderGoods.getOrderId(); Integer orderId = orderGoods.getOrderId();
LitemallOrder order = orderService.findById(orderId); LitemallOrder order = orderService.findById(orderId);
if(order == null){ if (order == null) {
return ResponseUtil.badArgumentValue(); return ResponseUtil.badArgumentValue();
} }
Short orderStatus = order.getOrderStatus(); Short orderStatus = order.getOrderStatus();
if(!OrderUtil.isConfirmStatus(order) && !OrderUtil.isAutoConfirmStatus(order)) { if (!OrderUtil.isConfirmStatus(order) && !OrderUtil.isAutoConfirmStatus(order)) {
return ResponseUtil.fail(404, "当前商品不能评价"); return ResponseUtil.fail(404, "当前商品不能评价");
} }
if(!order.getUserId().equals(userId)){ if (!order.getUserId().equals(userId)) {
return ResponseUtil.fail(404, "当前商品不属于用户"); return ResponseUtil.fail(404, "当前商品不属于用户");
} }
Integer commentId = orderGoods.getComment(); Integer commentId = orderGoods.getComment();
if(commentId == -1){ if (commentId == -1) {
return ResponseUtil.fail(404, "当前商品评价时间已经过期"); return ResponseUtil.fail(404, "当前商品评价时间已经过期");
} }
if(commentId != 0){ if (commentId != 0) {
return ResponseUtil.fail(404, "订单商品已评价"); return ResponseUtil.fail(404, "订单商品已评价");
} }
String content = JacksonUtil.parseString(body, "content"); String content = JacksonUtil.parseString(body, "content");
Integer star = JacksonUtil.parseInteger(body, "star"); Integer star = JacksonUtil.parseInteger(body, "star");
if(star == null || star < 0 || star > 5){ if (star == null || star < 0 || star > 5) {
return ResponseUtil.badArgumentValue(); return ResponseUtil.badArgumentValue();
} }
Boolean hasPicture = JacksonUtil.parseBoolean(body, "hasPicture"); Boolean hasPicture = JacksonUtil.parseBoolean(body, "hasPicture");
List<String> picUrls = JacksonUtil.parseStringList(body, "picUrls"); List<String> picUrls = JacksonUtil.parseStringList(body, "picUrls");
if(hasPicture == null || !hasPicture){ if (hasPicture == null || !hasPicture) {
picUrls = new ArrayList<>(0); picUrls = new ArrayList<>(0);
} }
// 1. 创建评价 // 1. 创建评价
LitemallComment comment = new LitemallComment(); LitemallComment comment = new LitemallComment();
comment.setUserId(userId); comment.setUserId(userId);
comment.setType((byte)0); comment.setType((byte) 0);
comment.setValueId(orderGoods.getGoodsId()); comment.setValueId(orderGoods.getGoodsId());
comment.setStar(star.shortValue()); comment.setStar(star.shortValue());
comment.setContent(content); comment.setContent(content);
...@@ -956,7 +955,7 @@ public class WxOrderController { ...@@ -956,7 +955,7 @@ public class WxOrderController {
// 3. 更新订单中未评价的订单商品可评价数量 // 3. 更新订单中未评价的订单商品可评价数量
Short commentCount = order.getComments(); Short commentCount = order.getComments();
if(commentCount > 0){ if (commentCount > 0) {
commentCount--; commentCount--;
} }
order.setComments(commentCount); order.setComments(commentCount);
......
...@@ -2,9 +2,9 @@ package org.linlinjava.litemall.wx.web; ...@@ -2,9 +2,9 @@ package org.linlinjava.litemall.wx.web;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.linlinjava.litemall.core.util.ResponseUtil;
import org.linlinjava.litemall.db.domain.LitemallRegion; import org.linlinjava.litemall.db.domain.LitemallRegion;
import org.linlinjava.litemall.db.service.LitemallRegionService; import org.linlinjava.litemall.db.service.LitemallRegionService;
import org.linlinjava.litemall.core.util.ResponseUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -25,19 +25,19 @@ public class WxRegionController { ...@@ -25,19 +25,19 @@ public class WxRegionController {
/** /**
* 区域数据 * 区域数据
* * <p>
* 根据父区域ID,返回子区域数据。 * 根据父区域ID,返回子区域数据。
* 如果父区域ID是0,则返回省级区域数据; * 如果父区域ID是0,则返回省级区域数据;
* *
* @param pid 父区域ID * @param pid 父区域ID
* @return 区域数据 * @return 区域数据
* 成功则 * 成功则
* { * {
* errno: 0, * errno: 0,
* errmsg: '成功', * errmsg: '成功',
* data: xxx * data: xxx
* } * }
* 失败则 { errno: XXX, errmsg: XXX } * 失败则 { errno: XXX, errmsg: XXX }
*/ */
@GetMapping("list") @GetMapping("list")
public Object list(@NotNull Integer pid) { public Object list(@NotNull Integer pid) {
......
...@@ -2,11 +2,11 @@ package org.linlinjava.litemall.wx.web; ...@@ -2,11 +2,11 @@ package org.linlinjava.litemall.wx.web;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.linlinjava.litemall.core.util.ResponseUtil;
import org.linlinjava.litemall.db.domain.LitemallKeyword; import org.linlinjava.litemall.db.domain.LitemallKeyword;
import org.linlinjava.litemall.db.domain.LitemallSearchHistory; import org.linlinjava.litemall.db.domain.LitemallSearchHistory;
import org.linlinjava.litemall.db.service.LitemallKeywordService; import org.linlinjava.litemall.db.service.LitemallKeywordService;
import org.linlinjava.litemall.db.service.LitemallSearchHistoryService; import org.linlinjava.litemall.db.service.LitemallSearchHistoryService;
import org.linlinjava.litemall.core.util.ResponseUtil;
import org.linlinjava.litemall.wx.annotation.LoginUser; import org.linlinjava.litemall.wx.annotation.LoginUser;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
......
...@@ -63,7 +63,7 @@ public class WxStorageController { ...@@ -63,7 +63,7 @@ public class WxStorageController {
if (key == null) { if (key == null) {
return ResponseEntity.notFound().build(); return ResponseEntity.notFound().build();
} }
if(key.contains("../")){ if (key.contains("../")) {
return ResponseEntity.badRequest().build(); return ResponseEntity.badRequest().build();
} }
String type = litemallStorage.getType(); String type = litemallStorage.getType();
...@@ -82,7 +82,7 @@ public class WxStorageController { ...@@ -82,7 +82,7 @@ public class WxStorageController {
if (key == null) { if (key == null) {
return ResponseEntity.notFound().build(); return ResponseEntity.notFound().build();
} }
if(key.contains("../")){ if (key.contains("../")) {
return ResponseEntity.badRequest().build(); return ResponseEntity.badRequest().build();
} }
......
...@@ -2,13 +2,13 @@ package org.linlinjava.litemall.wx.web; ...@@ -2,13 +2,13 @@ package org.linlinjava.litemall.wx.web;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.linlinjava.litemall.core.util.ResponseUtil;
import org.linlinjava.litemall.core.validator.Order; import org.linlinjava.litemall.core.validator.Order;
import org.linlinjava.litemall.core.validator.Sort; import org.linlinjava.litemall.core.validator.Sort;
import org.linlinjava.litemall.db.domain.LitemallGoods; import org.linlinjava.litemall.db.domain.LitemallGoods;
import org.linlinjava.litemall.db.domain.LitemallTopic; import org.linlinjava.litemall.db.domain.LitemallTopic;
import org.linlinjava.litemall.db.service.LitemallGoodsService; import org.linlinjava.litemall.db.service.LitemallGoodsService;
import org.linlinjava.litemall.db.service.LitemallTopicService; import org.linlinjava.litemall.db.service.LitemallTopicService;
import org.linlinjava.litemall.core.util.ResponseUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
......
...@@ -7,7 +7,10 @@ import org.linlinjava.litemall.db.service.LitemallOrderService; ...@@ -7,7 +7,10 @@ import org.linlinjava.litemall.db.service.LitemallOrderService;
import org.linlinjava.litemall.wx.annotation.LoginUser; import org.linlinjava.litemall.wx.annotation.LoginUser;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
...@@ -25,17 +28,17 @@ public class WxUserController { ...@@ -25,17 +28,17 @@ public class WxUserController {
* *
* @param userId 用户ID * @param userId 用户ID
* @return 用户信息 * @return 用户信息
* 成功则 * 成功则
* { * {
* errno: 0, * errno: 0,
* errmsg: '成功', * errmsg: '成功',
* data: xxx * data: xxx
* } * }
* 失败则 { errno: XXX, errmsg: XXX } * 失败则 { errno: XXX, errmsg: XXX }
*/ */
@GetMapping("index") @GetMapping("index")
public Object list(@LoginUser Integer userId) { public Object list(@LoginUser Integer userId) {
if(userId == null){ if (userId == null) {
return ResponseUtil.unlogin(); return ResponseUtil.unlogin();
} }
......
package org.linlinjava.litemall.wx; package org.linlinjava.litemall.wx;
import com.github.binarywang.wxpay.config.WxPayConfig;
import com.github.binarywang.wxpay.service.WxPayService;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
......
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