Tag: api

Android发布商API – 获取额外的数据(检测哪个用户购买)

对于应用内订阅,我正在使用此代码(在Kotlin中) iabHelper.launchSubscriptionPurchaseFlow(act, "month", 1001, this@SubscriptionActivity, extraKey) 在此之后,我正在向服务器请求购买验证。 为了在服务器上进行验证,我使用了这个代码(在Go中) result, err := androidpublisher.Purchases.Subscriptions.Get(packageName, product, token).Do() success := err == nil 如何获得我在应用程序中传递的extraKey? 我需要它知道,哪个用户购买

响应状态HTTP SpringBoot Kotlin Api

我从kotlin开始,如果任何人都可以帮助我,我已经有一个关于如何返回http状态的问题,当我的真正的,如果它返回200好,当它的任何其他方式,返回404 NotFound。 我试着按照下面的代码来做,但是在所有情况下,它只返回状态200 OK @DeleteMapping("{id}") fun delete(@PathVariable id: Long): ResponseEntity<Unit> { try { if (dogRepository.exists(id)) { dogRepository.delete(id) } return ResponseEntity.ok().build() } catch (e: Exception) { return ResponseEntity.notFound().build() } }