飞书任务回调
continuous-integration/drone/push Build is passing Details

1、创建修改日程
2、创建修改日程的参与人
于相涌/robot_optimize
YXY 1 year ago
parent 40f1f3deef
commit 59431a713e

@ -9,7 +9,8 @@ public enum TableDetailRelationTypeEnum {
*
*/
ROW("ROW", "行"),
COL("COL", "列");
COL("COL", "列"),
TASK_CALENDAR("TASK_CALENDAR", "任务_日历关系");
private final String code;
private final String info;

@ -3,7 +3,9 @@ package com.ruoyi.common.utils;
import java.lang.management.ManagementFactory;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.Date;
@ -145,4 +147,22 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
DateTimeFormatter fmt = DateTimeFormatter.ofPattern(pattern);
return LocalDateTime.parse(time,fmt);
}
public static LocalDateTime long2ldt(long time) {
Instant instant = Instant.ofEpochMilli(time);
ZoneId zone = ZoneId.systemDefault();
return LocalDateTime.ofInstant(instant, zone);
}
public static String long2Str(long time, String pattern) {
Date date = new Date(time);
SimpleDateFormat sdf = new SimpleDateFormat(pattern);
return sdf.format(date);
}
public static Long ldt2Long(LocalDateTime time) {
ZoneId zone = ZoneId.systemDefault();
Instant instant = time.atZone(zone).toInstant();
return instant.toEpochMilli();
}
}

