首页 > 解决方案 > 如何在 kotlin 中使用 JasonElement

问题描述

科特林

如何更改下面的代码以接收关键动态?

@FormUrlEncoded
@GET("sections/content?s=1339ccb7-e7e2-41f1-9da3-6f4e95dc9b5a")
fun getContentSection(
    @Field("id") id : String,
    @Field("type") type : String,
    @Field("title") title : String,
    @Field("description") description : String,
    @Field("thumbnail") thumbnail : String,
    @Field("featured") featured : Boolean,
    @Field("position") position : Int,
) : Single<Token>

邮差

"keydinamic": [  // ID da Seção
    {
        "id": "id_movie",  // ID do Vídeo/Live
        "type": "live",                                // Tipo de conteúdo
        "title": "Conteúdo_8-0-0",                     // Título do conteúdo
        "description": "Description_8-0-0",            // Descrição do conteúdo
        "thumbnail": "url.png",  // Thumbnail/Capa
        "featured": true,                                                // É destaque?
        "position": 0                                                    // Posição deste conteúdo
    },

JAVA json元素

在此处输入图像描述

标签: kotlin

解决方案


推荐阅读