查询用户授权app
							parent
							
								
									58755e20d9
								
							
						
					
					
						commit
						c1f55e4c99
					
				| 
						 | 
				
			
			@ -17,6 +17,7 @@ import org.springframework.stereotype.Service;
 | 
			
		|||
import java.util.HashMap;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
import java.util.Map;
 | 
			
		||||
import java.util.stream.Collectors;
 | 
			
		||||
 | 
			
		||||
@Service("IndexService")
 | 
			
		||||
@Slf4j
 | 
			
		||||
| 
						 | 
				
			
			@ -110,10 +111,18 @@ public class IndexServiceImpl implements IndexService {
 | 
			
		|||
            //查询当前用户授权应用
 | 
			
		||||
            JSONObject param = new JSONObject();
 | 
			
		||||
            param.put("type", "user");
 | 
			
		||||
            param.put("page", 1);
 | 
			
		||||
            param.put("limit", Integer.MAX_VALUE);
 | 
			
		||||
            String result = ykUtil.call(YkInfo.getAllAppList, param, JSONArray.class);
 | 
			
		||||
 | 
			
		||||
            List<JSONObject> list = JSONObject.parseObject(result, List.class);
 | 
			
		||||
 | 
			
		||||
            List<JSONObject> userAppList = getUserAppList(requestContext);
 | 
			
		||||
            List<String> appIdList = userAppList.stream().map(jsonObject -> jsonObject.getString("appId")).collect(Collectors.toList());
 | 
			
		||||
            for (JSONObject data : list) {
 | 
			
		||||
                if(appIdList.contains(data.getString("appId"))){
 | 
			
		||||
                    data.put("enable", "1");
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            return new GeneralResult(true, userAppList, "查询成功");
 | 
			
		||||
        } catch (Exception e) {
 | 
			
		||||
            log.info("查询失败", e);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue