完成h5前端微信分享功能
This commit is contained in:
parent
bcc17e7bd7
commit
1111efff6e
|
|
@ -22,7 +22,6 @@ import redis.clients.jedis.JedisPool;
|
|||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.net.URI;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/wechat")
|
||||
|
|
@ -37,17 +36,14 @@ public class WechatController {
|
|||
private final URI accessTokenURI;
|
||||
private final HttpService httpService;
|
||||
private final String appId;
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
public WechatController(JedisPool jedisPool,
|
||||
@Value("${wechat.appId}") String appId,
|
||||
@Value("${wechat.secret}") String secret,
|
||||
HttpService httpService,
|
||||
ObjectMapper objectMapper) {
|
||||
HttpService httpService) {
|
||||
this.jedisPool = jedisPool;
|
||||
this.httpService = httpService;
|
||||
this.appId = appId;
|
||||
this.objectMapper = objectMapper;
|
||||
this.accessTokenURI = URI.create(String.format(ACCESS_TOKEN_URL_TEMPLATE, appId, secret));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||
/**
|
||||
* 微信access token返回值
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public class WechatAccessTokenDTO {
|
||||
|
||||
@JsonProperty("errcode")
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.jinrui.reference.mini.model.dto.wechat;
|
|||
/**
|
||||
* 微信分享DTO
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public class WechatShareDTO {
|
||||
|
||||
private String url;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.jinrui.reference.mini.model.dto.wechat;
|
|||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class WechatTicketDTO {
|
||||
|
||||
@JsonProperty("errcode")
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import java.util.UUID;
|
|||
/**
|
||||
* 微信AccessToken返回值
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public class WechatVO {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(WechatVO.class);
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ import org.springframework.web.client.RestTemplate;
|
|||
import java.net.URI;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class HttpService {
|
||||
|
|
|
|||
Loading…
Reference in New Issue