Skip to content

【企业微信】fix家校应用single_choice属性字段 #2793

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@

/**
* 获取用户填写答案.
* https://developer.work.weixin.qq.com/document/path/93679
*
* @author Wang_Wong
* @author <a href="https://github.com/0katekate0">Wang_Wong</a>
*/
@Data
public class WxCpGetReportAnswer extends WxCpBaseResp implements Serializable {
Expand Down Expand Up @@ -63,8 +64,8 @@ public static class ReportValue implements Serializable {
@SerializedName("question_id")
private Integer questionId;

@SerializedName("single_chose")
private Integer singleChose;
@SerializedName("single_choice")
private Integer singleChoice;

@SerializedName("multi_choice")
private List<Integer> multiChoice;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,68 @@ public void test() throws WxErrorException {
String currDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date());


// Test
String reportAnswerStr = "{\"errcode\":0,\"errmsg\":\"ok\",\"answers\":[{\"id_type\":1,\"userid\":\"userid2\",\"report_time\":123456789,\"report_values\":[{\"question_id\":1,\"single_choice\":2},{\"question_id\":2,\"text\":\"广东省广州市\"},{\"question_id\":3,\"multi_choice\":[1,3]},{\"question_id\":4,\"fileid\":[\"XXXXXXX\"]}]},{\"id_type\":2,\"student_userid\":\"student_userid1\",\"parent_userid\":\"parent_userid1\",\"report_time\":123456789,\"report_values\":[{\"question_id\":1,\"single_choice\":1},{\"question_id\":2,\"text\":\"广东省深圳市\"},{\"question_id\":3,\"multi_choice\":[1,2,3]},{\"question_id\":4,\"fileid\":[\"XXXXXXX\"]}]}]}";
// Test Json
String reportAnswerStr = "{\n" +
" \"errcode\": 0,\n" +
" \"errmsg\": \"ok\",\n" +
" \"answers\":[\n" +
"\t\t{\n" +
"\t\t\t\"id_type\": 1,\n" +
"\t\t\t\"userid\": \"userid2\",\n" +
"\t\t\t\"report_time\": 123456789,\n" +
"\t\t\t\"report_values\": [\n" +
"\t\t\t\t{\n" +
"\t\t\t\t\t\"question_id\": 1,\n" +
"\t\t\t\t\t\"single_choice\": 2\n" +
"\t\t\t\t},\n" +
"\t\t\t\t{\n" +
"\t\t\t\t\t\"question_id\": 2,\n" +
"\t\t\t\t\t\"text\": \"广东省广州市\"\n" +
"\t\t\t\t},\n" +
"\t\t\t\t{\n" +
"\t\t\t\t\t\"question_id\": 3,\n" +
"\t\t\t\t\t\"multi_choice\": [\n" +
"\t\t\t\t\t\t1, 3\n" +
"\t\t\t\t\t]\n" +
"\t\t\t\t},\n" +
"\t\t\t\t{\n" +
"\t\t\t\t\t\"question_id\": 4,\n" +
"\t\t\t\t\t\"fileid\": [\n" +
" \"XXXXXXX\"\n" +
" ]\n" +
"\t\t\t\t}\n" +
"\t\t\t]\n" +
"\t\t},\n" +
"\t\t{\n" +
"\t\t\t\"id_type\": 2,\n" +
"\t\t\t\"student_userid\": \"student_userid1\",\n" +
"\t\t\t\"parent_userid\": \"parent_userid1\",\n" +
"\t\t\t\"report_time\": 123456789,\n" +
"\t\t\t\"report_values\":[\n" +
"\t\t\t\t{\n" +
"\t\t\t\t\t\"question_id\": 1,\n" +
"\t\t\t\t\t\"single_choice\": 1\n" +
"\t\t\t\t},\n" +
"\t\t\t\t{\n" +
"\t\t\t\t\t\"question_id\": 2,\n" +
"\t\t\t\t\t\"text\": \"广东省深圳市\"\n" +
"\t\t\t\t},\n" +
"\t\t\t\t{\n" +
"\t\t\t\t\t\"question_id\": 3,\n" +
"\t\t\t\t\t\"multi_choice\":[\n" +
"\t\t\t\t\t\t1,2,3\n" +
"\t\t\t\t\t]\n" +
"\t\t\t\t},\n" +
"\t\t\t\t{\n" +
"\t\t\t\t\t\"question_id\": 4,\n" +
"\t\t\t\t\t\"fileid\": [\n" +
" \"XXXXXXX\"\n" +
" ]\n" +
"\t\t\t\t}\n" +
"\t\t\t]\n" +
"\t\t}\n" +
"\t]\n" +
"}";
WxCpGetReportAnswer getReportAnswer = WxCpGetReportAnswer.fromJson(reportAnswerStr);
log.info("获取对应的getReportAnswer:{}", getReportAnswer.toJson());

Expand Down