16 changed files with 288 additions and 80 deletions
@ -1,32 +1,44 @@ |
|||||||
package com.logpm.factorydata.suofeiya.config; |
package com.logpm.factorydata.suofeiya.config; |
||||||
|
|
||||||
import com.logpm.factorydata.suofeiya.interceptor.FactoryAccountsInterceptor; |
|
||||||
import com.logpm.factorydata.suofeiya.interceptor.LocalServerLoginAccountsInterceptor; |
import com.logpm.factorydata.suofeiya.interceptor.LocalServerLoginAccountsInterceptor; |
||||||
|
import com.logpm.factorydata.suofeiya.pros.FactoryDataSuoFeiYaProperties; |
||||||
|
import com.logpm.factorydata.suofeiya.service.DeliveryNoteService; |
||||||
import com.logpm.factorydata.suofeiya.service.IFactoryTokenService; |
import com.logpm.factorydata.suofeiya.service.IFactoryTokenService; |
||||||
import lombok.AllArgsConstructor; |
|
||||||
import org.springblade.common.component.MockLoginService; |
import org.springblade.common.component.MockLoginService; |
||||||
import org.springblade.core.redis.cache.BladeRedis; |
import org.springblade.core.redis.cache.BladeRedis; |
||||||
import org.springblade.core.redis.lock.RedisLockClient; |
import org.springblade.core.redis.lock.RedisLockClient; |
||||||
import org.springframework.context.annotation.Configuration; |
import org.springframework.context.annotation.Configuration; |
||||||
|
import org.springframework.context.annotation.Lazy; |
||||||
import org.springframework.core.env.Environment; |
import org.springframework.core.env.Environment; |
||||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; |
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; |
||||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
||||||
|
|
||||||
|
import javax.annotation.Resource; |
||||||
|
|
||||||
@Configuration |
@Configuration |
||||||
@AllArgsConstructor |
|
||||||
public class InterceptorAdapterConfig implements WebMvcConfigurer { |
public class InterceptorAdapterConfig implements WebMvcConfigurer { |
||||||
|
|
||||||
private final IFactoryTokenService factoryTokenService; |
@Resource |
||||||
private final BladeRedis redis; |
private IFactoryTokenService factoryTokenService; |
||||||
private final Environment environment; |
@Resource |
||||||
private final RedisLockClient redisLockClient; |
private BladeRedis redis; |
||||||
private final MockLoginService mockLoginService; |
@Resource |
||||||
|
private Environment environment; |
||||||
|
@Resource |
||||||
|
private RedisLockClient redisLockClient; |
||||||
|
@Resource |
||||||
|
private MockLoginService mockLoginService; |
||||||
|
@Lazy |
||||||
|
@Resource |
||||||
|
private DeliveryNoteService deliveryNoteService; |
||||||
|
@Resource |
||||||
|
private FactoryDataSuoFeiYaProperties suoFeiYaProperties; |
||||||
|
|
||||||
@Override |
@Override |
||||||
public void addInterceptors(InterceptorRegistry interceptorRegistry) { |
public void addInterceptors(InterceptorRegistry interceptorRegistry) { |
||||||
// interceptorRegistry.addInterceptor(new FactoryAccountsInterceptor(factoryTokenService))
|
// interceptorRegistry.addInterceptor(new FactoryAccountsInterceptor(factoryTokenService))
|
||||||
// .addPathPatterns("/**").order(1);
|
// .addPathPatterns("/**").order(1);
|
||||||
interceptorRegistry.addInterceptor(new LocalServerLoginAccountsInterceptor(redis, environment,redisLockClient,mockLoginService)) |
interceptorRegistry.addInterceptor(new LocalServerLoginAccountsInterceptor(redis, environment, redisLockClient, mockLoginService, suoFeiYaProperties, deliveryNoteService)) |
||||||
.addPathPatterns("/**").order(2); |
.addPathPatterns("/**").order(2); |
||||||
} |
} |
||||||
} |
} |
||||||
|
@ -0,0 +1,26 @@ |
|||||||
|
package com.logpm.factorydata.suofeiya.vo; |
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
/** |
||||||
|
* 物流商认证 |
||||||
|
* |
||||||
|
* @author zhaoqiaobo |
||||||
|
* @create 2024-04-26 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
public class FactoryAuthVO { |
||||||
|
|
||||||
|
@ApiModelProperty(name = "物流编码") |
||||||
|
private String logisticsCode; |
||||||
|
@ApiModelProperty(name = "秘钥") |
||||||
|
private String appKey; |
||||||
|
@ApiModelProperty(name = "租户") |
||||||
|
private String tenantCode; |
||||||
|
@ApiModelProperty(name = "登录账号") |
||||||
|
private String loginAccount; |
||||||
|
@ApiModelProperty(name = "Authorization头") |
||||||
|
private String authorizationHeader; |
||||||
|
|
||||||
|
} |
@ -0,0 +1,27 @@ |
|||||||
|
package com.logpm.factorydata.suofeiya.vo; |
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
/** |
||||||
|
* 送货单 实体类 |
||||||
|
* |
||||||
|
* @author zhaoqiaobo |
||||||
|
* @create 2024-04-26 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@ApiModel(value = "索菲亚发货单", description = "索菲亚发货单") |
||||||
|
public class FactoryOrderDataVO { |
||||||
|
|
||||||
|
@ApiModelProperty("加密后的密文") |
||||||
|
private String digest; |
||||||
|
@ApiModelProperty("时间戳 毫秒") |
||||||
|
private Long timestamp; |
||||||
|
@ApiModelProperty("公司编码") |
||||||
|
private String companyCode; |
||||||
|
|
||||||
|
@ApiModelProperty("订单信息") |
||||||
|
private DeliveryNoteVO params; |
||||||
|
|
||||||
|
} |
Loading…
Reference in new issue