21 changed files with 394 additions and 12 deletions
@ -0,0 +1,17 @@ |
|||
package com.ccsens.common.service; |
|||
|
|||
import com.ccsens.common.bean.dto.CProjectDto; |
|||
import com.ccsens.util.bean.dto.QueryDto; |
|||
|
|||
/** |
|||
* @author AUSU |
|||
*/ |
|||
public interface IPowerService { |
|||
/** |
|||
* 查询项目内的权限 |
|||
* @param projectId 项目id |
|||
* @param userId 用户id |
|||
* @return 权限 |
|||
*/ |
|||
Integer queryUserPower(Long projectId,Long userId); |
|||
} |
@ -0,0 +1,33 @@ |
|||
package com.ccsens.common.service; |
|||
|
|||
import cn.hutool.core.util.ObjectUtil; |
|||
import com.ccsens.common.bean.dto.CProjectDto; |
|||
import com.ccsens.common.persist.dao.ProRoleDao; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Propagation; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import javax.annotation.Resource; |
|||
|
|||
/** |
|||
* @author AUSU |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) |
|||
public class PowerService implements IPowerService{ |
|||
|
|||
@Resource |
|||
private ProRoleDao roleDao; |
|||
|
|||
|
|||
@Override |
|||
public Integer queryUserPower(Long projectId, Long userId) { |
|||
Integer power = roleDao.isPmByUserId(userId, projectId); |
|||
if (ObjectUtil.isNull(power)) { |
|||
return 0; |
|||
} |
|||
return power; |
|||
} |
|||
} |
Loading…
Reference in new issue