mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-10-07 15:14:38 +08:00
🐛 #3692【小程序】【公众号】修复图片智能裁剪接口请求类型错误的问题
Co-authored-by: dengfeng <dengfeng@huaxincem.com>
This commit is contained in:
@@ -82,7 +82,7 @@ public class WxMaImgProcServiceImpl implements WxImgProcService {
|
||||
ratios = "";
|
||||
}
|
||||
|
||||
final String result = this.service.get(String.format(AI_CROP, imgUrl, ratios), null);
|
||||
final String result = this.service.post(String.format(AI_CROP, imgUrl, ratios), "");
|
||||
return WxImgProcAiCropResult.fromJson(result);
|
||||
}
|
||||
|
||||
|
@@ -86,8 +86,8 @@ public class WxMpImgProcServiceImpl implements WxImgProcService {
|
||||
ratios = "";
|
||||
}
|
||||
|
||||
final String result = this.wxMpService.get(String.format(AI_CROP.getUrl(this.wxMpService.getWxMpConfigStorage()),
|
||||
imgUrl, ratios), null);
|
||||
final String result = this.wxMpService.post(String.format(AI_CROP.getUrl(this.wxMpService.getWxMpConfigStorage()),
|
||||
imgUrl, ratios), "");
|
||||
return WxImgProcAiCropResult.fromJson(result);
|
||||
}
|
||||
|
||||
|
@@ -61,14 +61,14 @@ public class WxMpImgProcServiceImplTest {
|
||||
|
||||
@Test
|
||||
public void testAiCrop() throws WxErrorException {
|
||||
final WxImgProcAiCropResult result = this.mpService.getImgProcService().aiCrop("https://gitee.com/binary/weixin-java-tools/raw/master/images/qrcodes/mp.png");
|
||||
final WxImgProcAiCropResult result = this.mpService.getImgProcService().aiCrop("https://gitee.com/binary/weixin-java-tools/images/banners/wiki.jpg");
|
||||
assertThat(result).isNotNull();
|
||||
System.out.println(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAiCrop2() throws WxErrorException {
|
||||
final WxImgProcAiCropResult result = this.mpService.getImgProcService().aiCrop("https://gitee.com/binary/weixin-java-tools/raw/master/images/qrcodes/mp.png", "1,2.35");
|
||||
final WxImgProcAiCropResult result = this.mpService.getImgProcService().aiCrop("https://gitee.com/binary/weixin-java-tools/images/banners/wiki.jpg", "1,2.35");
|
||||
assertThat(result).isNotNull();
|
||||
System.out.println(result);
|
||||
}
|
||||
|
Reference in New Issue
Block a user