Skip to content

Commit

Permalink
Merge branch 'master' into Bulbasaur
Browse files Browse the repository at this point in the history
  • Loading branch information
lifenlong committed May 18, 2021
2 parents 0c3a192 + 3925422 commit 0173ba8
Show file tree
Hide file tree
Showing 87 changed files with 616 additions and 297 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ PS:单独部署的话,数据库文件访问这里:https://gitee.com/beijing_

#### 移动端

<img src="https://pickmall.cn/assets/imgs/other/app.gif" alt="移动端功能展示" style="width:300px;" />
<img src="https://pickmall.cn/assets/imgs/other/app.gif" alt="移动端功能展示" style="zoom:50%;" />



Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cn.lili.controller.distribution;

import cn.lili.common.enums.ResultCode;
import cn.lili.common.exception.ServiceException;
import cn.lili.common.utils.ResultUtil;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.distribution.entity.dto.DistributionGoodsSearchParams;
Expand All @@ -11,7 +12,6 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
Expand Down Expand Up @@ -57,6 +57,6 @@ public ResultMessage<IPage<DistributionGoodsVO>> distributionCheckGoods(
if (distributionSelectedGoodsService.add(distributionGoodsId)) {
return ResultUtil.success(ResultCode.SUCCESS);
}
return ResultUtil.error(ResultCode.ERROR);
throw new ServiceException(ResultCode.ERROR);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cn.lili.controller.member;

import cn.lili.common.enums.ResultCode;
import cn.lili.common.exception.ServiceException;
import cn.lili.common.utils.ResultUtil;
import cn.lili.common.vo.PageVO;
import cn.lili.common.vo.ResultMessage;
Expand All @@ -9,7 +10,6 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

Expand Down Expand Up @@ -47,7 +47,7 @@ public ResultMessage<Object> delAllByIds(@NotNull(message = "商品ID不能为
if (footprintService.deleteByIds(ids)) {
return ResultUtil.success(ResultCode.SUCCESS);
}
return ResultUtil.error(ResultCode.ERROR);
throw new ServiceException(ResultCode.ERROR);
}

@ApiOperation(value = "清空足迹")
Expand All @@ -56,7 +56,7 @@ public ResultMessage<Object> deleteAll() {
if (footprintService.clean()) {
return ResultUtil.success(ResultCode.SUCCESS);
}
return ResultUtil.error(ResultCode.ERROR);
throw new ServiceException(ResultCode.ERROR);
}

@ApiOperation(value = "获取当前会员足迹数量")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cn.lili.controller.member;

import cn.lili.common.enums.ResultCode;
import cn.lili.common.exception.ServiceException;
import cn.lili.common.security.context.UserContext;
import cn.lili.common.utils.ResultUtil;
import cn.lili.common.vo.PageVO;
Expand All @@ -12,7 +13,6 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

Expand Down Expand Up @@ -81,7 +81,7 @@ public ResultMessage<Object> delShippingAddressById(@PathVariable String id) {
if (memberAddressService.removeMemberAddress(id)) {
return ResultUtil.success(ResultCode.SUCCESS);
}
return ResultUtil.error(ResultCode.ERROR);
throw new ServiceException(ResultCode.ERROR);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ public ResultMessage<Object> setPassword(String password, @RequestHeader String
//校验验证码
if (verificationService.check(uuid, VerificationEnums.WALLET_PASSWORD)) {
memberWalletService.setMemberWalletPassword(member, password);
return ResultUtil.error(ResultCode.SUCCESS);
throw new ServiceException(ResultCode.SUCCESS);
} else {
return ResultUtil.error(ResultCode.VERIFICATION_ERROR);
throw new ServiceException(ResultCode.VERIFICATION_ERROR);
}

}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package cn.lili.controller.other;

import cn.lili.common.enums.ResultCode;
import cn.lili.common.exception.ServiceException;
import cn.lili.common.security.context.UserContext;
import cn.lili.common.utils.ResultUtil;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.page.entity.dos.Feedback;
import cn.lili.modules.page.service.FeedbackService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
Expand Down Expand Up @@ -38,7 +38,7 @@ public ResultMessage<Object> save(Feedback feedback) {
if (feedbackService.save(feedback)) {
return ResultUtil.success(ResultCode.SUCCESS);
}
return ResultUtil.error(ResultCode.ERROR);
throw new ServiceException(ResultCode.ERROR);
}

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cn.lili.controller.passport;

import cn.lili.common.enums.ResultCode;
import cn.lili.common.exception.ServiceException;
import cn.lili.common.sms.SmsUtil;
import cn.lili.common.utils.ResultUtil;
import cn.lili.common.verification.enums.VerificationEnums;
Expand All @@ -13,7 +14,6 @@
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

Expand Down Expand Up @@ -50,7 +50,7 @@ public ResultMessage<Object> userLogin(@NotNull(message = "用户名不能为空
if (verificationService.check(uuid, VerificationEnums.LOGIN)) {
return ResultUtil.data(this.memberService.usernameLogin(username, password));
} else {
return ResultUtil.error(ResultCode.VERIFICATION_ERROR);
throw new ServiceException(ResultCode.VERIFICATION_ERROR);
}
}

Expand All @@ -66,7 +66,7 @@ public ResultMessage<Object> smsLogin(@NotNull(message = "手机号为空") @Req
// if(smsUtil.verifyCode(mobile,VerificationEnums.LOGIN,uuid,code)){
return ResultUtil.data(memberService.mobilePhoneLogin(mobile));
// }else {
// return ResultUtil.error("验证码错误");
// throw new ServiceException("验证码错误");
// }
}

Expand All @@ -88,7 +88,7 @@ public ResultMessage<Object> register(@NotNull(message = "用户名不能为空"
if (result) {
return ResultUtil.data(memberService.register(username, password, mobilePhone));
} else {
return ResultUtil.error(ResultCode.VERIFICATION_SMS_ERROR);
throw new ServiceException(ResultCode.VERIFICATION_SMS_ERROR);
}
}

Expand All @@ -115,7 +115,7 @@ public ResultMessage<Member> resetByMobile(@NotNull(message = "手机号为空")
return ResultUtil.success(ResultCode.SUCCESS);
}
}
return ResultUtil.error(ResultCode.VERIFICATION_ERROR);
throw new ServiceException(ResultCode.VERIFICATION_ERROR);
}

@ApiOperation(value = "修改密码")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@


import cn.lili.common.enums.ResultCode;
import cn.lili.common.exception.ServiceException;
import cn.lili.common.token.Token;
import cn.lili.common.utils.ResultUtil;
import cn.lili.common.vo.ResultMessage;
Expand All @@ -16,7 +17,6 @@
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

Expand Down Expand Up @@ -68,7 +68,7 @@ public void callBack(@PathVariable String type, AuthCallback callback, HttpServl
@GetMapping("/result")
public ResultMessage<Object> callBackResult(String state) {
if (state == null) {
return ResultUtil.error(ResultCode.USER_CONNECT_LOGIN_ERROR);
throw new ServiceException(ResultCode.USER_CONNECT_LOGIN_ERROR);
}
return connectUtil.getResult(state);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cn.lili.controller.purchase;

import cn.lili.common.enums.ResultCode;
import cn.lili.common.exception.ServiceException;
import cn.lili.common.security.context.UserContext;
import cn.lili.common.utils.ResultUtil;
import cn.lili.common.vo.ResultMessage;
Expand Down Expand Up @@ -68,7 +69,7 @@ public ResultMessage<Object> close(@NotNull @PathVariable String id) {
if (purchaseOrderService.close(id)) {
return ResultUtil.success(ResultCode.SUCCESS);
}
return ResultUtil.error(ResultCode.ERROR);
throw new ServiceException(ResultCode.ERROR);
}

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cn.lili.controller.store;

import cn.lili.common.enums.ResultCode;
import cn.lili.common.exception.ServiceException;
import cn.lili.common.security.context.UserContext;
import cn.lili.common.utils.ResultUtil;
import cn.lili.common.vo.PageVO;
Expand Down Expand Up @@ -82,7 +83,7 @@ public ResultMessage<Object> applyFirstStep(StoreCompanyDTO storeCompanyDTO) {
if (storeService.applyFirstStep(storeCompanyDTO)) {
return ResultUtil.success(ResultCode.SUCCESS);
}
return ResultUtil.error(ResultCode.ERROR);
throw new ServiceException(ResultCode.ERROR);
}

@ApiOperation(value = "申请店铺第二步-填写银行信息")
Expand All @@ -91,7 +92,7 @@ public ResultMessage<Object> applyFirstStep(StoreBankDTO storeBankDTO) {
if (storeService.applySecondStep(storeBankDTO)) {
return ResultUtil.success(ResultCode.SUCCESS);
}
return ResultUtil.error(ResultCode.ERROR);
throw new ServiceException(ResultCode.ERROR);
}

@ApiOperation(value = "申请店铺第三步-填写其他信息")
Expand All @@ -100,7 +101,7 @@ public ResultMessage<Object> applyFirstStep(StoreOtherInfoDTO storeOtherInfoDTO)
if (storeService.applyThirdStep(storeOtherInfoDTO)) {
return ResultUtil.success(ResultCode.SUCCESS);
}
return ResultUtil.error(ResultCode.ERROR);
throw new ServiceException(ResultCode.ERROR);
}

@ApiOperation(value = "获取当前登录会员的店铺信息-入驻店铺")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public ResultMessage<TradeDTO> cartChecked(@NotNull(message = "读取选中列
throw e;
} catch (Exception e) {
log.error(ResultCode.CART_ERROR.message(), e);
return ResultUtil.error(ResultCode.CART_ERROR);
throw new ServiceException(ResultCode.CART_ERROR);
}
}

Expand All @@ -172,10 +172,10 @@ public ResultMessage<Object> shippingAddress(@NotNull(message = "收货地址ID
return ResultUtil.success(ResultCode.SUCCESS);
} catch (ServiceException se) {
log.error(ResultCode.SHIPPING_NOT_APPLY.message(), se);
return ResultUtil.error(ResultCode.SHIPPING_NOT_APPLY);
throw new ServiceException(ResultCode.SHIPPING_NOT_APPLY);
} catch (Exception e) {
log.error(ResultCode.CART_ERROR.message(), e);
return ResultUtil.error(ResultCode.CART_ERROR);
throw new ServiceException(ResultCode.CART_ERROR);
}
}

Expand All @@ -196,7 +196,7 @@ public ResultMessage<Object> shippingMethod(@NotNull(message = "配送方式不
return ResultUtil.success(ResultCode.SUCCESS);
} catch (Exception e) {
log.error(ResultCode.CART_ERROR.message(), e);
return ResultUtil.error(ResultCode.CART_ERROR);
throw new ServiceException(ResultCode.CART_ERROR);
}
}

Expand Down Expand Up @@ -232,9 +232,9 @@ public ResultMessage<Object> crateTrade(@RequestBody TradeParams tradeParams) {
} catch (Exception e) {
log.error(ResultCode.ORDER_ERROR.message(), e);
if (e.getMessage().equals(ResultCode.SHIPPING_NOT_APPLY.message())) {
return ResultUtil.error(ResultCode.SHIPPING_NOT_APPLY);
throw new ServiceException(ResultCode.SHIPPING_NOT_APPLY);
}
return ResultUtil.error(ResultCode.ORDER_ERROR);
throw new ServiceException(ResultCode.ORDER_ERROR);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cn.lili.controller.trade;

import cn.lili.common.enums.ResultCode;
import cn.lili.common.exception.ServiceException;
import cn.lili.common.security.AuthUser;
import cn.lili.common.security.context.UserContext;
import cn.lili.common.utils.ResultUtil;
Expand All @@ -16,7 +17,6 @@
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
Expand Down Expand Up @@ -66,11 +66,11 @@ public ResultMessage<OrderDetailVO> detail(@NotNull(message = "订单编号不
public ResultMessage<Object> receiving(@NotNull(message = "订单编号不能为空") @PathVariable("orderSn") String orderSn) {
Order order = orderService.getBySn(orderSn);
if (order == null) {
return ResultUtil.error(ResultCode.ORDER_NOT_EXIST);
throw new ServiceException(ResultCode.ORDER_NOT_EXIST);
}
//判定是否是待收货状态
if (!order.getOrderStatus().equals(OrderStatusEnum.DELIVERED.name())) {
return ResultUtil.error(ResultCode.ORDER_DELIVERED_ERROR);
throw new ServiceException(ResultCode.ORDER_DELIVERED_ERROR);
}
orderService.complete(orderSn);
return ResultUtil.success(ResultCode.SUCCESS);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cn.lili.controller.trade;

import cn.lili.common.enums.ResultCode;
import cn.lili.common.exception.ServiceException;
import cn.lili.common.security.AuthUser;
import cn.lili.common.security.context.UserContext;
import cn.lili.common.utils.ResultUtil;
Expand Down Expand Up @@ -82,7 +83,7 @@ public ResultMessage<OrderComplaintCommunicationVO> addCommunication(@RequestPar
return ResultUtil.data(communicationVO);

}
return ResultUtil.error(ResultCode.ERROR);
throw new ServiceException(ResultCode.ERROR);
}

@ApiOperation(value = "取消售后")
Expand All @@ -92,7 +93,7 @@ public ResultMessage<Object> cancel(@PathVariable String id) {
if (orderComplaintService.cancel(id)) {
return ResultUtil.success(ResultCode.SUCCESS);
}
return ResultUtil.error(ResultCode.ERROR);
throw new ServiceException(ResultCode.ERROR);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import cn.lili.common.aop.limiter.annotation.LimitPoint;
import cn.lili.common.enums.ResultCode;
import cn.lili.common.exception.ServiceException;
import cn.lili.common.sms.SmsUtil;
import cn.lili.common.utils.ResultUtil;
import cn.lili.common.verification.enums.VerificationEnums;
Expand Down Expand Up @@ -46,7 +47,7 @@ public ResultMessage getSmsCode(
smsUtil.sendSmsCode(mobile, verificationEnums, uuid);
return ResultUtil.success(ResultCode.VERIFICATION_SEND_SUCCESS);
} else {
return ResultUtil.error(ResultCode.VERIFICATION_SMS_EXPIRED_ERROR);
throw new ServiceException(ResultCode.VERIFICATION_SMS_EXPIRED_ERROR);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ public ResultMessage<Object> upload(MultipartFile file,
newFile.setCreateBy(authUser.getUsername());
newFile.setUserEnums(authUser.getRole().name());
//如果是店铺,则记录店铺id
if (authUser.getRole().equals(UserEnums.STORE.name())) {
if (authUser.getRole().equals(UserEnums.STORE)) {
newFile.setOwnerId(authUser.getStoreId());
} else {
newFile.setOwnerId(authUser.getId());
}
fileService.save(newFile);
} catch (Exception e) {
log.error("文件上传失败", e);
return ResultUtil.error(400, e.toString());
throw new ServiceException(ResultCode.OSS_EXCEPTION);
}
return ResultUtil.data(result);
}
Expand Down
Loading

0 comments on commit 0173ba8

Please sign in to comment.