package com.mcwl.communityCenter.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.mcwl.common.core.domain.R;
import com.mcwl.common.core.page.TableDataInfo;
import com.mcwl.communityCenter.domain.Community;
import com.mcwl.communityCenter.domain.dto.*;
import com.mcwl.communityCenter.domain.vo.CommunityDetailVo;

import javax.validation.Valid;

public interface CommunityService extends IService<Community> {
    TableDataInfo listByPage(CommunityListPageRes communityListPageRes);

    /**
     * 添加社区
     * @param addCommunityRes 社区信息
     */
    void addCommunity(AddCommunityRes addCommunityRes);

    /**
     * 加入社区
     * @param joinCommunityRes 加入社区信息
     */
    R<Object> joinCommunity(JoinCommunityRes joinCommunityRes);

    /**
     * 我加入的社区
     */
    TableDataInfo getMyJoinCommunity(JoinCommunityListPageRes joinCommunityListPageRes);

    Community getByTenantIdAndCommunityId(Long userId, Long communityId);

    /**
     * 退出社区
     */
    R<Object> quitCommunity(Long tenantId, Long communityId);

    /**
     * 判断是否加入社区
     */
    R<Object> isJoinCommunity(JoinCommunityRes joinCommunityRes);

    CommunityDetailVo getCommunityDetail(Long tenantId, Long communityId);

    void editCommunity(@Valid EditCommunityRes editCommunityRes);
}
