fuint-framework/fuint-base/src/main/java/com/fuint/base/service/BaseServiceImpl.java

(完整代码) 1KB

/**
 * fuint.cn Inc.
 * Copyright (c) 2019-2022 All Rights Reserved.
 */
package com.fuint.base.service;

import java.util.*;
import com.fuint.base.dao.entities.TAccount;
import com.fuint.base.dao.entities.TAccountDuty;
import com.fuint.base.service.account.TAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 基础接口服务类
 *
 * @author fsq
 * @version $Id: BaseServiceImpl.java
 */
@Service
public class BaseServiceImpl implements BaseService {

    /**
     * 账户接口服务
     */
    @Autowired
    private TAccountService tAccountService;

    public Set<String> findRoles(Long accountId) {
        TAccount user = this.tAccountService.findAccountById(accountId);
        Set<String> roles = new HashSet<String>();
        if (user != null) {
            Iterator<TAccountDuty> it = user.getHtAccountDuties().iterator();
            TAccountDuty htAccountDuty = null;
            while (it.hasNext()) {
                htAccountDuty = it.next();
                roles.add(htAccountDuty.gettDuty().getName());
            }
        }
        return roles;
    }

}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。