puzhibing
2026-09-21 008ffb622f7e8b941245a4cf19042c7baef39b24
ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/utils/XiaoeUtils.java
@@ -60,6 +60,8 @@
    private static final String COURSE_CHAPTER = "https://api.xiaoe-tech.com/xe.course.course.chapter.get/1.0.0";
    //获取店铺商品分组列表
    private static final String COURSE_GROUP_LIST = "https://api.xiaoe-tech.com/xe.resource_tags.list/1.0.0";
    //获取店铺商品分组列表
    private static final String CREATE_LIVE_PASSWORD = "https://api.xiaoe-tech.com/xe.alive.live_password.create/1.0.0";
    /**
@@ -132,7 +134,7 @@
                    xiaoeLiveVOPage.setRecords(xiaoeLiveVos);
                    xiaoeLiveVOPage.setCurrent(dto.getPage());
                    xiaoeLiveVOPage.setPages(data.getLong("page_count"));
                }
                }
            }
        }
        return xiaoeLiveVOPage;
@@ -413,6 +415,30 @@
        }
        return courseChapterVOList;
    }
    /**
     * 获取开播口令
     * @param id
     * @return
     */
    public JSONObject createLivePassword(String id) {
        Map<String, Object> requestParams = new HashMap<>();
        requestParams.put("alive_id", id);
        requestParams.put("access_token", getAccessToken());
        String post = HttpUtil.post(CREATE_LIVE_PASSWORD, JSONObject.toJSONString(requestParams));
        if (StringUtils.isNotBlank(post)) {
            log.info("获取开播口令返回结果:{}" ,post);
            JSONObject jsonObject = JSONObject.parseObject(post);
            if (jsonObject.get("code").equals(0)) {
                JSONObject data = jsonObject.getJSONObject("data");
                return data;
            }
        }
        return null;
    }
    public static void main(String[] args) {
        String urlString = BASE_URL +
                "?app_id=appwmuwNWD48082" +