惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

AI
AI
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Google DeepMind News
Google DeepMind News
T
Tenable Blog
博客园_首页
S
Securelist
Spread Privacy
Spread Privacy
Google Online Security Blog
Google Online Security Blog
Forbes - Security
Forbes - Security
Engineering at Meta
Engineering at Meta
U
Unit 42
L
LINUX DO - 热门话题
量子位
T
Threat Research - Cisco Blogs
博客园 - 【当耐特】
C
Cyber Attacks, Cyber Crime and Cyber Security
K
Kaspersky official blog
MyScale Blog
MyScale Blog
P
Proofpoint News Feed
The Last Watchdog
The Last Watchdog
Google DeepMind News
Google DeepMind News
GbyAI
GbyAI
Martin Fowler
Martin Fowler
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Security Latest
Security Latest
Scott Helme
Scott Helme
V
Vulnerabilities – Threatpost
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
I
InfoQ
Know Your Adversary
Know Your Adversary
Cisco Talos Blog
Cisco Talos Blog
The Register - Security
The Register - Security
T
The Blog of Author Tim Ferriss
aimingoo的专栏
aimingoo的专栏
V2EX - 技术
V2EX - 技术
T
Tailwind CSS Blog
月光博客
月光博客
Recent Announcements
Recent Announcements
G
Google Developers Blog
F
Full Disclosure
W
WeLiveSecurity
宝玉的分享
宝玉的分享
腾讯CDC
G
GRAHAM CLULEY
Vercel News
Vercel News
Simon Willison's Weblog
Simon Willison's Weblog
美团技术团队
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Help Net Security
Help Net Security

Kotlin

compose 使用性能问题 - V2EX 有人在项目里面使用 compose 开发吗 - V2EX 大家会在老项目中使用 kotlin 吗 - V2EX Kotlin 中文文档 2.2.20 版翻译完成了 - V2EX Kotlin 中文文档 2.1.20 版翻译完成了 - V2EX Kotlin 中文文档 2.1.0 版翻译完成了 - V2EX Kotlin 中文文档 2.0.20 版翻译完成了 - V2EX MIUI API28+ActivityTransition API+kotlin 无法检测到活动,只能手动触发广播,怎么定位问题? - V2EX 我老人家翻译的 Kotlin 中文文档,正在更新到最新的 2.0.20 版 - V2EX 我老人家翻译的《Kotlin 语言参考文档》中文版,已经迁移到了新的 Writerside 环境 - V2EX kotlin 没有受检异常真太难顶了。吐槽 - V2EX 屎山代码一则 - V2EX Kotlin 2.0.0 正式版发布了 - V2EX kotlin 中的 select 到底可以 select 哪些内容啊? - V2EX 请大佬帮忙看一眼我这个注解为什么没能抑制 never used 警告? - V2EX 我老人家翻译的《Kotlin 语言参考文档》中文版 - V2EX 使用 compose 开发了讯飞星火认知模型桌面端应用 - V2EX Kotlin 的协程到底是用来干嘛的?为什么没有可 suspend 的异步 IO 函数? - V2EX Kotlin 协程 Coroutine 与 Spring Boot 项目整合的最佳实践是怎样的? - V2EX 谷歌出品 kotlin 入门教程 - V2EX kotlin 源代码数据集 - V2EX KMM 中目前最成熟,最推荐的 shared viewmodel 方案是什么. - V2EX ​ Java /kotlin AST 构建相关,悬赏 200 求解,人已经麻了 - V2EX 有没有 Kotlin 讲协程比较好的书籍或博客连载 - V2EX ArrayList.set 提示 第二个参数 element 类型是 NoThing ? - V2EX 哪些公司后端用 kotlin 写的 - V2EX kotlin 表达式引擎 - V2EX 最近在看 Kotlin 别人一些代码, 看到如下的代码惊呆了 - V2EX Kotlin 的协程是真协程吗?被 b 站博主搞蒙了 - V2EX 有没有人能帮我解释一下,这里面的代码.如果我创建一个新窗口,按照这个逻辑,怎么显示出来 - V2EX 怎么解决 public reified 函数会要求所有用到的依赖都是 public 的问题 - V2EX Result 的方式处理异常用的多吗,我看了下好像和比较受好评的 rust result 用法差不多 - V2EX Kotlin 更换了新 logo:更加立体、更加清晰 - V2EX Kotlin 1.5.20 发布了~快来看看新特性 - V2EX 关于 kotlin 处理多个可空类型的变量的问题 - V2EX 求解这个 eval 函数返回值为什么是个 lambda?怎么才能拿到值? ​​​ - V2EX kotlin lazy 形式的 grouping and mapping 应该怎么写, sequence 里 grouping + aggregate 怎么比 Java stream 还复杂得多 - V2EX 强大的 v2ex,大家擅长 Kotlin, webview 交互的伙伴,来一波 - V2EX springboot kotlin 和 Java 混编, json 序列化用哪个比较好 - V2EX 有哪些知名 iOS 应用是纯 Kotlin 开发的? - V2EX kotlin 打包问题 - V2EX 求推荐 kotlin 安卓开发教程 - V2EX Kotlin 1.4 Released - V2EX 请教一下 kotlin json 序列化及配合 data class 的正确姿势 - V2EX 各位公司项目后端有用 Kotlin + Spring 的吗, DB 层框架选用的什么? - V2EX 慌的一批, Kotlin 这么优雅的语言为什么不火呢 - V2EX Kotlin 如何检测所有 lateinit 的 field 是否初始化 - V2EX 初入 kotlin,源码找不见求教 - V2EX libcore.reflect.parameterizedtypeimpl cannot be cast to Java .lang.clas 这个错误 我真是莫名其妙 - V2EX
[协程递归问题请教] - V2EX
yazinnnn · 2020-11-18 · via Kotlin

yazinnnn

[协程递归问题请教]

 

yazinnnn · 2020 年 11 月 18 日 · 3270 次点击

这是一个创建于 2034 天前的主题,其中的信息可能已经有所发展或是发生改变。

拿实际业务说 以钉钉接口中的跟部门 id [ 1 ] 为开始,递归出公司详细的组织架构


suspend fun getDepart(){
	fun getSubDepart(pid):List<Department>{
		val subList:List<departId> = dingApi.getSubDepartList(pid)
		return subList.map{
			Department(it,getSubDepart(it))
		}
	}
	return Department(1,getSubDepart(1))
}

data class Department(val departId,val subList:List<Department>) //sublist 是下属部门列表 


业务大概如此描述,同步状态下很简单,请问协程要怎么实现呢?

我用 withcontext ()包裹追钉钉 api,结果 build 时无法通过,报 call to 'resume' before 'invoke' with coroutine

请问有大佬能帮助一下吗?