【新增】微信小程序直播增加历史直播回放功能。

This commit is contained in:
JIANWEIE-WORKPC\Administrator
2023-03-02 12:38:17 +08:00
parent 919090d642
commit 2759c4226f
4 changed files with 102 additions and 50 deletions

View File

@@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Mvc;
using SKIT.FlurlHttpClient.Wechat.Api.Models;
using System.Threading.Tasks;
using SKIT.FlurlHttpClient.Wechat.Api;
using CoreCms.Net.Model.WeChatEntites;
namespace CoreCms.Net.Web.WebApi.Controllers
{
@@ -42,10 +43,12 @@ namespace CoreCms.Net.Web.WebApi.Controllers
var client = _weChatApiHttpClientFactory.CreateWxOpenClient();
var accessToken = WeChatCacheAccessTokenHelper.GetWxOpenAccessToken();
var request = new WxaBusinessGetLiveInfoRequest
var request = new MyWxaBusinessGetLiveInfoRequest
{
AccessToken = accessToken,
Limit = entity.limit,
Offset = (entity.page - 1) * entity.limit,
Action = !string.IsNullOrEmpty(entity.where) ? "get_replay" : ""
};
var response = await client.ExecuteWxaBusinessGetLiveInfoAsync(request);
@@ -57,7 +60,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
else
{
jm.status = false;
jm.msg = response.ErrorCode == 9410000 ? "直播间列表为空" : response.ErrorMessage;
jm.msg = response.ErrorCode == 9410000 ? "暂无直播信息" : response.ErrorMessage;
jm.otherData = response;
}
return jm;