Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -111,6 +111,14 @@ public class CzgControllerAdvice {
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单超时 取消
|
||||
*/
|
||||
@ExceptionHandler(OrderCancelException.class)
|
||||
public CzgResult<Object> handleOrderCancelException() {
|
||||
return CzgResult.failure(701,"订单已过期,请重新下单");
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理Hutool的断言抛出异常
|
||||
*/
|
||||
|
||||
@@ -18,7 +18,7 @@ public interface RedisCst {
|
||||
*/
|
||||
class classKeyExpired {
|
||||
//订单key过期
|
||||
public static final String EXPIRED_ORDER = "expired.order:";
|
||||
public static final String EXPIRED_ORDER = "expired:order:";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ public class SaTokenConfigure implements WebMvcConfigurer {
|
||||
// adminConfig.setTimeout(1000);
|
||||
adminConfig.setTokenStyle("simple-uuid");
|
||||
adminConfig.setIsConcurrent(true);
|
||||
adminConfig.setIsShare(true);
|
||||
adminConfig.setIsShare(false);
|
||||
MyStpLogic.ADMIN_LOGIC.setConfig(adminConfig);
|
||||
|
||||
// 小程序配置
|
||||
|
||||
@@ -65,10 +65,13 @@ public class MyStpLogic {
|
||||
throw new ApiNotPrintException("管理端登录必须传递店铺id");
|
||||
}
|
||||
SaSession session = logic.getSession().set("userId", id).set("isAdmin", isAdmin).set("isManager", loginType.equals(LoginType.MANAGER))
|
||||
.set("loginType", loginType).set("account", account).set("shopName", shopName);
|
||||
.set("loginType", loginType).set("account", account);
|
||||
if (shopId != null) {
|
||||
session.set("shopId", shopId);
|
||||
}
|
||||
if (shopName != null) {
|
||||
session.set("shopName", shopName);
|
||||
}
|
||||
}
|
||||
|
||||
public void reLogin(long id) {
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.czg.account.dto;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
@@ -10,6 +13,8 @@ import java.time.LocalDateTime;
|
||||
* @author ww
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class QueryReceiveDto {
|
||||
@NotNull(message = "优惠券id 不可为空")
|
||||
private Long couponId;
|
||||
|
||||
@@ -33,8 +33,7 @@ public class ShopInfoAddDTO {
|
||||
@NotNull(message = "状态不为空")
|
||||
private String detail;
|
||||
// @NotNull(message = "角色id不为空")
|
||||
// todo 默认为管理员角色,后期调整
|
||||
private Long roleId = 1L;
|
||||
private Long roleId;
|
||||
private String phone;
|
||||
/**
|
||||
* 店铺注册类型
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.czg.exception;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* @author ww
|
||||
* @description
|
||||
*/
|
||||
public class OrderCancelException extends RuntimeException{
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public OrderCancelException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user