微信接口开发

This commit is contained in:
huangdeliang
2021-05-13 20:01:15 +08:00
parent 2e8e6d7b8d
commit 735296b0f9
6 changed files with 125 additions and 1 deletions

View File

@ -1,8 +1,11 @@
package com.stdiet.framework.config;
import javax.servlet.http.HttpServletRequest;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
import com.stdiet.common.utils.ServletUtils;
import org.springframework.web.client.RestTemplate;
/**
* 服务相关配置
@ -29,4 +32,9 @@ public class ServerConfig
String contextPath = request.getServletContext().getContextPath();
return url.delete(url.length() - request.getRequestURI().length(), url.length()).append(contextPath).toString();
}
@Bean
public RestTemplate restTemplate() {
return new RestTemplate();
}
}