Add hubid for user
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
package net.gepafin.tendermanagement.service.impl;
|
||||
|
||||
import net.gepafin.tendermanagement.dao.HubDao;
|
||||
import net.gepafin.tendermanagement.model.request.HubReq;
|
||||
import net.gepafin.tendermanagement.model.response.HubResponseBean;
|
||||
import net.gepafin.tendermanagement.service.HubService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class HubServiceImpl implements HubService {
|
||||
|
||||
@Autowired
|
||||
private HubDao hubDao;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public HubResponseBean createHub(HubReq hubReq) {
|
||||
return hubDao.createHub(hubReq);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public HubResponseBean updateHub(Long hubId, HubReq hubReq) {
|
||||
return hubDao.updateHub(hubId, hubReq);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public HubResponseBean getHubById(Long hubId) {
|
||||
return hubDao.getHubById(hubId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public List<HubResponseBean> getAllHubs() {
|
||||
return hubDao.getAllHubs();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteHub(Long hubId) {
|
||||
hubDao.deleteHub(hubId);
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,7 @@ 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;
|
||||
|
||||
|
||||
@@ -93,4 +94,15 @@ public class UserServiceImpl implements UserService {
|
||||
UserEntity user=tokenProvider.validateUser(userInfo);
|
||||
return userDao.getUserById(user.getId());
|
||||
}
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public List<UserResponseBean> getUserByHubId(String hubId) {
|
||||
return userDao.getUserByHubId(hubId);
|
||||
}
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public UserResponseBean createUserByHubId(String hubId, UserReq userReq) {
|
||||
return userDao.createUserByHubId(hubId, userReq);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user