package com.judong.chuanyiserver.service.impl;

import com.judong.chuanyiserver.dao.ServerInDao;
import com.judong.chuanyiserver.service.ServerInService;
import com.judong.chuanyiserver.util.Result;
import com.judong.chuanyiserver.util.UserUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class ServerInServiceImpl implements ServerInService {

    @Autowired
    private ServerInDao serverInDao;

    @Autowired
    private UserUtil userUtil;

    @Override
    public Result selectServerByUser() {
        String userId = userUtil.getCurrentUserId();
        return Result.ok(serverInDao.selectServerByUser(userId));
    }
}
