-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
115f910
commit 7261f23
Showing
6 changed files
with
205 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 101 additions & 0 deletions
101
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUpdateRemarkRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
package me.chanjar.weixin.cp.bean.external; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import lombok.experimental.Accessors; | ||
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; | ||
|
||
import java.io.Serializable; | ||
|
||
/** | ||
* 修改客户备注信息请求. | ||
* | ||
* @author <a href="https://github.com/binarywang">Binary Wang</a> | ||
* @date 2020-09-19 | ||
*/ | ||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Accessors(chain = true) | ||
public class WxCpUpdateRemarkRequest implements Serializable { | ||
private static final long serialVersionUID = -4960239393895754138L; | ||
|
||
public String toJson() { | ||
return WxCpGsonBuilder.create().toJson(this); | ||
} | ||
|
||
/** | ||
* <pre> | ||
* 字段名:userid | ||
* 是否必须:是 | ||
* 描述:企业成员的userid | ||
* </pre> | ||
*/ | ||
@SerializedName("userid") | ||
private String userId; | ||
|
||
/** | ||
* <pre> | ||
* 字段名:external_userid | ||
* 是否必须:是 | ||
* 描述:外部联系人userid | ||
* </pre> | ||
*/ | ||
@SerializedName("external_userid") | ||
private String externalUserId; | ||
|
||
/** | ||
* <pre> | ||
* 字段名:remark | ||
* 是否必须:否 | ||
* 描述:此用户对外部联系人的备注,最多20个字符 | ||
* </pre> | ||
*/ | ||
@SerializedName("remark") | ||
private String remark; | ||
|
||
/** | ||
* <pre> | ||
* 字段名:description | ||
* 是否必须:否 | ||
* 描述:此用户对外部联系人的描述,最多150个字符 | ||
* </pre> | ||
*/ | ||
@SerializedName("description") | ||
private String description; | ||
|
||
/** | ||
* <pre> | ||
* 字段名:remark_company | ||
* 是否必须:否 | ||
* 描述:此用户对外部联系人备注的所属公司名称,最多20个字符 | ||
* </pre> | ||
*/ | ||
@SerializedName("remark_company") | ||
private String remarkCompany; | ||
|
||
/** | ||
* <pre> | ||
* 字段名:remark_mobiles | ||
* 是否必须:否 | ||
* 描述:此用户对外部联系人备注的手机号 | ||
* </pre> | ||
*/ | ||
@SerializedName("remark_mobiles") | ||
private String[] remarkMobiles; | ||
|
||
/** | ||
* <pre> | ||
* 字段名:remark_pic_mediaid | ||
* 是否必须:否 | ||
* 描述:备注图片的mediaid, | ||
* </pre> | ||
*/ | ||
@SerializedName("remark_pic_mediaid") | ||
private String remarkPicMediaId; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...java-cp/src/test/java/me/chanjar/weixin/cp/bean/external/WxCpUpdateRemarkRequestTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package me.chanjar.weixin.cp.bean.external; | ||
|
||
import me.chanjar.weixin.common.util.json.GsonParser; | ||
import org.testng.annotations.Test; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
/** | ||
* 单元测试. | ||
* | ||
* @author <a href="https://github.com/binarywang">Binary Wang</a> | ||
* @date 2020-09-20 | ||
*/ | ||
public class WxCpUpdateRemarkRequestTest { | ||
|
||
@Test | ||
public void testToJson() { | ||
String json = "{\n" + | ||
" \"userid\":\"zhangsan\",\n" + | ||
" \"external_userid\":\"woAJ2GCAAAd1asdasdjO4wKmE8Aabj9AAA\",\n" + | ||
" \"remark\":\"备注信息\",\n" + | ||
" \"description\":\"描述信息\",\n" + | ||
" \"remark_company\":\"腾讯科技\",\n" + | ||
" \"remark_mobiles\":[\n" + | ||
" \"13800000001\",\n" + | ||
" \"13800000002\"\n" + | ||
" ],\n" + | ||
" \"remark_pic_mediaid\":\"MEDIAID\"\n" + | ||
"}\n"; | ||
|
||
WxCpUpdateRemarkRequest request = WxCpUpdateRemarkRequest.builder() | ||
.description("描述信息") | ||
.userId("zhangsan") | ||
.externalUserId("woAJ2GCAAAd1asdasdjO4wKmE8Aabj9AAA") | ||
.remark("备注信息") | ||
.remarkCompany("腾讯科技") | ||
.remarkMobiles(new String[]{"13800000001","13800000002"}) | ||
.remarkPicMediaId("MEDIAID") | ||
.build(); | ||
assertThat(request.toJson()).isEqualTo(GsonParser.parse(json).toString()); | ||
} | ||
} |