package com.bofeng.service;

import com.bofeng.dao.UserPlaceMapper;
import com.bofeng.entity.Place;
import com.bofeng.entity.PlaceAndRoom;
import com.bofeng.entity.UserPlace;
import com.google.common.collect.Maps;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

@Service
@Transactional(readOnly = true)
public class UserPlaceService {
    @Autowired
    private UserPlaceMapper userPlaceMapper;


    public List<UserPlace> getByUserId(Long userId) {
        return userPlaceMapper.getByUserId(userId);
    }

    public UserPlace getByUserIdAndPlaceId(Long userId, Long placeId) {
        return userPlaceMapper.getByUserIdAndPlaceId(userId,placeId);
    }

    public List<Map<String,Object>> getCurrentPlacesByUserId(Long userId) {
        return userPlaceMapper.getCurrentPlacesByUserId(userId);
    }

}
