增加消息模块 添加批量导入
parent
f367d6866f
commit
50443e5ae8
@ -0,0 +1,32 @@
|
|||||||
|
package com.baiye.feign;
|
||||||
|
|
||||||
|
import com.baiye.constant.SecurityConstants;
|
||||||
|
import feign.RequestInterceptor;
|
||||||
|
import feign.RequestTemplate;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.web.context.request.RequestContextHolder;
|
||||||
|
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Enzo
|
||||||
|
* @date : 2022/1/4
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
@Slf4j
|
||||||
|
public class FeignConfiguration implements RequestInterceptor {
|
||||||
|
@Override
|
||||||
|
public void apply(RequestTemplate requestTemplate) {
|
||||||
|
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||||
|
HttpServletRequest request = attributes.getRequest();
|
||||||
|
// HeaderConstants.TOKEN_HEADER_NAME 替换为自己的请求头名称,下同
|
||||||
|
String token = request.getHeader(SecurityConstants.AUTHORIZATION);
|
||||||
|
if(token == null){
|
||||||
|
log.info("--请求中未携带token.......");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
requestTemplate.header(SecurityConstants.AUTHORIZATION, token);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,38 @@
|
|||||||
|
package com.baiye.model.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Enzo
|
||||||
|
* @date : 2022/1/6
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class UserFavorOfExcel {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 昵称
|
||||||
|
*/
|
||||||
|
private String nickName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 邮箱
|
||||||
|
*/
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 号码
|
||||||
|
*/
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 性别
|
||||||
|
*/
|
||||||
|
private String gender;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 密码
|
||||||
|
*/
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue