小编mae*_*aes的帖子

如何在 postgres 数据库中写入嵌套切片?

这可能看起来像一个愚蠢的问题,但我正在努力奋斗,以使其发挥作用。这里有一些细节,我想和大家分享一下,以便大家更好地理解我的意思。首先,我只是想学习编码,并尝试为自己实现在一个小项目中学到的东西。请多多包涵 :)

当前设置

我正在获取外部 API 端点,其中 json 如下所示:

{
    "orders": [
        {
            "input": {
                "amount": "1",
                "currency": "EUR",
                "type": "bank_account",
                "iban": "DEXXX"
            },
            "output": {
                "amount": "2",
                "currency": "CHF",
                "type": "paypal",
                "paypal_recipient": "example@example.org"
            },
            "id": "8e150ca6",
            "timestamp_created": "2021-06-06T20:34:19.827Z",
            "timestamp_executed": "2021-06-07T06:43:57Z",
            "timestamp_awaiting_payment_since": "2021-06-06T20:34:28.921Z",
            "timestamp_payment_received": "2021-06-07T06:43:57Z",
            "payment_details": {
                "iban": "DEXXX",
                "recipient_name": "Company1",
                "recipient_postal_address": [
                    "Maxstreet",
                    "1000 Berlin                                                                  ",
                    "Germany"
                ],
                "reference": "Order XY",
                "swift_bic": "BCNNXX",
                "type": "bank_account"
            },
            "price_breakdown": {
                "customer_trading_fee": {
                    "amount": "1.56",
                    "currency": "EUR"
                },
                "non-verified_fee": {
                    "amount": "0.79",
                    "currency": …
Run Code Online (Sandbox Code Playgroud)

rest struct nested go go-gorm

5
推荐指数
0
解决办法
169
查看次数

标签 统计

go ×1

go-gorm ×1

nested ×1

rest ×1

struct ×1