package com.microservices.zone.member.service;

import com.alibaba.fastjson2.JSONObject;
import com.microservices.common.core.web.page.GenericsTableDataInfo;
import com.microservices.system.api.domain.SysUser;
import com.microservices.zone.member.domain.ZoneMember;
import com.microservices.zone.member.domain.vo.*;

import java.util.List;

/**
 * 特色专区会员Service接口
 *
 * @author otto
 * @date 2023-05-16
 */
public interface IZoneMemberService {
    /**
     * 查询特色专区会员
     *
     * @param id 特色专区会员主键
     * @return 特色专区会员
     */
    public ZoneMember selectZoneMemberById(Long id);

    /**
     * 查询特色专区会员列表
     *
     * @param zoneMemberSearchVo 特色专区会员
     * @return 特色专区会员集合
     */
    public GenericsTableDataInfo<ZoneMemberDetailVo> selectZoneMemberList(ZoneMemberSearchVo zoneMemberSearchVo, boolean isOpen);

    /**
     * 新增特色专区会员
     *
     * @param zoneMemberInputVo 特色专区会员
     * @return 结果
     */
    public int insertZoneMember(ZoneMemberInputVo zoneMemberInputVo);

    /**
     * 修改特色专区会员
     *
     * @param id
     * @param zoneMemberUpdateVo 特色专区会员
     * @return 结果
     */
    public int updateZoneMember(Long id, ZoneMemberUpdateVo zoneMemberUpdateVo);

    /**
     * 批量删除特色专区会员
     *
     * @param ids 需要删除的特色专区会员主键集合
     * @return 结果
     */
    public int deleteZoneMemberByIds(Long[] ids);

    /**
     * 删除特色专区会员信息
     *
     * @param id 特色专区会员主键
     * @return 结果
     */
    public int deleteZoneMemberById(Long id);

    /**
     * 查询GitLink用户列表
     *
     * @param zoneId
     * @param gitLinkUserSearchVo
     * @return
     */
    GenericsTableDataInfo<JSONObject> selectGitlinkUserList(Long zoneId, GitLinkUserSearchVo gitLinkUserSearchVo);

    SysUser getUserInfoByInvitationToken(String invitationToken);

    boolean confirmInvitation(Long zoneId, String invitationToken, Boolean isConfirm);

    boolean applyToJoinZone(Long zoneId, ZoneMemberApplyVo zoneMemberApplyVo);

    boolean auditZoneMember(Long memberId, AuditInputVo auditInputVo);

    /**
     * 查询专区下会员数量
     *
     * @param zoneMemberSearchVo
     * @return
     */
    Integer selectZoneMemberListCount(ZoneMemberSearchVo zoneMemberSearchVo);

    /**
     * 设置是否首页展示
     *
     * @param id
     * @return
     */
    int updateZoneMemberHomePageShow(Long id);

    /**
     * 获取特色专区项目会员总览列表
     *
     * @param zoneId
     * @param zoneMemberOpenSearchVo
     * @return
     */
    List<ZoneMemberOverviewVo> selectZoneMemberOverviewList(Long zoneId, ZoneMemberOpenSearchVo zoneMemberOpenSearchVo, boolean isOpen);

    /**
     * 获取首页特色专区会员列表
     *
     * @param zoneId
     * @return
     */
    List<ZoneMemberDataVo> selectZoneMemberHomePageMemberList(Long zoneId,boolean isOpen);

    /**
     * 初始化特色专区会员
     *
     * @param zoneMemberInitVo 特色专区会员
     * @return 结果
     */
    public int initZoneMember(ZoneMemberInitVo zoneMemberInitVo);

    /**
     * 查询待审核会员列表
     * @param zoneMemberSearchVo
     * @return
     */
    GenericsTableDataInfo<ZoneMemberDetailVo> selectZoneMemberAuditList(ZoneMemberSearchVo zoneMemberSearchVo);

    /**
     * 查询当前登录用户会员审核状态
     *
     * @return
     */
    String selectZoneMemberAuditStatus(Long zoneId);

    Integer selectZoneMemberAuditCount(ZoneMemberSearchVo zoneMemberSearchVo);

    /**
     * 查询组织下GitLink用户列表
     *
     * @param deptId
     * @param gitLinkUserSearchVo
     * @return
     */
    GenericsTableDataInfo<JSONObject> selectGitlinkUserListByDept(Long deptId, GitLinkUserSearchVo gitLinkUserSearchVo);

    List<Long> checkUsersIsMemberInDept(Long deptId, Long[] userIds);

    List<Long> checkUserIsMemberInDepts(Long userId, Long[] deptIds);
}
