package org.springblade.app.controller;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.plugins.Page;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.codehaus.janino.Access;
import org.springblade.common.constant.CommonConstant;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.estate.dto.AccessRecordDTO;
import org.springblade.estate.entity.AccessRecord;
import org.springblade.estate.feign.IAccessRecordClient;
import org.springblade.estate.vo.AccessRecordVO;
import org.springblade.person.entity.HouseUser;
import org.springblade.person.feign.IHouseUserClient;
import org.springblade.person.vo.HouseUserVO;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.stream.Collectors;


/**
 * @author cy-computer
 */
@RestController
@RequestMapping("/app/accessRecords")
@RequiredArgsConstructor
@Slf4j
public class AccessRecordsController {

	private final IAccessRecordClient accessRecordClient;

	@PostMapping(value = "/list")
	public R<BladePage<AccessRecordVO>> list(@RequestBody AccessRecordDTO accessRecordDTO){
		accessRecordDTO.setUserType(CommonConstant.UserFlag.HOUSE_USER_FLAG.getValue());
		R<BladePage<AccessRecordVO>> bladePageR = accessRecordClient.pageByMemberId(accessRecordDTO);
		return bladePageR;
	}




}
