package com.mcwl.web.controller.communityCenter;


import com.mcwl.common.constant.HttpStatus;
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.service.CommunityService;
import com.mcwl.communityCenter.service.CommunityUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.Objects;

/**
 * 社区用户
 */
@Api(tags = "社区用户")
@RestController
@RequestMapping("communityUser")
@RequiredArgsConstructor
public class CommunityUserController {

    private final CommunityUserService communityUserService;


    /**
     * 社区用户列表
     */
    @ApiOperation(value = "社区用户列表")
    @PostMapping("list")
    public TableDataInfo getCommunityUserList(@RequestBody @Valid CommunityUserListPageRes communityUserListPageRes) {

        return communityUserService.getCommunityUserList(communityUserListPageRes);
    }

    /**
     * 拉黑
     */
    @ApiOperation(value = "拉黑")
    @PostMapping("black")
    public R<Object> black(@RequestBody @Valid BlackListRes blackListRes) {

        return communityUserService.black(blackListRes);
    }

    /**
     * 取消拉黑
     */
    @ApiOperation(value = "取消拉黑")
    @PostMapping("unBlack")
    public R<Object> unBlack(@RequestBody @Valid UnBlackListRes unBlackListRes) {

        return communityUserService.unBlack(unBlackListRes);
    }

    /**
     * 管理/取消管理
     */
    @ApiOperation(value = "管理/取消管理")
    @PostMapping("manage")
    public R<Object> manage(@RequestBody @Valid CommunityUserManageRes communityUserManageRes) {

        return communityUserService.manage(communityUserManageRes);
    }


}