@ -1,5 +1,6 @@
package com.ruoyi.flyingbook.LarkHelper;
import com.alibaba.fastjson.JSONObject;
import com.lark.oapi.service.approval.v4.model.*;
import com.ruoyi.flyingbook.domain.lark.LarkApprovalRequest;
import com.ruoyi.flyingbook.domain.lark.LarkException;
@ -35,7 +36,7 @@ public class LarkApprovalHelper extends LarkHelper{
if (getInstanceResp.getCode() == 0){
return getInstanceResp.getData();
}else {
throw new RuntimeException(new LarkException("LarkApprovalHelper.getApprovalInfoDetail",getInstanceResp.getMsg(),request).getErrorMessageBody());
throw new RuntimeException(new LarkException("LarkApprovalHelper.getApprovalInfoDetail", JSONObject.toJSONString(getInstanceResp.getError()),request).getErrorMessageBody());
}
} catch (Exception e) {
throw new RuntimeException(new LarkException("LarkApprovalHelper.getApprovalInfoDetail",e.getMessage(),request).getErrorMessageBody());

@ -0,0 +1,230 @@
package com.ruoyi.flyingbook.LarkHelper;
import com.alibaba.fastjson.JSONObject;
import com.lark.oapi.core.response.EmptyData;
import com.lark.oapi.service.calendar.v4.enums.BatchDeleteCalendarEventAttendeeUserIdTypeEnum;
import com.lark.oapi.service.calendar.v4.model.*;
import com.ruoyi.flyingbook.domain.lark.LarkCalendarRequest;
import com.ruoyi.flyingbook.domain.lark.LarkException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* @author yuxiangyong
* @create 2023-03-12 18:10
*/
@Slf4j
@Component
public class LarkCalendarHelper extends LarkHelper {
public static void main(String[] args) throws Exception {
LarkCalendarHelper calendarHelper = new LarkCalendarHelper();
LarkCalendarRequest calendarRequest = new LarkCalendarRequest(appId, secret);
PrimaryCalendarRespBody primaryCalendar = calendarHelper.getPrimaryCalendar(calendarRequest);
int i = 0;
}
/**
*
*
* @return
*/
public PrimaryCalendarRespBody getPrimaryCalendar(LarkCalendarRequest request) {
try {
PrimaryCalendarResp primary = buildClient(request)
.calendar().calendar()
.primary(
PrimaryCalendarReq.newBuilder()
.build()
);
if (primary.getCode() == 0) {
return primary.getData();
} else {
throw new RuntimeException(new LarkException("LarkCalendarHelper.getPrimaryCalendar", JSONObject.toJSONString(primary.getError()), request).getErrorMessageBody());
}
} catch (Exception e) {
throw new RuntimeException(new LarkException("LarkCalendarHelper.getPrimaryCalendar", e.getMessage(), request).getErrorMessageBody());
}
}
/**
*
* @param request
* @return
*/
public ListCalendarEventAttendeeRespBody getCalendarDetail(LarkCalendarRequest request) {
try {
ListCalendarEventAttendeeResp list = buildClient(request)
.calendar().calendarEventAttendee()
.list(
ListCalendarEventAttendeeReq.newBuilder()
.calendarId(request.getCalendarId())
.eventId(request.getEventId())
.build()
);
if (list.getCode() == 0) {
return list.getData();
} else {
throw new RuntimeException(new LarkException("LarkCalendarHelper.getPrimaryCalendar", JSONObject.toJSONString(list.getError()), request).getErrorMessageBody());
}
} catch (Exception e) {
throw new RuntimeException(new LarkException("LarkCalendarHelper.getPrimaryCalendar", e.getMessage(), request).getErrorMessageBody());
}
}
/**
*
*
* @return
*/
public CreateCalendarEventRespBody createCalendarDetail(LarkCalendarRequest request) {
try {
CreateCalendarEventResp createCalendarEventResp = buildClient(request)
.calendar().calendarEvent()
.create(
CreateCalendarEventReq.newBuilder()
.calendarId(request.getCalendarId())
.calendarEvent(
CalendarEvent.newBuilder()
.summary(request.getSummary())
.needNotification(request.getNeedNotification())
.attendeeAbility(request.getAttendeeAbility())
.startTime(
TimeInfo.newBuilder()
.timezone(request.getTimeZone())
.date(request.getStartDate())
.timestamp(request.getStartDateStamp())
.build()
)
.endTime(
TimeInfo.newBuilder()
.timezone(request.getTimeZone())
.date(request.getEndDate())
.timestamp(request.getEndDateStamp())
.build()
)
.build()
)
.build()
);
if (createCalendarEventResp.getCode() == 0) {
return createCalendarEventResp.getData();
} else {
throw new RuntimeException(new LarkException("LarkCalendarHelper.getPrimaryCalendar", JSONObject.toJSONString(createCalendarEventResp.getError()), request).getErrorMessageBody());
}
} catch (Exception e) {
throw new RuntimeException(new LarkException("LarkCalendarHelper.getPrimaryCalendar", e.getMessage(), request).getErrorMessageBody());
}
}
/**
*
*
* @return
*/
public PatchCalendarEventRespBody updateCalendarDetail(LarkCalendarRequest request) {
try {
PatchCalendarEventResp patch = buildClient(request)
.calendar().calendarEvent()
.patch(PatchCalendarEventReq.newBuilder()
.calendarId(request.getCalendarId())
.eventId(request.getEventId())
.calendarEvent(
CalendarEvent.newBuilder()
.summary(request.getSummary())
.needNotification(request.getNeedNotification())
.attendeeAbility(request.getAttendeeAbility())
.startTime(
TimeInfo.newBuilder()
.timezone(request.getTimeZone())
.date(request.getStartDate())
.timestamp(request.getStartDateStamp())
.build()
)
.endTime(
TimeInfo.newBuilder()
.timezone(request.getTimeZone())
.date(request.getEndDate())
.timestamp(request.getEndDateStamp())
.build()
)
.build()
)
.build());
if (patch.getCode() == 0) {
return patch.getData();
} else {
throw new RuntimeException(new LarkException("LarkCalendarHelper.getPrimaryCalendar", JSONObject.toJSONString(patch.getError()), request).getErrorMessageBody());
}
} catch (Exception e) {
throw new RuntimeException(new LarkException("LarkCalendarHelper.getPrimaryCalendar", e.getMessage(), request).getErrorMessageBody());
}
}
/**
*
*
* @return
*/
public CreateCalendarEventAttendeeRespBody attendeesCalendarDetail(LarkCalendarRequest request) {
try {
CreateCalendarEventAttendeeResp createCalendarEventAttendeeResp = buildClient(request)
.calendar().calendarEventAttendee()
.create(
CreateCalendarEventAttendeeReq.newBuilder()
.calendarId(request.getCalendarId())
.eventId(request.getEventId())
.createCalendarEventAttendeeReqBody(
CreateCalendarEventAttendeeReqBody.newBuilder()
.needNotification(request.getNeedNotification())
.attendees(request.getCalendarEventAttendeesArray())
.build()
)
.build()
);
if (createCalendarEventAttendeeResp.getCode() == 0) {
return createCalendarEventAttendeeResp.getData();
} else {
throw new RuntimeException(new LarkException("LarkCalendarHelper.getPrimaryCalendar", JSONObject.toJSONString(createCalendarEventAttendeeResp.getError()), request).getErrorMessageBody());
}
} catch (Exception e) {
throw new RuntimeException(new LarkException("LarkCalendarHelper.getPrimaryCalendar", e.getMessage(), request).getErrorMessageBody());
}
}
/**
*
*
* @return
*/
public EmptyData unAttendeesCalendarDetail(LarkCalendarRequest request) {
try {
BatchDeleteCalendarEventAttendeeResp batchDeleteCalendarEventAttendeeResp = buildClient(request)
.calendar().calendarEventAttendee()
.batchDelete(
BatchDeleteCalendarEventAttendeeReq.newBuilder()
.calendarId(request.getCalendarId())
.eventId(request.getEventId())
.userIdType(BatchDeleteCalendarEventAttendeeUserIdTypeEnum.USER_ID)
.batchDeleteCalendarEventAttendeeReqBody(
BatchDeleteCalendarEventAttendeeReqBody.newBuilder()
.deleteIds(request.getCalendarEventDeleteArray())
.build()
)
.build()
);
if (batchDeleteCalendarEventAttendeeResp.getCode() == 0) {
return batchDeleteCalendarEventAttendeeResp.getData();
} else {
throw new RuntimeException(new LarkException("LarkCalendarHelper.getPrimaryCalendar", JSONObject.toJSONString(batchDeleteCalendarEventAttendeeResp.getError()), request).getErrorMessageBody());
}
} catch (Exception e) {
throw new RuntimeException(new LarkException("LarkCalendarHelper.getPrimaryCalendar", e.getMessage(), request).getErrorMessageBody());
}
}
}

@ -1,5 +1,6 @@
package com.ruoyi.flyingbook.LarkHelper;
import com.alibaba.fastjson.JSONObject;
import com.lark.oapi.service.task.v1.enums.CreateTaskUserIdTypeEnum;
import com.lark.oapi.service.task.v1.model.*;
import com.ruoyi.flyingbook.domain.lark.LarkException;
@ -47,7 +48,11 @@ public class LarkTaskHelper extends LarkHelper {
.task(request.getTask())
.build()
);
return createTaskResp.getData();
if (createTaskResp.getCode() == 0){
return createTaskResp.getData();
}else {
throw new RuntimeException(new LarkException("LarkTaskHelper.createTask", JSONObject.toJSONString(createTaskResp.getError()),request).getErrorMessageBody());
}
} catch (Exception e) {
throw new RuntimeException(new LarkException("LarkTaskHelper.createTask",e.getMessage(),request).getErrorMessageBody());
}
@ -67,7 +72,11 @@ public class LarkTaskHelper extends LarkHelper {
.taskId(request.getLarkTaskId())
.build()
);
return getTaskResp.getData();
if (getTaskResp.getCode() == 0){
return getTaskResp.getData();
}else {
throw new RuntimeException(new LarkException("LarkTaskHelper.createTask", JSONObject.toJSONString(getTaskResp.getError()),request).getErrorMessageBody());
}
} catch (Exception e) {
throw new RuntimeException(new LarkException("LarkTaskHelper.createTask",e.getMessage(),request).getErrorMessageBody());
}

