update
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
package com.cool.store;
|
||||
|
||||
import com.zaxxer.hikari.HikariDataSource;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import tk.mybatis.spring.annotation.MapperScan;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: PartnerCWebApplication
|
||||
* @Description: C端web层
|
||||
* @date 2023-05-17 11:28
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@EnableAsync
|
||||
@MapperScan("com.cool.store.mapper")
|
||||
public class PartnerWebApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(PartnerWebApplication.class, args);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
@ConfigurationProperties("default.datasource")
|
||||
public DataSourceProperties defaultDataSourceProperties() {
|
||||
return new DataSourceProperties();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConfigurationProperties("spring.datasource.hikari")
|
||||
public DataSource defaultDataSource() {
|
||||
return defaultDataSourceProperties().initializeDataSourceBuilder().type(HikariDataSource.class).build();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.cool.store.config;
|
||||
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
/**
|
||||
* @Author: JCccc
|
||||
* @Date: 2022-6-12 10:35
|
||||
* @Description:
|
||||
*/
|
||||
@Component
|
||||
@Order(2)
|
||||
public class BodyWrapperFilter implements Filter {
|
||||
@Override
|
||||
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
|
||||
ServletRequest requestWrapper = null;
|
||||
if (org.springframework.util.StringUtils.hasLength(servletRequest.getContentType()) && servletRequest.getContentType().contains("multipart/form-data")) {
|
||||
filterChain.doFilter(servletRequest, servletResponse);
|
||||
}else {
|
||||
if (servletRequest instanceof HttpServletRequest) {
|
||||
requestWrapper = new CustomHttpServletRequestWrapper((HttpServletRequest) servletRequest);
|
||||
}
|
||||
if (requestWrapper == null) {
|
||||
filterChain.doFilter(servletRequest, servletResponse);
|
||||
} else {
|
||||
filterChain.doFilter(requestWrapper, servletResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.cool.store.config;
|
||||
|
||||
|
||||
import cn.hutool.http.HttpStatus;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @Description 跨域配置
|
||||
* @author Aaron
|
||||
* @date 2020/1/9
|
||||
*/
|
||||
@Component
|
||||
@Order(1)
|
||||
public class CorsFilter implements Filter {
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
|
||||
HttpServletResponse response = (HttpServletResponse) res;
|
||||
HttpServletRequest reqs = (HttpServletRequest) req;
|
||||
response.setHeader("Access-Control-Allow-Origin",reqs.getHeader("Origin"));
|
||||
response.setHeader("Access-Control-Allow-Credentials", "true");
|
||||
response.setHeader("Access-Control-Allow-Methods", "POST, OPTIONS, GET, DELETE, PUT");
|
||||
response.setHeader("Access-Control-Max-Age", "36000");
|
||||
response.setHeader("Access-Control-Allow-Headers", "*");
|
||||
if (reqs.getMethod().equals("OPTIONS") || reqs.getMethod().equals("HEAD")) {
|
||||
response.setStatus(HttpStatus.HTTP_OK);
|
||||
return;
|
||||
}
|
||||
chain.doFilter(req, res);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void init(FilterConfig filterConfig) {
|
||||
//do nothing
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
//do nothing
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.cool.store.config;
|
||||
|
||||
import javax.servlet.ReadListener;
|
||||
import javax.servlet.ServletInputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletRequestWrapper;
|
||||
import java.io.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
/**
|
||||
* @Author: JCccc
|
||||
* @Date: 2022-6-12 10:36
|
||||
* @Description: 重写一个自己的 RequestWrapper 拿出body给自己用
|
||||
*/
|
||||
|
||||
public class CustomHttpServletRequestWrapper extends HttpServletRequestWrapper {
|
||||
private byte[] body;
|
||||
public CustomHttpServletRequestWrapper(HttpServletRequest request) throws IOException {
|
||||
super(request);
|
||||
BufferedReader reader = request.getReader();
|
||||
try (StringWriter writer = new StringWriter()) {
|
||||
int read;
|
||||
char[] buf = new char[1024 * 8];
|
||||
while ((read = reader.read(buf)) != -1) {
|
||||
writer.write(buf, 0, read);
|
||||
}
|
||||
this.body = writer.getBuffer().toString().getBytes();
|
||||
}
|
||||
}
|
||||
public String getBody(){
|
||||
return new String(body, StandardCharsets.UTF_8);
|
||||
}
|
||||
@Override
|
||||
public ServletInputStream getInputStream() {
|
||||
final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(body);
|
||||
return new ServletInputStream() {
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean isReady() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the <code>ReadListener</code> for this ServletInputStream.
|
||||
* @param readListener The non-blocking IO read listener
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public void setReadListener(ReadListener readListener) {
|
||||
//do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public int read() {
|
||||
return byteArrayInputStream.read();
|
||||
}
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public BufferedReader getReader() {
|
||||
return new BufferedReader(new InputStreamReader(this.getInputStream()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.cool.store.config;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.converter.HttpMessageConverter;
|
||||
import org.springframework.web.servlet.HandlerExceptionResolver;
|
||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: ServletContextConfig
|
||||
* @Description:
|
||||
* @date 2023-06-08 16:28
|
||||
*/
|
||||
@Configuration
|
||||
public class ServletContextConfig extends WebMvcConfigurationSupport {
|
||||
|
||||
/**
|
||||
* 配置servlet处理
|
||||
*/
|
||||
@Override
|
||||
public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
|
||||
configurer.enable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCorsMappings(CorsRegistry registry) {
|
||||
registry.addMapping("/**")
|
||||
.allowedOrigins("*")
|
||||
.allowCredentials(true)
|
||||
.allowedMethods("GET", "POST", "OPTIONS", "PUT", "DELETE")
|
||||
.maxAge(3600);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
registry.addResourceHandler("/**").addResourceLocations("classpath:/static/");
|
||||
registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/");
|
||||
registry.addResourceHandler("doc.html").addResourceLocations("classpath:/META-INF/resources/");
|
||||
registry.addResourceHandler("/webjars/**")
|
||||
.addResourceLocations("classpath:/META-INF/resources/webjars/");
|
||||
super.addResourceHandlers(registry);
|
||||
}
|
||||
|
||||
/**
|
||||
* 消息改写器
|
||||
* @param converters
|
||||
*/
|
||||
@Override
|
||||
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
|
||||
//do nothing
|
||||
}
|
||||
|
||||
/**
|
||||
* 统一异常处理
|
||||
*
|
||||
* @param exceptionResolvers
|
||||
*/
|
||||
@Override
|
||||
public void configureHandlerExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers) {
|
||||
//do nothing
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
package com.cool.store.config;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.context.PartnerUserHolder;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.WechatMiniAppService;
|
||||
import com.cool.store.utils.AESDecryptor;
|
||||
import com.cool.store.utils.Md5Utils;
|
||||
import com.cool.store.utils.Sha1Utils;
|
||||
import com.cool.store.utils.UUIDUtils;
|
||||
import com.cool.store.vo.PartnerUserInfoVO;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.MDC;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.AntPathMatcher;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author ydw
|
||||
* @Description 权限校验
|
||||
* @date 2020/1/15
|
||||
*/
|
||||
@Component
|
||||
@Order(3)
|
||||
@Slf4j
|
||||
public class SignValidateFilter implements Filter {
|
||||
|
||||
@Resource
|
||||
private WechatMiniAppService wechatMiniAppService;
|
||||
|
||||
@Value("${signKey}")
|
||||
private String signKey;
|
||||
|
||||
private static AntPathMatcher matcher = new AntPathMatcher();
|
||||
|
||||
private static List<String> patternList =
|
||||
Lists.newArrayList("/web/check/ok","/check/ok",
|
||||
"/partner/mini/program/doc.html","/partner/mini/program/v2/api-docs","/**/test/**",
|
||||
"/partner/mini/program/oss/getUploadFileConfig",
|
||||
"/partner/mini/program/v1/partnerManage/partner/getIdentityCardInfo",
|
||||
"/**/swagger*/**", "/**/webjars/**","/partner/mini/program/v1/partnerManage/openArea/areaApplyQuery");
|
||||
|
||||
|
||||
/**
|
||||
* @param uri
|
||||
* @return boolean
|
||||
* @throws
|
||||
* @Title excludePath
|
||||
* @Description 是否是放行的请求
|
||||
*/
|
||||
private boolean excludePath(String uri) {
|
||||
for (String pattern : patternList) {
|
||||
if (matcher.match(pattern, uri)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FilterConfig filterConfig) throws ServletException {
|
||||
//do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
|
||||
MDC.put(CommonConstants.REQUEST_ID, UUIDUtils.get32UUID());
|
||||
HttpServletResponse response = (HttpServletResponse) servletResponse;
|
||||
HttpServletRequest request = (HttpServletRequest) servletRequest;
|
||||
CustomHttpServletRequestWrapper wrapper = (CustomHttpServletRequestWrapper) request;
|
||||
String uri = request.getRequestURI();
|
||||
String method = request.getMethod();
|
||||
String userStr = "";
|
||||
boolean isInWhiteList = excludePath(uri);
|
||||
log.info("url:{}", uri);
|
||||
if ( !isInWhiteList && !method.equals("OPTIONS")) {
|
||||
String params = "";
|
||||
if("GET".equalsIgnoreCase(method)){
|
||||
params = request.getQueryString();
|
||||
}else if("POST".equalsIgnoreCase(method)){
|
||||
params = wrapper.getBody();
|
||||
}
|
||||
log.info("params:{}", params);
|
||||
String sign = request.getHeader("SIGN");
|
||||
String nonce = request.getHeader("NONCE");
|
||||
String timestamp = request.getHeader("TIMESTAMP");
|
||||
String aesPhone = request.getHeader("PHONE");
|
||||
String openid = request.getHeader("OPENID");
|
||||
log.info("aesPhone:{}, signKey:{}", aesPhone, signKey);
|
||||
String phone = AESDecryptor.decrypt(aesPhone, signKey);
|
||||
String plaintextOpenid = AESDecryptor.decrypt(openid, signKey);
|
||||
String md5Value = phone + Md5Utils.md5(Md5Utils.md5(plaintextOpenid));
|
||||
log.info("sign:{}, nonce:{}, timestamp:{},aesPhone:{}, openid:{}, 解密后的手机号:{}, md5Value:{}, 明文plaintextOpenid:{}",
|
||||
sign, nonce, timestamp, aesPhone, openid, phone, md5Value, plaintextOpenid);
|
||||
String signStr = timestamp + nonce + params + signKey + md5Value;
|
||||
String newSign = Sha1Utils.getSha1(signStr.getBytes());
|
||||
log.info("signStr: {}, newSign: {}", signStr, newSign);
|
||||
// 前后端验签不等
|
||||
if (!newSign.equals(sign)) {
|
||||
response.setStatus(HttpStatus.OK.value());
|
||||
response.setContentType("application/json;charset=UTF-8");
|
||||
response.getWriter().write(JSON.toJSONString(ResponseResult.fail(ErrorCodeEnum.SIGN_FAIL)));
|
||||
return;
|
||||
}
|
||||
PartnerUserInfoVO partnerUserInfoVO = wechatMiniAppService.getUserInfo(phone, plaintextOpenid);
|
||||
if(partnerUserInfoVO != null){
|
||||
userStr = JSONObject.toJSONString(partnerUserInfoVO);
|
||||
log.info("url:{}, userStr:{}", uri, userStr);
|
||||
}
|
||||
}
|
||||
try {
|
||||
PartnerUserHolder.setUser(userStr);
|
||||
filterChain.doFilter(servletRequest, servletResponse);
|
||||
} finally {
|
||||
PartnerUserHolder.removeUser();
|
||||
MDC.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
//do nothing
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.cool.store.config;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.crypto.Mac;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.Base64;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 对腾讯云音视频回调单独验签
|
||||
*/
|
||||
@Component
|
||||
@Order(4)
|
||||
@Slf4j
|
||||
public class TRTCCallbackFilter implements Filter {
|
||||
|
||||
@Value("${trtc.video.callback.secretKey:null}")
|
||||
private String secretkey;
|
||||
|
||||
@Override
|
||||
public void init(FilterConfig filterConfig) {
|
||||
//do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
|
||||
HttpServletRequest request = (HttpServletRequest) servletRequest;
|
||||
String uri = request.getRequestURI();
|
||||
//不是腾讯云音视频回调请求
|
||||
if (!uri.startsWith("/partner/pc/video")) {
|
||||
filterChain.doFilter(servletRequest, servletResponse);
|
||||
return;
|
||||
}
|
||||
if (!"POST".equals(request.getMethod())) {
|
||||
return;
|
||||
}
|
||||
String requestBody = request.getReader().lines().collect(Collectors.joining());
|
||||
//回调的签名
|
||||
String sign = request.getHeader("Sign");
|
||||
//服务器端生成的签名
|
||||
String newSign = "";
|
||||
try {
|
||||
newSign = getResultSign(secretkey, requestBody);
|
||||
} catch (Exception e) {
|
||||
log.error("腾讯云音视频回调签名生成错误,e:\t{}", e.getMessage());
|
||||
return;
|
||||
}
|
||||
if (StringUtils.isEmpty(sign) || !newSign.equals(sign)) {
|
||||
log.error("腾讯云音视频回调签名错误, sign:\t{}, newSign:\t{}", sign, newSign);
|
||||
return;
|
||||
}
|
||||
filterChain.doFilter(servletRequest, servletResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
//do nothing
|
||||
}
|
||||
|
||||
private String getResultSign(String key, String body) throws NoSuchAlgorithmException, InvalidKeyException {
|
||||
Mac hmacSha256 = Mac.getInstance("HmacSHA256");
|
||||
SecretKeySpec secretKey = new SecretKeySpec(key.getBytes(), "HmacSHA256");
|
||||
hmacSha256.init(secretKey);
|
||||
return Base64.getEncoder().encodeToString(hmacSha256.doFinal(body.getBytes()));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
package com.cool.store.config;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.utils.UUIDUtils;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.MDC;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.AntPathMatcher;
|
||||
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author ydw
|
||||
* @Description 权限校验
|
||||
* @date 2020/1/15
|
||||
*/
|
||||
@Component
|
||||
@Order(3)
|
||||
@Slf4j
|
||||
public class TokenValidateFilter implements Filter {
|
||||
|
||||
@Autowired
|
||||
private RedisUtilPool redisUtilPool;
|
||||
|
||||
private static AntPathMatcher matcher = new AntPathMatcher();
|
||||
|
||||
private static List<String> patternList =
|
||||
|
||||
Lists.newArrayList("/web/check/ok","/check/ok",
|
||||
"/partner/pc/doc.html","/partner/pc/v2/api-docs","/**/test/**","/partner/pc/feiShuLogin","/partner/pc/oss/getUploadFileConfig",
|
||||
"/**/swagger*/**", "/**/webjars/**",
|
||||
//腾讯音视频回调,单独做验签
|
||||
"/partner/pc/video/**",
|
||||
//800回调地址暂时不做验证
|
||||
"/partner/pc/flow/qualificationReview/callback",
|
||||
"/**/ecSync/ecToApplet/**",
|
||||
"/**/ecSync/labelInfo/**",
|
||||
"/**/ecSync/getCrmCreateTime/**",
|
||||
"/**/ecSync/historyLine/**",
|
||||
"/**/ecSync/historyLineTrajectory/**",
|
||||
"/partner/pc/websocket/**",
|
||||
"/partner/pc/call/**");
|
||||
|
||||
/**
|
||||
* @param uri
|
||||
* @return boolean
|
||||
* @throws
|
||||
* @Title excludePath
|
||||
* @Description 是否是放行的请求
|
||||
*/
|
||||
private boolean excludePath(String uri) {
|
||||
for (String pattern : patternList) {
|
||||
if (matcher.match(pattern, uri)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FilterConfig filterConfig) throws ServletException {
|
||||
//do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
|
||||
// MDC.put(CommonConstants.REQUEST_ID, UUIDUtils.get32UUID());
|
||||
// HttpServletResponse response = (HttpServletResponse) servletResponse;
|
||||
// HttpServletRequest reqs = (HttpServletRequest) servletRequest;
|
||||
// String uri = reqs.getRequestURI();
|
||||
// String method = reqs.getMethod();
|
||||
// String userStr = "";
|
||||
// LoginUserInfo currentUser = null;
|
||||
// boolean isInWhiteList = excludePath(uri);
|
||||
// String accessToken = reqs.getHeader("accessToken");
|
||||
// String key = MessageFormat.format(CommonConstants.ACCESS_TOKEN_KEY, accessToken);
|
||||
// if(StringUtils.isNotBlank(accessToken)){
|
||||
// userStr = redisUtilPool.getString(key);
|
||||
// if(StringUtils.isNotBlank(userStr)){
|
||||
// currentUser = JSON.parseObject(userStr, LoginUserInfo.class);
|
||||
// }
|
||||
// }
|
||||
// log.info("url:{}", uri);
|
||||
// if ( !isInWhiteList && !method.equals("OPTIONS")) {
|
||||
// if (StringUtils.isEmpty(accessToken)) {
|
||||
// response.setStatus(HttpStatus.OK.value());
|
||||
// response.getWriter().write(JSON.toJSONString(
|
||||
// ResponseResult.fail(ErrorCodeEnum.ACCESS_TOKEN_INVALID)));
|
||||
// return;
|
||||
// }
|
||||
// if (Objects.isNull(currentUser)) {
|
||||
// response.setStatus(HttpStatus.OK.value());
|
||||
// response.getWriter().write(JSON.toJSONString(
|
||||
// ResponseResult.fail(ErrorCodeEnum.ACCESS_TOKEN_INVALID)));
|
||||
// return;
|
||||
// }
|
||||
// log.info("url:{}, access_token:{}, userId:{}, username:{}", uri, accessToken, currentUser.getUserId(), currentUser.getName());
|
||||
// }
|
||||
// if(StringUtils.isBlank(userStr) && !isInWhiteList){
|
||||
// response.setStatus(HttpStatus.OK.value());
|
||||
// response.getWriter().write(JSON.toJSONString(
|
||||
// ResponseResult.fail(ErrorCodeEnum.ACCESS_TOKEN_INVALID)));
|
||||
// return;
|
||||
// }
|
||||
// try {
|
||||
// CurrentUserHolder.setUser(userStr);
|
||||
// filterChain.doFilter(servletRequest, servletResponse);
|
||||
// } finally {
|
||||
// CurrentUserHolder.removeUser();
|
||||
// MDC.clear();
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
//do nothing
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.cool.store.config;
|
||||
|
||||
import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: XxlJobConfig
|
||||
* @Description: xxljob 配置信息
|
||||
* @date 2021-11-12 15:26
|
||||
*/
|
||||
@Configuration
|
||||
@ComponentScan(basePackages = "com.cool.store.job")
|
||||
public class XxlJobConfig {
|
||||
|
||||
private Logger logger = LoggerFactory.getLogger(XxlJobConfig.class);
|
||||
|
||||
@Value("${xxl.job.admin.addresses}")
|
||||
private String adminAddresses;
|
||||
|
||||
@Value("${xxl.job.executor.appname}")
|
||||
private String appName;
|
||||
|
||||
@Value("${xxl.job.executor.ip}")
|
||||
private String ip;
|
||||
|
||||
@Value("${xxl.job.executor.port}")
|
||||
private int port;
|
||||
|
||||
@Value("${xxl.job.accessToken}")
|
||||
private String accessToken;
|
||||
|
||||
@Value("${xxl.job.executor.logpath}")
|
||||
private String logPath;
|
||||
|
||||
@Value("${xxl.job.executor.logretentiondays}")
|
||||
private int logRetentionDays;
|
||||
|
||||
@Bean
|
||||
public XxlJobSpringExecutor xxlJobExecutor() {
|
||||
logger.info(">>>>>>>>>>> xxl-job config init.");
|
||||
XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
|
||||
xxlJobSpringExecutor.setAdminAddresses(adminAddresses);
|
||||
xxlJobSpringExecutor.setAppname(appName);
|
||||
xxlJobSpringExecutor.setIp(ip);
|
||||
xxlJobSpringExecutor.setPort(port);
|
||||
xxlJobSpringExecutor.setAccessToken(accessToken);
|
||||
xxlJobSpringExecutor.setLogPath(logPath);
|
||||
xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);
|
||||
return xxlJobSpringExecutor;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.cool.store.config.swagger;
|
||||
|
||||
import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.base.Predicates;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Profile;
|
||||
import springfox.documentation.RequestHandler;
|
||||
import springfox.documentation.builders.ApiInfoBuilder;
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
import springfox.documentation.service.ApiInfo;
|
||||
import springfox.documentation.service.Parameter;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @description:
|
||||
* @date 2023/05/15 02:52
|
||||
*/
|
||||
@Profile({"local", "dev", "ab", "test", "pre"})
|
||||
@Configuration
|
||||
@EnableSwagger2
|
||||
@EnableKnife4j
|
||||
public class Swagger2Config {
|
||||
|
||||
/**
|
||||
* 扫描接口地址的包名
|
||||
*/
|
||||
public static final String BASE_PACKAGE = "com.cool.store.controller";
|
||||
|
||||
private ApiInfo getApiInfo() {
|
||||
return new ApiInfoBuilder()
|
||||
.title("coolstore-partner-manage")
|
||||
.description("接口文档")
|
||||
.version("1.0")
|
||||
.build();
|
||||
}
|
||||
|
||||
private Docket createDocket (String groupName, String... packages){
|
||||
List<Parameter> pars = getParameters();
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
.enable(Boolean.TRUE)
|
||||
.apiInfo(this.getApiInfo())
|
||||
.groupName(groupName)
|
||||
.select()
|
||||
.apis(this.scanBasePackage(packages))
|
||||
//.paths(PathSelectors.regex(".*/getPartnerIntentInfo|.*/queryPartnerClerkInfoList|.*/queryPartnerBaseInfo"))
|
||||
.build()
|
||||
.globalOperationParameters(pars);
|
||||
}
|
||||
|
||||
private List<Parameter> getParameters() {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
private Predicate<RequestHandler> scanBasePackage(final String... controllerPack) {
|
||||
Predicate<RequestHandler> predicate = null;
|
||||
for (String strBasePackage : controllerPack) {
|
||||
if(StringUtils.isNotBlank(strBasePackage)){
|
||||
Predicate<RequestHandler> tempPredicate = RequestHandlerSelectors.basePackage(strBasePackage);
|
||||
predicate = predicate == null ? tempPredicate : Predicates.or(tempPredicate,predicate);
|
||||
}
|
||||
}
|
||||
return predicate;
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public Docket allApi() {
|
||||
return this.createDocket("全部", BASE_PACKAGE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.cool.store.controller.webb;
|
||||
|
||||
import com.cool.store.dto.content.*;
|
||||
import com.cool.store.entity.HyContentInfoDO;
|
||||
import com.cool.store.exception.ApiException;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.ContentService;
|
||||
import com.cool.store.vo.HyContentInfoVO;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("news")
|
||||
@Api(tags = "动态")
|
||||
@Slf4j
|
||||
public class ContentController {
|
||||
|
||||
@Autowired
|
||||
private ContentService contentService;
|
||||
|
||||
@PostMapping("/queryTitles")
|
||||
@ApiOperation("搜索标题是否重复")
|
||||
public ResponseResult<Boolean> queryTitles(@RequestBody ContentQueryTitlesDto title) {
|
||||
return ResponseResult.success(contentService.queryTitles(title.getTitle()));
|
||||
}
|
||||
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("新增动态")
|
||||
public ResponseResult<String> addContent(@RequestBody ContentAddDto dto) throws ApiException {
|
||||
return ResponseResult.success(contentService.addNews(dto));
|
||||
}
|
||||
|
||||
@PostMapping("/delete")
|
||||
@ApiOperation("删除动态")
|
||||
public ResponseResult deleteContent(@RequestBody ContentDelDto dto) {
|
||||
contentService.deleteContent(dto.getContentId());
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@PostMapping("/modify")
|
||||
@ApiOperation("修改动态")
|
||||
public ResponseResult updateContent(@RequestBody ContentUpdateDto dto) throws ApiException {
|
||||
contentService.updateContent(dto);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@PostMapping("/queryContentList")
|
||||
@ApiOperation("查询动态列表")
|
||||
public ResponseResult<PageInfo<HyContentInfoVO>> queryContentList(@RequestBody ContentQueryListDto dto) {
|
||||
PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
|
||||
List<HyContentInfoVO> list = contentService.queryContentList(dto);
|
||||
PageInfo<HyContentInfoVO> page = new PageInfo<>(list);
|
||||
return ResponseResult.success(page);
|
||||
}
|
||||
|
||||
@PostMapping("/detail")
|
||||
@ApiOperation("动态详情")
|
||||
public ResponseResult<HyContentInfoDO> queryContentInfo(@RequestBody ContentQueryDetailDto dto) {
|
||||
return ResponseResult.success(contentService.queryContentInfo(dto.getContentId()));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.cool.store.controller.webb;
|
||||
|
||||
import com.cool.store.dto.label.LabelAddDTO;
|
||||
import com.cool.store.dto.label.LabelDeleteDTO;
|
||||
import com.cool.store.dto.label.LabelListDTO;
|
||||
import com.cool.store.dto.label.LabelUpdateDTO;
|
||||
import com.cool.store.exception.ApiException;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.LabelService;
|
||||
import com.cool.store.vo.LabelGroupVO;
|
||||
import com.cool.store.vo.LabelListVo;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Fun Li 2023/8/10 14:20
|
||||
* @version 1.0
|
||||
*/
|
||||
@Api(tags = "标签管理")
|
||||
@RestController
|
||||
@RequestMapping("/label")
|
||||
public class LabelController {
|
||||
|
||||
@Autowired
|
||||
private LabelService labelService;
|
||||
|
||||
@ApiOperation("标签列表查询")
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<PageInfo<LabelListVo>> getLabelList(@RequestBody LabelListDTO dto) {
|
||||
PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
|
||||
List<LabelListVo> result = labelService.getLabelList(dto);
|
||||
return ResponseResult.success(new PageInfo<>(result));
|
||||
}
|
||||
|
||||
@ApiOperation("查询标签组及子标签列表")
|
||||
@GetMapping("/labelGroupAndLabelList")
|
||||
public ResponseResult<List<LabelGroupVO>> getAllLabelList() {
|
||||
List<LabelGroupVO> result = labelService.getAllGroupAndLabelList();
|
||||
return ResponseResult.success(result);
|
||||
}
|
||||
|
||||
@ApiOperation("新增标签")
|
||||
@PostMapping("/add")
|
||||
public ResponseResult addLabel(@RequestBody LabelAddDTO dto) throws ApiException {
|
||||
labelService.addLabel(dto);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation("修改标签")
|
||||
@PostMapping("/edit")
|
||||
public ResponseResult updateLabel(@RequestBody LabelUpdateDTO dto) throws ApiException {
|
||||
labelService.updateLabel(dto);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation("删除标签")
|
||||
@PostMapping("/delete")
|
||||
public ResponseResult deleteLabel(@RequestBody LabelDeleteDTO dto) {
|
||||
labelService.deleteLabel(dto);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.cool.store.controller.webb;
|
||||
|
||||
import com.cool.store.dto.label.LabelGroupAddDTO;
|
||||
import com.cool.store.dto.label.LabelGroupDeleteDTO;
|
||||
import com.cool.store.dto.label.LabelGroupListDTO;
|
||||
import com.cool.store.dto.label.LabelGroupUpdateDTO;
|
||||
import com.cool.store.exception.ApiException;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.LabelGroupService;
|
||||
import com.cool.store.vo.LabelGroupListVo;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Fun Li 2023/8/10 10:54
|
||||
* @version 1.0
|
||||
*/
|
||||
@Api(tags = {"标签组管理"})
|
||||
@RestController
|
||||
@RequestMapping({"/labelGroup"})
|
||||
public class LabelGroupController {
|
||||
@Autowired
|
||||
private LabelGroupService labelGroupService;
|
||||
|
||||
@ApiOperation("标签组分页查询")
|
||||
@PostMapping({"/list"})
|
||||
public ResponseResult<PageInfo<LabelGroupListVo>> getLabelGroupList(@RequestBody LabelGroupListDTO dto) {
|
||||
PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
|
||||
List<LabelGroupListVo> result = labelGroupService.getLabelGroupList(dto);
|
||||
return ResponseResult.success(new PageInfo<>(result));
|
||||
}
|
||||
|
||||
@ApiOperation("新增标签组")
|
||||
@PostMapping({"/add"})
|
||||
public ResponseResult addLabelGroup(@RequestBody LabelGroupAddDTO dto) throws ApiException {
|
||||
labelGroupService.addLabelGroup(dto);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation("修改标签组")
|
||||
@PostMapping({"/edit"})
|
||||
public ResponseResult updateLabelGroup(@RequestBody LabelGroupUpdateDTO dto) throws ApiException {
|
||||
labelGroupService.updateLabelGroup(dto);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation("删除标签组")
|
||||
@PostMapping({"/delete"})
|
||||
public ResponseResult deleteLabelGroup(@RequestBody LabelGroupDeleteDTO dto) throws ApiException {
|
||||
labelGroupService.deleteLabelGroup(dto);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation("获取所有标签组")
|
||||
@PostMapping({"/allList"})
|
||||
public ResponseResult<List<LabelGroupListVo>> deleteLabelGroup() {
|
||||
return ResponseResult.success(labelGroupService.getAllLabelGroupList());
|
||||
}
|
||||
|
||||
@ApiOperation("获取所有标签组")
|
||||
@PostMapping({"/allListAsc"})
|
||||
public ResponseResult<List<LabelGroupListVo>> getLabelGroupListOrder() {
|
||||
return ResponseResult.success(labelGroupService.getLabelGroupListOrder());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.cool.store.controller.webb;
|
||||
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.request.OpenAreaRequest;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.OpenAreaService;
|
||||
import com.cool.store.vo.OpenAreaTreeVO;
|
||||
import com.cool.store.vo.OpenAreaVO;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/15 9:49
|
||||
* @Version 1.0
|
||||
*/
|
||||
@RestController
|
||||
public class OpenAreaController {
|
||||
|
||||
@Resource
|
||||
OpenAreaService openAreaService;
|
||||
|
||||
@GetMapping(path = "/getOpenAreaTree")
|
||||
@ApiOperation("开放城市树-搜索城市 到第二节点")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "keyword", value = "搜索关键字", required = false),
|
||||
@ApiImplicitParam(name = "areaStatus", value = "状态 open-开放 keyOpen-重点开放 notOpen-未开放 saturated-已饱和", required = false)
|
||||
})
|
||||
public ResponseResult<List<OpenAreaTreeVO>> getOpenAreaTree(@RequestParam(value = "keyword",required = false)String keyword,
|
||||
@RequestParam(value = "areaStatus",required = false)String areaStatus){
|
||||
return ResponseResult.success(openAreaService.queryByKeyword(keyword,areaStatus,Boolean.TRUE));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(path = "/getAllOpenAreaTree")
|
||||
@ApiOperation("开放城市树-所有节点")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "keyword", value = "搜索关键字", required = false)
|
||||
})
|
||||
public ResponseResult<List<OpenAreaTreeVO>> getAllOpenAreaTree(@RequestParam(value = "keyword",required = false)String keyword){
|
||||
return ResponseResult.success(openAreaService.queryAllOpenAreaByKeyword(keyword,null,Boolean.FALSE));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(path = "/getOpenAreaList")
|
||||
@ApiOperation("开放城市树-子列表")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "parentId", value = "父区域名称", required = false),
|
||||
@ApiImplicitParam(name = "type", value = "可预约-reservation 可申请-apply ", required = false)
|
||||
})
|
||||
public ResponseResult<List<OpenAreaVO>> getOpenAreaList(@RequestParam(value = "parentId",required = false)Long parentId,
|
||||
@RequestParam(value = "type",required = false)String type){
|
||||
return ResponseResult.success(openAreaService.getChildrenList(type,parentId));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping(path = "/changeOpenAreaStatus")
|
||||
@ApiOperation("变更开放区域状态")
|
||||
public ResponseResult<Boolean> changeOpenAreaStatus(@RequestBody OpenAreaRequest openAreaRequest){
|
||||
String userId = CurrentUserHolder.getUserId();
|
||||
return ResponseResult.success(openAreaService.batchUpdate( userId, openAreaRequest));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.cool.store.controller.webb;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.dto.trtc.callback.VideoCallBackDTO;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.TRTCVideoService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/video")
|
||||
@Api(tags = "腾讯音视频接口")
|
||||
@Slf4j
|
||||
public class VideoController {
|
||||
|
||||
@Autowired
|
||||
private TRTCVideoService videoService;
|
||||
|
||||
@PostMapping("/callback")
|
||||
@ApiOperation("音视频回调(腾讯云回调)")
|
||||
public ResponseResult videoCallback(@RequestBody VideoCallBackDTO videoCallBackDTO) {
|
||||
try {
|
||||
log.info("腾讯音视频上传回调开始,request{}", JSONObject.toJSONString(videoCallBackDTO));
|
||||
//不是音视频上传的回调
|
||||
if (311 != videoCallBackDTO.getEventType()) {
|
||||
return null;
|
||||
}
|
||||
if (0 != videoCallBackDTO.getEventInfo().getPayload().getStatus()) {
|
||||
log.error("腾讯音视频录制视频上传错误:request:\t{}", videoCallBackDTO);
|
||||
return null;
|
||||
}
|
||||
videoService.handleVideoCallBack(videoCallBackDTO);
|
||||
return new ResponseResult(0, "腾讯云回调音视频回调数据接收成功");
|
||||
} catch (Exception e) {
|
||||
log.error("腾讯音视频录制视频上传回调错误:e:\t{}", e.toString());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.cool.store.controller.webc;
|
||||
|
||||
import com.cool.store.dto.content.ContentQueryDetailDto;
|
||||
import com.cool.store.dto.content.ContentQueryListDto;
|
||||
import com.cool.store.entity.HyContentInfoDO;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.ContentService;
|
||||
import com.cool.store.vo.HyContentInfoVO;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("news")
|
||||
@Api(tags = "动态")
|
||||
@Slf4j
|
||||
public class ContentController {
|
||||
|
||||
@Autowired
|
||||
private ContentService contentService;
|
||||
|
||||
@PostMapping("/queryContentList")
|
||||
@ApiOperation("查询动态列表")
|
||||
public ResponseResult<PageInfo<HyContentInfoVO>> queryContentList(@RequestBody ContentQueryListDto dto) {
|
||||
PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
|
||||
List<HyContentInfoVO> list = contentService.queryContentListToC(dto);
|
||||
PageInfo<HyContentInfoVO> page = new PageInfo<>(list);
|
||||
return ResponseResult.success(page);
|
||||
}
|
||||
|
||||
@PostMapping("/detail")
|
||||
@ApiOperation("动态详情")
|
||||
public ResponseResult<HyContentInfoDO> queryContentInfo(@RequestBody ContentQueryDetailDto dto) {
|
||||
return ResponseResult.success(contentService.queryContentInfo(dto.getContentId()));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.cool.store.controller.webc;
|
||||
|
||||
import com.cool.store.context.PartnerUserHolder;
|
||||
import com.cool.store.dto.wx.MiniProgramLoginDTO;
|
||||
import com.cool.store.request.MobileUpdateRequest;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.WechatMiniAppService;
|
||||
import com.cool.store.vo.PartnerUserInfoVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: MiniProgramAppController
|
||||
* @Description:
|
||||
* @date 2023-05-29 14:28
|
||||
*/
|
||||
|
||||
@Api(tags = "微信小程序app接口")
|
||||
@RestController
|
||||
@RequestMapping({"/v1/partnerManage/miniProgram" })
|
||||
public class MiniProgramAppController {
|
||||
|
||||
@Resource
|
||||
private WechatMiniAppService wechatMiniAppService;
|
||||
|
||||
@ApiOperation("小程序登录")
|
||||
@PostMapping("/login")
|
||||
public ResponseResult<PartnerUserInfoVO> login(@RequestBody @Valid MiniProgramLoginDTO param) {
|
||||
PartnerUserInfoVO userInfoVO = wechatMiniAppService.miniProgramLogin(param);
|
||||
return ResponseResult.success(userInfoVO);
|
||||
}
|
||||
|
||||
@ApiOperation("获取手机号")
|
||||
@GetMapping("/getUserPhoneNumber")
|
||||
public ResponseResult<String> getUserPhoneNumber(@RequestParam(value = "mobileCode",required = true)String mobileCode) {
|
||||
return ResponseResult.success(wechatMiniAppService.getUserPhoneNumber(mobileCode));
|
||||
}
|
||||
|
||||
@ApiOperation("更新手机号")
|
||||
@PostMapping("/updateUserPhoneNumber")
|
||||
public ResponseResult<String> updateUserPhoneNumber(@RequestBody @Valid MobileUpdateRequest request) {
|
||||
PartnerUserInfoVO userInfoVO = PartnerUserHolder.getUser();
|
||||
return ResponseResult.success(wechatMiniAppService.updateUserPhoneNumber(request, userInfoVO));
|
||||
}
|
||||
|
||||
@ApiOperation("根据mobile和openId获取用户信息")
|
||||
@GetMapping("/getUserInfo")
|
||||
public ResponseResult<PartnerUserInfoVO> getUserInfo(){
|
||||
PartnerUserInfoVO userInfoVO = PartnerUserHolder.getUser();
|
||||
return ResponseResult.success(userInfoVO);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.cool.store.controller.webc;
|
||||
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/test")
|
||||
public class TestController {
|
||||
|
||||
@Resource
|
||||
private EnterpriseUserDAO enterpriseUserDAO;
|
||||
|
||||
@Resource
|
||||
private EnterpriseUserRoleDao enterpriseUserRoleDao;
|
||||
|
||||
@Resource
|
||||
private HyPartnerUserInfoDAO hyPartnerUserInfoDAO;
|
||||
|
||||
@Resource
|
||||
private RegionDao regionDao;
|
||||
|
||||
@Resource
|
||||
private SysRoleDao sysRoleDao;
|
||||
|
||||
@Resource
|
||||
private UserRegionMappingDAO userRegionMappingDAO;
|
||||
|
||||
@GetMapping("/getUserInfo")
|
||||
public ResponseResult getUserInfo(@RequestParam("userId")String userId){
|
||||
EnterpriseUserDO enterpriseUser = enterpriseUserDAO.getUserInfoById(userId);
|
||||
return ResponseResult.success(enterpriseUser);
|
||||
}
|
||||
|
||||
@GetMapping("/getUserInfoByUserIds")
|
||||
public ResponseResult getUserInfoByUserIds(@RequestParam(value = "userIdList", required = false) List<String> userIdList){
|
||||
List<EnterpriseUserDO> enterpriseUserDOList = enterpriseUserDAO.getUserInfoByUserIds(userIdList);
|
||||
return ResponseResult.success(enterpriseUserDOList);
|
||||
}
|
||||
|
||||
@GetMapping("/getUserRoleIds")
|
||||
public ResponseResult getUserRoleIds(@RequestParam("userId")String userId){
|
||||
List<Long> roleIdList = enterpriseUserRoleDao.getUserRoleIds(userId);
|
||||
return ResponseResult.success(roleIdList);
|
||||
}
|
||||
|
||||
@GetMapping("/selectByMobile")
|
||||
public ResponseResult selectByMobile(@RequestParam("mobile")String mobile){
|
||||
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByMobile(mobile);
|
||||
return ResponseResult.success(hyPartnerUserInfoDO);
|
||||
}
|
||||
|
||||
@GetMapping("/getRegionById")
|
||||
public ResponseResult getRegionById(@RequestParam("regionId")Long regionId){
|
||||
RegionDO regionDO = regionDao.getRegionById(regionId);
|
||||
return ResponseResult.success(regionDO);
|
||||
}
|
||||
|
||||
@GetMapping("/selectRoleByRoleIds")
|
||||
public ResponseResult selectRoleByRoleIds(@RequestParam("roleIds")List<Long> roleIds){
|
||||
List<SysRoleDO> sysRoleDOList = sysRoleDao.selectRoleByRoleIds(roleIds);
|
||||
return ResponseResult.success(sysRoleDOList);
|
||||
}
|
||||
|
||||
@GetMapping("/listUserRegionMappingByUserId")
|
||||
public ResponseResult listUserRegionMappingByUserId(@RequestParam("userIds")List<String> userIds){
|
||||
List<UserRegionMappingDO> userRegionMappingDOList = userRegionMappingDAO.listUserRegionMappingByUserId(userIds);
|
||||
return ResponseResult.success(userRegionMappingDOList);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
|
||||
#mysql config
|
||||
default.datasource.url=jdbc:mysql://dingpushcoolcollege.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_hy?useSSL=false&useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true
|
||||
default.datasource.username=hsay
|
||||
default.datasource.password=Z3J7xBbgouMD
|
||||
|
||||
#redis
|
||||
spring.redis.host=tstore-coolcollege.redis.rds.aliyuncs.com
|
||||
spring.redis.port=6379
|
||||
spring.redis.password=Cx111111
|
||||
spring.redis.database=0
|
||||
spring.redis.timeout=2000ms
|
||||
spring.redis.lettuce.pool.max-wait=100ms
|
||||
spring.redis.lettuce.pool.max-active=1024
|
||||
spring.redis.lettuce.pool.max-idle=200
|
||||
spring.redis.lettuce.pool.min-idle=0
|
||||
spring.redis.lettuce.shutdown-timeout=100ms
|
||||
redis.host.uri=http://userInfo:Cx111111@tstore-coolcollege.redis.rds.aliyuncs.com:6379/0
|
||||
redis.isv.host.uri=http://userInfo:Cx111111@tstore-coolcollege.redis.rds.aliyuncs.com:6379/2
|
||||
|
||||
#pagehelper
|
||||
pagehelper.helper-dialect=mysql
|
||||
pagehelper.reasonable=false
|
||||
pagehelper.returnPageInfo=check
|
||||
pagehelper.support-methods-arguments=false
|
||||
pagehelper.params=count=countSql
|
||||
pagehelper.page-size-zero=true
|
||||
|
||||
spring.mvc.async.request-timeout=60000
|
||||
|
||||
# mybatis config
|
||||
mybatis.mapper-locations=classpath*:mapper/**/*Mapper.xml
|
||||
|
||||
mybatis.configuration.call-setters-on-nulls=true
|
||||
mybatis.configuration.map-underscore-to-camel-case=true
|
||||
|
||||
isv.domain=https://abstore-isv.coolstore.cn/isv
|
||||
|
||||
#rocketmq \u914D\u7F6E
|
||||
rocketmq.accessKey=zK2oVEz4G1ts23d2
|
||||
rocketmq.secretKey=0UstLCS0mh2ASgBh
|
||||
rocketmq.nameSrvAdder=http://rmq-cn-9lb38l1rx04.cn-hangzhou.rmq.aliyuncs.com:8080
|
||||
rocketmq.topic=simple_message
|
||||
|
||||
#oss配置
|
||||
oss.accessKeyId=LTAI5tRSXy2MrqaaBJ6gReur
|
||||
oss.accessKeySecret=FFsl8d9batprJ0vXr0k4Y8ada40Wm2
|
||||
oss.endpoint=oss-cn-hangzhou.aliyuncs.com
|
||||
oss.bucket=cool-store-hsay
|
||||
oss.file.dir=partner/171cddee76471740/
|
||||
oss.excelFile.dir=lineExcel/
|
||||
|
||||
#企业corpId
|
||||
corp.id=171cddee76471740
|
||||
#cdn地址
|
||||
cdn.url=https://testhsaypic.coolstore.cn
|
||||
|
||||
#TRTC
|
||||
trtc.sdkAppId=1400811820
|
||||
trtc.secretKey=4854bab106c2ca2a2fda16a8c966933e28a078a34e458999d6227e8cd8ab8219
|
||||
trtc.video.callback.secretKey=1ECEAD34DBD84E838BF07FC7360EA4D8
|
||||
|
||||
weixin.appId=wx997f2206e276e513
|
||||
weixin.appSecret=90a51574dde00480316f81a552e6b5cb
|
||||
weixin.index.url=pages/index/index
|
||||
|
||||
signKey=77fea013c3a6459685b83c21a2fc3411
|
||||
fixMobileOpenid=HSAY5531DA7
|
||||
#xxljob配置
|
||||
#xxljob配置
|
||||
xxl.job.admin.addresses=http://10.7.53.224:10001/xxl-job-admin
|
||||
xxl.job.executor.appname=${spring.application.name}
|
||||
xxl.job.executor.ip=
|
||||
xxl.job.executor.port=31001
|
||||
xxl.job.executor.logpath=logs/xxl-job/jobhandler
|
||||
xxl.job.executor.logretentiondays=3
|
||||
xxl.job.accessToken=25365115eed84e9ba5e0040abb255a09
|
||||
|
||||
|
||||
hs.mdm.baseUrl=http://36.7.115.86:10112
|
||||
hs.mdm.appkey=HSAYPartner
|
||||
hs.mdm.appsec=ab39fedb886fa3587c7f517551976de8b2606f5511fd8f8675266825d74c5cd3
|
||||
|
||||
#sms
|
||||
hs.sms.accessKeyId=LTAI5tPWCTeCyngfYLqoSGWk
|
||||
hs.sms.accessKeySecret=jkzIXlvNF17ne5TPPEFP1sQhcfg4Je
|
||||
|
||||
ec.baseUrl=https://oapi-gateway.shpr.top/basic
|
||||
|
||||
#飞书通知
|
||||
feishu.notice.link.url=https://applink.feishu.cn/client/web_app/open?appId=cli_a4f3e24dc73a100c&lk_target_url=https%3A%2F%2Ftest-hsay-web.coolstore.cn%2F%23%2Fwork%2Fbench
|
||||
feishu.notice.link.url.mobile=https://test-hsay-web.coolstore.cn/#/mobile
|
||||
|
||||
#阿里云ak sk
|
||||
aliyun.accessKeyId=LTAI5t9RaXvABZbHvoXjDFJ1
|
||||
aliyun.accessKeySecret=zhOK7WWo3yGoUWkOMaatty19k25CMd
|
||||
aliyun.authCode=Y81FVZepk6
|
||||
|
||||
exhibition.channel.id=52399
|
||||
recommended.channel.id=52400
|
||||
manual.channel.id=52403
|
||||
sms.invate.channel.id=46930
|
||||
|
||||
ec.sync.createUserId=ou_18d7526a527a30a06ee99205ad983f3f
|
||||
|
||||
#沪上阿姨事件中心地址
|
||||
hsay.event.url=https://oapi-gateway.shpr.top/event
|
||||
hsay.event.systemsource=hsay_test
|
||||
@@ -0,0 +1,108 @@
|
||||
|
||||
#mysql config
|
||||
default.datasource.url=jdbc:mysql://dingpushcoolcollege.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_hy?useSSL=false&useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true
|
||||
default.datasource.username=hsay
|
||||
default.datasource.password=Z3J7xBbgouMD
|
||||
|
||||
#redis
|
||||
spring.redis.host=tstore-coolcollege.redis.rds.aliyuncs.com
|
||||
spring.redis.port=6379
|
||||
spring.redis.password=Cx111111
|
||||
spring.redis.database=0
|
||||
spring.redis.timeout=2000ms
|
||||
spring.redis.lettuce.pool.max-wait=100ms
|
||||
spring.redis.lettuce.pool.max-active=1024
|
||||
spring.redis.lettuce.pool.max-idle=200
|
||||
spring.redis.lettuce.pool.min-idle=0
|
||||
spring.redis.lettuce.shutdown-timeout=100ms
|
||||
redis.host.uri=http://userInfo:Cx111111@tstore-coolcollege.redis.rds.aliyuncs.com:6379/0
|
||||
redis.isv.host.uri=http://userInfo:Cx111111@tstore-coolcollege.redis.rds.aliyuncs.com:6379/2
|
||||
|
||||
#pagehelper
|
||||
pagehelper.helper-dialect=mysql
|
||||
pagehelper.reasonable=false
|
||||
pagehelper.returnPageInfo=check
|
||||
pagehelper.support-methods-arguments=false
|
||||
pagehelper.params=count=countSql
|
||||
pagehelper.page-size-zero=true
|
||||
|
||||
spring.mvc.async.request-timeout=60000
|
||||
|
||||
# mybatis config
|
||||
mybatis.mapper-locations=classpath*:mapper/**/*Mapper.xml
|
||||
|
||||
mybatis.configuration.call-setters-on-nulls=true
|
||||
mybatis.configuration.map-underscore-to-camel-case=true
|
||||
|
||||
isv.domain=https://abstore-isv.coolstore.cn/isv
|
||||
|
||||
#rocketmq \u914D\u7F6E
|
||||
rocketmq.accessKey=zK2oVEz4G1ts23d2
|
||||
rocketmq.secretKey=0UstLCS0mh2ASgBh
|
||||
rocketmq.nameSrvAdder=http://rmq-cn-9lb38l1rx04.cn-hangzhou.rmq.aliyuncs.com:8080
|
||||
rocketmq.topic=simple_message
|
||||
|
||||
#oss配置
|
||||
oss.accessKeyId=LTAI5tRSXy2MrqaaBJ6gReur
|
||||
oss.accessKeySecret=FFsl8d9batprJ0vXr0k4Y8ada40Wm2
|
||||
oss.endpoint=oss-cn-hangzhou.aliyuncs.com
|
||||
oss.bucket=cool-store-hsay
|
||||
oss.file.dir=partner/171cddee76471740/
|
||||
oss.excelFile.dir=lineExcel/
|
||||
|
||||
#企业corpId
|
||||
corp.id=171cddee76471740
|
||||
#cdn地址
|
||||
cdn.url=https://testhsaypic.coolstore.cn
|
||||
|
||||
#TRTC
|
||||
trtc.sdkAppId=1600026212
|
||||
trtc.secretKey=e036b654c665f649f053a01ff6f5652a826980027be298d4d49949f6e26434a5
|
||||
trtc.video.callback.secretKey=ur4wq2iFbRI03Q35
|
||||
|
||||
weixin.appId=wx997f2206e276e513
|
||||
weixin.appSecret=90a51574dde00480316f81a552e6b5cb
|
||||
weixin.index.url=pages/index/index
|
||||
|
||||
signKey=77fea013c3a6459685b83c21a2fc3411
|
||||
fixMobileOpenid=HSAY5531DA7
|
||||
#xxljob配置
|
||||
#xxljob配置
|
||||
xxl.job.admin.addresses=http://10.7.53.224:10001/xxl-job-admin
|
||||
xxl.job.executor.appname=${spring.application.name}
|
||||
xxl.job.executor.ip=
|
||||
xxl.job.executor.port=31001
|
||||
xxl.job.executor.logpath=logs/xxl-job/jobhandler
|
||||
xxl.job.executor.logretentiondays=3
|
||||
xxl.job.accessToken=25365115eed84e9ba5e0040abb255a09
|
||||
|
||||
|
||||
hs.mdm.baseUrl=http://36.7.115.86:10112
|
||||
hs.mdm.appkey=HSAYPartner
|
||||
hs.mdm.appsec=ab39fedb886fa3587c7f517551976de8b2606f5511fd8f8675266825d74c5cd3
|
||||
|
||||
#sms
|
||||
hs.sms.accessKeyId=LTAI5tPWCTeCyngfYLqoSGWk
|
||||
hs.sms.accessKeySecret=jkzIXlvNF17ne5TPPEFP1sQhcfg4Je
|
||||
|
||||
ec.baseUrl=https://oapi-gateway.shpr.top/basic
|
||||
|
||||
#飞书通知
|
||||
feishu.notice.link.url=https://applink.feishu.cn/client/web_app/open?appId=cli_a4f3e24dc73a100c&lk_target_url=https%3A%2F%2Ftest-hsay-web.coolstore.cn%2F%23%2Fwork%2Fbench
|
||||
feishu.notice.link.url.mobile=https://test-hsay-web.coolstore.cn/#/mobile
|
||||
|
||||
#阿里云ak sk
|
||||
aliyun.accessKeyId=LTAI5t9RaXvABZbHvoXjDFJ1
|
||||
aliyun.accessKeySecret=zhOK7WWo3yGoUWkOMaatty19k25CMd
|
||||
aliyun.authCode=Y81FVZepk6
|
||||
|
||||
exhibition.channel.id=52399
|
||||
recommended.channel.id=52400
|
||||
manual.channel.id=52403
|
||||
sms.invate.channel.id=46930
|
||||
|
||||
ec.sync.createUserId=ou_18d7526a527a30a06ee99205ad983f3f
|
||||
|
||||
#沪上阿姨事件中心地址
|
||||
hsay.event.url=https://oapi-gateway.shpr.top/event
|
||||
hsay.event.systemsource=hsay_test
|
||||
@@ -0,0 +1,108 @@
|
||||
|
||||
#mysql config
|
||||
default.datasource.url=jdbc:mysql://dingpushcoolcollege.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_hy?useSSL=false&useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true
|
||||
default.datasource.username=hsay
|
||||
default.datasource.password=Z3J7xBbgouMD
|
||||
|
||||
#redis
|
||||
spring.redis.host=tstore-coolcollege.redis.rds.aliyuncs.com
|
||||
spring.redis.port=6379
|
||||
spring.redis.password=Cx111111
|
||||
spring.redis.database=0
|
||||
spring.redis.timeout=2000ms
|
||||
spring.redis.lettuce.pool.max-wait=100ms
|
||||
spring.redis.lettuce.pool.max-active=1024
|
||||
spring.redis.lettuce.pool.max-idle=200
|
||||
spring.redis.lettuce.pool.min-idle=0
|
||||
spring.redis.lettuce.shutdown-timeout=100ms
|
||||
redis.host.uri=http://userInfo:Cx111111@tstore-coolcollege.redis.rds.aliyuncs.com:6379/0
|
||||
redis.isv.host.uri=http://userInfo:Cx111111@tstore-coolcollege.redis.rds.aliyuncs.com:6379/2
|
||||
|
||||
#pagehelper
|
||||
pagehelper.helper-dialect=mysql
|
||||
pagehelper.reasonable=false
|
||||
pagehelper.returnPageInfo=check
|
||||
pagehelper.support-methods-arguments=false
|
||||
pagehelper.params=count=countSql
|
||||
pagehelper.page-size-zero=true
|
||||
|
||||
spring.mvc.async.request-timeout=60000
|
||||
|
||||
# mybatis config
|
||||
mybatis.mapper-locations=classpath*:mapper/**/*Mapper.xml
|
||||
|
||||
mybatis.configuration.call-setters-on-nulls=true
|
||||
mybatis.configuration.map-underscore-to-camel-case=true
|
||||
|
||||
isv.domain=https://abstore-isv.coolstore.cn/isv
|
||||
|
||||
#rocketmq \u914D\u7F6E
|
||||
rocketmq.accessKey=zK2oVEz4G1ts23d2
|
||||
rocketmq.secretKey=0UstLCS0mh2ASgBh
|
||||
rocketmq.nameSrvAdder=http://rmq-cn-9lb38l1rx04.cn-hangzhou.rmq.aliyuncs.com:8080
|
||||
rocketmq.topic=simple_message
|
||||
|
||||
#oss配置
|
||||
oss.accessKeyId=LTAI5tRSXy2MrqaaBJ6gReur
|
||||
oss.accessKeySecret=FFsl8d9batprJ0vXr0k4Y8ada40Wm2
|
||||
oss.endpoint=oss-cn-hangzhou.aliyuncs.com
|
||||
oss.bucket=cool-store-hsay
|
||||
oss.file.dir=partner/171cddee76471740/
|
||||
oss.excelFile.dir=lineExcel/
|
||||
|
||||
#企业corpId
|
||||
corp.id=171cddee76471740
|
||||
#cdn地址
|
||||
cdn.url=https://testhsaypic.coolstore.cn
|
||||
|
||||
#TRTC
|
||||
trtc.sdkAppId=1400811820
|
||||
trtc.secretKey=4854bab106c2ca2a2fda16a8c966933e28a078a34e458999d6227e8cd8ab8219
|
||||
trtc.video.callback.secretKey=1ECEAD34DBD84E838BF07FC7360EA4D8
|
||||
|
||||
weixin.appId=wx997f2206e276e513
|
||||
weixin.appSecret=90a51574dde00480316f81a552e6b5cb
|
||||
weixin.index.url=pages/index/index
|
||||
|
||||
signKey=77fea013c3a6459685b83c21a2fc3411
|
||||
fixMobileOpenid=HSAY5531DA7
|
||||
#xxljob配置
|
||||
#xxljob配置
|
||||
xxl.job.admin.addresses=http://10.7.53.224:10001/xxl-job-admin
|
||||
xxl.job.executor.appname=${spring.application.name}
|
||||
xxl.job.executor.ip=
|
||||
xxl.job.executor.port=31001
|
||||
xxl.job.executor.logpath=logs/xxl-job/jobhandler
|
||||
xxl.job.executor.logretentiondays=3
|
||||
xxl.job.accessToken=25365115eed84e9ba5e0040abb255a09
|
||||
|
||||
|
||||
hs.mdm.baseUrl=http://36.7.115.86:10112
|
||||
hs.mdm.appkey=HSAYPartner
|
||||
hs.mdm.appsec=ab39fedb886fa3587c7f517551976de8b2606f5511fd8f8675266825d74c5cd3
|
||||
|
||||
#sms
|
||||
hs.sms.accessKeyId=LTAI5tPWCTeCyngfYLqoSGWk
|
||||
hs.sms.accessKeySecret=jkzIXlvNF17ne5TPPEFP1sQhcfg4Je
|
||||
|
||||
ec.baseUrl=https://oapi-gateway.shpr.top/basic
|
||||
|
||||
#飞书通知
|
||||
feishu.notice.link.url=https://applink.feishu.cn/client/web_app/open?appId=cli_a4f3e24dc73a100c&lk_target_url=https%3A%2F%2Ftest-hsay-web.coolstore.cn%2F%23%2Fwork%2Fbench
|
||||
feishu.notice.link.url.mobile=https://test-hsay-web.coolstore.cn/#/mobile
|
||||
|
||||
#阿里云ak sk
|
||||
aliyun.accessKeyId=LTAI5t9RaXvABZbHvoXjDFJ1
|
||||
aliyun.accessKeySecret=zhOK7WWo3yGoUWkOMaatty19k25CMd
|
||||
aliyun.authCode=Y81FVZepk6
|
||||
|
||||
exhibition.channel.id=52399
|
||||
recommended.channel.id=52400
|
||||
manual.channel.id=52403
|
||||
sms.invate.channel.id=46930
|
||||
|
||||
ec.sync.createUserId=ou_18d7526a527a30a06ee99205ad983f3f
|
||||
|
||||
#沪上阿姨事件中心地址
|
||||
hsay.event.url=https://oapi-gateway.shpr.top/event
|
||||
hsay.event.systemsource=hsay_test
|
||||
@@ -0,0 +1,108 @@
|
||||
|
||||
#mysql config
|
||||
default.datasource.url=jdbc:mysql://dingpushcoolcollege.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_hy?useSSL=false&useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true
|
||||
default.datasource.username=hsay
|
||||
default.datasource.password=Z3J7xBbgouMD
|
||||
|
||||
#redis
|
||||
spring.redis.host=tstore-coolcollege.redis.rds.aliyuncs.com
|
||||
spring.redis.port=6379
|
||||
spring.redis.password=Cx111111
|
||||
spring.redis.database=0
|
||||
spring.redis.timeout=2000ms
|
||||
spring.redis.lettuce.pool.max-wait=100ms
|
||||
spring.redis.lettuce.pool.max-active=1024
|
||||
spring.redis.lettuce.pool.max-idle=200
|
||||
spring.redis.lettuce.pool.min-idle=0
|
||||
spring.redis.lettuce.shutdown-timeout=100ms
|
||||
redis.host.uri=http://userInfo:Cx111111@tstore-coolcollege.redis.rds.aliyuncs.com:6379/0
|
||||
redis.isv.host.uri=http://userInfo:Cx111111@tstore-coolcollege.redis.rds.aliyuncs.com:6379/2
|
||||
|
||||
#pagehelper
|
||||
pagehelper.helper-dialect=mysql
|
||||
pagehelper.reasonable=false
|
||||
pagehelper.returnPageInfo=check
|
||||
pagehelper.support-methods-arguments=false
|
||||
pagehelper.params=count=countSql
|
||||
pagehelper.page-size-zero=true
|
||||
|
||||
spring.mvc.async.request-timeout=60000
|
||||
|
||||
# mybatis config
|
||||
mybatis.mapper-locations=classpath*:mapper/**/*Mapper.xml
|
||||
|
||||
mybatis.configuration.call-setters-on-nulls=true
|
||||
mybatis.configuration.map-underscore-to-camel-case=true
|
||||
|
||||
isv.domain=https://abstore-isv.coolstore.cn/isv
|
||||
|
||||
#rocketmq \u914D\u7F6E
|
||||
rocketmq.accessKey=zK2oVEz4G1ts23d2
|
||||
rocketmq.secretKey=0UstLCS0mh2ASgBh
|
||||
rocketmq.nameSrvAdder=http://rmq-cn-9lb38l1rx04.cn-hangzhou.rmq.aliyuncs.com:8080
|
||||
rocketmq.topic=simple_message
|
||||
|
||||
#oss配置
|
||||
oss.accessKeyId=LTAI5tRSXy2MrqaaBJ6gReur
|
||||
oss.accessKeySecret=FFsl8d9batprJ0vXr0k4Y8ada40Wm2
|
||||
oss.endpoint=oss-cn-hangzhou.aliyuncs.com
|
||||
oss.bucket=cool-store-hsay
|
||||
oss.file.dir=partner/171cddee76471740/
|
||||
oss.excelFile.dir=lineExcel/
|
||||
|
||||
#企业corpId
|
||||
corp.id=171cddee76471740
|
||||
#cdn地址
|
||||
cdn.url=https://testhsaypic.coolstore.cn
|
||||
|
||||
#TRTC
|
||||
trtc.sdkAppId=1600026212
|
||||
trtc.secretKey=e036b654c665f649f053a01ff6f5652a826980027be298d4d49949f6e26434a5
|
||||
trtc.video.callback.secretKey=ur4wq2iFbRI03Q35
|
||||
|
||||
weixin.appId=wx997f2206e276e513
|
||||
weixin.appSecret=90a51574dde00480316f81a552e6b5cb
|
||||
weixin.index.url=pages/index/index
|
||||
|
||||
signKey=77fea013c3a6459685b83c21a2fc3411
|
||||
fixMobileOpenid=HSAY5531DA7
|
||||
#xxljob配置
|
||||
#xxljob配置
|
||||
xxl.job.admin.addresses=http://10.7.53.224:10001/xxl-job-admin
|
||||
xxl.job.executor.appname=${spring.application.name}
|
||||
xxl.job.executor.ip=
|
||||
xxl.job.executor.port=31001
|
||||
xxl.job.executor.logpath=logs/xxl-job/jobhandler
|
||||
xxl.job.executor.logretentiondays=3
|
||||
xxl.job.accessToken=25365115eed84e9ba5e0040abb255a09
|
||||
|
||||
|
||||
hs.mdm.baseUrl=http://36.7.115.86:10112
|
||||
hs.mdm.appkey=HSAYPartner
|
||||
hs.mdm.appsec=ab39fedb886fa3587c7f517551976de8b2606f5511fd8f8675266825d74c5cd3
|
||||
|
||||
#sms
|
||||
hs.sms.accessKeyId=LTAI5tPWCTeCyngfYLqoSGWk
|
||||
hs.sms.accessKeySecret=jkzIXlvNF17ne5TPPEFP1sQhcfg4Je
|
||||
|
||||
ec.baseUrl=https://oapi-gateway.shpr.top/basic
|
||||
|
||||
#飞书通知
|
||||
feishu.notice.link.url=https://applink.feishu.cn/client/web_app/open?appId=cli_a4f3e24dc73a100c&lk_target_url=https%3A%2F%2Ftest-hsay-web.coolstore.cn%2F%23%2Fwork%2Fbench
|
||||
feishu.notice.link.url.mobile=https://test-hsay-web.coolstore.cn/#/mobile
|
||||
|
||||
#阿里云ak sk
|
||||
aliyun.accessKeyId=LTAI5t9RaXvABZbHvoXjDFJ1
|
||||
aliyun.accessKeySecret=zhOK7WWo3yGoUWkOMaatty19k25CMd
|
||||
aliyun.authCode=Y81FVZepk6
|
||||
|
||||
exhibition.channel.id=52399
|
||||
recommended.channel.id=52400
|
||||
manual.channel.id=52403
|
||||
sms.invate.channel.id=46930
|
||||
|
||||
ec.sync.createUserId=ou_18d7526a527a30a06ee99205ad983f3f
|
||||
|
||||
#沪上阿姨事件中心地址
|
||||
hsay.event.url=https://oapi-gateway.shpr.top/event
|
||||
hsay.event.systemsource=hsay_test
|
||||
@@ -0,0 +1,53 @@
|
||||
spring.application.name=hsay-partner-web
|
||||
spring.profiles.active=test
|
||||
|
||||
server.port=40000
|
||||
server.servlet.context-path=/xfsg
|
||||
|
||||
#logback
|
||||
logging.config=classpath:logback-spring.xml
|
||||
logging.path=/data/log/partner
|
||||
|
||||
#connection pool config
|
||||
spring.datasource.hikari.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.hikari.cachePrepStmts=true
|
||||
spring.datasource.hikari.prepStmtCacheSize=250
|
||||
spring.datasource.hikari.prepStmtCacheSqlLimit=2048
|
||||
spring.datasource.hikari.useServerPrepStmts=true
|
||||
spring.datasource.hikari.useLocalSessionState=true
|
||||
spring.datasource.hikari.rewriteBatchedStatements=true
|
||||
spring.datasource.hikari.cacheResultSetMetadata=true
|
||||
spring.datasource.hikari.cacheServerConfiguration=true
|
||||
spring.datasource.hikari.elideSetAutoCommits=true
|
||||
spring.datasource.hikari.maintainTimeStats=false
|
||||
spring.datasource.hikari.minimumIdle=10
|
||||
spring.datasource.hikari.maximumPoolSize=150
|
||||
spring.datasource.hikari.maxLifetime=200000
|
||||
spring.datasource.hikari.connectionTimeout=3000
|
||||
spring.datasource.hikari.poolName=DefaultHikariCP
|
||||
spring.datasource.hikari.idleTimeout=300000
|
||||
#\u914D\u7F6E\u8FD4\u56DE\u65F6\u95F4\u6233
|
||||
spring.jackson.serialization.write-dates-as-timestamps=true
|
||||
# file size
|
||||
spring.servlet.multipart.maxFileSize=1024MB
|
||||
spring.servlet.multipart.maxRequestSize=1024MB
|
||||
# Max file size.
|
||||
spring.servlet.multipart.max-file-size=1024MB
|
||||
# Max request size.
|
||||
spring.servlet.multipart.max-request-size=1024MB
|
||||
spring.main.allow-circular-references=true
|
||||
|
||||
allow.upload.image.ext=jpg,jpeg,gif,png,bmp,jfif
|
||||
allow.upload.file.ext=zip,mp4,pptx,ppt,doc,docx,pdf
|
||||
allow.upload.video.ext=3gp,asf,avi,dat,dv,flv,f4v,gif,m2t,m3u8,m4v,mj2,mjpeg,mkv,mov,mp4,mpe,mpg,mpeg,mts,ogg,qt,rm,rmvb,swf,ts,vob,wmv,webm
|
||||
allow.upload.audio.ext=mp3
|
||||
allow.upload.image.size=1024 * 1024L * 1024L
|
||||
allow.upload.file.size=30 * 1024 * 1024L
|
||||
allow.upload.video.size=1024 * 1024 * 10L
|
||||
allow.upload.audio.size=1024 * 1024 * 10L
|
||||
|
||||
server.connection-timeout=18000000
|
||||
server.tomcat.basedir=/tmp/tomcat/partner-b
|
||||
|
||||
log4j2.formatMsgNoLookups=true
|
||||
mybatis.configuration.variables.enterpriseId=e17cd2dc350541df8a8b0af9bd27f77d
|
||||
58
coolstore-partner-web/src/main/resources/logback-spring.xml
Normal file
58
coolstore-partner-web/src/main/resources/logback-spring.xml
Normal file
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--scan:配置文件如果发生改变,将会被重新加载,scanPeriod:设置监测配置文件是否有修改的时间间隔 -->
|
||||
<configuration scan="true" scanPeriod="60 seconds">
|
||||
<!--应用的名称 -->
|
||||
<property name="APPNAME" value="partner-web-b" />
|
||||
<!--应用的端口号 -->
|
||||
<property name="PORT" value="31000" />
|
||||
<!--日志文件本地存放目录路径-->
|
||||
<property name="logBaseFolder" value="/data/log/partner" />
|
||||
<!--日志文件名称的前缀部分 -->
|
||||
<property name="logFileNamePrefix" value="${APPNAME}-${PORT}" />
|
||||
<!--日志文件最小切割单位 -->
|
||||
<property name="every_file_size" value="300MB" />
|
||||
<!--日志文件保存时间 -->
|
||||
<property name="every_his_size" value="5" />
|
||||
<!--用来指定日志文件的上限大小,删除旧的日志 -->
|
||||
<property name="every_max_size" value="20GB" />
|
||||
<!-- 日志文件的编码 -->
|
||||
<property name="log_charset" value="UTF-8" />
|
||||
<!--|日志时间|线程id|端口号|应用名称|类名|方法名|日志级别|traceId |输入参数|输出参数|耗时|任意多个扩展字段|具体打印的msg内容然后换行-->
|
||||
<property name="log_pattern" value="|%d{yyyy-MM-dd HH:mm:ss.SSS}|%t|${APPNAME}|[%X{requestId}]|[%X{messageId}]%logger|%M|%p|%m%n"/>
|
||||
|
||||
<!-- 输出到控制台 -->
|
||||
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>DEBUG</level>
|
||||
</filter>
|
||||
<encoder>
|
||||
<pattern>${log_pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
<!-- 核心系统日志输出到文件,基于日志大小和时间归档 -->
|
||||
<appender name="rollingFile"
|
||||
class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">>
|
||||
<fileNamePattern>${logBaseFolder}/${logFileNamePrefix}.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<maxHistory>${every_his_size}</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log_pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<logger name="com.cool.store.mapper" level="DEBUG" additivity="true" />
|
||||
<!--灰度、线上 不输出到console-->
|
||||
<springProfile name="hd,online,release">
|
||||
<root level="info">
|
||||
<appender-ref ref="rollingFile"/>
|
||||
</root>
|
||||
</springProfile>
|
||||
|
||||
<springProfile name="ab,dev,test,local,release,pre">
|
||||
<root level="info">
|
||||
<appender-ref ref="stdout"/>
|
||||
</root>
|
||||
</springProfile>
|
||||
|
||||
</configuration>
|
||||
Binary file not shown.
BIN
coolstore-partner-web/src/main/resources/static/passLetterBg.jpg
Normal file
BIN
coolstore-partner-web/src/main/resources/static/passLetterBg.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 942 KiB |
Reference in New Issue
Block a user