package com.example.system.chat.service;

import com.example.system.chat.mapper.FriendMapper;
import com.example.system.chat.model.Friend;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FriendService {
    @Autowired
    private FriendMapper friendMapper;

    /**
     * 获取好友列表
     */
    public List<Friend> getFriendList(Integer userId) {
        List<Friend> ret = friendMapper.getFriendList(userId);
        return ret;
    }

    //添加好友
    public Object addFriend(Integer userId, String userName, Integer friendId, String friendName) {
        return 2 == friendMapper.addFriend(userId, userName, friendId, friendName);
    }
}