@ -0,0 +1,165 @@
package com.ruoyi.flyingbook.domain.lark;
import com.lark.oapi.service.calendar.v4.enums.CalendarEventEventAttendeeAbilityEnum;
import com.lark.oapi.service.calendar.v4.model.CalendarEventAttendee;
import com.lark.oapi.service.calendar.v4.model.CalendarEventAttendeeId;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* @author yuxiangyong
* @create 2023-03-18 1:05
*/
@Data
@NoArgsConstructor
public class LarkCalendarRequest extends LarkRequest {
/**
*
*/
private String calendarId;
/**
*
*/
private String eventId;
/**
* id
*/
private String operateId;
/**
*
*/
private List<String> followerIdList;
/**
*
*/
private String summary;
/**
*
* YYYY-mm-DD
*/
private String startDate;
private String endDate;
/**
*
* YYYY-mm-DD
*/
private String startDateStamp;
private String endDateStamp;
/**
* Asia/Shanghai
*/
private String timeZone;
/**
* bot,false
*/
private Boolean needNotification;
/**
* can_see_others
* none
* can_see_others
* can_invite_others
* can_modify_event
*/
private CalendarEventEventAttendeeAbilityEnum attendeeAbility;
public LarkCalendarRequest(String appId, String appSecret) {
super(appId, appSecret);
}
/**
*
* @param appId
* @param appSecret
* @param calendarId
* @param eventId
*/
public LarkCalendarRequest(String appId, String appSecret, String calendarId, String eventId) {
super(appId, appSecret);
this.calendarId = calendarId;
this.eventId = eventId;
}
/**
*
*/
public LarkCalendarRequest(String appId, String appSecret, String calendarId, String summary, String startDate, String endDate) {
super(appId, appSecret);
this.calendarId = calendarId;
this.summary = summary;
this.startDate = startDate;
this.endDate = endDate;
this.timeZone = "Asia/Shanghai";
this.needNotification = Boolean.FALSE;
this.attendeeAbility = CalendarEventEventAttendeeAbilityEnum.CANSEEOTHERS;
}
/**
*
*/
public LarkCalendarRequest(String appId, String appSecret, String calendarId, String eventId, String summary, String startDate, String endDate) {
super(appId, appSecret);
this.calendarId = calendarId;
this.eventId = eventId;
this.summary = summary;
this.startDate = startDate;
this.endDate = endDate;
this.timeZone = "Asia/Shanghai";
this.needNotification = Boolean.FALSE;
this.attendeeAbility = CalendarEventEventAttendeeAbilityEnum.CANSEEOTHERS;
}
/**
*
*/
public LarkCalendarRequest(String appId, String appSecret, String calendarId, String eventId,List<String> followerIdList,String operateId) {
super(appId, appSecret);
this.calendarId = calendarId;
this.eventId = eventId;
this.operateId = operateId;
this.followerIdList = followerIdList;
}
/**
*
*/
public LarkCalendarRequest(String appId, String appSecret, String calendarId, String eventId,List<String> followerIdList) {
super(appId, appSecret);
this.calendarId = calendarId;
this.eventId = eventId;
this.followerIdList = followerIdList;
}
public CalendarEventAttendee[] getCalendarEventAttendeesArray() {
int size = followerIdList.size();
CalendarEventAttendee[] calendarEventAttendees = new CalendarEventAttendee[size];
for (int i = 0; i < followerIdList.size(); i++) {
CalendarEventAttendee calendarEventAttendee = new CalendarEventAttendee();
calendarEventAttendee.setIsOptional(Boolean.TRUE);
calendarEventAttendee.setUserId(followerIdList.get(i));
calendarEventAttendee.setOperateId(operateId);
calendarEventAttendees[i] = calendarEventAttendee;
}
return calendarEventAttendees;
}
public CalendarEventAttendeeId[] getCalendarEventDeleteArray() {
int size = followerIdList.size();
CalendarEventAttendeeId[] calendarEventAttendees = new CalendarEventAttendeeId[size];
for (int i = 0; i < followerIdList.size(); i++) {
CalendarEventAttendeeId calendarEventAttendee = new CalendarEventAttendeeId();
calendarEventAttendee.setType("user");
calendarEventAttendee.setUserId(followerIdList.get(i));
calendarEventAttendees[i] = calendarEventAttendee;
}
return calendarEventAttendees;
}
}

