Commit 9b64eb34 authored by 吴春's avatar 吴春

提交代码

parent 46a72eb7
...@@ -15,6 +15,7 @@ using Newtonsoft.Json.Linq; ...@@ -15,6 +15,7 @@ using Newtonsoft.Json.Linq;
using Mall.Common.Plugin; using Mall.Common.Plugin;
using Google.Protobuf.WellKnownTypes; using Google.Protobuf.WellKnownTypes;
using Mall.Model.Entity.Education; using Mall.Model.Entity.Education;
using Microsoft.AspNetCore.Authorization;
namespace Mall.WebApi.Controllers.Education namespace Mall.WebApi.Controllers.Education
{ {
...@@ -634,6 +635,7 @@ namespace Mall.WebApi.Controllers.Education ...@@ -634,6 +635,7 @@ namespace Mall.WebApi.Controllers.Education
/// </summary> /// </summary>
/// <param name="request"></param> /// <param name="request"></param>
/// <returns></returns> /// <returns></returns>
[AllowAnonymous]
[HttpPost] [HttpPost]
public ApiResult GetMiAiDynamicList(object requestMsg) public ApiResult GetMiAiDynamicList(object requestMsg)
{ {
......
...@@ -878,7 +878,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -878,7 +878,7 @@ namespace Mall.WebApi.Controllers.MallBase
} }
} }
[AllowAnonymous]
[HttpPost] [HttpPost]
public ApiResult GetMiAiBaseIfo() public ApiResult GetMiAiBaseIfo()
{ {
...@@ -891,53 +891,57 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -891,53 +891,57 @@ namespace Mall.WebApi.Controllers.MallBase
int MyFollowId = 0; int MyFollowId = 0;
int OtherFollowId = 0; int OtherFollowId = 0;
var oldList = miaiModule.GetFollowMemberList(new RB_MiAi_FollowMember_Extend { Status = 0, UserId = userId, CreateBy = userInfo.UserId, MallBaseId = userInfo.MallBaseId, TenantId = userInfo.TenantId }); if (userInfo!=null)
var oldOtherList = miaiModule.GetFollowMemberList(new RB_MiAi_FollowMember_Extend { Status = 0, UserId = userInfo.UserId, CreateBy = userId, MallBaseId = userInfo.MallBaseId, TenantId = userInfo.TenantId });
var oldUserInfo = miaiModule.GetMemberUserInfo(userId);
var oldBaseInfo = miaiModule.GetBaseInfoList(new RB_MiAi_BaseInfo_Extend { UserId = userId, TenantId = userInfo.TenantId, MallBaseId = userInfo.MallBaseId }).FirstOrDefault();
if (userId != userInfo.UserId)
{ {
if (oldList != null && oldList.Any() && oldOtherList != null && oldOtherList.Any()) var oldList = miaiModule.GetFollowMemberList(new RB_MiAi_FollowMember_Extend { Status = 0, UserId = userId, CreateBy = userInfo.UserId, MallBaseId = userInfo.MallBaseId, TenantId = userInfo.TenantId });
{ var oldOtherList = miaiModule.GetFollowMemberList(new RB_MiAi_FollowMember_Extend { Status = 0, UserId = userInfo.UserId, CreateBy = userId, MallBaseId = userInfo.MallBaseId, TenantId = userInfo.TenantId });
isFollow = 3;
MyFollowId = oldList.FirstOrDefault()?.ID ?? 0;
OtherFollowId = oldOtherList.FirstOrDefault()?.ID ?? 0;
}
else if (oldList != null && oldList.Any())
{
isFollow = 1;
MyFollowId = oldList.FirstOrDefault()?.ID ?? 0;
}
else if (oldOtherList != null && oldOtherList.Any())
{
isFollow = 2;
OtherFollowId = oldOtherList.FirstOrDefault()?.ID ?? 0;
}
else
{
isFollow = 0;
}
//设置消息推送 if (userId != userInfo.UserId)
miaiCommonModule.SetMessage(new RB_Miai_Message_Extend()
{ {
Id = 0, if (oldList != null && oldList.Any() && oldOtherList != null && oldOtherList.Any())
Type = Common.Enum.MiAi.MessageTypeEnum.Look, {
UserId = userId, isFollow = 3;
SourceId = userId, MyFollowId = oldList.FirstOrDefault()?.ID ?? 0;
Content = "用户访问了您的自画像", OtherFollowId = oldOtherList.FirstOrDefault()?.ID ?? 0;
Status = 0, }
TenantId = oldUserInfo.TenantId, else if (oldList != null && oldList.Any())
MallBaseId = oldUserInfo.MallBaseId, {
CreateBy = userInfo.UserId, isFollow = 1;
CreateDate = DateTime.Now, MyFollowId = oldList.FirstOrDefault()?.ID ?? 0;
UpdateDate = DateTime.Now }
}); else if (oldOtherList != null && oldOtherList.Any())
{
isFollow = 2;
OtherFollowId = oldOtherList.FirstOrDefault()?.ID ?? 0;
}
else
{
isFollow = 0;
}
} //设置消息推送
miaiCommonModule.SetMessage(new RB_Miai_Message_Extend()
{
Id = 0,
Type = Common.Enum.MiAi.MessageTypeEnum.Look,
UserId = userId,
SourceId = userId,
Content = "用户访问了您的自画像",
Status = 0,
TenantId = RequestParm.TenantId,
MallBaseId = RequestParm.MallBaseId,
CreateBy = userInfo.UserId,
CreateDate = DateTime.Now,
UpdateDate = DateTime.Now
});
}
}
var oldUserInfo = miaiModule.GetMemberUserInfo(userId);
var oldBaseInfo = miaiModule.GetBaseInfoList(new RB_MiAi_BaseInfo_Extend { UserId = userId, TenantId = RequestParm.TenantId, MallBaseId = RequestParm.MallBaseId }).FirstOrDefault();
if (oldUserInfo != null && oldUserInfo.Id > 0) if (oldUserInfo != null && oldUserInfo.Id > 0)
{ {
...@@ -1308,7 +1312,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1308,7 +1312,7 @@ namespace Mall.WebApi.Controllers.MallBase
{ {
return ApiResult.Failed("动态id不为空"); return ApiResult.Failed("动态id不为空");
} }
Rb_Education_Dynamic_Extend articele = dynamicModule.GetDynamicDetial(new Rb_Education_Dynamic_Extend { UserId = userInfo.UserId, Id = articleId }); Rb_Education_Dynamic_Extend articele = dynamicModule.GetMiAiDynamicDetial(new Rb_Education_Dynamic_Extend { UserId = userInfo.UserId, Id = articleId });
if (articele != null) if (articele != null)
{ {
var data = DecoratorDynameicResult(articele); var data = DecoratorDynameicResult(articele);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment