{"id":241,"date":"2023-02-19T01:13:09","date_gmt":"2023-02-18T17:13:09","guid":{"rendered":"https:\/\/www.jinhaihan.top\/WordPress\/?p=241"},"modified":"2023-02-19T01:13:13","modified_gmt":"2023-02-18T17:13:13","slug":"%e5%9f%ba%e4%ba%8ekotlin%e5%92%8c%e6%90%ba%e7%a8%8b%e7%9a%84%e4%b8%80%e7%a7%8dretrofit%e5%b0%81%e8%a3%85","status":"publish","type":"post","link":"https:\/\/www.jinhaihan.top\/WordPress\/%e5%9f%ba%e4%ba%8ekotlin%e5%92%8c%e6%90%ba%e7%a8%8b%e7%9a%84%e4%b8%80%e7%a7%8dretrofit%e5%b0%81%e8%a3%85\/","title":{"rendered":"<strong>\u57fa\u4e8eKotlin\u548c\u643a\u7a0b\u7684\u4e00\u79cdRetrofit\u5c01\u88c5<\/strong>"},"content":{"rendered":"\n<div class=\"wp-block-jetpack-markdown\"><h1>\u4e00\u3001\u5c01\u88c5\u6b65\u9aa4<\/h1>\n<p>\u76f4\u63a5\u4e0a\u4ee3\u7801\uff1a<\/p>\n<p>\u9996\u5148\u5f15\u5165\u76f8\u5173\u4f9d\u8d56\uff1a<\/p>\n<pre><code>api &#039;com.squareup.retrofit2:retrofit:2.9.0&#039;  \nimplementation &#039;com.squareup.retrofit2:converter-gson:2.4.0&#039;  \nimplementation(&quot;com.squareup.okhttp3:okhttp:4.10.0&quot;)  \napi &#039;com.github.JessYanCoding:RetrofitUrlManager:v1.4.0&#039;  \napi &#039;com.google.code.gson:gson:2.10.1&#039;\n<\/code><\/pre>\n<ol>\n<li>\u65b0\u5efa\u4e00\u4e2a\u5355\u4f8b\u7684RetrofitClient\u7b80\u5355\u5c01\u88c5<\/li>\n<\/ol>\n<pre><code class=\"language-kotlin\">package com.kim.jetpackmvi.network  \n  \nimport android.util.Log.INFO  \nimport com.kim.jetpackmvi.network.logging.Level  \nimport com.kim.jetpackmvi.network.logging.LoggingInterceptor  \nimport me.jessyan.retrofiturlmanager.RetrofitUrlManager  \nimport okhttp3.ConnectionPool  \nimport okhttp3.OkHttpClient  \nimport org.greenrobot.eventbus.android.BuildConfig  \nimport retrofit2.Retrofit  \nimport retrofit2.converter.gson.GsonConverterFactory  \nimport java.util.concurrent.TimeUnit  \n  \n  \n\/**  \n * @ClassName: RetrofitClient  \n * @Description: Retrofit Kotlin \u5c01\u88c5  \n * @Author: kim  \n * @Date: 2\/18\/23 5:53 PM  \n *\/class RetrofitClient  {  \n    companion object {  \n        val instance by lazy(LazyThreadSafetyMode.SYNCHRONIZED) {  \n            RetrofitClient()  \n        }  \n    }  \n  \n    private lateinit var retrofit: Retrofit  \n    private lateinit var okHttpClient: OkHttpClient  \n  \n    private constructor() {  \n        \/\/\u7981\u7528\u7f13\u5b58  \n\/\/        if (httpCacheDirectory == null) {  \n\/\/            httpCacheDirectory = File(mContext.getCacheDir(), &quot;goldze_cache&quot;)  \n\/\/        }  \n\/\/        try {  \n\/\/            if (cache == null) {  \n\/\/                cache = Cache(httpCacheDirectory, CACHE_TIMEOUT)  \n\/\/            }  \n\/\/        } catch (e: Exception) {  \n\/\/            KLog.e(&quot;Could not create http cache&quot;, e)  \n\/\/        }  \n        val sslParams: HttpsUtils.SSLParams = HttpsUtils.getSslSocketFactory()  \n        okHttpClient = RetrofitUrlManager.getInstance().with(OkHttpClient.Builder())  \n            \/\/.cookieJar(CookieJarImpl(PersistentCookieStore(mContext))) \/\/                .cache(cache)  \n            \/\/.addInterceptor(BaseInterceptor(headers))            \/\/.addInterceptor(CacheInterceptor(mContext))            .sslSocketFactory(sslParams.sSLSocketFactory!!, sslParams.trustManager!!)  \n            .addInterceptor(  \n                LoggingInterceptor.Builder() \/\/\u6784\u5efa\u8005\u6a21\u5f0f  \n                    .loggable(true\/*BuildConfig.DEBUG*\/) \/\/\u662f\u5426\u5f00\u542f\u65e5\u5fd7\u6253\u5370  \n                    .setLevel(Level.BASIC) \/\/\u6253\u5370\u7684\u7b49\u7ea7  \n                    .log(INFO) \/\/ \u6253\u5370\u7c7b\u578b  \n                    .request(&quot;Request&quot;) \/\/ request\u7684Tag  \n                    .response(&quot;Response&quot;) \/\/ Response\u7684Tag  \n                    \/\/.addHeader(&quot;log-header&quot;, &quot;I am the log request header.&quot;) \/\/ \u6dfb\u52a0\u6253\u5370\u5934, \u6ce8\u610f key \u548c value \u90fd\u4e0d\u80fd\u662f\u4e2d\u6587                    .build()  \n            )  \n            .connectTimeout(10, TimeUnit.SECONDS)  \n            .writeTimeout(10, TimeUnit.SECONDS)  \n            .readTimeout(10, TimeUnit.SECONDS)  \n            .connectionPool(  \n                ConnectionPool(  \n                    8,  \n                    15,  \n                    TimeUnit.SECONDS  \n                )  \n            ) \/\/ \u8fd9\u91cc\u4f60\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u673a\u578b\u8bbe\u7f6e\u540c\u65f6\u8fde\u63a5\u7684\u4e2a\u6570\u548c\u65f6\u95f4\uff0c\u6211\u8fd9\u91cc8\u4e2a\uff0c\u548c\u6bcf\u4e2a\u4fdd\u6301\u65f6\u95f4\u4e3a10s  \n            .build()  \n\/\/        retrofit = Retrofit.Builder()  \n\/\/            .client(okHttpClient)  \n\/\/            .addConverterFactory(GsonConverterFactory.create())  \n\/\/            \/\/.addCallAdapterFactory(RxJava2CallAdapterFactory.create())  \n\/\/            .baseUrl(url)  \n\/\/            .build()  \n    }  \n  \n    \/**  \n     * create you ApiService     * Create an implementation of the API endpoints defined by the `service` interface.     *\/    \n     fun &lt;T&gt; create(url: String, service: Class&lt;T&gt;?): T {  \n        if (service == null) {  \n            throw RuntimeException(&quot;Api service is null!&quot;)  \n        }  \n        retrofit = Retrofit.Builder()  \n            .client(okHttpClient)  \n            .addConverterFactory(GsonConverterFactory.create())  \n            \/\/.addCallAdapterFactory(RxJava2CallAdapterFactory.create())  \n            .baseUrl(url)  \n            .build()  \n        return retrofit.create(service)  \n    }  \n}\n<\/code><\/pre>\n<p>\u5728\u4ee5\u4e0a\u4ee3\u7801\u4e2d\uff0c\u7ed3\u5408\u4e86\u65e5\u5fd7\u62e6\u622a\u5668\u7b49\u81ea\u5b9a\u4e49\u7684\u62e6\u622a\u5668\uff08\u4f1a\u5355\u72ec\u5199\u6587\u7ae0\u5217\u51fa\uff0c\u4e0e\u672c\u6587\u65e0\u5173\uff09\uff0c\u53ef\u4ee5\u4f7f\u7528<code>create<\/code>\u521b\u5efaRetrofit\u5bf9\u8c61\u3002<\/p>\n<ol start=\"2\">\n<li>\u5efa\u7acb\u4e00\u4e2a\u6587\u4ef6\uff0c\u540d\u4e3aApiCall\uff0c\u6709\u5982\u4e0b\u5185\u5bb9\uff1a<\/li>\n<\/ol>\n<pre><code class=\"language-kotlin\">package com.kim.jetpackmvi.network  \n  \nimport android.util.Log  \nimport com.google.gson.JsonParseException  \nimport kotlinx.coroutines.CoroutineScope  \nimport kotlinx.coroutines.Dispatchers  \nimport kotlinx.coroutines.withContext  \nimport org.apache.http.conn.ConnectTimeoutException  \nimport org.json.JSONException  \nimport retrofit2.HttpException  \nimport java.io.IOException  \nimport java.net.SocketTimeoutException  \nimport java.net.UnknownHostException  \n  \n\/**  \n * @ClassName: ApiCall  \n * @Description: java\u7c7b\u4f5c\u7528\u63cf\u8ff0  \n * @Author: kim  \n * @Date: 2\/19\/23 12:38 AM  \n *\/suspend inline fun &lt;T&gt; apiCall(crossinline call: suspend CoroutineScope.() -&gt; T, crossinline onSuccess: ((T) -&gt; Unit), crossinline onError: ((Exception) -&gt; Unit)) {  \n    withContext(Dispatchers.IO) {  \n        var res: T? = null  \n        try {  \n            res = call()  \n            onSuccess(res)  \n        } catch (e: Throwable) {  \n            Log.e(&quot;ApiCaller&quot;, &quot;request error&quot;, e)  \n            \/\/ \u8bf7\u6c42\u51fa\u9519\n            onError(ApiException.build(e))  \n        }\n    }  \n}  \n  \n\/\/ \u7f51\u7edc\u3001\u6570\u636e\u89e3\u6790\u9519\u8bef\u5904\u7406  \nclass ApiException(val code: Int, override val message: String?, override val cause: Throwable? = null)  \n    : RuntimeException(message, cause) {  \n    companion object {  \n        \/\/ \u7f51\u7edc\u72b6\u6001\u7801  \n        const val CODE_NET_ERROR = 4000  \n        const val CODE_TIMEOUT = 4080  \n        const val CODE_JSON_PARSE_ERROR = 4010  \n        const val CODE_SERVER_ERROR = 5000  \n        \/\/ \u4e1a\u52a1\u72b6\u6001\u7801  \n        const val CODE_AUTH_INVALID = 401  \n  \n        fun build(e: Throwable): ApiException {  \n            return if (e is HttpException) {  \n                ApiException(CODE_NET_ERROR, &quot;\u7f51\u7edc\u5f02\u5e38(${e.code()},${e.message()})&quot;)  \n            } else if (e is UnknownHostException) {  \n                ApiException(CODE_NET_ERROR, &quot;\u7f51\u7edc\u8fde\u63a5\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u540e\u518d\u8bd5&quot;)  \n            } else if (e is ConnectTimeoutException || e is SocketTimeoutException) {  \n                ApiException(CODE_TIMEOUT, &quot;\u8bf7\u6c42\u8d85\u65f6\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5&quot;)  \n            } else if (e is IOException) {  \n                ApiException(CODE_NET_ERROR, &quot;\u7f51\u7edc\u5f02\u5e38(${e.message})&quot;)  \n            } else if (e is JsonParseException || e is JSONException) {  \n                \/\/ Json\u89e3\u6790\u5931\u8d25  \n                ApiException(CODE_JSON_PARSE_ERROR, &quot;\u6570\u636e\u89e3\u6790\u9519\u8bef\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5&quot;)  \n            } else {  \n                ApiException(CODE_SERVER_ERROR, &quot;\u7cfb\u7edf\u9519\u8bef(${e.message})&quot;)  \n            }  \n        }  \n    }  \n}\n<\/code><\/pre>\n<ol start=\"3\">\n<li>\u5efa\u7acb\u4e00\u4e2aService<\/li>\n<\/ol>\n<pre><code class=\"language-kotlin\">\/**  \n * @ClassName: TestApiService  \n * @Description: java\u7c7b\u4f5c\u7528\u63cf\u8ff0  \n * @Author: kim  \n * @Date: 2\/18\/23 5:50 PM  \n *\/interface TestApiService {  \n    \/**  \n     * \u6d4b\u8bd5post\u63a5\u53e3\uff0c\u53d1\u7ed9\u4ed6\u5565\u5b83\u8fd4\u56de\u5565     *\/    \n    @Headers(DOMAIN_NAME+ DOMAIN_NAME_postTest)  \n    @POST(&quot;post&quot;)  \n    \/\/ \u6ce8\u610f\u8fd9\u91cc\u7684suspend\n    suspend fun postTest(@Body json: String): ResponseBody  \n}  \n  \nlateinit var apiService: TestApiService\n<\/code><\/pre>\n<ol start=\"4\">\n<li>\u8c03\u7528<\/li>\n<\/ol>\n<pre><code class=\"language-kotlin\">\/\/\u4f7f\u7528retrofit url manager\u521d\u59cb\u5316\nprivate fun initRetrofit() {  \n    apiService = RetrofitClient.instance.create(  \n        testUrl,  \n        TestApiService::class.java  \n    )  \n    \/\/RetrofitClient.getInstance().apiService = apiService;  \n    RetrofitUrlManager.getInstance().putDomain(DOMAIN_NAME_postTest, testUrl)  \n    RetrofitUrlManager.getInstance().setGlobalDomain(testUrl) \n}\n<\/code><\/pre>\n<pre><code class=\"language-kotlin\">\/\/\u5728view model\u4e2d\u8c03\u7528\u534f\u7a0b\nviewModelScope.launch {  \n    delay(2000)  \n    apiCall({  \n        apiService.postTest(&quot;{\\&quot;aaa\\&quot;:123}&quot;)  \n    }, {  \n        Logger.i(it.string())  \n    }, {  \n        Logger.i(it.message + &quot;&quot;)  \n    })  \n}\n<\/code><\/pre>\n<p>\u7ed3\u675f\u3002<\/p>\n<h1>\u4e8c\u3001\u7b80\u5355\u89e3\u91ca<\/h1>\n<p>Retrofit\u5df2\u7ecf\u652f\u6301Kotlin\u7684\u534f\u7a0b\u4e86\uff0c\u5728Api Service\u4e2d\u52a0\u5165suspend\u5173\u952e\u5b57\u5373\u53ef\u3002<\/p>\n<p>\u4f7f\u7528ApiCall\u51fd\u6570\u4f20\u5165\u4e09\u4e2a\u53c2\u6570\uff0c\u8981\u8fd0\u884c\u7684\u534f\u7a0b\u3001\u6210\u529f\u56de\u8c03\u3001\u8fd4\u56de\u56de\u8c03\u3002\n\u76f4\u63a5\u5728<code>withContext(Dispatchers.IO)<\/code>\u4e2d\u4f7f\u7528\u5373\u53ef\u3002<\/p>\n<p>\u53c2\u8003\u94fe\u63a5<\/p>\n<blockquote>\n<p><a href=\"https:\/\/zhuanlan.zhihu.com\/p\/439126883\" target=\"_blank\" rel=\"noopener\">Retrofit+\u534f\u7a0b\uff0c\u7f51\u7edc\u8bf7\u6c42\u5c01\u88c5\u5b9e\u6218 &#8211; \u77e5\u4e4e (zhihu.com)<\/a>\n<a href=\"https:\/\/juejin.cn\/post\/6959115482511343647\" target=\"_blank\" rel=\"noopener\">\u4f18\u96c5\u7684\u5c01\u88c5\u7f51\u7edc\u8bf7\u6c42\uff0c\u534f\u7a0b + Retrofit &#8211; \u6398\u91d1 (juejin.cn)<\/a><\/p>\n<\/blockquote>\n<p>\u53c2\u8003\u4e861\u7684\u72b6\u6001\u56de\u8c03\uff0c\u53c2\u8003\u4e862\u7684\u534f\u7a0b\u5c01\u88c5<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":242,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[8,7],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.jinhaihan.top\/WordPress\/wp-content\/uploads\/2023\/02\/czNmcy1wcml2YXRlL3Jhd3BpeGVsX2ltYWdlcy93ZWJzaXRlX2NvbnRlbnQvbHIvcHgxMDg5NTEyLWltYWdlLWt3dnkzcXdyLmpwZw.jpg?fit=1300%2C867&ssl=1","jetpack-related-posts":[{"id":232,"url":"https:\/\/www.jinhaihan.top\/WordPress\/ts%e7%9a%84%e8%af%b7%e6%b1%82%e5%b0%81%e8%a3%85\/","url_meta":{"origin":241,"position":0},"title":"TS\u7684\u8bf7\u6c42\u5c01\u88c5","author":"Kim","date":"2023\u5e741\u670831\u65e5","format":false,"excerpt":"\u9996\u5148\u5b89\u88c5axios npm install axios \u65b0\u5efarequest.ts \u8fdb\u884c\u521d\u59cb\u8bbe\u7f6e\u5e76\u8bbe\u5b9a\u2026","rel":"","context":"\u5728\u201c\u524d\u7aef\u201d\u4e2d","block_context":{"text":"\u524d\u7aef","link":"https:\/\/www.jinhaihan.top\/WordPress\/category\/bolg\/%e5%89%8d%e7%ab%af\/"},"img":{"alt_text":"purple and blue light digital wallpaper","src":"https:\/\/i0.wp.com\/www.jinhaihan.top\/WordPress\/wp-content\/uploads\/2023\/01\/pexels-photo-3780104.jpg?fit=1200%2C863&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.jinhaihan.top\/WordPress\/wp-content\/uploads\/2023\/01\/pexels-photo-3780104.jpg?fit=1200%2C863&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.jinhaihan.top\/WordPress\/wp-content\/uploads\/2023\/01\/pexels-photo-3780104.jpg?fit=1200%2C863&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.jinhaihan.top\/WordPress\/wp-content\/uploads\/2023\/01\/pexels-photo-3780104.jpg?fit=1200%2C863&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":208,"url":"https:\/\/www.jinhaihan.top\/WordPress\/swiftui-%e5%ba%94%e7%94%a8%e5%86%85%e4%ba%8b%e4%bb%b6%e9%80%9a%e7%9f%a5-notificationcenter\/","url_meta":{"origin":241,"position":1},"title":"SwiftUI-\u5e94\u7528\u5185\u4e8b\u4ef6\u901a\u77e5 &#8211; NotificationCenter","author":"Kim","date":"2022\u5e748\u670831\u65e5","format":false,"excerpt":"\u5f00\u53d1\u73af\u5883 XCode 14 Beta Macos 13 Mac os App SwiftUI \u4f7f\u7528\u65b9\u2026","rel":"","context":"\u5728\u201cSwiftUI\u201d\u4e2d","block_context":{"text":"SwiftUI","link":"https:\/\/www.jinhaihan.top\/WordPress\/category\/bolg\/swiftui\/"},"img":{"alt_text":"black and gray digital device","src":"https:\/\/i0.wp.com\/www.jinhaihan.top\/WordPress\/wp-content\/uploads\/2022\/08\/pexels-photo-193003.jpeg?fit=1200%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.jinhaihan.top\/WordPress\/wp-content\/uploads\/2022\/08\/pexels-photo-193003.jpeg?fit=1200%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.jinhaihan.top\/WordPress\/wp-content\/uploads\/2022\/08\/pexels-photo-193003.jpeg?fit=1200%2C800&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.jinhaihan.top\/WordPress\/wp-content\/uploads\/2022\/08\/pexels-photo-193003.jpeg?fit=1200%2C800&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":225,"url":"https:\/\/www.jinhaihan.top\/WordPress\/wpf-databinding%e7%9a%84%e5%87%a0%e7%a7%8d%e6%96%b9%e5%bc%8f\/","url_meta":{"origin":241,"position":2},"title":"# WPF Databinding\u7684\u51e0\u79cd\u65b9\u5f0f","author":"Kim","date":"2022\u5e7412\u670829\u65e5","format":false,"excerpt":"WPF Databinding\u7684\u51e0\u79cd\u65b9\u5f0f \u6709\u65f6\u5019\u4f1a\u548cUWP\u3001\u5176\u4ed6\u8bed\u8a00\u7684\u7ed1\u5b9a\u5f04\u6df7\uff0c\u8fd9\u91cc\u505a\u4e00\u4e0b\u5907\u4efd\u8bb0\u5f55 \u2026","rel":"","context":"\u5728\u201cWPF\u201d\u4e2d","block_context":{"text":"WPF","link":"https:\/\/www.jinhaihan.top\/WordPress\/category\/bolg\/wpf\/"},"img":{"alt_text":"gray and brown mountain","src":"https:\/\/i0.wp.com\/www.jinhaihan.top\/WordPress\/wp-content\/uploads\/2022\/12\/pexels-photo-417173.jpeg?fit=1200%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.jinhaihan.top\/WordPress\/wp-content\/uploads\/2022\/12\/pexels-photo-417173.jpeg?fit=1200%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.jinhaihan.top\/WordPress\/wp-content\/uploads\/2022\/12\/pexels-photo-417173.jpeg?fit=1200%2C800&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.jinhaihan.top\/WordPress\/wp-content\/uploads\/2022\/12\/pexels-photo-417173.jpeg?fit=1200%2C800&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":235,"url":"https:\/\/www.jinhaihan.top\/WordPress\/%e5%9c%a8gin%e6%a1%86%e6%9e%b6%e4%b8%ad%e8%8e%b7%e5%8f%96%e5%a4%96%e9%83%a8%e8%af%b7%e6%b1%82%e4%b8%adget%e5%92%8cpost%e7%9a%84%e5%8f%82%e6%95%b0\/","url_meta":{"origin":241,"position":3},"title":"\u5728Gin\u6846\u67b6\u4e2d\u83b7\u53d6\u5916\u90e8\u8bf7\u6c42\u4e2dGet\u548cPost\u7684\u53c2\u6570","author":"Kim","date":"2023\u5e741\u670831\u65e5","format":false,"excerpt":"\u9996\u5148\u5047\u8bbe\u5df2\u7ecf\u642d\u5efa\u597d\u6574\u4e2a\u670d\u52a1\uff0c\u5e76\u521b\u5efa\u4e86\u51e0\u4e2aAPI\u7528\u4e8e\u6d4b\u8bd5\u3002 \u5728Get\u8bf7\u6c42\u4e2d\uff0c\u5047\u8bbe\u7531\u4ee5\u4e0b\u51fd\u6570\u5904\u7406\uff0c\u5219\u83b7\u53d6\u2026","rel":"","context":"\u5728\u201cGolang\u201d\u4e2d","block_context":{"text":"Golang","link":"https:\/\/www.jinhaihan.top\/WordPress\/category\/bolg\/golang\/"},"img":{"alt_text":"Dynamic Earth - Ocean Currents","src":"https:\/\/i0.wp.com\/www.jinhaihan.top\/WordPress\/wp-content\/uploads\/2023\/01\/7402441936_5c99447ca0_b.jpg?fit=1024%2C576&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.jinhaihan.top\/WordPress\/wp-content\/uploads\/2023\/01\/7402441936_5c99447ca0_b.jpg?fit=1024%2C576&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.jinhaihan.top\/WordPress\/wp-content\/uploads\/2023\/01\/7402441936_5c99447ca0_b.jpg?fit=1024%2C576&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":162,"url":"https:\/\/www.jinhaihan.top\/WordPress\/c-%e7%94%9f%e6%88%90%e8%93%9d%e5%9b%be%e7%b1%bb%e5%af%b9%e8%b1%a1\/","url_meta":{"origin":241,"position":4},"title":"C++ \u751f\u6210\u84dd\u56fe\u7c7b\u5bf9\u8c61","author":"Kim","date":"2022\u5e743\u67082\u65e5","format":false,"excerpt":"\u83b7\u53d6\u84dd\u56fe\u8d44\u6e90\u8def\u5f84 \u5728UE\u4e2d\u53f3\u952e\u8d44\u6e90\uff0c\u9009\u62e9Copy Reference\u5373\u53ef\uff0c\u540e\u7eed\u7528\u5230\u7684\u8def\u5f84\u3001Name\u90fd\u2026","rel":"","context":"\u5728\u201c\u535a\u5ba2\u201d\u4e2d","block_context":{"text":"\u535a\u5ba2","link":"https:\/\/www.jinhaihan.top\/WordPress\/category\/bolg\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.jinhaihan.top\/WordPress\/wp-content\/uploads\/2022\/03\/R.jpg?fit=1200%2C750&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.jinhaihan.top\/WordPress\/wp-content\/uploads\/2022\/03\/R.jpg?fit=1200%2C750&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.jinhaihan.top\/WordPress\/wp-content\/uploads\/2022\/03\/R.jpg?fit=1200%2C750&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.jinhaihan.top\/WordPress\/wp-content\/uploads\/2022\/03\/R.jpg?fit=1200%2C750&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":205,"url":"https:\/\/www.jinhaihan.top\/WordPress\/wpf%e4%b8%ad%e7%9a%84%e5%a4%9a%e8%af%ad%e8%a8%80%e6%94%af%e6%8c%81_%e5%8a%a8%e6%80%81%e5%88%87%e6%8d%a2%e8%af%ad%e8%a8%80\/","url_meta":{"origin":241,"position":5},"title":"wpf\u4e2d\u7684\u591a\u8bed\u8a00\u652f\u6301_\u52a8\u6001\u5207\u6362\u8bed\u8a00","author":"Kim","date":"2022\u5e748\u670831\u65e5","format":false,"excerpt":"\u4e3b\u6d41\u65b9\u6cd5\u53c2\u8003\u535a\u5ba2\uff1a(\u867d\u7136\u8001\u4e86\u70b9\u4f46\u662f\u6709\u7528) WPF\u5e94\u7528\u7a0b\u5e8f\u652f\u6301\u591a\u56fd\u8bed\u8a00\u89e3\u51b3\u65b9\u6848 \u4f46\u662f\u9ed8\u8ba4\u7684\u65b9\u6848\u91cc\u8bd5\u7528\u9759\u2026","rel":"","context":"\u5728\u201cWPF\u201d\u4e2d","block_context":{"text":"WPF","link":"https:\/\/www.jinhaihan.top\/WordPress\/category\/bolg\/wpf\/"},"img":{"alt_text":"pieces of paper with words","src":"https:\/\/i0.wp.com\/www.jinhaihan.top\/WordPress\/wp-content\/uploads\/2022\/08\/pexels-photo-6045344.jpeg?fit=1200%2C795&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.jinhaihan.top\/WordPress\/wp-content\/uploads\/2022\/08\/pexels-photo-6045344.jpeg?fit=1200%2C795&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.jinhaihan.top\/WordPress\/wp-content\/uploads\/2022\/08\/pexels-photo-6045344.jpeg?fit=1200%2C795&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.jinhaihan.top\/WordPress\/wp-content\/uploads\/2022\/08\/pexels-photo-6045344.jpeg?fit=1200%2C795&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.jinhaihan.top\/WordPress\/wp-json\/wp\/v2\/posts\/241"}],"collection":[{"href":"https:\/\/www.jinhaihan.top\/WordPress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jinhaihan.top\/WordPress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jinhaihan.top\/WordPress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jinhaihan.top\/WordPress\/wp-json\/wp\/v2\/comments?post=241"}],"version-history":[{"count":1,"href":"https:\/\/www.jinhaihan.top\/WordPress\/wp-json\/wp\/v2\/posts\/241\/revisions"}],"predecessor-version":[{"id":243,"href":"https:\/\/www.jinhaihan.top\/WordPress\/wp-json\/wp\/v2\/posts\/241\/revisions\/243"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.jinhaihan.top\/WordPress\/wp-json\/wp\/v2\/media\/242"}],"wp:attachment":[{"href":"https:\/\/www.jinhaihan.top\/WordPress\/wp-json\/wp\/v2\/media?parent=241"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jinhaihan.top\/WordPress\/wp-json\/wp\/v2\/categories?post=241"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jinhaihan.top\/WordPress\/wp-json\/wp\/v2\/tags?post=241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}