GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — 互联企业的消息推送接口返回字段类型和官网api不一致 · Issue #2148 · binarywang/WxJava

互联企业的消息推送接口返回字段类型和官网api不一致 #2148

New issue
Copy link
New issue
Copy link
Closed
Closed
互联企业的消息推送接口返回字段类型和官网api不一致#2148
Copy link
Labels
stale企业微信

Description

@pingtiandasheng
pingtiandasheng
opened on Jun 8, 2021
Issue body actions

简要描述

接口返回字段类型和企业微信官网api不一致

模块版本情况

  • WxJava 模块名: weixin-java-cp 消息推送
  • me.chanjar.weixin.cp.bean.message.WxCpMessageSendResult
  • WxJava 版本号:4.1.0

详细描述

@SerializedName("invaliduser")
private String invalidUser;
@SerializedName("invalidparty")
private String invalidParty;
@SerializedName("invalidtag")
private String invalidTag;

字段类型不一致,json转换会报错

日志

2021-06-08 14:55:33.452 [http-nio-8080-exec-2] INFO c.m.a.config.exception.handler.MyExceptionHandler - java.lang.IllegalStateException: Expected a string but was BEGIN_ARRAY at line 1 column 43 path $.invaliduser
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_ARRAY at line 1 column 43 path $.invaliduser
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:226)
at com.google.gson.Gson.fromJson(Gson.java:932)
at com.google.gson.Gson.fromJson(Gson.java:897)
at com.google.gson.Gson.fromJson(Gson.java:846)
at com.google.gson.Gson.fromJson(Gson.java:817)
at me.chanjar.weixin.cp.bean.message.WxCpMessageSendResult.fromJson(WxCpMessageSendResult.java:30)
at me.chanjar.weixin.cp.api.impl.WxCpMessageServiceImpl.sendLinkedCorpMessage(WxCpMessageServiceImpl.java:49)
at com.mychery.awesomeproject.service.impl.WxCommonServiceImpl.sendLinkedCorpMessage(WxCommonServiceImpl.java:51)
at com.mychery.awesomeproject.service.impl.PushMessageServiceImpl.pushMessage(PushMessageServiceImpl.java:88)
at com.mychery.awesomeproject.service.impl.PushMessageServiceImpl.PCPushMessage(PushMessageServiceImpl.java:55)
at com.mychery.awesomeproject.controller.PushMessageController.messagePush(PushMessageController.java:44)
at com.mychery.awesomeproject.controller.PushMessageController$$FastClassBySpringCGLIB$$98daf70f.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)

Activity

  1. binarywang commented on Jun 8, 2021

    @binarywang
    binarywang
    on Jun 8, 2021
    Owner
    More actions

    请发出原始报文,看样子是由于出现了数组

  2. binarywang commented on Jun 8, 2021

    @binarywang
    binarywang
    on Jun 8, 2021
    Owner
    More actions

    如果我没看错,官方文档是这样写的:

     {
       "errcode" : 0,
       "errmsg" : "ok",
       "invaliduser" : "userid1|userid2",
       "invalidparty" : "partyid1|partyid2",
       "invalidtag": "tagid1|tagid2"
     }
    
    
  3. pingtiandasheng commented on Jun 8, 2021

    @pingtiandasheng
    pingtiandasheng
    on Jun 8, 2021
    Author
    More actions

    请发出原始报文,看样子是由于出现了数组

    是的,官网的返回实例现在是这样的
    {
    "errcode" : 0,
    "errmsg" : "ok",
    "invaliduser" : ["userid1","userid2","CorpId1/userid1","CorpId2/userid2"], // 不区分大小写,返回的列表都统一转为小写
    "invalidparty" : ["partyid1","partyid2","LinkedId1/partyid1","LinkedId2/partyid2"],
    "invalidtag":["tagid1","tagid2"]
    }

  4. pingtiandasheng commented on Jun 8, 2021

    @pingtiandasheng
    pingtiandasheng
    on Jun 8, 2021
    Author
    More actions

    如果我没看错,官方文档是这样写的:

     {
       "errcode" : 0,
       "errmsg" : "ok",
       "invaliduser" : "userid1|userid2",
       "invalidparty" : "partyid1|partyid2",
       "invalidtag": "tagid1|tagid2"
     }
    

    我看到的官网咋是这样的
    {
    "errcode" : 0,
    "errmsg" : "ok",
    "invaliduser" : ["userid1","userid2","CorpId1/userid1","CorpId2/userid2"], // 不区分大小写,返回的列表都统一转为小写
    "invalidparty" : ["partyid1","partyid2","LinkedId1/partyid1","LinkedId2/partyid2"],
    "invalidtag":["tagid1","tagid2"]
    }
    api地址
    https://work.weixin.qq.com/api/doc/90000/90135/90250

  5. binarywang commented on Jun 8, 2021

    @binarywang
    binarywang
    on Jun 8, 2021
    Owner
    More actions

    你用的是互联企业的消息推送?看来两种消息返回结构不一致导致的

  6. pingtiandasheng commented on Jun 8, 2021

    @pingtiandasheng
    pingtiandasheng
    on Jun 8, 2021
    Author
    More actions

    你用的是互联企业的消息推送?看来两种消息返回结构不一致导致的

    嗯嗯是的

  7. pingtiandasheng commented on Jun 9, 2021

    @pingtiandasheng
    pingtiandasheng
    on Jun 9, 2021
    Author
    More actions

    期待大神们丰富一下这一块

  8. pingtiandasheng
    closed this as completedon Jun 9, 2021
  9. binarywang commented on Jun 9, 2021

    @binarywang
    binarywang
    on Jun 9, 2021
    Owner
    More actions

    期待不如自己马上行动,提交PR,这是目前最快的方法,你如果要等大佬行动,那可要且等了

  10. binarywang
    reopened this on Jun 11, 2021
  11. binarywang
    changed the title [-]接口返回字段类型和企业微信官网api不一致[/-] [+]互联企业的消息推送接口返回字段类型和企业微信官网api不一致[/+] on Jun 11, 2021
  12. binarywang
    changed the title [-]互联企业的消息推送接口返回字段类型和企业微信官网api不一致[/-] [+]互联企业的消息推送接口返回字段类型和官网api不一致[/+] on Jun 11, 2021
  13. binarywang
    added
    企业微信
    on Jun 11, 2021
  14. chutian0124
    added 2 commits that reference this issue on Jun 22, 2021

    互联企业的消息推送接口返回字段类型和官网api不一致 binarywang#2148

    11ee52f

    互联企业的消息推送接口返回字段类型和官网api不一致 binarywang#2148

    bf266b8
  15. binarywang
    added a commit that references this issue on Jun 23, 2021

    🐛 #2148 【企业微信】修复互联企业消息推送接口返回字段问题

    71289e4
  16. huixiang-2024
    added a commit that references this issue on Jun 25, 2021

    Merge branch 'develop' of github.com:Wechat-Group/WxJava into develop

    d6501e8
  17. stale commented on Aug 10, 2021

    @stale
    staleBot
    on Aug 10, 2021
    More actions

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

  18. stale
    added
    stale
    on Aug 10, 2021
  19. binarywang
    closed this as completedon Aug 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stale企业微信

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.