@ -1,19 +1,29 @@
package com.ruoyi.flyingbook.strategy.operate;
import com.ruoyi.common.enums.EventOperateStatus;
import com.ruoyi.common.enums.EventOperateType;
import cn.hutool.core.io.unit.DataUnit;
import com.lark.oapi.service.calendar.v4.model.*;
import com.lark.oapi.service.task.v1.model.Due;
import com.lark.oapi.service.task.v1.model.GetTaskRespBody;
import com.lark.oapi.service.task.v1.model.Task;
import com.ruoyi.common.enums.*;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.flyingbook.LarkHelper.LarkCalendarHelper;
import com.ruoyi.flyingbook.LarkHelper.LarkTaskHelper;
import com.ruoyi.flyingbook.domain.Event;
import com.ruoyi.flyingbook.domain.EventLog;
import com.ruoyi.flyingbook.domain.RequestVo;
import com.ruoyi.flyingbook.domain.*;
import com.ruoyi.flyingbook.domain.lark.LarkCalendarRequest;
import com.ruoyi.flyingbook.domain.lark.LarkTaskRequest;
import com.ruoyi.flyingbook.service.IEventLogService;
import com.ruoyi.flyingbook.service.IEventService;
import com.ruoyi.flyingbook.service.ILarkCompanyRelationService;
import com.ruoyi.flyingbook.service.ILarkTableRowRelationService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Map;
import java.time.LocalDateTime;
import java.util.*;
/**
@ -32,7 +42,12 @@ public class LarkTaskCallbackOperate extends LarkAbstract {
private LarkTaskHelper larkTaskHelper;
@Autowired
private IEventService eventService;
@Autowired
private ILarkCompanyRelationService larkCompanyRelationService;
@Autowired
private ILarkTableRowRelationService larkTableRowRelationService;
@Autowired
private LarkCalendarHelper larkCalendarHelper;
@Override
protected void preOperate(RequestVo request) {
@ -40,14 +55,136 @@ public class LarkTaskCallbackOperate extends LarkAbstract {
if (event == null) {
throw new RuntimeException("当前事件为空");
}
LarkCompanyRelation companyRelation = larkCompanyRelationService.getByAppIdAndType(event.getAppId(), AppType.MULTIDIMENSIONAL_TABLE.getCode());
if (companyRelation == null){
throw new RuntimeException(String.format("eventId:{} appId:{} appType:{} 不存在对应的lark_company配置",event.getId(),event.getAppId(),AppType.MULTIDIMENSIONAL_TABLE.getCode()));
}
request.setAppId(companyRelation.getAppId());
request.setAppSecret(companyRelation.getSecret());
}
@Override
protected void businessProcessing(RequestVo request) {
Event event = request.getEvent();
String larkTaskId = event.getRecordId();
// larkTaskHelper.createTask()
//获取任务明细
LarkTaskRequest getTaskRequest = new LarkTaskRequest(request.getAppId(),request.getAppSecret(),larkTaskId);
GetTaskRespBody taskInfo = larkTaskHelper.getTaskInfo(getTaskRequest);
Task task = taskInfo.getTask();
//任务的关注人及负责人取交集
String[] collaboratorIds = task.getCollaboratorIds();
String operator = collaboratorIds[0];
String[] followerIds = task.getFollowerIds();
//待绑定日程用户
String[] taskFollowerArray = getArrayIntersection(collaboratorIds, followerIds);
//待解除绑定日程用户
List<String> taskUnFollowerList = new ArrayList<>();
//判断当前任务是否已经存在与日历的关系
LarkTableRowRelation taskCalendarRelation = getTaskCalendarByTaskId(larkTaskId);
//待更新日历的id
String calendarId = getCalendarInfo(request.getAppId(), request.getAppSecret());
String eventId = null;
if (taskCalendarRelation == null){
//关系为空,创建日程
String summary = task.getSummary();
if (StringUtils.isNotBlank(task.getCompleteTime()) && !task.getCompleteTime().equals("0")){
summary += "✔";
}
Due due = task.getDue();
LarkCalendarRequest calendarRequest = null;
if (due == null){
String time = DateUtils.ldt2str(LocalDateTime.now(), DateUtils.YYYY_MM_DD);
calendarRequest = new LarkCalendarRequest(request.getAppId(), request.getAppSecret(), calendarId, summary, task.getDescription(), time, time);
}else {
Boolean isAllDay = due.getIsAllDay();
Long time = Long.valueOf(due.getTime());
if (isAllDay){
String allDay = DateUtils.long2Str(time, DateUtils.YYYY_MM_DD);
calendarRequest = new LarkCalendarRequest(request.getAppId(), request.getAppSecret(), calendarId, summary, task.getDescription(), allDay, allDay);
}else {
LocalDateTime localDateTime = DateUtils.long2ldt(time);
LocalDateTime startTime = localDateTime.minusHours(2L);
calendarRequest = new LarkCalendarRequest(request.getAppId(), request.getAppSecret(), calendarId, summary, task.getDescription(), null, null);
calendarRequest.setStartDateStamp(String.valueOf(DateUtils.ldt2Long(startTime)));
calendarRequest.setEndDateStamp(due.getTime());
}
}
CreateCalendarEventRespBody calendarDetail = larkCalendarHelper.createCalendarDetail(calendarRequest);
eventId = calendarDetail.getEvent().getEventId();
//任务日历关系实体
this.buildTaskCalendarRelation(larkTaskId,eventId);
}else {
eventId = taskCalendarRelation.getToId();
LarkCalendarRequest calendarRequest = new LarkCalendarRequest(request.getAppId(), request.getAppSecret(), calendarId, eventId);
ListCalendarEventAttendeeRespBody calendarDetail = larkCalendarHelper.getCalendarDetail(calendarRequest);
for (CalendarEventAttendee item : calendarDetail.getItems()) {
taskUnFollowerList.add(item.getUserId());
}
}
if (CollectionUtils.isNotEmpty(taskUnFollowerList)){
LarkCalendarRequest remove = new LarkCalendarRequest(request.getAppId(), request.getAppSecret(), calendarId, eventId, taskUnFollowerList);
larkCalendarHelper.unAttendeesCalendarDetail(remove);
}
if (taskFollowerArray != null && taskFollowerArray.length > 0){
LarkCalendarRequest add = new LarkCalendarRequest(request.getAppId(), request.getAppSecret(), calendarId, eventId, Arrays.asList(taskFollowerArray), operator);
larkCalendarHelper.attendeesCalendarDetail(add);
}
}
/**
*
* @return
*/
private void buildTaskCalendarRelation(String larkTaskId,String eventId){
LarkTableRowRelation rowRelation = new LarkTableRowRelation();
rowRelation.setFlag(FlagStatus.OK.getCode());
rowRelation.setType(TableDetailRelationTypeEnum.TASK_CALENDAR.getCode());
rowRelation.setFromId(larkTaskId);
rowRelation.setToId(eventId);
larkTableRowRelationService.insertLarkTableRowRelation(rowRelation);
}
/**
*
* @param appId
* @param appSecret
* @return
*/
private String getCalendarInfo(String appId,String appSecret){
LarkCalendarRequest calendarRequest = new LarkCalendarRequest(appId, appSecret);
PrimaryCalendarRespBody primaryCalendar = larkCalendarHelper.getPrimaryCalendar(calendarRequest);
UserCalendar calendar = primaryCalendar.getCalendars()[0];
return calendar.getCalendar().getCalendarId();
}
/**
*
* @return
*/
private LarkTableRowRelation getTaskCalendarByTaskId(String larkTaskId){
LarkTableRowRelation rowRelationQuery = new LarkTableRowRelation();
rowRelationQuery.setType(TableDetailRelationTypeEnum.TASK_CALENDAR.getCode());
rowRelationQuery.setSubType(TableDetailRelationTypeEnum.TASK_CALENDAR.getCode());
rowRelationQuery.setFromId(larkTaskId);
rowRelationQuery.setFlag(FlagStatus.OK.getCode());
List<LarkTableRowRelation> larkTableRowRelations = larkTableRowRelationService.selectLarkTableRowRelationList(rowRelationQuery);
return CollectionUtils.isNotEmpty(larkTableRowRelations) ? larkTableRowRelations.get(0) : null;
}
/**
*
* @param collaboratorIds
* @param followerIds
* @return
*/
private String[] getArrayIntersection(String[] collaboratorIds,String[] followerIds){
new HashSet<String>(Arrays.asList(collaboratorIds));
Set<String> collaboratorIdSet = collaboratorIds != null ? new HashSet<String>(Arrays.asList(collaboratorIds)) : new HashSet<String>();
Set<String> followerIdSet = followerIds != null ? new HashSet<String>(Arrays.asList(followerIds)) : new HashSet<String>();
collaboratorIdSet.addAll(followerIdSet);
return collaboratorIdSet.toArray(new String[collaboratorIdSet.size()]);
}
@Override

Loading…
Cancel
Save