Unverified Commit d5189853 authored by linlinjava's avatar linlinjava Committed by GitHub
Browse files

Merge pull request #277 from linlinjava/youxinLu-master

接口调整
parents b17b7b64 58b82462
...@@ -152,6 +152,7 @@ public class WxOrderService { ...@@ -152,6 +152,7 @@ public class WxOrderService {
orderGoodsVo.put("number", orderGoods.getNumber()); orderGoodsVo.put("number", orderGoods.getNumber());
orderGoodsVo.put("picUrl", orderGoods.getPicUrl()); orderGoodsVo.put("picUrl", orderGoods.getPicUrl());
orderGoodsVo.put("specifications", orderGoods.getSpecifications()); orderGoodsVo.put("specifications", orderGoods.getSpecifications());
orderGoodsVo.put("price",orderGoods.getPrice());
orderGoodsVoList.add(orderGoodsVo); orderGoodsVoList.add(orderGoodsVo);
} }
orderVo.put("goodsList", orderGoodsVoList); orderVo.put("goodsList", orderGoodsVoList);
......
...@@ -239,10 +239,12 @@ public class WxAuthController { ...@@ -239,10 +239,12 @@ public class WxAuthController {
String password = JacksonUtil.parseString(body, "password"); String password = JacksonUtil.parseString(body, "password");
String mobile = JacksonUtil.parseString(body, "mobile"); String mobile = JacksonUtil.parseString(body, "mobile");
String code = JacksonUtil.parseString(body, "code"); String code = JacksonUtil.parseString(body, "code");
// 如果是小程序注册,则必须非空
// 其他情况,可以为空
String wxCode = JacksonUtil.parseString(body, "wxCode"); String wxCode = JacksonUtil.parseString(body, "wxCode");
if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password) || StringUtils.isEmpty(mobile) if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password) || StringUtils.isEmpty(mobile)
|| StringUtils.isEmpty(wxCode) || StringUtils.isEmpty(code)) { || StringUtils.isEmpty(code)) {
return ResponseUtil.badArgument(); return ResponseUtil.badArgument();
} }
...@@ -264,7 +266,10 @@ public class WxAuthController { ...@@ -264,7 +266,10 @@ public class WxAuthController {
return ResponseUtil.fail(AUTH_CAPTCHA_UNMATCH, "验证码错误"); return ResponseUtil.fail(AUTH_CAPTCHA_UNMATCH, "验证码错误");
} }
String openId = null; String openId = "";
// 非空,则是小程序注册
// 继续验证openid
if(!StringUtils.isEmpty(wxCode)) {
try { try {
WxMaJscode2SessionResult result = this.wxService.getUserService().getSessionInfo(wxCode); WxMaJscode2SessionResult result = this.wxService.getUserService().getSessionInfo(wxCode);
openId = result.getOpenid(); openId = result.getOpenid();
...@@ -284,6 +289,7 @@ public class WxAuthController { ...@@ -284,6 +289,7 @@ public class WxAuthController {
return ResponseUtil.fail(AUTH_OPENID_BINDED, "openid已绑定账号"); return ResponseUtil.fail(AUTH_OPENID_BINDED, "openid已绑定账号");
} }
} }
}
LitemallUser user = null; LitemallUser user = null;
BCryptPasswordEncoder encoder = new BCryptPasswordEncoder(); BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
......
...@@ -30,6 +30,20 @@ public class WxCatalogController { ...@@ -30,6 +30,20 @@ public class WxCatalogController {
@Autowired @Autowired
private LitemallCategoryService categoryService; private LitemallCategoryService categoryService;
@GetMapping("/getfirstcategory")
public Object getFirstCategory() {
// 所有一级分类目录
List<LitemallCategory> l1CatList = categoryService.queryL1();
return ResponseUtil.ok(l1CatList);
}
@GetMapping("/getsecondcategory")
public Object getSecondCategory(@NotNull Integer id) {
// 所有二级分类目录
List<LitemallCategory> currentSubCategory = categoryService.queryByPid(id);
return ResponseUtil.ok(currentSubCategory);
}
/** /**
* 分类详情 * 分类详情
* *
......
...@@ -79,7 +79,7 @@ public class WxCouponController { ...@@ -79,7 +79,7 @@ public class WxCouponController {
*/ */
@GetMapping("mylist") @GetMapping("mylist")
public Object mylist(@LoginUser Integer userId, public Object mylist(@LoginUser Integer userId,
@NotNull Short status, Short status,
@RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "1") Integer page,
@RequestParam(defaultValue = "10") Integer limit, @RequestParam(defaultValue = "10") Integer limit,
@Sort @RequestParam(defaultValue = "add_time") String sort, @Sort @RequestParam(defaultValue = "add_time") String sort,
......
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