cn.felord.api.LivingApi Maven / Gradle / Ivy
/*
* Copyright (c) 2023. felord.cn
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://www.apache.org/licenses/LICENSE-2.0
* Website:
* https://felord.cn
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.felord.api;
import cn.felord.WeComException;
import cn.felord.domain.GenericResponse;
import cn.felord.domain.WeComResponse;
import cn.felord.domain.living.LivingCodeRequest;
import cn.felord.domain.living.LivingCreateRequest;
import cn.felord.domain.living.LivingId;
import cn.felord.domain.living.LivingInfo;
import cn.felord.domain.living.LivingShareInfoResponse;
import cn.felord.domain.living.LivingUpdateRequest;
import cn.felord.domain.living.UserLivingsRequest;
import cn.felord.domain.living.UserLivingsResponse;
import cn.felord.domain.living.WatchStatRequest;
import cn.felord.domain.living.WatchStatResponse;
import cn.felord.domain.living.WwShareCode;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
/**
* 直播API
*
* @author dax
* @since 2024/11/23
*/
public interface LivingApi {
/**
* 创建预约直播
*
* 权限说明:
*
* - 发起人必须在应用可见范围内,「上课直播/直播」应用默认全员可见
* - 系统应用「上课直播/直播」默认可使用直播接口
* - 自建应用需要配置在“可调用接口的应用”里
* - 第三方服务商创建应用的时候,需要开启“直播接口权限”
*
*
* @param request the request
* @return the generic response
* @throws WeComException the weComException
*/
@POST("living/create")
GenericResponse create(@Body LivingCreateRequest request) throws WeComException;
/**
* 修改预约直播
*
* 权限说明:
*
* - 仅允许修改当前应用创建的直播。
*
*
* @param request the request
* @return the we com response
* @throws WeComException the weComException
*/
@POST("living/modify")
WeComResponse modify(@Body LivingUpdateRequest request) throws WeComException;
/**
* 取消预约直播
*
* 权限说明:
*
* - 仅允许取消当前应用创建的直播。
*
*
* @param livingId the living id
* @return the we com response
* @throws WeComException the weComException
*/
@POST("living/cancel")
WeComResponse cancel(@Body LivingId livingId) throws WeComException;
/**
* 删除直播回放
*
* 权限说明:
*
* - 仅允许删除当前应用的直播回放。
*
*
* @param livingId the living id
* @return the we com response
* @throws WeComException the weComException
*/
@POST("living/delete_replay_data")
WeComResponse deleteReplayData(@Body LivingId livingId) throws WeComException;
/**
* 获取微信观看直播凭证
*
* 权限说明:
*
* - 非直播系统应用仅允许获取当前应用创建的微信观看直播凭证。
* - 直播系统应用可以调用该企业任意直播的微信观看直播凭证。
*
*
* @param request the request
* @return the generic response
* @throws WeComException the weComException
*/
@POST("living/get_living_code")
GenericResponse getLivingCode(@Body LivingCodeRequest request) throws WeComException;
/**
* 获取成员直播ID列表
*
* 通过此接口可以获取指定成员的所有直播ID
*
* 权限说明:
*
* - 「上课直播/直播」应用有获取用户的所有直播
* - 自建应用和第三方应用只能获取本应用创建的直播
*
*
* @param request the request
* @return the user all livingid
* @throws WeComException the weComException
*/
@POST("living/get_user_all_livingid")
UserLivingsResponse getUserAllLivingid(@Body UserLivingsRequest request) throws WeComException;
/**
* 获取直播详情
*
* 权限说明:
*
* - 「上课直播/直播」应用有获取用户的所有直播
* - 自建应用和第三方应用只能获取本应用创建的直播
*
*
* @param livingid the livingid
* @return the living info
* @throws WeComException the weComException
*/
@GET("living/get_living_info")
GenericResponse getLivingInfo(@Query("livingid") String livingid) throws WeComException;
/**
* 获取直播观看明细
*
* 通过该接口可以获取所有观看直播的人员统计
*
* 权限说明:
*
* - 「上课直播/直播」应用有获取用户的所有直播
* - 自建应用和第三方应用只能获取本应用创建的直播
*
*
* @param request the request
* @return the user all livingid
* @throws WeComException the weComException
*/
@POST("living/get_watch_stat")
WatchStatResponse getWatchStat(@Body WatchStatRequest request) throws WeComException;
/**
* 获取跳转小程序商城的直播观众信息
*
* 通过此接口,开发者可获取跳转小程序商城的直播间(“推广产品”直播)观众id、邀请人id及对应直播间id,以打通卖货直播的“人货场”信息闭环。
*
* 权限说明:
*
* - 系统应用「直播」默认可使用此接口
* - 自建应用需要配置在“可调用接口的应用”里
* - 第三方服务商创建应用的时候,需要开启“直播接口权限”
* - 跳转的小程序需要与企业有绑定关系
*
*
* @param wwShareCode the wwShareCode
* @return the user all livingid
* @throws WeComException the weComException
*/
@POST("living/get_living_share_info")
LivingShareInfoResponse getLivingShareInfo(@Body WwShareCode wwShareCode) throws WeComException;
}