修改pc装修数据返回
This commit is contained in:
parent
c2948a80cd
commit
7f51c84830
|
|
@ -15,6 +15,7 @@ import me.chanjar.weixin.mp.api.WxMpService;
|
|||
import me.chanjar.weixin.mp.api.impl.WxMpMenuServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
@ -82,6 +83,7 @@ public class ChannelOaMenusServiceImpl implements IChannelOaMenusService {
|
|||
Assert.notNull(item.get("sub_button"), "子级菜单不能为空");
|
||||
List<Map<String, String>> subButtons = ListUtils.stringToListAsMapStr(item.get("sub_button"));
|
||||
|
||||
List<WxMenuButton> subMenuButtons = new ArrayList<>();
|
||||
if (subButtons.size() > 5) {
|
||||
throw new OperateException("子级菜单超出限制(最多5个)");
|
||||
}
|
||||
|
|
@ -92,17 +94,22 @@ public class ChannelOaMenusServiceImpl implements IChannelOaMenusService {
|
|||
Assert.notNull(subItem.get("appid"), "子级菜单appId参数缺失!");
|
||||
Assert.notNull(subItem.get("url"), "子级菜单url数缺失!");
|
||||
Assert.notNull(subItem.get("pagepath"), "子级菜单pagePath数缺失!");
|
||||
wxMenuButton.setType(subItem.get("type"));
|
||||
wxMenuButton.setAppId(subItem.get("appid"));
|
||||
wxMenuButton.setUrl(subItem.get("url"));
|
||||
wxMenuButton.setPagePath(subItem.get("pagepath"));
|
||||
subMenuButton.setType(subItem.get("type"));
|
||||
subMenuButton.setAppId(subItem.get("appid"));
|
||||
subMenuButton.setUrl(subItem.get("url"));
|
||||
subMenuButton.setPagePath(subItem.get("pagepath"));
|
||||
} else {
|
||||
Assert.notNull(subItem.get("url"), "子级菜单url数缺失");
|
||||
wxMenuButton.setType(subItem.get("type"));
|
||||
wxMenuButton.setUrl(subItem.get("url"));
|
||||
subMenuButton.setType(subItem.get("type"));
|
||||
subMenuButton.setUrl(subItem.get("url"));
|
||||
}
|
||||
menuButtons.add(subMenuButton);
|
||||
|
||||
subMenuButtons.add(subMenuButton);
|
||||
|
||||
}
|
||||
wxMenuButton.setType("click");
|
||||
wxMenuButton.setSubButtons(subMenuButtons);
|
||||
menuButtons.add(wxMenuButton);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue