mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-04-05 17:38:05 +08:00
🎨 #3356【公众号】草稿箱模块新建草稿/修改草稿接口补充字段
This commit is contained in:
parent
172a49c18c
commit
2226693f59
@ -79,6 +79,18 @@ public class WxMpDraftArticles implements ToJson, Serializable {
|
||||
@SerializedName("thumb_url")
|
||||
private String thumbUrl;
|
||||
|
||||
/**
|
||||
* 封面裁剪为2.35:1规格的坐标字段。以原始图片(thumb_media_id)左上角(0,0),右下角(1,1)建立平面坐标系,经过裁剪后的图片,其左上角所在的坐标即为(X1,Y1),右下角所在的坐标则为(X2,Y2),用分隔符_拼接为X1_Y1_X2_Y2,每个坐标值的精度为不超过小数点后6位数字。示例见下图,图中(X1,Y1) 等于(0.1945,0),(X2,Y2)等于(1,0.5236),所以请求参数值为0.1945_0_1_0.5236。
|
||||
*/
|
||||
@SerializedName("pic_crop_235_1")
|
||||
private String picCrop2351;
|
||||
|
||||
/**
|
||||
* 封面裁剪为1:1规格的坐标字段,裁剪原理同pic_crop_235_1,裁剪后的图片必须符合规格要求。
|
||||
*/
|
||||
@SerializedName("pic_crop_1_1")
|
||||
private String picCrop11;
|
||||
|
||||
public static WxMpDraftArticles fromJson(String json) {
|
||||
return WxGsonBuilder.create().fromJson(json, WxMpDraftArticles.class);
|
||||
}
|
||||
|
@ -4,11 +4,7 @@ import com.google.inject.Inject;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
import me.chanjar.weixin.mp.api.WxMpService;
|
||||
import me.chanjar.weixin.mp.api.test.ApiTestModule;
|
||||
import me.chanjar.weixin.mp.bean.draft.WxMpAddDraft;
|
||||
import me.chanjar.weixin.mp.bean.draft.WxMpDraftArticles;
|
||||
import me.chanjar.weixin.mp.bean.draft.WxMpDraftInfo;
|
||||
import me.chanjar.weixin.mp.bean.draft.WxMpDraftList;
|
||||
import me.chanjar.weixin.mp.bean.draft.WxMpUpdateDraft;
|
||||
import me.chanjar.weixin.mp.bean.draft.*;
|
||||
import org.testng.annotations.Guice;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
@ -59,6 +55,8 @@ public class WxMpDraftServiceImplTest {
|
||||
.thumbMediaId(thumbMediaId)
|
||||
// 显示封面、打开评论、所有人可评论
|
||||
.showCoverPic(1).needOpenComment(1).onlyFansCanComment(0)
|
||||
.picCrop2351("0.1945_0_1_0.5236")
|
||||
.picCrop11("0.1945_0_1_0.5236")
|
||||
.build();
|
||||
draftArticleList.add(draftArticle);
|
||||
|
||||
@ -78,7 +76,10 @@ public class WxMpDraftServiceImplTest {
|
||||
@Test
|
||||
public void testUpdateDraft() throws WxErrorException {
|
||||
WxMpDraftArticles draftArticles = WxMpDraftArticles.builder()
|
||||
.title("新标题").content("新图文消息的具体内容").thumbMediaId(thumbMediaId).build();
|
||||
.title("新标题").content("新图文消息的具体内容").thumbMediaId(thumbMediaId)
|
||||
.picCrop2351("0.1945_0_1_0.5236")
|
||||
.picCrop11("0.1945_0_1_0.5236")
|
||||
.build();
|
||||
WxMpUpdateDraft updateDraft = WxMpUpdateDraft.builder()
|
||||
.mediaId(mediaId)
|
||||
.index(0)
|
||||
|
Loading…
Reference in New Issue
Block a user