|
@@ -22,6 +22,8 @@ using GxPress.Service.Interface.AdminVerify;
|
|
|
using GxPress.Service.Interface.Group;
|
|
|
using GxPress.Service.Interface.Middle;
|
|
|
using GxPress.Repository.Interface.Group;
|
|
|
+using GxPress.Result;
|
|
|
+
|
|
|
namespace GxPress.Service.Implement.Group
|
|
|
{
|
|
|
public partial class GroupService : IGroupService
|
|
@@ -138,8 +140,14 @@ namespace GxPress.Service.Implement.Group
|
|
|
/// </summary>
|
|
|
/// <param name="request"></param>
|
|
|
/// <returns></returns>
|
|
|
- public async Task<bool> InsertsAsync(GroupUserInRequest request)
|
|
|
+ public async Task<AppResult> InsertsAsync(GroupUserInRequest request)
|
|
|
{
|
|
|
+ var result = new AppResult()
|
|
|
+ {
|
|
|
+ Code = 200,
|
|
|
+ Success = true,
|
|
|
+ Msg = ""
|
|
|
+ };
|
|
|
request.UserIds = request.UserIds.Distinct().ToList();
|
|
|
//获取当前小组
|
|
|
var group = await _groupRepository.GetAsync(request.GroupId);
|
|
@@ -157,19 +165,21 @@ namespace GxPress.Service.Implement.Group
|
|
|
};
|
|
|
await _adminVerifyService.InsertAsync(adminVerifyInsertRequest);
|
|
|
if (request.SourceType == 2)
|
|
|
- throw new BusinessException("等待用户同意同意");
|
|
|
+ result.Msg = "等待用户同意同意";
|
|
|
if (request.SourceType == 1)
|
|
|
- throw new BusinessException("等待管理员同意");
|
|
|
+ result.Msg = "等待管理员同意";
|
|
|
+ result.Code = 201;
|
|
|
+ result.Success = true;
|
|
|
}
|
|
|
|
|
|
if (!group.IsAdmin && request.SourceType == 1)
|
|
|
{
|
|
|
//管理员插入
|
|
|
await AddUsersAsync(request);
|
|
|
- return true;
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
- return true;
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|