FastComments.com

FastComments Go SDK

这是 FastComments 的官方 Go SDK。

FastComments API 的官方 Go SDK

仓库

在 GitHub 上查看


AI coding agents Internal Link

skills.sh

为您的编码代理提供 FastComments 所需的上下文——小部件、配置、安全单点登录、REST API 和 SDK:

npx skills add fastcomments/skills

兼容 Claude Code、Codex、Cursor、Copilot、Gemini,以及所有其他由 skills CLI 支持的代理。

Installation Internal Link

go get github.com/fastcomments/fastcomments-go

使用 API 客户端

公共 API(无身份验证)

PublicAPI 允许在不进行身份验证的情况下访问公共端点:

package main

import (
    "context"
    "fmt"
    "github.com/fastcomments/fastcomments-go/client"
)

func main() {
    config := client.NewConfiguration()
    apiClient := client.NewAPIClient(config)

    // 使用 PublicAPI 获取评论
    response, httpResp, err := apiClient.PublicAPI.GetCommentsPublic(
        context.Background(),
        "your-tenant-id",
    ).UrlId("your-page-url-id").Execute()

    if err != nil {
        panic(err)
    }

    fmt.Printf("Status: %d\n", httpResp.StatusCode)
    fmt.Printf("Comments: %+v\n", response)
}

默认 API(需要 API Key)

DefaultAPI 需要使用您的 API Key 进行身份验证:

package main

import (
    "context"
    "fmt"
    "github.com/fastcomments/fastcomments-go/client"
)

func main() {
    config := client.NewConfiguration()
    apiClient := client.NewAPIClient(config)

    // 使用 API 密钥创建已认证的上下文
    auth := context.WithValue(
        context.Background(),
        client.ContextAPIKeys,
        map[string]client.APIKey{
            "api_key": {Key: "your-api-key-here"},
        },
    )

    // 使用已认证的 DefaultAPI 获取评论
    response, httpResp, err := apiClient.DefaultAPI.GetComments(auth).
        TenantId("your-tenant-id").
        UrlId("your-page-url-id").
        Execute()

    if err != nil {
        panic(err)
    }

    fmt.Printf("Status: %d\n", httpResp.StatusCode)
    fmt.Printf("Comments: %+v\n", response)
}

审核 API(审核仪表板)

ModerationAPI 提供了功能丰富的实时快速审核 API 套件。所有审核方法都接受 sso 参数,并且可以通过 SSO 或 FastComments.com 会话 cookie 进行身份验证:

package main

import (
    "context"
    "fmt"
    "github.com/fastcomments/fastcomments-go/client"
)

func main() {
    config := client.NewConfiguration()
    apiClient := client.NewAPIClient(config)

    // 使用 ModerationAPI 列出用于审核的评论
    response, httpResp, err := apiClient.ModerationAPI.GetApiComments(
        context.Background(),
    ).Sso("your-sso-token").Execute()

    if err != nil {
        panic(err)
    }

    fmt.Printf("Status: %d\n", httpResp.StatusCode)
    fmt.Printf("Comments: %+v\n", response)
}

Usage Internal Link

简单 SSO

package main

import (
    "context"
    "fmt"
    "github.com/fastcomments/fastcomments-go/client"
    "github.com/fastcomments/fastcomments-go/sso"
)

func main() {
    // 创建简单 SSO 令牌
    user := &sso.SimpleSSOUserData{
        UserID: "user-123",
        Email:  "user@example.com",
        Avatar: "https://example.com/avatar.jpg",
    }

    ssoInstance := sso.NewSimple(user)
    token, err := ssoInstance.CreateToken()
    if err != nil {
        panic(err)
    }

    fmt.Println("SSO Token:", token)

    // 使用 SSO 令牌进行已验证的 API 调用
    config := client.NewConfiguration()
    apiClient := client.NewAPIClient(config)

    response, httpResp, err := apiClient.PublicAPI.GetCommentsPublic(
        context.Background(),
        "your-tenant-id",
    ).UrlId("your-page-url-id").Sso(token).Execute()

    if err != nil {
        panic(err)
    }

    fmt.Printf("Status: %d\n", httpResp.StatusCode)
    fmt.Printf("Comments: %+v\n", response)
}

安全 SSO

package main

import (
    "context"
    "fmt"
    "github.com/fastcomments/fastcomments-go/client"
    "github.com/fastcomments/fastcomments-go/sso"
)

func main() {
    // 创建安全 SSO 令牌
    user := &sso.SecureSSOUserData{
        UserID:   "user-123",
        Email:    "user@example.com",
        Username: "johndoe",
        Avatar:   "https://example.com/avatar.jpg",
    }

    apiKey := "your-api-key"
    ssoInstance, err := sso.NewSecure(apiKey, user)
    if err != nil {
        panic(err)
    }

    token, err := ssoInstance.CreateToken()
    if err != nil {
        panic(err)
    }

    fmt.Println("Secure SSO Token:", token)

    // 使用 SSO 令牌进行已验证的 API 调用
    config := client.NewConfiguration()
    apiClient := client.NewAPIClient(config)

    response, httpResp, err := apiClient.PublicAPI.GetCommentsPublic(
        context.Background(),
        "your-tenant-id",
    ).UrlId("your-page-url-id").Sso(token).Execute()

    if err != nil {
        panic(err)
    }

    fmt.Printf("Status: %d\n", httpResp.StatusCode)
    fmt.Printf("Comments: %+v\n", response)
}

Aggregate Internal Link


通过对文档进行分组(如果提供了 groupBy)并应用多个操作来聚合文档。支持不同的操作(例如 sum、countDistinct、avg 等)。

参数

名称类型位置必需描述
tenantIdstringquery是
parentTenantIdstringquery否
includeStatsbooleanquery否

响应

返回:AggregateResponse

示例

聚合示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 aggregationRequest := *openapiclient.NewAggregationRequest("ResourceName_example", []openapiclient.AggregationOperation{*openapiclient.NewAggregationOperation("Field_example", openapiclient.AggregationOpType("sum"))}) // AggregationRequest |
14 parentTenantId := "parentTenantId_example" // string | (可选)
15 includeStats := true // bool | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.DefaultAPI.Aggregate(context.Background()).TenantId(tenantId).AggregationRequest(aggregationRequest).ParentTenantId(parentTenantId).IncludeStats(includeStats).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.Aggregate``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // 来自 `Aggregate` 的响应: AggregateResponse
25 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.Aggregate`: %v\n", resp)
26}
27

GetAuditLogs Internal Link

参数

名称类型位置是否必需描述
tenantIdstringquery是
limitnumberquery否
skipnumberquery否
orderstringquery否
afternumberquery否
beforenumberquery否

响应

返回: GetAuditLogsResponse

示例

GetAuditLogs 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 limit := float64(1.2) // float64 | (可选)
14 skip := float64(1.2) // float64 | (可选)
15 order := openapiclient.SORT_DIR("ASC") // SORTDIR | (可选)
16 after := float64(1.2) // float64 | (可选)
17 before := float64(1.2) // float64 | (可选)
18
19 configuration := openapiclient.NewConfiguration()
20 apiClient := openapiclient.NewAPIClient(configuration)
21 resp, r, err := apiClient.DefaultAPI.GetAuditLogs(context.Background()).TenantId(tenantId).Limit(limit).Skip(skip).Order(order).After(after).Before(before).Execute()
22 if err != nil {
23 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetAuditLogs``: %v\n", err)
24 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
25 }
26 // 来自 `GetAuditLogs` 的响应: GetAuditLogsResponse
27 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetAuditLogs`: %v\n", resp)
28}
29

LogoutPublic Internal Link

响应

返回:APIEmptyResponse

示例

LogoutPublic 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12
13 configuration := openapiclient.NewConfiguration()
14 apiClient := openapiclient.NewAPIClient(configuration)
15 resp, r, err := apiClient.PublicAPI.LogoutPublic(context.Background()).Execute()
16 if err != nil {
17 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.LogoutPublic``: %v\n", err)
18 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
19 }
20 // response from `LogoutPublic`: APIEmptyResponse
21 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.LogoutPublic`: %v\n", resp)
22}
23

BlockFromCommentPublic Internal Link


参数

NameTypeLocationRequiredDescription
tenantIdstringqueryYes
commentIdstringpathYes
ssostringqueryNo

响应

返回: BlockSuccess

示例

BlockFromCommentPublic 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string |
14 publicBlockFromCommentParams := *openapiclient.NewPublicBlockFromCommentParams([]string{"CommentIds_example"}) // PublicBlockFromCommentParams |
15 sso := "sso_example" // string | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.PublicAPI.BlockFromCommentPublic(context.Background(), commentId).TenantId(tenantId).PublicBlockFromCommentParams(publicBlockFromCommentParams).Sso(sso).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.BlockFromCommentPublic``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // 来自 `BlockFromCommentPublic` 的响应:BlockSuccess
25 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.BlockFromCommentPublic`: %v\n", resp)
26}
27

UnBlockCommentPublic Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
commentIdstringpath是
ssostringquery否

响应

返回: UnblockSuccess

示例

UnBlockCommentPublic 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string |
14 publicBlockFromCommentParams := *openapiclient.NewPublicBlockFromCommentParams([]string{"CommentIds_example"}) // PublicBlockFromCommentParams |
15 sso := "sso_example" // string | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.PublicAPI.UnBlockCommentPublic(context.Background(), commentId).TenantId(tenantId).PublicBlockFromCommentParams(publicBlockFromCommentParams).Sso(sso).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.UnBlockCommentPublic``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // 来自 `UnBlockCommentPublic` 的响应: UnblockSuccess
25 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.UnBlockCommentPublic`: %v\n", resp)
26}
27

CheckedCommentsForBlocked Internal Link

参数

名称类型位于必需描述
tenantIdstringquery是
commentIdsstringquery是以逗号分隔的评论 ID 列表。
ssostringquery否

响应

返回:CheckBlockedCommentsResponse

示例

CheckedCommentsForBlocked 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentIds := "commentIds_example" // string | 以逗号分隔的评论 ID 列表。
14 sso := "sso_example" // string | (可选)
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.PublicAPI.CheckedCommentsForBlocked(context.Background()).TenantId(tenantId).CommentIds(commentIds).Sso(sso).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.CheckedCommentsForBlocked``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `CheckedCommentsForBlocked` 的响应:CheckBlockedCommentsResponse
24 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.CheckedCommentsForBlocked`: %v\n", resp)
25}
26

BlockUserFromComment Internal Link


参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
idstringpath是
userIdstringquery否
anonUserIdstringquery否

响应

返回: BlockSuccess

示例

BlockUserFromComment 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14 blockFromCommentParams := *openapiclient.NewBlockFromCommentParams() // BlockFromCommentParams |
15 userId := "userId_example" // string | (可选)
16 anonUserId := "anonUserId_example" // string | (可选)
17
18 configuration := openapiclient.NewConfiguration()
19 apiClient := openapiclient.NewAPIClient(configuration)
20 resp, r, err := apiClient.DefaultAPI.BlockUserFromComment(context.Background(), id).TenantId(tenantId).BlockFromCommentParams(blockFromCommentParams).UserId(userId).AnonUserId(anonUserId).Execute()
21 if err != nil {
22 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.BlockUserFromComment``: %v\n", err)
23 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
24 }
25 // 来自 `BlockUserFromComment` 的响应: BlockSuccess
26 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.BlockUserFromComment`: %v\n", resp)
27}
28

CreateCommentPublic Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringpathYes
urlIdstringqueryYes
broadcastIdstringqueryYes
sessionIdstringqueryNo
ssostringqueryNo

响应

返回: SaveCommentsResponseWithPresence

示例

CreateCommentPublic 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 urlId := "urlId_example" // string |
14 broadcastId := "broadcastId_example" // string |
15 commentData := *openapiclient.NewCommentData("CommenterName_example", "Comment_example", "Url_example", "UrlId_example") // CommentData |
16 sessionId := "sessionId_example" // string | (可选)
17 sso := "sso_example" // string | (可选)
18
19 configuration := openapiclient.NewConfiguration()
20 apiClient := openapiclient.NewAPIClient(configuration)
21 resp, r, err := apiClient.PublicAPI.CreateCommentPublic(context.Background(), tenantId).UrlId(urlId).BroadcastId(broadcastId).CommentData(commentData).SessionId(sessionId).Sso(sso).Execute()
22 if err != nil {
23 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.CreateCommentPublic``: %v\n", err)
24 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
25 }
26 // 来自 `CreateCommentPublic` 的响应:SaveCommentsResponseWithPresence
27 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.CreateCommentPublic`: %v\n", resp)
28}
29

DeleteComment Internal Link


参数

名称类型位置必需描述
tenantIdstringquery是
idstringpath是
contextUserIdstringquery否
isLivebooleanquery否

响应

返回:DeleteCommentResult

示例

DeleteComment 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14 contextUserId := "contextUserId_example" // string | (可选)
15 isLive := true // bool | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.DefaultAPI.DeleteComment(context.Background(), id).TenantId(tenantId).ContextUserId(contextUserId).IsLive(isLive).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.DeleteComment``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // 来自 `DeleteComment` 的响应: DeleteCommentResult
25 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.DeleteComment`: %v\n", resp)
26}
27

DeleteCommentPublic Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringpath是
commentIdstringpath是
broadcastIdstringquery是
editKeystringquery否
ssostringquery否

响应

返回: PublicAPIDeleteCommentResponse

示例

DeleteCommentPublic 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string |
14 broadcastId := "broadcastId_example" // string |
15 editKey := "editKey_example" // string | (可选)
16 sso := "sso_example" // string | (可选)
17
18 configuration := openapiclient.NewConfiguration()
19 apiClient := openapiclient.NewAPIClient(configuration)
20 resp, r, err := apiClient.PublicAPI.DeleteCommentPublic(context.Background(), tenantId, commentId).BroadcastId(broadcastId).EditKey(editKey).Sso(sso).Execute()
21 if err != nil {
22 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.DeleteCommentPublic``: %v\n", err)
23 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
24 }
25 // 来自 `DeleteCommentPublic` 的响应:PublicAPIDeleteCommentResponse
26 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.DeleteCommentPublic`: %v\n", resp)
27}
28

DeleteCommentVote Internal Link

参数

名称类型位置必需描述
tenantIdstringpath是
commentIdstringpath是
voteIdstringpath是
urlIdstringquery是
broadcastIdstringquery是
editKeystringquery否
ssostringquery否

响应

返回:VoteDeleteResponse

示例

DeleteCommentVote 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string |
14 voteId := "voteId_example" // string |
15 urlId := "urlId_example" // string |
16 broadcastId := "broadcastId_example" // string |
17 editKey := "editKey_example" // string | (可选)
18 sso := "sso_example" // string | (可选)
19
20 configuration := openapiclient.NewConfiguration()
21 apiClient := openapiclient.NewAPIClient(configuration)
22 resp, r, err := apiClient.PublicAPI.DeleteCommentVote(context.Background(), tenantId, commentId, voteId).UrlId(urlId).BroadcastId(broadcastId).EditKey(editKey).Sso(sso).Execute()
23 if err != nil {
24 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.DeleteCommentVote``: %v\n", err)
25 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
26 }
27 // 来自 `DeleteCommentVote` 的响应: VoteDeleteResponse
28 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.DeleteCommentVote`: %v\n", resp)
29}
30

FlagComment Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringqueryYes
idstringpathYes
userIdstringqueryNo
anonUserIdstringqueryNo

响应

返回:FlagCommentResponse

示例

FlagComment 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14 userId := "userId_example" // string | (可选)
15 anonUserId := "anonUserId_example" // string | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.DefaultAPI.FlagComment(context.Background(), id).TenantId(tenantId).UserId(userId).AnonUserId(anonUserId).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.FlagComment``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // 来自 `FlagComment` 的响应: FlagCommentResponse
25 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.FlagComment`: %v\n", resp)
26}
27

GetComment Internal Link

参数

名称类型位置必填描述
tenantIdstringquery是
idstringpath是

响应

返回: APIGetCommentResponse

示例

GetComment 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.GetComment(context.Background(), id).TenantId(tenantId).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetComment``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `GetComment` 的响应: APIGetCommentResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetComment`: %v\n", resp)
24}
25

GetComments Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
pageintegerquery否
limitintegerquery否
skipintegerquery否
asTreebooleanquery否
skipChildrenintegerquery否
limitChildrenintegerquery否
maxTreeDepthintegerquery否
urlIdstringquery否
userIdstringquery否
anonUserIdstringquery否
contextUserIdstringquery否
hashTagstringquery否
parentIdstringquery否
directionstringquery否
fromDateintegerquery否
toDateintegerquery否

响应

返回: APIGetCommentsResponse

示例

GetComments 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 page := int32(56) // int32 | (可选)
14 limit := int32(56) // int32 | (可选)
15 skip := int32(56) // int32 | (可选)
16 asTree := true // bool | (可选)
17 skipChildren := int32(56) // int32 | (可选)
18 limitChildren := int32(56) // int32 | (可选)
19 maxTreeDepth := int32(56) // int32 | (可选)
20 urlId := "urlId_example" // string | (可选)
21 userId := "userId_example" // string | (可选)
22 anonUserId := "anonUserId_example" // string | (可选)
23 contextUserId := "contextUserId_example" // string | (可选)
24 hashTag := "hashTag_example" // string | (可选)
25 parentId := "parentId_example" // string | (可选)
26 direction := openapiclient.SortDirections("OF") // SortDirections | (可选)
27 fromDate := int64(789) // int64 | (可选)
28 toDate := int64(789) // int64 | (可选)
29
30 configuration := openapiclient.NewConfiguration()
31 apiClient := openapiclient.NewAPIClient(configuration)
32 resp, r, err := apiClient.DefaultAPI.GetComments(context.Background()).TenantId(tenantId).Page(page).Limit(limit).Skip(skip).AsTree(asTree).SkipChildren(skipChildren).LimitChildren(limitChildren).MaxTreeDepth(maxTreeDepth).UrlId(urlId).UserId(userId).AnonUserId(anonUserId).ContextUserId(contextUserId).HashTag(hashTag).ParentId(parentId).Direction(direction).FromDate(fromDate).ToDate(toDate).Execute()
33 if err != nil {
34 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetComments``: %v\n", err)
35 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
36 }
37 // 来自 `GetComments` 的响应:APIGetCommentsResponse
38 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetComments`: %v\n", resp)
39}
40

GetCommentsPublic Internal Link

req tenantId urlId

参数

NameTypeLocationRequiredDescription
tenantIdstringpath是
urlIdstringquery是
pageintegerquery否
directionstringquery否
ssostringquery否
skipintegerquery否
skipChildrenintegerquery否
limitintegerquery否
limitChildrenintegerquery否
countChildrenbooleanquery否
fetchPageForCommentIdstringquery否
includeConfigbooleanquery否
countAllbooleanquery否
includei10nbooleanquery否
localestringquery否
modulesstringquery否
isCrawlerbooleanquery否
includeNotificationCountbooleanquery否
asTreebooleanquery否
maxTreeDepthintegerquery否
useFullTranslationIdsbooleanquery否
parentIdstringquery否
searchTextstringquery否
hashTagsarrayquery否
userIdstringquery否
customConfigStrstringquery否
afterCommentIdstringquery否
beforeCommentIdstringquery否

响应

返回: GetCommentsResponseWithPresencePublicComment

示例

GetCommentsPublic 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 urlId := "urlId_example" // string |
14 page := int32(56) // int32 | (可选)
15 direction := openapiclient.SortDirections("OF") // SortDirections | (可选)
16 sso := "sso_example" // string | (可选)
17 skip := int32(56) // int32 | (可选)
18 skipChildren := int32(56) // int32 | (可选)
19 limit := int32(56) // int32 | (可选)
20 limitChildren := int32(56) // int32 | (可选)
21 countChildren := true // bool | (可选)
22 fetchPageForCommentId := "fetchPageForCommentId_example" // string | (可选)
23 includeConfig := true // bool | (可选)
24 countAll := true // bool | (可选)
25 includei10n := true // bool | (可选)
26 locale := "locale_example" // string | (可选)
27 modules := "modules_example" // string | (可选)
28 isCrawler := true // bool | (可选)
29 includeNotificationCount := true // bool | (可选)
30 asTree := true // bool | (可选)
31 maxTreeDepth := int32(56) // int32 | (可选)
32 useFullTranslationIds := true // bool | (可选)
33 parentId := "parentId_example" // string | (可选)
34 searchText := "searchText_example" // string | (可选)
35 hashTags := []string{"Inner_example"} // []string | (可选)
36 userId := "userId_example" // string | (可选)
37 customConfigStr := "customConfigStr_example" // string | (可选)
38 afterCommentId := "afterCommentId_example" // string | (可选)
39 beforeCommentId := "beforeCommentId_example" // string | (可选)
40
41 configuration := openapiclient.NewConfiguration()
42 apiClient := openapiclient.NewAPIClient(configuration)
43 resp, r, err := apiClient.PublicAPI.GetCommentsPublic(context.Background(), tenantId).UrlId(urlId).Page(page).Direction(direction).Sso(sso).Skip(skip).SkipChildren(skipChildren).Limit(limit).LimitChildren(limitChildren).CountChildren(countChildren).FetchPageForCommentId(fetchPageForCommentId).IncludeConfig(includeConfig).CountAll(countAll).Includei10n(includei10n).Locale(locale).Modules(modules).IsCrawler(isCrawler).IncludeNotificationCount(includeNotificationCount).AsTree(asTree).MaxTreeDepth(maxTreeDepth).UseFullTranslationIds(useFullTranslationIds).ParentId(parentId).SearchText(searchText).HashTags(hashTags).UserId(userId).CustomConfigStr(customConfigStr).AfterCommentId(afterCommentId).BeforeCommentId(beforeCommentId).Execute()
44 if err != nil {
45 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.GetCommentsPublic``: %v\n", err)
46 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
47 }
48 // 来自 `GetCommentsPublic` 的响应: GetCommentsResponseWithPresencePublicComment
49 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.GetCommentsPublic`: %v\n", resp)
50}
51

GetCommentText Internal Link

参数

名称类型位置必需描述
tenantIdstringpath是
commentIdstringpath是
editKeystringquery否
ssostringquery否

响应

返回: PublicAPIGetCommentTextResponse

示例

GetCommentText 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string |
14 editKey := "editKey_example" // string | (可选)
15 sso := "sso_example" // string | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.PublicAPI.GetCommentText(context.Background(), tenantId, commentId).EditKey(editKey).Sso(sso).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.GetCommentText``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // 来自 `GetCommentText` 的响应: PublicAPIGetCommentTextResponse
25 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.GetCommentText`: %v\n", resp)
26}
27

GetCommentVoteUserNames Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringpath是
commentIdstringpath是
dirintegerquery是
ssostringquery否

响应

返回: GetCommentVoteUserNamesSuccessResponse

示例

GetCommentVoteUserNames 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string |
14 dir := int32(56) // int32 |
15 sso := "sso_example" // string | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.PublicAPI.GetCommentVoteUserNames(context.Background(), tenantId, commentId).Dir(dir).Sso(sso).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.GetCommentVoteUserNames``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // 来自 `GetCommentVoteUserNames` 的响应: GetCommentVoteUserNamesSuccessResponse
25 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.GetCommentVoteUserNames`: %v\n", resp)
26}
27

LockComment Internal Link

参数

名称类型位置必需描述
tenantIdstring路径是
commentIdstring路径是
broadcastIdstring查询是
ssostring查询否

响应

返回: APIEmptyResponse

示例

LockComment 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string |
14 broadcastId := "broadcastId_example" // string |
15 sso := "sso_example" // string | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.PublicAPI.LockComment(context.Background(), tenantId, commentId).BroadcastId(broadcastId).Sso(sso).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.LockComment``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // 来自 `LockComment` 的响应: APIEmptyResponse
25 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.LockComment`: %v\n", resp)
26}
27

PinComment Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringpath是
commentIdstringpath是
broadcastIdstringquery是
ssostringquery否

响应

返回: ChangeCommentPinStatusResponse

示例

PinComment 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string |
14 broadcastId := "broadcastId_example" // string |
15 sso := "sso_example" // string | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.PublicAPI.PinComment(context.Background(), tenantId, commentId).BroadcastId(broadcastId).Sso(sso).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.PinComment``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // `PinComment` 的响应:ChangeCommentPinStatusResponse
25 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.PinComment`: %v\n", resp)
26}
27

SaveComment Internal Link

参数

名称类型Location必需描述
tenantIdstringquery是
isLivebooleanquery否
doSpamCheckbooleanquery否
sendEmailsbooleanquery否
populateNotificationsbooleanquery否

响应

返回: APISaveCommentResponse

示例

SaveComment 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 createCommentParams := *openapiclient.NewCreateCommentParams("CommenterName_example", "Comment_example", "Url_example", "UrlId_example", "Locale_example") // CreateCommentParams |
14 isLive := true // bool | (可选)
15 doSpamCheck := true // bool | (可选)
16 sendEmails := true // bool | (可选)
17 populateNotifications := true // bool | (可选)
18
19 configuration := openapiclient.NewConfiguration()
20 apiClient := openapiclient.NewAPIClient(configuration)
21 resp, r, err := apiClient.DefaultAPI.SaveComment(context.Background()).TenantId(tenantId).CreateCommentParams(createCommentParams).IsLive(isLive).DoSpamCheck(doSpamCheck).SendEmails(sendEmails).PopulateNotifications(populateNotifications).Execute()
22 if err != nil {
23 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.SaveComment``: %v\n", err)
24 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
25 }
26 // 来自 `SaveComment` 的响应:APISaveCommentResponse
27 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.SaveComment`: %v\n", resp)
28}
29

SaveCommentsBulk Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
isLivebooleanquery否
doSpamCheckbooleanquery否
sendEmailsbooleanquery否
populateNotificationsbooleanquery否

响应

返回: []SaveCommentsBulkResponse

示例

SaveCommentsBulk 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 createCommentParams := []openapiclient.CreateCommentParams{*openapiclient.NewCreateCommentParams("CommenterName_example", "Comment_example", "Url_example", "UrlId_example", "Locale_example")} // []CreateCommentParams |
14 isLive := true // bool | (可选)
15 doSpamCheck := true // bool | (可选)
16 sendEmails := true // bool | (可选)
17 populateNotifications := true // bool | (可选)
18
19 configuration := openapiclient.NewConfiguration()
20 apiClient := openapiclient.NewAPIClient(configuration)
21 resp, r, err := apiClient.DefaultAPI.SaveCommentsBulk(context.Background()).TenantId(tenantId).CreateCommentParams(createCommentParams).IsLive(isLive).DoSpamCheck(doSpamCheck).SendEmails(sendEmails).PopulateNotifications(populateNotifications).Execute()
22 if err != nil {
23 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.SaveCommentsBulk``: %v\n", err)
24 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
25 }
26 // 来自 `SaveCommentsBulk` 的响应: []SaveCommentsBulkResponse
27 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.SaveCommentsBulk`: %v\n", resp)
28}
29

SetCommentText Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstring路径是
commentIdstring路径是
broadcastIdstring查询是
editKeystring查询否
ssostring查询否

响应

返回:PublicAPISetCommentTextResponse

示例

SetCommentText 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string |
14 broadcastId := "broadcastId_example" // string |
15 commentTextUpdateRequest := *openapiclient.NewCommentTextUpdateRequest("Comment_example") // CommentTextUpdateRequest |
16 editKey := "editKey_example" // string | (可选)
17 sso := "sso_example" // string | (可选)
18
19 configuration := openapiclient.NewConfiguration()
20 apiClient := openapiclient.NewAPIClient(configuration)
21 resp, r, err := apiClient.PublicAPI.SetCommentText(context.Background(), tenantId, commentId).BroadcastId(broadcastId).CommentTextUpdateRequest(commentTextUpdateRequest).EditKey(editKey).Sso(sso).Execute()
22 if err != nil {
23 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.SetCommentText``: %v\n", err)
24 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
25 }
26 // 来自 `SetCommentText` 的响应: PublicAPISetCommentTextResponse
27 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.SetCommentText`: %v\n", resp)
28}
29

UnBlockUserFromComment Internal Link

参数

名称类型位置必需描述
tenantIdstringquery是
idstringpath是
userIdstringquery否
anonUserIdstringquery否

响应

返回: UnblockSuccess

示例

UnBlockUserFromComment 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14 unBlockFromCommentParams := *openapiclient.NewUnBlockFromCommentParams() // UnBlockFromCommentParams |
15 userId := "userId_example" // string | (可选)
16 anonUserId := "anonUserId_example" // string | (可选)
17
18 configuration := openapiclient.NewConfiguration()
19 apiClient := openapiclient.NewAPIClient(configuration)
20 resp, r, err := apiClient.DefaultAPI.UnBlockUserFromComment(context.Background(), id).TenantId(tenantId).UnBlockFromCommentParams(unBlockFromCommentParams).UserId(userId).AnonUserId(anonUserId).Execute()
21 if err != nil {
22 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.UnBlockUserFromComment``: %v\n", err)
23 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
24 }
25 // 来自 `UnBlockUserFromComment` 的响应: UnblockSuccess
26 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.UnBlockUserFromComment`: %v\n", resp)
27}
28

UnFlagComment Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
idstringpath是
userIdstringquery否
anonUserIdstringquery否

响应

返回: FlagCommentResponse

示例

UnFlagComment 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14 userId := "userId_example" // string | (可选)
15 anonUserId := "anonUserId_example" // string | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.DefaultAPI.UnFlagComment(context.Background(), id).TenantId(tenantId).UserId(userId).AnonUserId(anonUserId).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.UnFlagComment``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // 来自 `UnFlagComment` 的响应: FlagCommentResponse
25 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.UnFlagComment`: %v\n", resp)
26}
27

UnLockComment Internal Link


参数

名称类型位置必需描述
tenantIdstring路径是
commentIdstring路径是
broadcastIdstring查询是
ssostring查询否

响应

返回: APIEmptyResponse

示例

UnLockComment 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string |
14 broadcastId := "broadcastId_example" // string |
15 sso := "sso_example" // string | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.PublicAPI.UnLockComment(context.Background(), tenantId, commentId).BroadcastId(broadcastId).Sso(sso).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.UnLockComment``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // 来自 `UnLockComment` 的响应:APIEmptyResponse
25 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.UnLockComment`: %v\n", resp)
26}
27

UnPinComment Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringpath是
commentIdstringpath是
broadcastIdstringquery是
ssostringquery否

响应

返回: ChangeCommentPinStatusResponse

示例

UnPinComment 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string |
14 broadcastId := "broadcastId_example" // string |
15 sso := "sso_example" // string | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.PublicAPI.UnPinComment(context.Background(), tenantId, commentId).BroadcastId(broadcastId).Sso(sso).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.UnPinComment``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // 来自 `UnPinComment` 的响应: ChangeCommentPinStatusResponse
25 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.UnPinComment`: %v\n", resp)
26}
27

UpdateComment Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
idstringpath是
contextUserIdstringquery否
doSpamCheckbooleanquery否
isLivebooleanquery否

响应

返回: APIEmptyResponse

示例

UpdateComment 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14 updatableCommentParams := *openapiclient.NewUpdatableCommentParams() // UpdatableCommentParams |
15 contextUserId := "contextUserId_example" // string | (可选)
16 doSpamCheck := true // bool | (可选)
17 isLive := true // bool | (可选)
18
19 configuration := openapiclient.NewConfiguration()
20 apiClient := openapiclient.NewAPIClient(configuration)
21 resp, r, err := apiClient.DefaultAPI.UpdateComment(context.Background(), id).TenantId(tenantId).UpdatableCommentParams(updatableCommentParams).ContextUserId(contextUserId).DoSpamCheck(doSpamCheck).IsLive(isLive).Execute()
22 if err != nil {
23 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.UpdateComment``: %v\n", err)
24 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
25 }
26 // 来自 `UpdateComment` 的响应: APIEmptyResponse
27 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.UpdateComment`: %v\n", resp)
28}
29

VoteComment Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringpathYes
commentIdstringpathYes
urlIdstringqueryYes
broadcastIdstringqueryYes
sessionIdstringqueryNo
ssostringqueryNo

响应

返回: VoteResponse

示例

VoteComment 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string |
14 urlId := "urlId_example" // string |
15 broadcastId := "broadcastId_example" // string |
16 voteBodyParams := *openapiclient.NewVoteBodyParams("CommenterEmail_example", "CommenterName_example", "VoteDir_example", "Url_example") // VoteBodyParams |
17 sessionId := "sessionId_example" // string | (可选)
18 sso := "sso_example" // string | (可选)
19
20 configuration := openapiclient.NewConfiguration()
21 apiClient := openapiclient.NewAPIClient(configuration)
22 resp, r, err := apiClient.PublicAPI.VoteComment(context.Background(), tenantId, commentId).UrlId(urlId).BroadcastId(broadcastId).VoteBodyParams(voteBodyParams).SessionId(sessionId).Sso(sso).Execute()
23 if err != nil {
24 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.VoteComment``: %v\n", err)
25 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
26 }
27 // 来自 `VoteComment` 的响应: VoteResponse
28 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.VoteComment`: %v\n", resp)
29}
30

GetCommentsForUser Internal Link


参数

NameTypeLocationRequiredDescription
userIdstringqueryNo
directionstringqueryNo
repliesToUserIdstringqueryNo
pagenumberqueryNo
includei10nbooleanqueryNo
localestringqueryNo
isCrawlerbooleanqueryNo

响应

返回: GetCommentsForUserResponse

示例

GetCommentsForUser 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 userId := "userId_example" // string | (可选)
13 direction := openapiclient.SortDirections("OF") // SortDirections | (可选)
14 repliesToUserId := "repliesToUserId_example" // string | (可选)
15 page := float64(1.2) // float64 | (可选)
16 includei10n := true // bool | (可选)
17 locale := "locale_example" // string | (可选)
18 isCrawler := true // bool | (可选)
19
20 configuration := openapiclient.NewConfiguration()
21 apiClient := openapiclient.NewAPIClient(configuration)
22 resp, r, err := apiClient.PublicAPI.GetCommentsForUser(context.Background()).UserId(userId).Direction(direction).RepliesToUserId(repliesToUserId).Page(page).Includei10n(includei10n).Locale(locale).IsCrawler(isCrawler).Execute()
23 if err != nil {
24 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.GetCommentsForUser``: %v\n", err)
25 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
26 }
27 // 来自 `GetCommentsForUser` 的响应: GetCommentsForUserResponse
28 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.GetCommentsForUser`: %v\n", resp)
29}
30

AddDomainConfig Internal Link

参数

名称类型位置必填描述
tenantIdstringquery是

响应

返回:AddDomainConfigResponse

示例

AddDomainConfig 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 addDomainConfigParams := *openapiclient.NewAddDomainConfigParams("Domain_example") // AddDomainConfigParams |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.AddDomainConfig(context.Background()).TenantId(tenantId).AddDomainConfigParams(addDomainConfigParams).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.AddDomainConfig``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `AddDomainConfig` 的响应: AddDomainConfigResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.AddDomainConfig`: %v\n", resp)
24}
25

DeleteDomainConfig Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringqueryYes
domainstringpathYes

响应

返回: DeleteDomainConfigResponse

示例

DeleteDomainConfig 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 domain := "domain_example" // string |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.DeleteDomainConfig(context.Background(), domain).TenantId(tenantId).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.DeleteDomainConfig``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `DeleteDomainConfig` 的响应: DeleteDomainConfigResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.DeleteDomainConfig`: %v\n", resp)
24}
25

GetDomainConfig Internal Link

参数

名称TypeLocation必需描述
tenantIdstringquery是
domainstringpath是

响应

返回: GetDomainConfigResponse

示例

GetDomainConfig 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 domain := "domain_example" // string |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.GetDomainConfig(context.Background(), domain).TenantId(tenantId).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetDomainConfig``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `GetDomainConfig` 的响应: GetDomainConfigResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetDomainConfig`: %v\n", resp)
24}
25

GetDomainConfigs Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是

响应

返回: GetDomainConfigsResponse

示例

GetDomainConfigs 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13
14 configuration := openapiclient.NewConfiguration()
15 apiClient := openapiclient.NewAPIClient(configuration)
16 resp, r, err := apiClient.DefaultAPI.GetDomainConfigs(context.Background()).TenantId(tenantId).Execute()
17 if err != nil {
18 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetDomainConfigs``: %v\n", err)
19 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
20 }
21 // 来自 `GetDomainConfigs` 的响应: GetDomainConfigsResponse
22 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetDomainConfigs`: %v\n", resp)
23}
24

PatchDomainConfig Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringqueryYes
domainToUpdatestringpathYes

响应

返回: PatchDomainConfigResponse

示例

PatchDomainConfig 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 domainToUpdate := "domainToUpdate_example" // string |
14 patchDomainConfigParams := *openapiclient.NewPatchDomainConfigParams() // PatchDomainConfigParams |
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.DefaultAPI.PatchDomainConfig(context.Background(), domainToUpdate).TenantId(tenantId).PatchDomainConfigParams(patchDomainConfigParams).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.PatchDomainConfig``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `PatchDomainConfig` 的响应: PatchDomainConfigResponse
24 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.PatchDomainConfig`: %v\n", resp)
25}
26

PutDomainConfig Internal Link

参数

名称类型位置必需描述
tenantIdstringquery是
domainToUpdatestringpath是

响应

返回: PutDomainConfigResponse

示例

PutDomainConfig 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 domainToUpdate := "domainToUpdate_example" // string |
14 updateDomainConfigParams := *openapiclient.NewUpdateDomainConfigParams("Domain_example") // UpdateDomainConfigParams |
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.DefaultAPI.PutDomainConfig(context.Background(), domainToUpdate).TenantId(tenantId).UpdateDomainConfigParams(updateDomainConfigParams).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.PutDomainConfig``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `PutDomainConfig` 的响应: PutDomainConfigResponse
24 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.PutDomainConfig`: %v\n", resp)
25}
26

CreateEmailTemplate Internal Link

参数

名称类型位置必需描述
tenantIdstringquery是

响应

返回: CreateEmailTemplateResponse

示例

CreateEmailTemplate 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 createEmailTemplateBody := *openapiclient.NewCreateEmailTemplateBody("EmailTemplateId_example", "DisplayName_example", "Ejs_example") // CreateEmailTemplateBody |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.CreateEmailTemplate(context.Background()).TenantId(tenantId).CreateEmailTemplateBody(createEmailTemplateBody).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.CreateEmailTemplate``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // response from `CreateEmailTemplate`: CreateEmailTemplateResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.CreateEmailTemplate`: %v\n", resp)
24}
25

DeleteEmailTemplate Internal Link

参数

名称类型位置必填描述
tenantIdstringquery是
idstringpath是

响应

返回: APIEmptyResponse

示例

DeleteEmailTemplate 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // 字符串 |
13 id := "id_example" // 字符串 |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.DeleteEmailTemplate(context.Background(), id).TenantId(tenantId).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.DeleteEmailTemplate``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `DeleteEmailTemplate` 的响应: APIEmptyResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.DeleteEmailTemplate`: %v\n", resp)
24}
25

DeleteEmailTemplateRenderError Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringqueryYes
idstringpathYes
errorIdstringpathYes

响应

返回: APIEmptyResponse

示例

DeleteEmailTemplateRenderError 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14 errorId := "errorId_example" // string |
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.DefaultAPI.DeleteEmailTemplateRenderError(context.Background(), id, errorId).TenantId(tenantId).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.DeleteEmailTemplateRenderError``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `DeleteEmailTemplateRenderError` 的响应: APIEmptyResponse
24 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.DeleteEmailTemplateRenderError`: %v\n", resp)
25}
26

GetEmailTemplate Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
idstringpath是

响应

返回: GetEmailTemplateResponse

示例

GetEmailTemplate 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.GetEmailTemplate(context.Background(), id).TenantId(tenantId).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetEmailTemplate``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `GetEmailTemplate` 的响应: GetEmailTemplateResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetEmailTemplate`: %v\n", resp)
24}
25

GetEmailTemplateDefinitions Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是

响应

返回: GetEmailTemplateDefinitionsResponse

示例

GetEmailTemplateDefinitions 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13
14 configuration := openapiclient.NewConfiguration()
15 apiClient := openapiclient.NewAPIClient(configuration)
16 resp, r, err := apiClient.DefaultAPI.GetEmailTemplateDefinitions(context.Background()).TenantId(tenantId).Execute()
17 if err != nil {
18 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetEmailTemplateDefinitions``: %v\n", err)
19 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
20 }
21 // 来自 `GetEmailTemplateDefinitions` 的响应: GetEmailTemplateDefinitionsResponse
22 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetEmailTemplateDefinitions`: %v\n", resp)
23}
24

GetEmailTemplateRenderErrors Internal Link

参数

名称类型位置必需描述
tenantIdstringquery是
idstringpath是
skipnumberquery否

响应

返回: GetEmailTemplateRenderErrorsResponse

示例

GetEmailTemplateRenderErrors 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14 skip := float64(1.2) // float64 | (可选)
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.DefaultAPI.GetEmailTemplateRenderErrors(context.Background(), id).TenantId(tenantId).Skip(skip).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetEmailTemplateRenderErrors``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `GetEmailTemplateRenderErrors` 的响应: GetEmailTemplateRenderErrorsResponse
24 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetEmailTemplateRenderErrors`: %v\n", resp)
25}
26

GetEmailTemplates Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
skipnumberquery否

响应

返回: GetEmailTemplatesResponse

示例

GetEmailTemplates 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 skip := float64(1.2) // float64 | (可选)
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.GetEmailTemplates(context.Background()).TenantId(tenantId).Skip(skip).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetEmailTemplates``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `GetEmailTemplates` 的响应: GetEmailTemplatesResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetEmailTemplates`: %v\n", resp)
24}
25

RenderEmailTemplate Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
localestringquery否

响应

返回: RenderEmailTemplateResponse

示例

RenderEmailTemplate 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 renderEmailTemplateBody := *openapiclient.NewRenderEmailTemplateBody("EmailTemplateId_example", "Ejs_example") // RenderEmailTemplateBody |
14 locale := "locale_example" // string | (可选)
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.DefaultAPI.RenderEmailTemplate(context.Background()).TenantId(tenantId).RenderEmailTemplateBody(renderEmailTemplateBody).Locale(locale).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.RenderEmailTemplate``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `RenderEmailTemplate` 的响应: RenderEmailTemplateResponse
24 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.RenderEmailTemplate`: %v\n", resp)
25}
26

UpdateEmailTemplate Internal Link

参数

名称类型位置必需描述
tenantIdstring查询是
idstring路径是

响应

返回:APIEmptyResponse

示例

UpdateEmailTemplate 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14 updateEmailTemplateBody := *openapiclient.NewUpdateEmailTemplateBody() // UpdateEmailTemplateBody |
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.DefaultAPI.UpdateEmailTemplate(context.Background(), id).TenantId(tenantId).UpdateEmailTemplateBody(updateEmailTemplateBody).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.UpdateEmailTemplate``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `UpdateEmailTemplate` 的响应: APIEmptyResponse
24 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.UpdateEmailTemplate`: %v\n", resp)
25}
26

GetEventLog Internal Link

req tenantId urlId userIdWS

参数

名称类型位置必填描述
tenantIdstringpath是
urlIdstringquery是
userIdWSstringquery是
startTimeintegerquery是
endTimeintegerquery否

响应

返回: GetEventLogResponse

示例

GetEventLog 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 urlId := "urlId_example" // string |
14 userIdWS := "userIdWS_example" // string |
15 startTime := int64(789) // int64 |
16 endTime := int64(789) // int64 | (可选)
17
18 configuration := openapiclient.NewConfiguration()
19 apiClient := openapiclient.NewAPIClient(configuration)
20 resp, r, err := apiClient.PublicAPI.GetEventLog(context.Background(), tenantId).UrlId(urlId).UserIdWS(userIdWS).StartTime(startTime).EndTime(endTime).Execute()
21 if err != nil {
22 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.GetEventLog``: %v\n", err)
23 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
24 }
25 // 来自 `GetEventLog` 的响应: GetEventLogResponse
26 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.GetEventLog`: %v\n", resp)
27}
28

GetGlobalEventLog Internal Link

req tenantId urlId userIdWS

参数

名称类型位置必填描述
tenantIdstringpath是
urlIdstringquery是
userIdWSstringquery是
startTimeintegerquery是
endTimeintegerquery否

响应

返回: GetEventLogResponse

示例

GetGlobalEventLog 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 urlId := "urlId_example" // string |
14 userIdWS := "userIdWS_example" // string |
15 startTime := int64(789) // int64 |
16 endTime := int64(789) // int64 | (可选)
17
18 configuration := openapiclient.NewConfiguration()
19 apiClient := openapiclient.NewAPIClient(configuration)
20 resp, r, err := apiClient.PublicAPI.GetGlobalEventLog(context.Background(), tenantId).UrlId(urlId).UserIdWS(userIdWS).StartTime(startTime).EndTime(endTime).Execute()
21 if err != nil {
22 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.GetGlobalEventLog``: %v\n", err)
23 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
24 }
25 // 来自 `GetGlobalEventLog` 的响应: GetEventLogResponse
26 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.GetGlobalEventLog`: %v\n", resp)
27}
28

CreateFeedPost Internal Link

参数

名称类型位置必填描述
tenantIdstringquery是
broadcastIdstringquery否
isLivebooleanquery否
doSpamCheckbooleanquery否
skipDupCheckbooleanquery否

响应

返回: CreateFeedPostsResponse

示例

CreateFeedPost 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 createFeedPostParams := *openapiclient.NewCreateFeedPostParams() // CreateFeedPostParams |
14 broadcastId := "broadcastId_example" // string | (可选)
15 isLive := true // bool | (可选)
16 doSpamCheck := true // bool | (可选)
17 skipDupCheck := true // bool | (可选)
18
19 configuration := openapiclient.NewConfiguration()
20 apiClient := openapiclient.NewAPIClient(configuration)
21 resp, r, err := apiClient.DefaultAPI.CreateFeedPost(context.Background()).TenantId(tenantId).CreateFeedPostParams(createFeedPostParams).BroadcastId(broadcastId).IsLive(isLive).DoSpamCheck(doSpamCheck).SkipDupCheck(skipDupCheck).Execute()
22 if err != nil {
23 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.CreateFeedPost``: %v\n", err)
24 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
25 }
26 // 来自 `CreateFeedPost` 的响应: CreateFeedPostsResponse
27 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.CreateFeedPost`: %v\n", resp)
28}
29

CreateFeedPostPublic Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringpath是
broadcastIdstringquery否
ssostringquery否

响应

返回: CreateFeedPostResponse

示例

CreateFeedPostPublic 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 createFeedPostParams := *openapiclient.NewCreateFeedPostParams() // CreateFeedPostParams |
14 broadcastId := "broadcastId_example" // string | (可选)
15 sso := "sso_example" // string | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.PublicAPI.CreateFeedPostPublic(context.Background(), tenantId).CreateFeedPostParams(createFeedPostParams).BroadcastId(broadcastId).Sso(sso).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.CreateFeedPostPublic``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // 来自 `CreateFeedPostPublic` 的响应: CreateFeedPostResponse
25 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.CreateFeedPostPublic`: %v\n", resp)
26}
27

DeleteFeedPostPublic Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringpath是
postIdstringpath是
broadcastIdstringquery否
ssostringquery否

响应

返回: DeleteFeedPostPublicResponse

示例

DeleteFeedPostPublic 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 postId := "postId_example" // string |
14 broadcastId := "broadcastId_example" // string | (可选)
15 sso := "sso_example" // string | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.PublicAPI.DeleteFeedPostPublic(context.Background(), tenantId, postId).BroadcastId(broadcastId).Sso(sso).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.DeleteFeedPostPublic``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // 来自 `DeleteFeedPostPublic` 的响应: DeleteFeedPostPublicResponse
25 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.DeleteFeedPostPublic`: %v\n", resp)
26}
27

GetFeedPosts Internal Link

请求 tenantId afterId

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
afterIdstringquery否
limitintegerquery否
tagsarrayquery否

响应

返回: GetFeedPostsResponse

示例

GetFeedPosts 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 afterId := "afterId_example" // string | (可选)
14 limit := int32(56) // int32 | (可选)
15 tags := []string{"Inner_example"} // []string | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.DefaultAPI.GetFeedPosts(context.Background()).TenantId(tenantId).AfterId(afterId).Limit(limit).Tags(tags).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetFeedPosts``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // 来自 `GetFeedPosts` 的响应: GetFeedPostsResponse
25 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetFeedPosts`: %v\n", resp)
26}
27

GetFeedPostsPublic Internal Link

req tenantId afterId

参数

名称类型位置是否必需描述
tenantIdstringpath是
afterIdstringquery否
limitintegerquery否
tagsarrayquery否
ssostringquery否
isCrawlerbooleanquery否
includeUserInfobooleanquery否

响应

返回: PublicFeedPostsResponse

示例

GetFeedPostsPublic 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 afterId := "afterId_example" // string | (可选)
14 limit := int32(56) // int32 | (可选)
15 tags := []string{"Inner_example"} // []string | (可选)
16 sso := "sso_example" // string | (可选)
17 isCrawler := true // bool | (可选)
18 includeUserInfo := true // bool | (可选)
19
20 configuration := openapiclient.NewConfiguration()
21 apiClient := openapiclient.NewAPIClient(configuration)
22 resp, r, err := apiClient.PublicAPI.GetFeedPostsPublic(context.Background(), tenantId).AfterId(afterId).Limit(limit).Tags(tags).Sso(sso).IsCrawler(isCrawler).IncludeUserInfo(includeUserInfo).Execute()
23 if err != nil {
24 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.GetFeedPostsPublic``: %v\n", err)
25 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
26 }
27 // 来自 `GetFeedPostsPublic` 的响应: PublicFeedPostsResponse
28 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.GetFeedPostsPublic`: %v\n", resp)
29}
30

GetFeedPostsStats Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringpath是
postIdsarrayquery是
ssostringquery否

响应

返回: FeedPostsStatsResponse

示例

GetFeedPostsStats 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 postIds := []string{"Inner_example"} // []string |
14 sso := "sso_example" // string | (可选)
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.PublicAPI.GetFeedPostsStats(context.Background(), tenantId).PostIds(postIds).Sso(sso).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.GetFeedPostsStats``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `GetFeedPostsStats` 的响应: FeedPostsStatsResponse
24 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.GetFeedPostsStats`: %v\n", resp)
25}
26

GetUserReactsPublic Internal Link

参数

名称类型位置必填描述
tenantIdstring路径是
postIdsarray查询否
ssostring查询否

响应

返回: UserReactsResponse

示例

GetUserReactsPublic 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 postIds := []string{"Inner_example"} // []string | (可选)
14 sso := "sso_example" // string | (可选)
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.PublicAPI.GetUserReactsPublic(context.Background(), tenantId).PostIds(postIds).Sso(sso).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.GetUserReactsPublic``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `GetUserReactsPublic` 的响应: UserReactsResponse
24 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.GetUserReactsPublic`: %v\n", resp)
25}
26

ReactFeedPostPublic Internal Link

参数

名称类型位置必填描述
tenantIdstringpath是
postIdstringpath是
isUndobooleanquery否
broadcastIdstringquery否
ssostringquery否

响应

返回:ReactFeedPostResponse

示例

ReactFeedPostPublic 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 postId := "postId_example" // string |
14 reactBodyParams := *openapiclient.NewReactBodyParams() // ReactBodyParams |
15 isUndo := true // bool | (可选)
16 broadcastId := "broadcastId_example" // string | (可选)
17 sso := "sso_example" // string | (可选)
18
19 configuration := openapiclient.NewConfiguration()
20 apiClient := openapiclient.NewAPIClient(configuration)
21 resp, r, err := apiClient.PublicAPI.ReactFeedPostPublic(context.Background(), tenantId, postId).ReactBodyParams(reactBodyParams).IsUndo(isUndo).BroadcastId(broadcastId).Sso(sso).Execute()
22 if err != nil {
23 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.ReactFeedPostPublic``: %v\n", err)
24 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
25 }
26 // 来自 `ReactFeedPostPublic` 的响应:ReactFeedPostResponse
27 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.ReactFeedPostPublic`: %v\n", resp)
28}
29

UpdateFeedPost Internal Link

参数

名称类型位置必填描述
tenantIdstringquery是
idstringpath是

响应

返回: APIEmptyResponse

示例

UpdateFeedPost 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 "time"
9 openapiclient "github.com/fastcomments/fastcomments-go/client"
10)
11
12func main() {
13 tenantId := "tenantId_example" // string |
14 id := "id_example" // string |
15 feedPost := *openapiclient.NewFeedPost("Id_example", "TenantId_example", time.Now()) // FeedPost |
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.DefaultAPI.UpdateFeedPost(context.Background(), id).TenantId(tenantId).FeedPost(feedPost).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.UpdateFeedPost``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // response from `UpdateFeedPost`: APIEmptyResponse
25 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.UpdateFeedPost`: %v\n", resp)
26}
27

UpdateFeedPostPublic Internal Link


参数

名称类型位置必需描述
tenantIdstringpath是
postIdstringpath是
broadcastIdstringquery否
ssostringquery否

响应

返回: CreateFeedPostResponse

示例

UpdateFeedPostPublic 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 postId := "postId_example" // string |
14 updateFeedPostParams := *openapiclient.NewUpdateFeedPostParams() // UpdateFeedPostParams |
15 broadcastId := "broadcastId_example" // string | (可选)
16 sso := "sso_example" // string | (可选)
17
18 configuration := openapiclient.NewConfiguration()
19 apiClient := openapiclient.NewAPIClient(configuration)
20 resp, r, err := apiClient.PublicAPI.UpdateFeedPostPublic(context.Background(), tenantId, postId).UpdateFeedPostParams(updateFeedPostParams).BroadcastId(broadcastId).Sso(sso).Execute()
21 if err != nil {
22 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.UpdateFeedPostPublic``: %v\n", err)
23 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
24 }
25 // 来自 `UpdateFeedPostPublic` 的响应:CreateFeedPostResponse
26 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.UpdateFeedPostPublic`: %v\n", resp)
27}
28

FlagCommentPublic Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
commentIdstringpath是
isFlaggedbooleanquery是
ssostringquery否

响应

返回: APIEmptyResponse

示例

FlagCommentPublic 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string |
14 isFlagged := true // bool |
15 sso := "sso_example" // string | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.PublicAPI.FlagCommentPublic(context.Background(), commentId).TenantId(tenantId).IsFlagged(isFlagged).Sso(sso).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.FlagCommentPublic``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // response from `FlagCommentPublic`: APIEmptyResponse
25 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.FlagCommentPublic`: %v\n", resp)
26}
27

GetGifLarge Internal Link

参数

名称类型位置必填描述
tenantIdstringpath是
largeInternalURLSanitizedstringquery是

响应

返回: GifGetLargeResponse

示例

GetGifLarge 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 largeInternalURLSanitized := "largeInternalURLSanitized_example" // string |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.PublicAPI.GetGifLarge(context.Background(), tenantId).LargeInternalURLSanitized(largeInternalURLSanitized).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.GetGifLarge``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `GetGifLarge` 的响应:GifGetLargeResponse
23 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.GetGifLarge`: %v\n", resp)
24}
25

GetGifsSearch Internal Link


参数

NameTypeLocationRequiredDescription
tenantIdstringpath是
searchstringquery是
localestringquery否
ratingstringquery否
pagenumberquery否

响应

返回: GetGifsSearchResponse

示例

GetGifsSearch 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 search := "search_example" // string |
14 locale := "locale_example" // string | (可选)
15 rating := "rating_example" // string | (可选)
16 page := float64(1.2) // float64 | (可选)
17
18 configuration := openapiclient.NewConfiguration()
19 apiClient := openapiclient.NewAPIClient(configuration)
20 resp, r, err := apiClient.PublicAPI.GetGifsSearch(context.Background(), tenantId).Search(search).Locale(locale).Rating(rating).Page(page).Execute()
21 if err != nil {
22 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.GetGifsSearch``: %v\n", err)
23 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
24 }
25 // 来自 `GetGifsSearch` 的响应: GetGifsSearchResponse
26 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.GetGifsSearch`: %v\n", resp)
27}
28

GetGifsTrending Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringpath是
localestringquery否
ratingstringquery否
pagenumberquery否

响应

返回: GetGifsTrendingResponse

示例

GetGifsTrending 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 locale := "locale_example" // string | (可选)
14 rating := "rating_example" // string | (可选)
15 page := float64(1.2) // float64 | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.PublicAPI.GetGifsTrending(context.Background(), tenantId).Locale(locale).Rating(rating).Page(page).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.GetGifsTrending``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // 来自 `GetGifsTrending` 的响应: GetGifsTrendingResponse
25 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.GetGifsTrending`: %v\n", resp)
26}
27

AddHashTag Internal Link

参数

名称类型位置必填描述
tenantIdstringqueryYes

响应

返回: CreateHashTagResponse

示例

AddHashTag 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 createHashTagBody := *openapiclient.NewCreateHashTagBody("Tag_example") // CreateHashTagBody | (可选)
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.AddHashTag(context.Background()).TenantId(tenantId).CreateHashTagBody(createHashTagBody).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.AddHashTag``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `AddHashTag` 的响应: CreateHashTagResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.AddHashTag`: %v\n", resp)
24}
25

AddHashTagsBulk Internal Link

参数

名称类型位置必填描述
tenantIdstringquery是

响应

返回:BulkCreateHashTagsResponse

示例

AddHashTagsBulk 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 bulkCreateHashTagsBody := *openapiclient.NewBulkCreateHashTagsBody([]openapiclient.BulkCreateHashTagsBodyTagsInner{*openapiclient.NewBulkCreateHashTagsBodyTagsInner("Tag_example")}) // BulkCreateHashTagsBody | (optional)
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.AddHashTagsBulk(context.Background()).TenantId(tenantId).BulkCreateHashTagsBody(bulkCreateHashTagsBody).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.AddHashTagsBulk``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // `AddHashTagsBulk` 的响应:BulkCreateHashTagsResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.AddHashTagsBulk`: %v\n", resp)
24}
25

DeleteHashTag Internal Link

参数

名称类型位置必填描述
tenantIdstringqueryYes
tagstringpathYes

响应

返回:APIEmptyResponse

示例

DeleteHashTag 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 tag := "tag_example" // string |
14 deleteHashTagRequestBody := *openapiclient.NewDeleteHashTagRequestBody() // DeleteHashTagRequestBody | (可选)
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.DefaultAPI.DeleteHashTag(context.Background(), tag).TenantId(tenantId).DeleteHashTagRequestBody(deleteHashTagRequestBody).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.DeleteHashTag``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `DeleteHashTag`: APIEmptyResponse
24 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.DeleteHashTag`: %v\n", resp)
25}
26

GetHashTags Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
pagenumberquery否

响应

返回: GetHashTagsResponse

示例

GetHashTags 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 page := float64(1.2) // float64 | (可选)
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.GetHashTags(context.Background()).TenantId(tenantId).Page(page).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetHashTags``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `GetHashTags` 的响应: GetHashTagsResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetHashTags`: %v\n", resp)
24}
25

PatchHashTag Internal Link

参数

名称类型位置必填描述
tenantIdstringqueryYes
tagstringpathYes

响应

返回: UpdateHashTagResponse

示例

PatchHashTag 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 tag := "tag_example" // string |
14 updateHashTagBody := *openapiclient.NewUpdateHashTagBody() // UpdateHashTagBody | (optional) // (可选)
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.DefaultAPI.PatchHashTag(context.Background(), tag).TenantId(tenantId).UpdateHashTagBody(updateHashTagBody).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.PatchHashTag``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `PatchHashTag` 的响应: UpdateHashTagResponse
24 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.PatchHashTag`: %v\n", resp)
25}
26

DeleteModerationVote Internal Link

参数

名称类型位置必需描述
tenantIdstringquery是
commentIdstringpath是
voteIdstringpath是
broadcastIdstringquery否
ssostringquery否

响应

返回: VoteDeleteResponse

示例

DeleteModerationVote 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string |
14 voteId := "voteId_example" // string |
15 broadcastId := "broadcastId_example" // string | (optional)
16 sso := "sso_example" // string | (optional)
17
18 configuration := openapiclient.NewConfiguration()
19 apiClient := openapiclient.NewAPIClient(configuration)
20 resp, r, err := apiClient.ModerationAPI.DeleteModerationVote(context.Background(), commentId, voteId).TenantId(tenantId).BroadcastId(broadcastId).Sso(sso).Execute()
21 if err != nil {
22 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.DeleteModerationVote``: %v\n", err)
23 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
24 }
25 // `DeleteModerationVote` 的响应: VoteDeleteResponse
26 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.DeleteModerationVote`: %v\n", resp)
27}
28

GetApiComments Internal Link

参数

名称类型位置必填描述
tenantIdstringquery是
pagenumberquery否
countnumberquery否
text-searchstringquery否
byIPFromCommentstringquery否
filtersstringquery否
searchFiltersstringquery否
sortsstringquery否
demobooleanquery否
ssostringquery否

响应

返回:ModerationAPIGetCommentsResponse

示例

获取ApiComments 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 page := float64(1.2) // float64 | (optional) -> (可选)
14 count := float64(1.2) // float64 | (optional) -> (可选)
15 textSearch := "textSearch_example" // string | (optional) -> (可选)
16 byIPFromComment := "byIPFromComment_example" // string | (optional) -> (可选)
17 filters := "filters_example" // string | (optional) -> (可选)
18 searchFilters := "searchFilters_example" // string | (optional) -> (可选)
19 sorts := "sorts_example" // string | (optional) -> (可选)
20 demo := true // bool | (optional) -> (可选)
21 sso := "sso_example" // string | (optional) -> (可选)
22
23 configuration := openapiclient.NewConfiguration()
24 apiClient := openapiclient.NewAPIClient(configuration)
25 resp, r, err := apiClient.ModerationAPI.GetApiComments(context.Background()).TenantId(tenantId).Page(page).Count(count).TextSearch(textSearch).ByIPFromComment(byIPFromComment).Filters(filters).SearchFilters(searchFilters).Sorts(sorts).Demo(demo).Sso(sso).Execute()
26 if err != nil {
27 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.GetApiComments``: %v\n", err)
28 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
29 }
30 // `GetApiComments` 的响应: ModerationAPIGetCommentsResponse
31 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.GetApiComments`: %v\n", resp)
32}
33

GetApiExportStatus Internal Link

参数

名称类型位置必需描述
tenantIdstringquery是
batchJobIdstringquery否
ssostringquery否

响应

返回: ModerationExportStatusResponse

示例

GetApiExportStatus 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 batchJobId := "batchJobId_example" // string | (可选)
14 sso := "sso_example" // string | (可选)
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.ModerationAPI.GetApiExportStatus(context.Background()).TenantId(tenantId).BatchJobId(batchJobId).Sso(sso).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.GetApiExportStatus``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // `GetApiExportStatus` 的响应: ModerationExportStatusResponse
24 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.GetApiExportStatus`: %v\n", resp)
25}
26

GetApiIds Internal Link

参数

名称类型位置必需描述
tenantIdstringquery是
text-searchstringquery否
byIPFromCommentstringquery否
filtersstringquery否
searchFiltersstringquery否
afterIdstringquery否
demobooleanquery否
ssostringquery否

响应

返回:ModerationAPIGetCommentIdsResponse

示例

GetApiIds 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 textSearch := "textSearch_example" // string | (可选)
14 byIPFromComment := "byIPFromComment_example" // string | (可选)
15 filters := "filters_example" // string | (可选)
16 searchFilters := "searchFilters_example" // string | (可选)
17 afterId := "afterId_example" // string | (可选)
18 demo := true // bool | (可选)
19 sso := "sso_example" // string | (可选)
20
21 configuration := openapiclient.NewConfiguration()
22 apiClient := openapiclient.NewAPIClient(configuration)
23 resp, r, err := apiClient.ModerationAPI.GetApiIds(context.Background()).TenantId(tenantId).TextSearch(textSearch).ByIPFromComment(byIPFromComment).Filters(filters).SearchFilters(searchFilters).AfterId(afterId).Demo(demo).Sso(sso).Execute()
24 if err != nil {
25 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.GetApiIds``: %v\n", err)
26 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
27 }
28 // `GetApiIds` 的响应:ModerationAPIGetCommentIdsResponse
29 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.GetApiIds`: %v\n", resp)
30}
31

GetBanUsersFromComment Internal Link

参数

名称类型位置必需描述
tenantIdstringqueryYes
commentIdstringpathYes
ssostringqueryNo

响应

返回: GetBannedUsersFromCommentResponse

示例

GetBanUsersFromComment 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string |
14 sso := "sso_example" // string | (optional)
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.ModerationAPI.GetBanUsersFromComment(context.Background(), commentId).TenantId(tenantId).Sso(sso).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.GetBanUsersFromComment``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `GetBanUsersFromComment` 的响应: GetBannedUsersFromCommentResponse
24 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.GetBanUsersFromComment`: %v\n", resp)
25}
26

GetCommentBanStatus Internal Link

参数

名称类型位置必填描述
tenantIdstringquery是
commentIdstringpath是
ssostringquery否

响应

返回: GetCommentBanStatusResponse

示例

GetCommentBanStatus 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string |
14 sso := "sso_example" // string | (optional) -> (可选)
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.ModerationAPI.GetCommentBanStatus(context.Background(), commentId).TenantId(tenantId).Sso(sso).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.GetCommentBanStatus``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // `GetCommentBanStatus` 的响应: GetCommentBanStatusResponse
24 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.GetCommentBanStatus`: %v\n", resp)
25}
26

GetCommentChildren Internal Link

参数

名称类型位置必填描述
tenantIdstringquery是
commentIdstringpath是
ssostringquery否

响应

返回: ModerationAPIChildCommentsResponse

示例

获取子评论示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string |
14 sso := "sso_example" // string | (可选)
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.ModerationAPI.GetCommentChildren(context.Background(), commentId).TenantId(tenantId).Sso(sso).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.GetCommentChildren``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // `GetCommentChildren` 的响应: ModerationAPIChildCommentsResponse
24 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.GetCommentChildren`: %v\n", resp)
25}
26

GetCount Internal Link

参数

名称类型位置必填描述
tenantIdstringquery是
text-searchstringquery否
byIPFromCommentstringquery否
filterstringquery否
searchFiltersstringquery否
demobooleanquery否
ssostringquery否

响应

Returns: ModerationAPICountCommentsResponse

示例

GetCount 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 textSearch := "textSearch_example" // string | (可选)
14 byIPFromComment := "byIPFromComment_example" // string | (可选)
15 filter := "filter_example" // string | (可选)
16 searchFilters := "searchFilters_example" // string | (可选)
17 demo := true // bool | (可选)
18 sso := "sso_example" // string | (可选)
19
20 configuration := openapiclient.NewConfiguration()
21 apiClient := openapiclient.NewAPIClient(configuration)
22 resp, r, err := apiClient.ModerationAPI.GetCount(context.Background()).TenantId(tenantId).TextSearch(textSearch).ByIPFromComment(byIPFromComment).Filter(filter).SearchFilters(searchFilters).Demo(demo).Sso(sso).Execute()
23 if err != nil {
24 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.GetCount``: %v\n", err)
25 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
26 }
27 // `GetCount` 的响应: ModerationAPICountCommentsResponse
28 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.GetCount`: %v\n", resp)
29}
30

GetCounts Internal Link

参数

名称类型位置必需描述
tenantIdstringquery是
ssostringquery否

响应

返回: GetBannedUsersCountResponse

示例

GetCounts 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 sso := "sso_example" // string | (可选)
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.ModerationAPI.GetCounts(context.Background()).TenantId(tenantId).Sso(sso).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "调用 `ModerationAPI.GetCounts` 时出错: %v\n", err)
20 fmt.Fprintf(os.Stderr, "完整的 HTTP 响应: %v\n", r)
21 }
22 // 来自 `GetCounts` 的响应: GetBannedUsersCountResponse
23 fmt.Fprintf(os.Stdout, "来自 `ModerationAPI.GetCounts` 的响应: %v\n", resp)
24}
25

GetLogs Internal Link

参数

名称类型位置必填描述
tenantIdstringquery是
commentIdstringpath是
ssostringquery否

响应

返回: ModerationAPIGetLogsResponse

示例

GetLogs 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string |
14 sso := "sso_example" // string | (可选)
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.ModerationAPI.GetLogs(context.Background(), commentId).TenantId(tenantId).Sso(sso).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.GetLogs``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // `GetLogs` 的响应: ModerationAPIGetLogsResponse
24 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.GetLogs`: %v\n", resp)
25}
26

GetManualBadges Internal Link

参数

名称类型位置必需描述
tenantIdstringqueryYes
ssostringqueryNo

响应

返回:GetTenantManualBadgesResponse

示例

GetManualBadges 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 sso := "sso_example" // string | (可选)
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.ModerationAPI.GetManualBadges(context.Background()).TenantId(tenantId).Sso(sso).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.GetManualBadges``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `GetManualBadges` 的响应: GetTenantManualBadgesResponse
23 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.GetManualBadges`: %v\n", resp)
24}
25

GetManualBadgesForUser Internal Link

参数

名称类型位置必填描述
tenantIdstringqueryYes
badgesUserIdstringqueryNo
commentIdstringqueryNo
ssostringqueryNo

响应

返回:GetUserManualBadgesResponse

示例

GetManualBadgesForUser 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 badgesUserId := "badgesUserId_example" // string | (可选)
14 commentId := "commentId_example" // string | (可选)
15 sso := "sso_example" // string | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.ModerationAPI.GetManualBadgesForUser(context.Background()).TenantId(tenantId).BadgesUserId(badgesUserId).CommentId(commentId).Sso(sso).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "调用 `ModerationAPI.GetManualBadgesForUser`` 时出错:%v\n", err)
22 fmt.Fprintf(os.Stderr, "完整的 HTTP 响应:%v\n", r)
23 }
24 // 来自 `GetManualBadgesForUser`:GetUserManualBadgesResponse
25 fmt.Fprintf(os.Stdout, "来自 `ModerationAPI.GetManualBadgesForUser` 的响应:%v\n", resp)
26}
27

GetModerationComment Internal Link

参数

名称类型位置必填描述
tenantIdstringqueryYes
commentIdstringpathYes
includeEmailbooleanqueryNo
includeIPbooleanqueryNo
ssostringqueryNo

响应

返回:ModerationAPICommentResponse

示例

GetModerationComment 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string |
14 includeEmail := true // bool | (optional)
15 includeIP := true // bool | (optional)
16 sso := "sso_example" // string | (optional)
17
18 configuration := openapiclient.NewConfiguration()
19 apiClient := openapiclient.NewAPIClient(configuration)
20 resp, r, err := apiClient.ModerationAPI.GetModerationComment(context.Background(), commentId).TenantId(tenantId).IncludeEmail(includeEmail).IncludeIP(includeIP).Sso(sso).Execute()
21 if err != nil {
22 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.GetModerationComment``: %v\n", err)
23 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
24 }
25 // `GetModerationComment` 的响应: ModerationAPICommentResponse
26 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.GetModerationComment`: %v\n", resp)
27}
28

GetModerationCommentText Internal Link

参数

名称类型位置必需描述
tenantIdstringquery是
commentIdstringpath是
ssostringquery否

响应

返回:GetCommentTextResponse

示例

GetModerationCommentText 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string |
14 sso := "sso_example" // string | (可选)
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.ModerationAPI.GetModerationCommentText(context.Background(), commentId).TenantId(tenantId).Sso(sso).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.GetModerationCommentText``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `GetModerationCommentText` 的响应: GetCommentTextResponse
24 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.GetModerationCommentText`: %v\n", resp)
25}
26

GetPreBanSummary Internal Link

参数

名称类型位置必需描述
tenantIdstringqueryYes
commentIdstringpathYes
includeByUserIdAndEmailbooleanqueryNo
includeByIPbooleanqueryNo
includeByEmailDomainbooleanqueryNo
ssostringqueryNo

响应

返回: PreBanSummary

示例

GetPreBanSummary 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string |
14 includeByUserIdAndEmail := true // bool | (可选)
15 includeByIP := true // bool | (可选)
16 includeByEmailDomain := true // bool | (可选)
17 sso := "sso_example" // string | (可选)
18
19 configuration := openapiclient.NewConfiguration()
20 apiClient := openapiclient.NewAPIClient(configuration)
21 resp, r, err := apiClient.ModerationAPI.GetPreBanSummary(context.Background(), commentId).TenantId(tenantId).IncludeByUserIdAndEmail(includeByUserIdAndEmail).IncludeByIP(includeByIP).IncludeByEmailDomain(includeByEmailDomain).Sso(sso).Execute()
22 if err != nil {
23 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.GetPreBanSummary``: %v\n", err)
24 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
25 }
26 // 来自 `GetPreBanSummary` 的响应: PreBanSummary
27 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.GetPreBanSummary`: %v\n", resp)
28}
29

GetSearchCommentsSummary Internal Link

参数

名称类型位置必需描述
tenantIdstringquery是
valuestringquery否
filtersstringquery否
searchFiltersstringquery否
ssostringquery否

响应

返回: ModerationCommentSearchResponse

示例

GetSearchCommentsSummary 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 value := "value_example" // string | (可选)
14 filters := "filters_example" // string | (可选)
15 searchFilters := "searchFilters_example" // string | (可选)
16 sso := "sso_example" // string | (可选)
17
18 configuration := openapiclient.NewConfiguration()
19 apiClient := openapiclient.NewAPIClient(configuration)
20 resp, r, err := apiClient.ModerationAPI.GetSearchCommentsSummary(context.Background()).TenantId(tenantId).Value(value).Filters(filters).SearchFilters(searchFilters).Sso(sso).Execute()
21 if err != nil {
22 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.GetSearchCommentsSummary``: %v\n", err)
23 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
24 }
25 // 来自 `GetSearchCommentsSummary` 的响应: ModerationCommentSearchResponse
26 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.GetSearchCommentsSummary`: %v\n", resp)
27}
28

GetSearchPages Internal Link

参数

名称类型位置必需描述
tenantIdstringqueryYes
valuestringqueryNo
ssostringqueryNo

响应

返回:ModerationPageSearchResponse

示例

GetSearchPages 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 value := "value_example" // string | (可选)
14 sso := "sso_example" // string | (可选)
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.ModerationAPI.GetSearchPages(context.Background()).TenantId(tenantId).Value(value).Sso(sso).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "调用 `ModerationAPI.GetSearchPages`` 时出错: %v\n", err)
21 fmt.Fprintf(os.Stderr, "完整的 HTTP 响应: %v\n", r)
22 }
23 // 来自 `GetSearchPages` 的响应: ModerationPageSearchResponse
24 fmt.Fprintf(os.Stdout, "来自 `ModerationAPI.GetSearchPages` 的响应: %v\n", resp)
25}
26

GetSearchSites Internal Link

参数

名称类型位置必需描述
tenantIdstringquery是
valuestringquery否
ssostringquery否

响应

返回:ModerationSiteSearchResponse

示例

GetSearchSites 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 value := "value_example" // string | (可选)
14 sso := "sso_example" // string | (可选)
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.ModerationAPI.GetSearchSites(context.Background()).TenantId(tenantId).Value(value).Sso(sso).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.GetSearchSites``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `GetSearchSites` 的响应: ModerationSiteSearchResponse
24 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.GetSearchSites`: %v\n", resp)
25}
26

GetSearchSuggest Internal Link

参数

名称类型位置必需描述
tenantIdstringquery是
text-searchstringquery否
ssostringquery否

响应

返回:ModerationSuggestResponse

示例

GetSearchSuggest 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 textSearch := "textSearch_example" // string | (可选)
14 sso := "sso_example" // string | (可选)
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.ModerationAPI.GetSearchSuggest(context.Background()).TenantId(tenantId).TextSearch(textSearch).Sso(sso).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.GetSearchSuggest``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // `GetSearchSuggest` 的响应: ModerationSuggestResponse
24 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.GetSearchSuggest`: %v\n", resp)
25}
26

GetSearchUsers Internal Link


参数

名称类型位置必填描述
tenantIdstringquery是
valuestringquery否
ssostringquery否

响应

返回:ModerationUserSearchResponse

示例

GetSearchUsers 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 value := "value_example" // string | (可选)
14 sso := "sso_example" // string | (可选)
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.ModerationAPI.GetSearchUsers(context.Background()).TenantId(tenantId).Value(value).Sso(sso).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.GetSearchUsers``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // `GetSearchUsers` 的响应: ModerationUserSearchResponse
24 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.GetSearchUsers`: %v\n", resp)
25}
26

GetTrustFactor Internal Link

参数

名称类型位置必需描述
tenantIdstringquery是
userIdstringquery否
ssostringquery否

响应

返回:GetUserTrustFactorResponse

示例

GetTrustFactor 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 userId := "userId_example" // string | (可选)
14 sso := "sso_example" // string | (可选)
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.ModerationAPI.GetTrustFactor(context.Background()).TenantId(tenantId).UserId(userId).Sso(sso).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "调用 `ModerationAPI.GetTrustFactor` 时出错: %v\n", err)
21 fmt.Fprintf(os.Stderr, "完整 HTTP 响应: %v\n", r)
22 }
23 // `GetTrustFactor` 的响应:GetUserTrustFactorResponse
24 fmt.Fprintf(os.Stdout, "来自 `ModerationAPI.GetTrustFactor` 的响应: %v\n", resp)
25}
26

GetUserBanPreference Internal Link

参数

名称类型位置必填描述
tenantIdstringquery是
ssostringquery否

响应

返回: APIModerateGetUserBanPreferencesResponse

示例

获取用户禁令偏好 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 sso := "sso_example" // string | (可选)
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.ModerationAPI.GetUserBanPreference(context.Background()).TenantId(tenantId).Sso(sso).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.GetUserBanPreference``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 响应来自 `GetUserBanPreference`:APIModerateGetUserBanPreferencesResponse
23 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.GetUserBanPreference`: %v\n", resp)
24}
25

GetUserInternalProfile Internal Link

参数

名称类型位置必填描述
tenantIdstringqueryYes
commentIdstringqueryNo
ssostringqueryNo

响应

返回: GetUserInternalProfileResponse

示例

GetUserInternalProfile 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string | (可选)
14 sso := "sso_example" // string | (可选)
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.ModerationAPI.GetUserInternalProfile(context.Background()).TenantId(tenantId).CommentId(commentId).Sso(sso).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.GetUserInternalProfile``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `GetUserInternalProfile` 的响应: GetUserInternalProfileResponse
24 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.GetUserInternalProfile`: %v\n", resp)
25}
26

PostAdjustCommentVotes Internal Link

参数

名称类型位置必填描述
tenantIdstringquery是
commentIdstringpath是
broadcastIdstringquery否
ssostringquery否

响应

返回: AdjustVotesResponse

示例

PostAdjustCommentVotes 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string |
14 adjustCommentVotesParams := *openapiclient.NewAdjustCommentVotesParams(float64(123)) // AdjustCommentVotesParams |
15 broadcastId := "broadcastId_example" // string | (optional)
16 sso := "sso_example" // string | (optional)
17
18 configuration := openapiclient.NewConfiguration()
19 apiClient := openapiclient.NewAPIClient(configuration)
20 resp, r, err := apiClient.ModerationAPI.PostAdjustCommentVotes(context.Background(), commentId).TenantId(tenantId).AdjustCommentVotesParams(adjustCommentVotesParams).BroadcastId(broadcastId).Sso(sso).Execute()
21 if err != nil {
22 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.PostAdjustCommentVotes``: %v\n", err)
23 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
24 }
25 // `PostAdjustCommentVotes` 的响应: AdjustVotesResponse
26 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.PostAdjustCommentVotes`: %v\n", resp)
27}
28

PostApiExport Internal Link

参数

名称类型位置必需描述
tenantIdstringquery是
text-searchstringquery否
byIPFromCommentstringquery否
filtersstringquery否
searchFiltersstringquery否
sortsstringquery否
ssostringquery否

响应

返回: ModerationExportResponse

示例

PostApiExport 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 textSearch := "textSearch_example" // string | (可选)
14 byIPFromComment := "byIPFromComment_example" // string | (可选)
15 filters := "filters_example" // string | (可选)
16 searchFilters := "searchFilters_example" // string | (可选)
17 sorts := "sorts_example" // string | (可选)
18 sso := "sso_example" // string | (可选)
19
20 configuration := openapiclient.NewConfiguration()
21 apiClient := openapiclient.NewAPIClient(configuration)
22 resp, r, err := apiClient.ModerationAPI.PostApiExport(context.Background()).TenantId(tenantId).TextSearch(textSearch).ByIPFromComment(byIPFromComment).Filters(filters).SearchFilters(searchFilters).Sorts(sorts).Sso(sso).Execute()
23 if err != nil {
24 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.PostApiExport``: %v\n", err)
25 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
26 }
27 // 来自 `PostApiExport` 的响应:ModerationExportResponse
28 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.PostApiExport`: %v\n", resp)
29}
30

PostBanUserFromComment Internal Link

参数

名称类型位置必填描述
tenantIdstringqueryYes
commentIdstringpathYes
banEmailbooleanqueryNo
banEmailDomainbooleanqueryNo
banIPbooleanqueryNo
deleteAllUsersCommentsbooleanqueryNo
bannedUntilstringqueryNo
isShadowBanbooleanqueryNo
updateIdstringqueryNo
banReasonstringqueryNo
ssostringqueryNo

响应

返回:BanUserFromCommentResult

示例

PostBanUserFromComment 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string |
14 banEmail := true // bool | (可选)
15 banEmailDomain := true // bool | (可选)
16 banIP := true // bool | (可选)
17 deleteAllUsersComments := true // bool | (可选)
18 bannedUntil := "bannedUntil_example" // string | (可选)
19 isShadowBan := true // bool | (可选)
20 updateId := "updateId_example" // string | (可选)
21 banReason := "banReason_example" // string | (可选)
22 sso := "sso_example" // string | (可选)
23
24 configuration := openapiclient.NewConfiguration()
25 apiClient := openapiclient.NewAPIClient(configuration)
26 resp, r, err := apiClient.ModerationAPI.PostBanUserFromComment(context.Background(), commentId).TenantId(tenantId).BanEmail(banEmail).BanEmailDomain(banEmailDomain).BanIP(banIP).DeleteAllUsersComments(deleteAllUsersComments).BannedUntil(bannedUntil).IsShadowBan(isShadowBan).UpdateId(updateId).BanReason(banReason).Sso(sso).Execute()
27 if err != nil {
28 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.PostBanUserFromComment``: %v\n", err)
29 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
30 }
31 // `PostBanUserFromComment` 的响应:BanUserFromCommentResult
32 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.PostBanUserFromComment`: %v\n", resp)
33}
34

PostBanUserUndo Internal Link

参数

名称类型位置必需描述
tenantIdstringquery是
ssostringquery否

响应

返回: APIEmptyResponse

示例

PostBanUserUndo 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 banUserUndoParams := *openapiclient.NewBanUserUndoParams(*openapiclient.NewAPIBanUserChangeLog()) // BanUserUndoParams |
14 sso := "sso_example" // string | (可选)
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.ModerationAPI.PostBanUserUndo(context.Background()).TenantId(tenantId).BanUserUndoParams(banUserUndoParams).Sso(sso).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.PostBanUserUndo``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `PostBanUserUndo` 的响应: APIEmptyResponse
24 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.PostBanUserUndo`: %v\n", resp)
25}
26

PostBulkPreBanSummary Internal Link

参数

名称类型位置必填描述
tenantIdstringqueryYes
includeByUserIdAndEmailbooleanqueryNo
includeByIPbooleanqueryNo
includeByEmailDomainbooleanqueryNo
ssostringqueryNo

响应

Returns: BulkPreBanSummary

示例

PostBulkPreBanSummary 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 bulkPreBanParams := *openapiclient.NewBulkPreBanParams([]string{"CommentIds_example"}) // BulkPreBanParams |
14 includeByUserIdAndEmail := true // bool | (可选)
15 includeByIP := true // bool | (可选)
16 includeByEmailDomain := true // bool | (可选)
17 sso := "sso_example" // string | (可选)
18
19 configuration := openapiclient.NewConfiguration()
20 apiClient := openapiclient.NewAPIClient(configuration)
21 resp, r, err := apiClient.ModerationAPI.PostBulkPreBanSummary(context.Background()).TenantId(tenantId).BulkPreBanParams(bulkPreBanParams).IncludeByUserIdAndEmail(includeByUserIdAndEmail).IncludeByIP(includeByIP).IncludeByEmailDomain(includeByEmailDomain).Sso(sso).Execute()
22 if err != nil {
23 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.PostBulkPreBanSummary``: %v\n", err)
24 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
25 }
26 // `PostBulkPreBanSummary` 的响应: BulkPreBanSummary
27 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.PostBulkPreBanSummary`: %v\n", resp)
28}
29

PostCommentsByIds Internal Link

参数

名称类型位置必需描述
tenantIdstringqueryYes
ssostringqueryNo

响应

Returns: ModerationAPIChildCommentsResponse

示例

PostCommentsByIds 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentsByIdsParams := *openapiclient.NewCommentsByIdsParams([]string{"Ids_example"}) // CommentsByIdsParams |
14 sso := "sso_example" // string | (可选)
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.ModerationAPI.PostCommentsByIds(context.Background()).TenantId(tenantId).CommentsByIdsParams(commentsByIdsParams).Sso(sso).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.PostCommentsByIds``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `PostCommentsByIds` 的响应: ModerationAPIChildCommentsResponse
24 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.PostCommentsByIds`: %v\n", resp)
25}
26

PostFlagComment Internal Link

参数

名称类型位置必需描述
tenantIdstringquery是
commentIdstringpath是
broadcastIdstringquery否
ssostringquery否

响应

返回:APIEmptyResponse

示例

PostFlagComment 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string |
14 broadcastId := "broadcastId_example" // string | (可选)
15 sso := "sso_example" // string | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.ModerationAPI.PostFlagComment(context.Background(), commentId).TenantId(tenantId).BroadcastId(broadcastId).Sso(sso).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.PostFlagComment``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // `PostFlagComment` 的响应: APIEmptyResponse
25 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.PostFlagComment`: %v\n", resp)
26}
27

PostRemoveComment Internal Link

参数

名称类型位置必填描述
tenantIdstringquery是
commentIdstringpath是
broadcastIdstringquery否
ssostringquery否

响应

返回: PostRemoveCommentApiResponse

示例

PostRemoveComment 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string |
14 broadcastId := "broadcastId_example" // string | (可选)
15 sso := "sso_example" // string | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.ModerationAPI.PostRemoveComment(context.Background(), commentId).TenantId(tenantId).BroadcastId(broadcastId).Sso(sso).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.PostRemoveComment``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // `PostRemoveComment` 的响应: PostRemoveCommentApiResponse
25 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.PostRemoveComment`: %v\n", resp)
26}
27

PostRestoreDeletedComment Internal Link

参数

名称类型位置必填描述
tenantIdstringqueryYes
commentIdstringpathYes
broadcastIdstringqueryNo
ssostringqueryNo

响应

Returns: APIEmptyResponse

示例

PostRestoreDeletedComment 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string |
14 broadcastId := "broadcastId_example" // string | (可选)
15 sso := "sso_example" // string | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.ModerationAPI.PostRestoreDeletedComment(context.Background(), commentId).TenantId(tenantId).BroadcastId(broadcastId).Sso(sso).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.PostRestoreDeletedComment``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // 来自 `PostRestoreDeletedComment` 的响应: APIEmptyResponse
25 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.PostRestoreDeletedComment`: %v\n", resp)
26}
27

PostSetCommentApprovalStatus Internal Link

参数

名称类型位置必填描述
tenantIdstringquery是
commentIdstringpath是
approvedbooleanquery否
broadcastIdstringquery否
ssostringquery否

响应

返回:SetCommentApprovedResponse

示例

PostSetCommentApprovalStatus 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string |
14 approved := true // bool | (可选)
15 broadcastId := "broadcastId_example" // string | (可选)
16 sso := "sso_example" // string | (可选)
17
18 configuration := openapiclient.NewConfiguration()
19 apiClient := openapiclient.NewAPIClient(configuration)
20 resp, r, err := apiClient.ModerationAPI.PostSetCommentApprovalStatus(context.Background(), commentId).TenantId(tenantId).Approved(approved).BroadcastId(broadcastId).Sso(sso).Execute()
21 if err != nil {
22 fmt.Fprintf(os.Stderr, "调用 `ModerationAPI.PostSetCommentApprovalStatus`` 时出错:%v\n", err)
23 fmt.Fprintf(os.Stderr, "完整 HTTP 响应: %v\n", r)
24 }
25 // `PostSetCommentApprovalStatus` 的响应: SetCommentApprovedResponse
26 fmt.Fprintf(os.Stdout, "来自 `ModerationAPI.PostSetCommentApprovalStatus` 的响应:%v\n", resp)
27}
28

PostSetCommentReviewStatus Internal Link

参数

名称类型位置必填描述
tenantIdstringquery是
commentIdstringpath是
reviewedbooleanquery否
broadcastIdstringquery否
ssostringquery否

响应

返回:APIEmptyResponse

示例

PostSetCommentReviewStatus 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string |
14 reviewed := true // bool | (可选)
15 broadcastId := "broadcastId_example" // string | (可选)
16 sso := "sso_example" // string | (可选)
17
18 configuration := openapiclient.NewConfiguration()
19 apiClient := openapiclient.NewAPIClient(configuration)
20 resp, r, err := apiClient.ModerationAPI.PostSetCommentReviewStatus(context.Background(), commentId).TenantId(tenantId).Reviewed(reviewed).BroadcastId(broadcastId).Sso(sso).Execute()
21 if err != nil {
22 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.PostSetCommentReviewStatus``: %v\n", err)
23 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
24 }
25 // `PostSetCommentReviewStatus` 的响应: APIEmptyResponse
26 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.PostSetCommentReviewStatus`: %v\n", resp)
27}
28

PostSetCommentSpamStatus Internal Link

参数

名称类型位置必填描述
tenantIdstringqueryYes
commentIdstringpathYes
spambooleanqueryNo
permNotSpambooleanqueryNo
broadcastIdstringqueryNo
ssostringqueryNo

响应

返回:APIEmptyResponse

示例

PostSetCommentSpamStatus 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string |
14 spam := true // bool | (可选)
15 permNotSpam := true // bool | (可选)
16 broadcastId := "broadcastId_example" // string | (可选)
17 sso := "sso_example" // string | (可选)
18
19 configuration := openapiclient.NewConfiguration()
20 apiClient := openapiclient.NewAPIClient(configuration)
21 resp, r, err := apiClient.ModerationAPI.PostSetCommentSpamStatus(context.Background(), commentId).TenantId(tenantId).Spam(spam).PermNotSpam(permNotSpam).BroadcastId(broadcastId).Sso(sso).Execute()
22 if err != nil {
23 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.PostSetCommentSpamStatus``: %v\n", err)
24 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
25 }
26 // 来自 `PostSetCommentSpamStatus` 的响应: APIEmptyResponse
27 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.PostSetCommentSpamStatus`: %v\n", resp)
28}
29

PostSetCommentText Internal Link

参数

名称类型位置必需描述
tenantIdstringquery是
commentIdstringpath是
broadcastIdstringquery否
ssostringquery否

响应

返回:SetCommentTextResponse

示例

PostSetCommentText 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string |
14 setCommentTextParams := *openapiclient.NewSetCommentTextParams("Comment_example") // SetCommentTextParams |
15 broadcastId := "broadcastId_example" // string | (可选)
16 sso := "sso_example" // string | (可选)
17
18 configuration := openapiclient.NewConfiguration()
19 apiClient := openapiclient.NewAPIClient(configuration)
20 resp, r, err := apiClient.ModerationAPI.PostSetCommentText(context.Background(), commentId).TenantId(tenantId).SetCommentTextParams(setCommentTextParams).BroadcastId(broadcastId).Sso(sso).Execute()
21 if err != nil {
22 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.PostSetCommentText``: %v\n", err)
23 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
24 }
25 // `PostSetCommentText` 的响应: SetCommentTextResponse
26 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.PostSetCommentText`: %v\n", resp)
27}
28

PostUnFlagComment Internal Link

参数

名称类型位置必需描述
tenantIdstringquery是
commentIdstringpath是
broadcastIdstringquery否
ssostringquery否

响应

返回:APIEmptyResponse

示例

PostUnFlagComment 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string |
14 broadcastId := "broadcastId_example" // string | (可选)
15 sso := "sso_example" // string | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.ModerationAPI.PostUnFlagComment(context.Background(), commentId).TenantId(tenantId).BroadcastId(broadcastId).Sso(sso).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.PostUnFlagComment``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // 来自 `PostUnFlagComment` 的响应: APIEmptyResponse
25 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.PostUnFlagComment`: %v\n", resp)
26}
27

PostVote Internal Link

参数

名称类型位置必需描述
tenantIdstringqueryYes
commentIdstringpathYes
directionstringqueryNo
broadcastIdstringqueryNo
ssostringqueryNo

响应

返回: VoteResponse

示例

PostVote 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string |
14 direction := "direction_example" // string | (可选)
15 broadcastId := "broadcastId_example" // string | (可选)
16 sso := "sso_example" // string | (可选)
17
18 configuration := openapiclient.NewConfiguration()
19 apiClient := openapiclient.NewAPIClient(configuration)
20 resp, r, err := apiClient.ModerationAPI.PostVote(context.Background(), commentId).TenantId(tenantId).Direction(direction).BroadcastId(broadcastId).Sso(sso).Execute()
21 if err != nil {
22 fmt.Fprintf(os.Stderr, "调用 `ModerationAPI.PostVote` 时出错:%v\n", err)
23 fmt.Fprintf(os.Stderr, "完整的 HTTP 响应:%v\n", r)
24 }
25 // 来自 `PostVote` 的响应:VoteResponse
26 fmt.Fprintf(os.Stdout, "`ModerationAPI.PostVote` 的响应:%v\n", resp)
27}
28

PutAwardBadge Internal Link

参数

名称类型位置必填描述
tenantIdstringquery是
badgeIdstringquery是
userIdstringquery否
commentIdstringquery否
broadcastIdstringquery否
ssostringquery否

响应

返回:AwardUserBadgeResponse

示例

PutAwardBadge 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 badgeId := "badgeId_example" // string |
14 userId := "userId_example" // string | (可选)
15 commentId := "commentId_example" // string | (可选)
16 broadcastId := "broadcastId_example" // string | (可选)
17 sso := "sso_example" // string | (可选)
18
19 configuration := openapiclient.NewConfiguration()
20 apiClient := openapiclient.NewAPIClient(configuration)
21 resp, r, err := apiClient.ModerationAPI.PutAwardBadge(context.Background()).TenantId(tenantId).BadgeId(badgeId).UserId(userId).CommentId(commentId).BroadcastId(broadcastId).Sso(sso).Execute()
22 if err != nil {
23 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.PutAwardBadge``: %v\n", err)
24 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
25 }
26 // 来自 `PutAwardBadge` 的响应: AwardUserBadgeResponse
27 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.PutAwardBadge`: %v\n", resp)
28}
29

PutCloseThread Internal Link

参数

名称类型位置必填描述
tenantIdstringquery是
urlIdstringquery是
ssostringquery否

响应

返回:APIEmptyResponse

示例

PutCloseThread 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 urlId := "urlId_example" // string |
14 sso := "sso_example" // string | (可选)
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.ModerationAPI.PutCloseThread(context.Background()).TenantId(tenantId).UrlId(urlId).Sso(sso).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.PutCloseThread``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `PutCloseThread` 的响应: APIEmptyResponse
24 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.PutCloseThread`: %v\n", resp)
25}
26

PutRemoveBadge Internal Link

参数

名称类型位置必需描述
tenantIdstringqueryYes
badgeIdstringqueryYes
userIdstringqueryNo
commentIdstringqueryNo
broadcastIdstringqueryNo
ssostringqueryNo

响应

返回: RemoveUserBadgeResponse

示例

PutRemoveBadge 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 badgeId := "badgeId_example" // string |
14 userId := "userId_example" // string | (可选)
15 commentId := "commentId_example" // string | (可选)
16 broadcastId := "broadcastId_example" // string | (可选)
17 sso := "sso_example" // string | (可选)
18
19 configuration := openapiclient.NewConfiguration()
20 apiClient := openapiclient.NewAPIClient(configuration)
21 resp, r, err := apiClient.ModerationAPI.PutRemoveBadge(context.Background()).TenantId(tenantId).BadgeId(badgeId).UserId(userId).CommentId(commentId).BroadcastId(broadcastId).Sso(sso).Execute()
22 if err != nil {
23 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.PutRemoveBadge``: %v\n", err)
24 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
25 }
26 // `PutRemoveBadge` 的响应: RemoveUserBadgeResponse
27 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.PutRemoveBadge`: %v\n", resp)
28}
29

PutReopenThread Internal Link

参数

名称类型位置必需描述
tenantIdstringqueryYes
urlIdstringqueryYes
ssostringqueryNo

响应

返回: APIEmptyResponse

示例

PutReopenThread 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 urlId := "urlId_example" // string |
14 sso := "sso_example" // string | (可选)
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.ModerationAPI.PutReopenThread(context.Background()).TenantId(tenantId).UrlId(urlId).Sso(sso).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `ModerationAPI.PutReopenThread``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // response from `PutReopenThread`: APIEmptyResponse
24 fmt.Fprintf(os.Stdout, "Response from `ModerationAPI.PutReopenThread`: %v\n", resp)
25}
26

SetTrustFactor Internal Link

参数

名称类型位置必填描述
tenantIdstringquery是
userIdstringquery否
trustFactorstringquery否
ssostringquery否

响应

返回:SetUserTrustFactorResponse

示例

SetTrustFactor 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 userId := "userId_example" // string | (可选)
14 trustFactor := "trustFactor_example" // string | (可选)
15 sso := "sso_example" // string | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.ModerationAPI.SetTrustFactor(context.Background()).TenantId(tenantId).UserId(userId).TrustFactor(trustFactor).Sso(sso).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "调用 `ModerationAPI.SetTrustFactor`` 时出错:%v\n", err)
22 fmt.Fprintf(os.Stderr, "完整 HTTP 响应:%v\n", r)
23 }
24 // 来自 `SetTrustFactor` 的响应: SetUserTrustFactorResponse
25 fmt.Fprintf(os.Stdout, "来自 `ModerationAPI.SetTrustFactor` 的响应:%v\n", resp)
26}
27

CreateModerator Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是

响应

返回: CreateModeratorResponse

示例

CreateModerator 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 createModeratorBody := *openapiclient.NewCreateModeratorBody("Name_example", "Email_example") // CreateModeratorBody |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.CreateModerator(context.Background()).TenantId(tenantId).CreateModeratorBody(createModeratorBody).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.CreateModerator``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `CreateModerator` 的响应: CreateModeratorResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.CreateModerator`: %v\n", resp)
24}
25

DeleteModerator Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
idstringpath是
sendEmailstringquery否

响应

返回: APIEmptyResponse

示例

DeleteModerator 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14 sendEmail := "sendEmail_example" // string | (可选)
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.DefaultAPI.DeleteModerator(context.Background(), id).TenantId(tenantId).SendEmail(sendEmail).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.DeleteModerator``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `DeleteModerator` 的响应:APIEmptyResponse
24 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.DeleteModerator`: %v\n", resp)
25}
26

GetModerator Internal Link


参数

名称类型位置必需描述
tenantIdstringquery是
idstringpath是

响应

返回:GetModeratorResponse

示例

GetModerator 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // 字符串 |
13 id := "id_example" // 字符串 |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.GetModerator(context.Background(), id).TenantId(tenantId).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetModerator``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // `GetModerator` 的响应:GetModeratorResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetModerator`: %v\n", resp)
24}
25

GetModerators Internal Link

参数

名称类型位置是否必需描述
tenantIdstringquery是
skipnumberquery否

响应

返回: GetModeratorsResponse

示例

GetModerators 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 skip := float64(1.2) // float64 | (可选)
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.GetModerators(context.Background()).TenantId(tenantId).Skip(skip).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetModerators``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `GetModerators` 的响应: GetModeratorsResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetModerators`: %v\n", resp)
24}
25

SendInvite Internal Link

参数

名称类型位置必需描述
tenantIdstringquery是
idstringpath是
fromNamestringquery是

响应

返回: APIEmptyResponse

示例

SendInvite 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14 fromName := "fromName_example" // string |
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.DefaultAPI.SendInvite(context.Background(), id).TenantId(tenantId).FromName(fromName).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.SendInvite``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `SendInvite` 的响应: APIEmptyResponse
24 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.SendInvite`: %v\n", resp)
25}
26

UpdateModerator Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringqueryYes
idstringpathYes

响应

返回:APIEmptyResponse

示例

UpdateModerator 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14 updateModeratorBody := *openapiclient.NewUpdateModeratorBody() // UpdateModeratorBody |
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.DefaultAPI.UpdateModerator(context.Background(), id).TenantId(tenantId).UpdateModeratorBody(updateModeratorBody).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.UpdateModerator``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `UpdateModerator` 的响应: APIEmptyResponse
24 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.UpdateModerator`: %v\n", resp)
25}
26

DeleteNotificationCount Internal Link


参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
idstringpath是

响应

返回:APIEmptyResponse

示例

DeleteNotificationCount 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.DeleteNotificationCount(context.Background(), id).TenantId(tenantId).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.DeleteNotificationCount``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `DeleteNotificationCount` 的响应:APIEmptyResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.DeleteNotificationCount`: %v\n", resp)
24}
25

GetCachedNotificationCount Internal Link

参数

名称类型位置必填描述
tenantIdstringquery是
idstringpath是

响应

返回:GetCachedNotificationCountResponse

示例

GetCachedNotificationCount 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.GetCachedNotificationCount(context.Background(), id).TenantId(tenantId).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetCachedNotificationCount``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `GetCachedNotificationCount` 的响应: GetCachedNotificationCountResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetCachedNotificationCount`: %v\n", resp)
24}
25

GetNotificationCount Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
userIdstringquery否
urlIdstringquery否
fromCommentIdstringquery否
viewedbooleanquery否
typestringquery否

响应

返回: GetNotificationCountResponse

示例

GetNotificationCount 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 userId := "userId_example" // string | (可选)
14 urlId := "urlId_example" // string | (可选)
15 fromCommentId := "fromCommentId_example" // string | (可选)
16 viewed := true // bool | (可选)
17 type_ := "type__example" // string | (可选)
18
19 configuration := openapiclient.NewConfiguration()
20 apiClient := openapiclient.NewAPIClient(configuration)
21 resp, r, err := apiClient.DefaultAPI.GetNotificationCount(context.Background()).TenantId(tenantId).UserId(userId).UrlId(urlId).FromCommentId(fromCommentId).Viewed(viewed).Type_(type_).Execute()
22 if err != nil {
23 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetNotificationCount``: %v\n", err)
24 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
25 }
26 // 来自 `GetNotificationCount` 的响应: GetNotificationCountResponse
27 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetNotificationCount`: %v\n", resp)
28}
29

GetNotifications Internal Link

参数

名称类型位置必填描述
tenantIdstringquery是
userIdstringquery否
urlIdstringquery否
fromCommentIdstringquery否
viewedbooleanquery否
typestringquery否
skipnumberquery否

响应

返回: GetNotificationsResponse

示例

GetNotifications 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 userId := "userId_example" // string | (可选)
14 urlId := "urlId_example" // string | (可选)
15 fromCommentId := "fromCommentId_example" // string | (可选)
16 viewed := true // bool | (可选)
17 type_ := "type__example" // string | (可选)
18 skip := float64(1.2) // float64 | (可选)
19
20 configuration := openapiclient.NewConfiguration()
21 apiClient := openapiclient.NewAPIClient(configuration)
22 resp, r, err := apiClient.DefaultAPI.GetNotifications(context.Background()).TenantId(tenantId).UserId(userId).UrlId(urlId).FromCommentId(fromCommentId).Viewed(viewed).Type_(type_).Skip(skip).Execute()
23 if err != nil {
24 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetNotifications``: %v\n", err)
25 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
26 }
27 // 来自 `GetNotifications` 的响应: GetNotificationsResponse
28 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetNotifications`: %v\n", resp)
29}
30

UpdateNotification Internal Link

参数

名称类型位置必填描述
tenantIdstring查询是
idstring路径是
userIdstring查询否

响应

返回: APIEmptyResponse

示例

UpdateNotification 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14 updateNotificationBody := *openapiclient.NewUpdateNotificationBody() // UpdateNotificationBody |
15 userId := "userId_example" // string | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.DefaultAPI.UpdateNotification(context.Background(), id).TenantId(tenantId).UpdateNotificationBody(updateNotificationBody).UserId(userId).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.UpdateNotification``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // 来自 `UpdateNotification` 的响应: APIEmptyResponse
25 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.UpdateNotification`: %v\n", resp)
26}
27

CreateV1PageReact Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstring路径是
urlIdstring查询是
titlestring查询否

响应

返回:CreateV1PageReact

示例

CreateV1PageReact 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 urlId := "urlId_example" // string |
14 title := "title_example" // string | (可选)
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.PublicAPI.CreateV1PageReact(context.Background(), tenantId).UrlId(urlId).Title(title).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.CreateV1PageReact``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `CreateV1PageReact` 的响应:CreateV1PageReact
24 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.CreateV1PageReact`: %v\n", resp)
25}
26

CreateV2PageReact Internal Link

参数

名称类型位置必填描述
tenantIdstringpath是
urlIdstringquery是
idstringquery是
titlestringquery否

响应

返回:CreateV1PageReact

示例

CreateV2PageReact 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 urlId := "urlId_example" // string |
14 id := "id_example" // string |
15 title := "title_example" // string | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.PublicAPI.CreateV2PageReact(context.Background(), tenantId).UrlId(urlId).Id(id).Title(title).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.CreateV2PageReact``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // 来自 `CreateV2PageReact` 的响应: CreateV1PageReact
25 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.CreateV2PageReact`: %v\n", resp)
26}
27

DeleteV1PageReact Internal Link


参数

NameTypeLocationRequiredDescription
tenantIdstringpath是
urlIdstringquery是

响应

返回: CreateV1PageReact

示例

DeleteV1PageReact 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 urlId := "urlId_example" // string |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.PublicAPI.DeleteV1PageReact(context.Background(), tenantId).UrlId(urlId).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.DeleteV1PageReact``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `DeleteV1PageReact` 的响应: CreateV1PageReact
23 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.DeleteV1PageReact`: %v\n", resp)
24}
25

DeleteV2PageReact Internal Link

参数

名称类型位置必需描述
tenantIdstring路径是
urlIdstring查询是
idstring查询是

响应

返回: CreateV1PageReact

示例

DeleteV2PageReact 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // 字符串 |
13 urlId := "urlId_example" // 字符串 |
14 id := "id_example" // 字符串 |
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.PublicAPI.DeleteV2PageReact(context.Background(), tenantId).UrlId(urlId).Id(id).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.DeleteV2PageReact``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `DeleteV2PageReact` 的响应:CreateV1PageReact
24 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.DeleteV2PageReact`: %v\n", resp)
25}
26

GetV1PageLikes Internal Link

参数

名称类型位置必需描述
tenantIdstringpath是
urlIdstringquery是

响应

返回: GetV1PageLikes

示例

GetV1PageLikes 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 urlId := "urlId_example" // string |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.PublicAPI.GetV1PageLikes(context.Background(), tenantId).UrlId(urlId).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.GetV1PageLikes``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // response from `GetV1PageLikes`: GetV1PageLikes
23 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.GetV1PageLikes`: %v\n", resp)
24}
25

GetV2PageReacts Internal Link

参数

名称类型位置必填描述
tenantIdstringpath是
urlIdstringquery是

响应

返回:GetV2PageReacts

示例

GetV2PageReacts 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 urlId := "urlId_example" // string |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.PublicAPI.GetV2PageReacts(context.Background(), tenantId).UrlId(urlId).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.GetV2PageReacts``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `GetV2PageReacts` 的响应: GetV2PageReacts
23 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.GetV2PageReacts`: %v\n", resp)
24}
25

GetV2PageReactUsers Internal Link


参数

名称类型位置必需描述
tenantIdstringpath是
urlIdstringquery是
idstringquery是

响应

返回:GetV2PageReactUsersResponse

示例

GetV2PageReactUsers 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 urlId := "urlId_example" // string |
14 id := "id_example" // string |
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.PublicAPI.GetV2PageReactUsers(context.Background(), tenantId).UrlId(urlId).Id(id).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.GetV2PageReactUsers``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `GetV2PageReactUsers` 的响应: GetV2PageReactUsersResponse
24 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.GetV2PageReactUsers`: %v\n", resp)
25}
26

AddPage Internal Link


参数

名称类型位置必需描述
tenantIdstringquery是

响应

返回: AddPageAPIResponse

示例

AddPage 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 createAPIPageData := *openapiclient.NewCreateAPIPageData("Title_example", "Url_example", "UrlId_example") // CreateAPIPageData |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.AddPage(context.Background()).TenantId(tenantId).CreateAPIPageData(createAPIPageData).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.AddPage``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `AddPage` 的响应: AddPageAPIResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.AddPage`: %v\n", resp)
24}
25

DeletePage Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
idstringpath是

响应

返回: DeletePageAPIResponse

示例

DeletePage 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.DeletePage(context.Background(), id).TenantId(tenantId).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.DeletePage``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `DeletePage` 的响应: DeletePageAPIResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.DeletePage`: %v\n", resp)
24}
25

GetOfflineUsers Internal Link


此页面的过去评论者(当前不在线)。按 displayName 排序。 在用尽 /users/online 后,使用此接口来呈现 “成员” 部分。 基于 commenterName 的游标分页:服务器沿部分索引 {tenantId, urlId, commenterName} 从 afterName 向前通过 $gt 遍历,无 $skip 成本。

参数

名称类型位置必需描述
tenantIdstringpathYes
urlIdstringqueryYes页面 URL 标识符(服务器端已清理)。
afterNamestringqueryNo游标:传入上一次响应中的 nextAfterName。
afterUserIdstringqueryNo游标决胜项:传入上一次响应中的 nextAfterUserId。当设置 afterName 时需要此项,以免同名时丢失条目。

响应

返回:PageUsersOfflineResponse

示例

GetOfflineUsers 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string | 租户 ID
13 urlId := "urlId_example" // string | 页面 URL 标识符(服务器端已清理)。
14 afterName := "afterName_example" // string | 游标:传入上一次响应中的 nextAfterName。(可选)
15 afterUserId := "afterUserId_example" // string | 游标决胜项:传入上一次响应中的 nextAfterUserId。当设置 afterName 时需要此项,以免同名时丢失条目。(可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.PublicAPI.GetOfflineUsers(context.Background(), tenantId).UrlId(urlId).AfterName(afterName).AfterUserId(afterUserId).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.GetOfflineUsers``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // 来自 `GetOfflineUsers` 的响应:PageUsersOfflineResponse
25 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.GetOfflineUsers`: %v\n", resp)
26}
27

GetOnlineUsers Internal Link


当前在线的页面查看者:其 websocket 会话当前订阅了该页面的人。返回 anonCount + totalCount(房间范围的订阅者,包括我们不枚举的匿名观众)。

参数

名称类型位置必需描述
tenantIdstringpath是
urlIdstringquery是Page URL identifier (cleaned server-side).
afterNamestringquery否游标:传入来自上一个响应的 nextAfterName。
afterUserIdstringquery否游标决胜项:传入来自上一个响应的 nextAfterUserId。在设置 afterName 时为必要,以防止同名导致条目丢失。

响应

返回: PageUsersOnlineResponse

示例

GetOnlineUsers 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 urlId := "urlId_example" // string | 页面 URL 标识符(服务器端已清理)。
14 afterName := "afterName_example" // string | 游标:传入来自上一个响应的 nextAfterName。 (optional)
15 afterUserId := "afterUserId_example" // string | 游标决胜项:传入来自上一个响应的 nextAfterUserId。Required when afterName is set so name-ties don't drop entries. (optional)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.PublicAPI.GetOnlineUsers(context.Background(), tenantId).UrlId(urlId).AfterName(afterName).AfterUserId(afterUserId).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.GetOnlineUsers``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // response from `GetOnlineUsers`: PageUsersOnlineResponse
25 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.GetOnlineUsers`: %v\n", resp)
26}
27

GetPageByURLId Internal Link

参数

名称类型位置必需描述
tenantIdstringquery是
urlIdstringquery是

响应

返回: GetPageByURLIdAPIResponse

示例

GetPageByURLId 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 urlId := "urlId_example" // string |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.GetPageByURLId(context.Background()).TenantId(tenantId).UrlId(urlId).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetPageByURLId``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `GetPageByURLId` 的响应: GetPageByURLIdAPIResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetPageByURLId`: %v\n", resp)
24}
25

GetPages Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是

响应

返回: GetPagesAPIResponse

示例

GetPages 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // 字符串 |
13
14 configuration := openapiclient.NewConfiguration()
15 apiClient := openapiclient.NewAPIClient(configuration)
16 resp, r, err := apiClient.DefaultAPI.GetPages(context.Background()).TenantId(tenantId).Execute()
17 if err != nil {
18 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetPages``: %v\n", err)
19 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
20 }
21 // 来自 `GetPages` 的响应: GetPagesAPIResponse
22 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetPages`: %v\n", resp)
23}
24

GetPagesPublic Internal Link

列出租户的页面。由 FChat 桌面客户端用于填充其房间列表。要求在每个页面的已解析自定义配置中 enableFChat 为 true。需要 SSO 的页面将根据请求用户的组访问权限进行过滤。

参数

名称类型位置必需描述
tenantIdstringpath是
cursorstringquery否不透明的分页游标,由先前请求返回为 nextCursor。与相同的 sortBy 绑定。
limitintegerquery否1..200,默认 50
qstringquery否可选的、大小写不敏感的标题前缀过滤。
sortBystringquery否排序顺序。updatedAt(默认,按最新优先),commentCount(按评论数最多优先),或 title(按字母顺序)。
hasCommentsbooleanquery否如果为 true,则只返回至少有一条评论的页面。

响应

返回: GetPublicPagesResponse

示例

GetPagesPublic 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 cursor := "cursor_example" // string | 不透明的分页游标,由先前请求返回为 `nextCursor`。与相同的 `sortBy` 绑定。 (optional)
14 limit := int32(56) // int32 | 1..200,默认 50 (optional)
15 q := "q_example" // string | 可选的、大小写不敏感的标题前缀过滤。 (optional)
16 sortBy := openapiclient.PagesSortBy("updatedAt") // PagesSortBy | 排序顺序。`updatedAt`(默认,按最新优先),`commentCount`(按评论数最多优先),或 `title`(按字母顺序)。 (optional)
17 hasComments := true // bool | 如果为 true,则只返回至少有一条评论的页面。 (optional)
18
19 configuration := openapiclient.NewConfiguration()
20 apiClient := openapiclient.NewAPIClient(configuration)
21 resp, r, err := apiClient.PublicAPI.GetPagesPublic(context.Background(), tenantId).Cursor(cursor).Limit(limit).Q(q).SortBy(sortBy).HasComments(hasComments).Execute()
22 if err != nil {
23 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.GetPagesPublic``: %v\n", err)
24 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
25 }
26 // response from `GetPagesPublic`: GetPublicPagesResponse
27 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.GetPagesPublic`: %v\n", resp)
28}
29

GetUsersInfo Internal Link


获取租户的批量用户信息。给定 userIds,返回 User / SSOUser 的显示信息。 由评论小部件使用,以丰富通过在线状态事件刚出现的用户信息。 无页面上下文:隐私统一强制执行(私有档案将被屏蔽)。

参数

名称类型位置必需描述
tenantIdstringpath是
idsstringquery是以逗号分隔的 userIds。

响应

返回:PageUsersInfoResponse

示例

GetUsersInfo 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 ids := "ids_example" // string | 以逗号分隔的 userIds。
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.PublicAPI.GetUsersInfo(context.Background(), tenantId).Ids(ids).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.GetUsersInfo``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `GetUsersInfo` 的响应:PageUsersInfoResponse
23 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.GetUsersInfo`: %v\n", resp)
24}
25

PatchPage Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
idstringpath是

响应

返回: PatchPageAPIResponse

示例

PatchPage 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14 updateAPIPageData := *openapiclient.NewUpdateAPIPageData() // UpdateAPIPageData |
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.DefaultAPI.PatchPage(context.Background(), id).TenantId(tenantId).UpdateAPIPageData(updateAPIPageData).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.PatchPage``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `PatchPage` 的响应: PatchPageAPIResponse
24 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.PatchPage`: %v\n", resp)
25}
26

DeletePendingWebhookEvent Internal Link


参数

名称类型位置必填描述
tenantIdstring查询是
idstring路径是

响应

返回:APIEmptyResponse

示例

DeletePendingWebhookEvent 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.DeletePendingWebhookEvent(context.Background(), id).TenantId(tenantId).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.DeletePendingWebhookEvent``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `DeletePendingWebhookEvent` 的响应:APIEmptyResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.DeletePendingWebhookEvent`: %v\n", resp)
24}
25

GetPendingWebhookEventCount Internal Link

参数

名称类型位置必需描述
tenantIdstringquery是
commentIdstringquery否
externalIdstringquery否
eventTypestringquery否
typestringquery否
domainstringquery否
attemptCountGTnumberquery否

响应

返回: GetPendingWebhookEventCountResponse

示例

GetPendingWebhookEventCount 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string | (可选)
14 externalId := "externalId_example" // string | (可选)
15 eventType := "eventType_example" // string | (可选)
16 type_ := "type__example" // string | (可选)
17 domain := "domain_example" // string | (可选)
18 attemptCountGT := float64(1.2) // float64 | (可选)
19
20 configuration := openapiclient.NewConfiguration()
21 apiClient := openapiclient.NewAPIClient(configuration)
22 resp, r, err := apiClient.DefaultAPI.GetPendingWebhookEventCount(context.Background()).TenantId(tenantId).CommentId(commentId).ExternalId(externalId).EventType(eventType).Type_(type_).Domain(domain).AttemptCountGT(attemptCountGT).Execute()
23 if err != nil {
24 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetPendingWebhookEventCount``: %v\n", err)
25 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
26 }
27 // 来自 `GetPendingWebhookEventCount` 的响应: GetPendingWebhookEventCountResponse
28 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetPendingWebhookEventCount`: %v\n", resp)
29}
30

GetPendingWebhookEvents Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringqueryYes
commentIdstringqueryNo
externalIdstringqueryNo
eventTypestringqueryNo
typestringqueryNo
domainstringqueryNo
attemptCountGTnumberqueryNo
skipnumberqueryNo

响应

返回: GetPendingWebhookEventsResponse

示例

GetPendingWebhookEvents 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string | (可选)
14 externalId := "externalId_example" // string | (可选)
15 eventType := "eventType_example" // string | (可选)
16 type_ := "type__example" // string | (可选)
17 domain := "domain_example" // string | (可选)
18 attemptCountGT := float64(1.2) // float64 | (可选)
19 skip := float64(1.2) // float64 | (可选)
20
21 configuration := openapiclient.NewConfiguration()
22 apiClient := openapiclient.NewAPIClient(configuration)
23 resp, r, err := apiClient.DefaultAPI.GetPendingWebhookEvents(context.Background()).TenantId(tenantId).CommentId(commentId).ExternalId(externalId).EventType(eventType).Type_(type_).Domain(domain).AttemptCountGT(attemptCountGT).Skip(skip).Execute()
24 if err != nil {
25 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetPendingWebhookEvents``: %v\n", err)
26 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
27 }
28 // 来自 `GetPendingWebhookEvents` 的响应: GetPendingWebhookEventsResponse
29 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetPendingWebhookEvents`: %v\n", resp)
30}
31

CreateQuestionConfig Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是

响应

返回: CreateQuestionConfigResponse

示例

CreateQuestionConfig 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 createQuestionConfigBody := *openapiclient.NewCreateQuestionConfigBody("Name_example", "Question_example", "Type_example", float64(123)) // CreateQuestionConfigBody |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.CreateQuestionConfig(context.Background()).TenantId(tenantId).CreateQuestionConfigBody(createQuestionConfigBody).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.CreateQuestionConfig``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `CreateQuestionConfig` 的响应: CreateQuestionConfigResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.CreateQuestionConfig`: %v\n", resp)
24}
25

DeleteQuestionConfig Internal Link

参数

名称类型位置必需描述
tenantIdstringqueryYes
idstringpathYes

响应

返回: APIEmptyResponse

示例

DeleteQuestionConfig 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.DeleteQuestionConfig(context.Background(), id).TenantId(tenantId).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.DeleteQuestionConfig``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `DeleteQuestionConfig` 的响应: APIEmptyResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.DeleteQuestionConfig`: %v\n", resp)
24}
25

GetQuestionConfig Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringqueryYes
idstringpathYes

响应

返回: GetQuestionConfigResponse

示例

GetQuestionConfig 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.GetQuestionConfig(context.Background(), id).TenantId(tenantId).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetQuestionConfig``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `GetQuestionConfig` 的响应: GetQuestionConfigResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetQuestionConfig`: %v\n", resp)
24}
25

GetQuestionConfigs Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
skipnumberquery否

响应

返回:GetQuestionConfigsResponse

示例

GetQuestionConfigs 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 skip := float64(1.2) // float64 | (可选)
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.GetQuestionConfigs(context.Background()).TenantId(tenantId).Skip(skip).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetQuestionConfigs``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `GetQuestionConfigs` 的响应: GetQuestionConfigsResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetQuestionConfigs`: %v\n", resp)
24}
25

UpdateQuestionConfig Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstring查询是
idstring路径是

响应

返回: APIEmptyResponse

示例

UpdateQuestionConfig 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14 updateQuestionConfigBody := *openapiclient.NewUpdateQuestionConfigBody() // UpdateQuestionConfigBody |
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.DefaultAPI.UpdateQuestionConfig(context.Background(), id).TenantId(tenantId).UpdateQuestionConfigBody(updateQuestionConfigBody).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.UpdateQuestionConfig``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `UpdateQuestionConfig` 的响应: APIEmptyResponse
24 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.UpdateQuestionConfig`: %v\n", resp)
25}
26

CreateQuestionResult Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是

响应

返回: CreateQuestionResultResponse

示例

CreateQuestionResult 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 createQuestionResultBody := *openapiclient.NewCreateQuestionResultBody("UrlId_example", float64(123), "QuestionId_example") // CreateQuestionResultBody |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.CreateQuestionResult(context.Background()).TenantId(tenantId).CreateQuestionResultBody(createQuestionResultBody).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.CreateQuestionResult``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `CreateQuestionResult` 的响应: CreateQuestionResultResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.CreateQuestionResult`: %v\n", resp)
24}
25

DeleteQuestionResult Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
idstringpath是

响应

返回: APIEmptyResponse

示例

DeleteQuestionResult 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.DeleteQuestionResult(context.Background(), id).TenantId(tenantId).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.DeleteQuestionResult``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `DeleteQuestionResult` 的响应: APIEmptyResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.DeleteQuestionResult`: %v\n", resp)
24}
25

GetQuestionResult Internal Link


参数

NameTypeLocationRequiredDescription
tenantIdstring查询是
idstring路径是

响应

返回:GetQuestionResultResponse

示例

GetQuestionResult 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.GetQuestionResult(context.Background(), id).TenantId(tenantId).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetQuestionResult``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `GetQuestionResult` 的响应: GetQuestionResultResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetQuestionResult`: %v\n", resp)
24}
25

GetQuestionResults Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
urlIdstringquery否
userIdstringquery否
startDatestringquery否
questionIdstringquery否
questionIdsstringquery否
skipnumberquery否

响应

返回:GetQuestionResultsResponse

示例

GetQuestionResults 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 urlId := "urlId_example" // string | (可选)
14 userId := "userId_example" // string | (可选)
15 startDate := "startDate_example" // string | (可选)
16 questionId := "questionId_example" // string | (可选)
17 questionIds := "questionIds_example" // string | (可选)
18 skip := float64(1.2) // float64 | (可选)
19
20 configuration := openapiclient.NewConfiguration()
21 apiClient := openapiclient.NewAPIClient(configuration)
22 resp, r, err := apiClient.DefaultAPI.GetQuestionResults(context.Background()).TenantId(tenantId).UrlId(urlId).UserId(userId).StartDate(startDate).QuestionId(questionId).QuestionIds(questionIds).Skip(skip).Execute()
23 if err != nil {
24 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetQuestionResults``: %v\n", err)
25 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
26 }
27 // 来自 `GetQuestionResults` 的响应: GetQuestionResultsResponse
28 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetQuestionResults`: %v\n", resp)
29}
30

UpdateQuestionResult Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringqueryYes
idstringpathYes

响应

返回: APIEmptyResponse

示例

UpdateQuestionResult 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14 updateQuestionResultBody := *openapiclient.NewUpdateQuestionResultBody() // UpdateQuestionResultBody |
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.DefaultAPI.UpdateQuestionResult(context.Background(), id).TenantId(tenantId).UpdateQuestionResultBody(updateQuestionResultBody).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.UpdateQuestionResult``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // response from `UpdateQuestionResult`: APIEmptyResponse
24 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.UpdateQuestionResult`: %v\n", resp)
25}
26

AggregateQuestionResults Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
questionIdstringquery否
questionIdsarrayquery否
urlIdstringquery否
timeBucketstringquery否
startDatestringquery否
forceRecalculatebooleanquery否

响应

返回: AggregateQuestionResultsResponse

示例

AggregateQuestionResults 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 "time"
9 openapiclient "github.com/fastcomments/fastcomments-go/client"
10)
11
12func main() {
13 tenantId := "tenantId_example" // string |
14 questionId := "questionId_example" // string | (可选)
15 questionIds := []string{"Inner_example"} // []string | (可选)
16 urlId := "urlId_example" // string | (可选)
17 timeBucket := openapiclient.AggregateTimeBucket("day") // AggregateTimeBucket | (可选)
18 startDate := time.Now() // time.Time | (可选)
19 forceRecalculate := true // bool | (可选)
20
21 configuration := openapiclient.NewConfiguration()
22 apiClient := openapiclient.NewAPIClient(configuration)
23 resp, r, err := apiClient.DefaultAPI.AggregateQuestionResults(context.Background()).TenantId(tenantId).QuestionId(questionId).QuestionIds(questionIds).UrlId(urlId).TimeBucket(timeBucket).StartDate(startDate).ForceRecalculate(forceRecalculate).Execute()
24 if err != nil {
25 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.AggregateQuestionResults``: %v\n", err)
26 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
27 }
28 // 来自 `AggregateQuestionResults` 的响应: AggregateQuestionResultsResponse
29 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.AggregateQuestionResults`: %v\n", resp)
30}
31

BulkAggregateQuestionResults Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
forceRecalculatebooleanquery否

响应

返回: BulkAggregateQuestionResultsResponse

示例

BulkAggregateQuestionResults 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 bulkAggregateQuestionResultsRequest := *openapiclient.NewBulkAggregateQuestionResultsRequest([]openapiclient.BulkAggregateQuestionItem{*openapiclient.NewBulkAggregateQuestionItem("AggId_example")}) // BulkAggregateQuestionResultsRequest |
14 forceRecalculate := true // bool | (可选)
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.DefaultAPI.BulkAggregateQuestionResults(context.Background()).TenantId(tenantId).BulkAggregateQuestionResultsRequest(bulkAggregateQuestionResultsRequest).ForceRecalculate(forceRecalculate).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.BulkAggregateQuestionResults``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // response from `BulkAggregateQuestionResults`: BulkAggregateQuestionResultsResponse
24 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.BulkAggregateQuestionResults`: %v\n", resp)
25}
26

CombineCommentsWithQuestionResults Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstring查询Yes
questionIdstring查询No
questionIdsarray查询No
urlIdstring查询No
startDatestring查询No
forceRecalculateboolean查询No
minValuenumber查询No
maxValuenumber查询No
limitnumber查询No

响应

返回: CombineQuestionResultsWithCommentsResponse

示例

CombineCommentsWithQuestionResults 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 "time"
9 openapiclient "github.com/fastcomments/fastcomments-go/client"
10)
11
12func main() {
13 tenantId := "tenantId_example" // string |
14 questionId := "questionId_example" // string | (可选)
15 questionIds := []string{"Inner_example"} // []string | (可选)
16 urlId := "urlId_example" // string | (可选)
17 startDate := time.Now() // time.Time | (可选)
18 forceRecalculate := true // bool | (可选)
19 minValue := float64(1.2) // float64 | (可选)
20 maxValue := float64(1.2) // float64 | (可选)
21 limit := float64(1.2) // float64 | (可选)
22
23 configuration := openapiclient.NewConfiguration()
24 apiClient := openapiclient.NewAPIClient(configuration)
25 resp, r, err := apiClient.DefaultAPI.CombineCommentsWithQuestionResults(context.Background()).TenantId(tenantId).QuestionId(questionId).QuestionIds(questionIds).UrlId(urlId).StartDate(startDate).ForceRecalculate(forceRecalculate).MinValue(minValue).MaxValue(maxValue).Limit(limit).Execute()
26 if err != nil {
27 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.CombineCommentsWithQuestionResults``: %v\n", err)
28 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
29 }
30 // 来自 `CombineCommentsWithQuestionResults` 的响应:CombineQuestionResultsWithCommentsResponse
31 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.CombineCommentsWithQuestionResults`: %v\n", resp)
32}
33

AddSSOUser Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是

Response

返回: AddSSOUserAPIResponse

示例

AddSSOUser 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string | 租户 ID
13 createAPISSOUserData := *openapiclient.NewCreateAPISSOUserData("Email_example", "Username_example", "Id_example") // CreateAPISSOUserData | 创建 AP SSO 用户数据
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.AddSSOUser(context.Background()).TenantId(tenantId).CreateAPISSOUserData(createAPISSOUserData).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.AddSSOUser``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `AddSSOUser` 的响应:AddSSOUserAPIResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.AddSSOUser`: %v\n", resp)
24}
25

DeleteSSOUser Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
idstringpath是
deleteCommentsbooleanquery否
commentDeleteModestringquery否

响应

返回: DeleteSSOUserAPIResponse

示例

DeleteSSOUser 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14 deleteComments := true // bool | (可选)
15 commentDeleteMode := "commentDeleteMode_example" // string | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.DefaultAPI.DeleteSSOUser(context.Background(), id).TenantId(tenantId).DeleteComments(deleteComments).CommentDeleteMode(commentDeleteMode).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.DeleteSSOUser``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // 来自 `DeleteSSOUser` 的响应: DeleteSSOUserAPIResponse
25 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.DeleteSSOUser`: %v\n", resp)
26}
27

GetSSOUserByEmail Internal Link

参数

名称类型位置必需描述
tenantIdstringquery是
emailstringpath是

响应

返回: GetSSOUserByEmailAPIResponse

示例

GetSSOUserByEmail 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 email := "email_example" // string |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.GetSSOUserByEmail(context.Background(), email).TenantId(tenantId).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetSSOUserByEmail``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `GetSSOUserByEmail` 的响应: GetSSOUserByEmailAPIResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetSSOUserByEmail`: %v\n", resp)
24}
25

GetSSOUserById Internal Link

参数

名称类型位置必需描述
tenantIdstringquery是
idstringpath是

响应

返回: GetSSOUserByIdAPIResponse

示例

GetSSOUserById 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.GetSSOUserById(context.Background(), id).TenantId(tenantId).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetSSOUserById``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `GetSSOUserById` 的响应: GetSSOUserByIdAPIResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetSSOUserById`: %v\n", resp)
24}
25

GetSSOUsers Internal Link


参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
skipintegerquery否

响应

返回: GetSSOUsersResponse

示例

GetSSOUsers 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 skip := int32(56) // int32 | (可选)
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.GetSSOUsers(context.Background()).TenantId(tenantId).Skip(skip).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetSSOUsers``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `GetSSOUsers` 的响应: GetSSOUsersResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetSSOUsers`: %v\n", resp)
24}
25

PatchSSOUser Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
idstringpath是
updateCommentsbooleanquery否

响应

返回: PatchSSOUserAPIResponse

示例

PatchSSOUser 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14 updateAPISSOUserData := *openapiclient.NewUpdateAPISSOUserData() // UpdateAPISSOUserData |
15 updateComments := true // bool | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.DefaultAPI.PatchSSOUser(context.Background(), id).TenantId(tenantId).UpdateAPISSOUserData(updateAPISSOUserData).UpdateComments(updateComments).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.PatchSSOUser``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // 来自 `PatchSSOUser` 的响应: PatchSSOUserAPIResponse
25 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.PatchSSOUser`: %v\n", resp)
26}
27

PutSSOUser Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
idstringpath是
updateCommentsbooleanquery否

Response

返回: PutSSOUserAPIResponse

示例

PutSSOUser 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14 updateAPISSOUserData := *openapiclient.NewUpdateAPISSOUserData() // UpdateAPISSOUserData |
15 updateComments := true // bool | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.DefaultAPI.PutSSOUser(context.Background(), id).TenantId(tenantId).UpdateAPISSOUserData(updateAPISSOUserData).UpdateComments(updateComments).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.PutSSOUser``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // 来自 `PutSSOUser` 的响应:PutSSOUserAPIResponse
25 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.PutSSOUser`: %v\n", resp)
26}
27

CreateSubscription Internal Link

参数

名称类型位置必需描述
tenantIdstringqueryYes

响应

返回: CreateSubscriptionAPIResponse

示例

CreateSubscription 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 createAPIUserSubscriptionData := *openapiclient.NewCreateAPIUserSubscriptionData("UrlId_example") // CreateAPIUserSubscriptionData |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.CreateSubscription(context.Background()).TenantId(tenantId).CreateAPIUserSubscriptionData(createAPIUserSubscriptionData).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.CreateSubscription``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `CreateSubscription` 的响应: CreateSubscriptionAPIResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.CreateSubscription`: %v\n", resp)
24}
25

DeleteSubscription Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
idstringpath是
userIdstringquery否

响应

返回: DeleteSubscriptionAPIResponse

示例

DeleteSubscription 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14 userId := "userId_example" // string | (可选)
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.DefaultAPI.DeleteSubscription(context.Background(), id).TenantId(tenantId).UserId(userId).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.DeleteSubscription``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `DeleteSubscription` 的响应: DeleteSubscriptionAPIResponse
24 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.DeleteSubscription`: %v\n", resp)
25}
26

GetSubscriptions Internal Link

参数

名称类型位置必需描述
tenantIdstring查询是
userIdstring查询否

响应

返回: GetSubscriptionsAPIResponse

示例

GetSubscriptions 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 userId := "userId_example" // string | (可选)
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.GetSubscriptions(context.Background()).TenantId(tenantId).UserId(userId).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetSubscriptions``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `GetSubscriptions` 的响应: GetSubscriptionsAPIResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetSubscriptions`: %v\n", resp)
24}
25

UpdateSubscription Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
idstringpath是
userIdstringquery否

响应

返回:UpdateSubscriptionAPIResponse

示例

UpdateSubscription 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14 updateAPIUserSubscriptionData := *openapiclient.NewUpdateAPIUserSubscriptionData() // UpdateAPIUserSubscriptionData |
15 userId := "userId_example" // string | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.DefaultAPI.UpdateSubscription(context.Background(), id).TenantId(tenantId).UpdateAPIUserSubscriptionData(updateAPIUserSubscriptionData).UserId(userId).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.UpdateSubscription``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // 来自 `UpdateSubscription` 的响应: UpdateSubscriptionAPIResponse
25 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.UpdateSubscription`: %v\n", resp)
26}
27

GetTenantDailyUsages Internal Link

参数

名称类型位置必需描述
tenantIdstringquery是
yearNumbernumberquery否
monthNumbernumberquery否
dayNumbernumberquery否
skipnumberquery否

响应

返回: GetTenantDailyUsagesResponse

示例

GetTenantDailyUsages 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 yearNumber := float64(1.2) // float64 | (可选)
14 monthNumber := float64(1.2) // float64 | (可选)
15 dayNumber := float64(1.2) // float64 | (可选)
16 skip := float64(1.2) // float64 | (可选)
17
18 configuration := openapiclient.NewConfiguration()
19 apiClient := openapiclient.NewAPIClient(configuration)
20 resp, r, err := apiClient.DefaultAPI.GetTenantDailyUsages(context.Background()).TenantId(tenantId).YearNumber(yearNumber).MonthNumber(monthNumber).DayNumber(dayNumber).Skip(skip).Execute()
21 if err != nil {
22 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetTenantDailyUsages``: %v\n", err)
23 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
24 }
25 // 来自 `GetTenantDailyUsages` 的响应: GetTenantDailyUsagesResponse
26 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetTenantDailyUsages`: %v\n", resp)
27}
28

CreateTenantPackage Internal Link

参数

名称类型位置必需描述
tenantIdstringquery是

响应

返回:CreateTenantPackageResponse

示例

CreateTenantPackage 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 createTenantPackageBody := *openapiclient.NewCreateTenantPackageBody("Name_example", float64(123), float64(123), float64(123), float64(123), float64(123), float64(123), float64(123), float64(123), false, "ForWhoText_example", []string{"FeatureTaglines_example"}, false) // CreateTenantPackageBody |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.CreateTenantPackage(context.Background()).TenantId(tenantId).CreateTenantPackageBody(createTenantPackageBody).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.CreateTenantPackage``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `CreateTenantPackage` 的响应:CreateTenantPackageResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.CreateTenantPackage`: %v\n", resp)
24}
25

DeleteTenantPackage Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
idstringpath是

响应

返回: APIEmptyResponse

示例

DeleteTenantPackage 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.DeleteTenantPackage(context.Background(), id).TenantId(tenantId).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.DeleteTenantPackage``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `DeleteTenantPackage` 的响应: APIEmptyResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.DeleteTenantPackage`: %v\n", resp)
24}
25

GetTenantPackage Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
idstringpath是

响应

返回: GetTenantPackageResponse

示例

GetTenantPackage 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.GetTenantPackage(context.Background(), id).TenantId(tenantId).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetTenantPackage``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `GetTenantPackage` 的响应: GetTenantPackageResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetTenantPackage`: %v\n", resp)
24}
25

GetTenantPackages Internal Link


参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
skipnumberquery否

响应

返回:GetTenantPackagesResponse

示例

GetTenantPackages 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 skip := float64(1.2) // float64 | (可选)
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.GetTenantPackages(context.Background()).TenantId(tenantId).Skip(skip).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetTenantPackages``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `GetTenantPackages` 的响应:GetTenantPackagesResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetTenantPackages`: %v\n", resp)
24}
25

ReplaceTenantPackage Internal Link

参数

名称类型位置必填描述
tenantIdstringquery是
idstringpath是

响应

返回: APIEmptyResponse

示例

ReplaceTenantPackage 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14 replaceTenantPackageBody := *openapiclient.NewReplaceTenantPackageBody("Name_example", float64(123), float64(123), float64(123), float64(123), float64(123), float64(123), float64(123), float64(123), float64(123), float64(123), false, "ForWhoText_example", []string{"FeatureTaglines_example"}, false) // ReplaceTenantPackageBody |
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.DefaultAPI.ReplaceTenantPackage(context.Background(), id).TenantId(tenantId).ReplaceTenantPackageBody(replaceTenantPackageBody).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.ReplaceTenantPackage``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `ReplaceTenantPackage` 的响应: APIEmptyResponse
24 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.ReplaceTenantPackage`: %v\n", resp)
25}
26

UpdateTenantPackage Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
idstringpath是

响应

返回:APIEmptyResponse

示例

UpdateTenantPackage 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14 updateTenantPackageBody := *openapiclient.NewUpdateTenantPackageBody() // UpdateTenantPackageBody |
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.DefaultAPI.UpdateTenantPackage(context.Background(), id).TenantId(tenantId).UpdateTenantPackageBody(updateTenantPackageBody).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.UpdateTenantPackage``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `UpdateTenantPackage` 的响应: APIEmptyResponse
24 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.UpdateTenantPackage`: %v\n", resp)
25}
26

CreateTenantUser Internal Link

参数

名称类型位置必需描述
tenantIdstringquery是

响应

返回: CreateTenantUserResponse

示例

CreateTenantUser 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 createTenantUserBody := *openapiclient.NewCreateTenantUserBody("Username_example", "Email_example") // CreateTenantUserBody |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.CreateTenantUser(context.Background()).TenantId(tenantId).CreateTenantUserBody(createTenantUserBody).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.CreateTenantUser``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `CreateTenantUser` 的响应: CreateTenantUserResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.CreateTenantUser`: %v\n", resp)
24}
25

DeleteTenantUser Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringqueryYes
idstringpathYes
deleteCommentsstringqueryNo
commentDeleteModestringqueryNo

响应

返回: APIEmptyResponse

示例

DeleteTenantUser 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14 deleteComments := "deleteComments_example" // string | (可选)
15 commentDeleteMode := "commentDeleteMode_example" // string | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.DefaultAPI.DeleteTenantUser(context.Background(), id).TenantId(tenantId).DeleteComments(deleteComments).CommentDeleteMode(commentDeleteMode).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.DeleteTenantUser``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // 来自 `DeleteTenantUser` 的响应: APIEmptyResponse
25 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.DeleteTenantUser`: %v\n", resp)
26}
27

GetTenantUser Internal Link

参数

名称类型位置必需描述
tenantIdstringquery是
idstringpath是

响应

返回: GetTenantUserResponse

示例

GetTenantUser 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.GetTenantUser(context.Background(), id).TenantId(tenantId).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetTenantUser``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `GetTenantUser` 的响应: GetTenantUserResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetTenantUser`: %v\n", resp)
24}
25

GetTenantUsers Internal Link


参数

名称类型位置必需描述
tenantIdstringquery是
skipnumberquery否

响应

返回: GetTenantUsersResponse

示例

GetTenantUsers 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 skip := float64(1.2) // float64 | (可选)
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.GetTenantUsers(context.Background()).TenantId(tenantId).Skip(skip).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetTenantUsers``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // response from `GetTenantUsers`: GetTenantUsersResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetTenantUsers`: %v\n", resp)
24}
25

ReplaceTenantUser Internal Link

参数

名称类型位置必填描述
tenantIdstringquery是
idstringpath是
updateCommentsstringquery否

响应

返回:APIEmptyResponse

示例

ReplaceTenantUser 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14 replaceTenantUserBody := *openapiclient.NewReplaceTenantUserBody("Username_example", "Email_example") // ReplaceTenantUserBody |
15 updateComments := "updateComments_example" // string | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.DefaultAPI.ReplaceTenantUser(context.Background(), id).TenantId(tenantId).ReplaceTenantUserBody(replaceTenantUserBody).UpdateComments(updateComments).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.ReplaceTenantUser``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // 来自 `ReplaceTenantUser` 的响应: APIEmptyResponse
25 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.ReplaceTenantUser`: %v\n", resp)
26}
27

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
idstringpath是
redirectURLstringquery否

响应

返回: APIEmptyResponse

示例

SendLoginLink 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14 redirectURL := "redirectURL_example" // string | (可选)
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.DefaultAPI.SendLoginLink(context.Background(), id).TenantId(tenantId).RedirectURL(redirectURL).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.SendLoginLink``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // response from `SendLoginLink`: APIEmptyResponse
24 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.SendLoginLink`: %v\n", resp)
25}
26

UpdateTenantUser Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
idstringpath是
updateCommentsstringquery否

响应

返回:APIEmptyResponse

示例

UpdateTenantUser 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14 updateTenantUserBody := *openapiclient.NewUpdateTenantUserBody() // UpdateTenantUserBody |
15 updateComments := "updateComments_example" // string | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.DefaultAPI.UpdateTenantUser(context.Background(), id).TenantId(tenantId).UpdateTenantUserBody(updateTenantUserBody).UpdateComments(updateComments).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.UpdateTenantUser``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // 来自 `UpdateTenantUser` 的响应: APIEmptyResponse
25 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.UpdateTenantUser`: %v\n", resp)
26}
27

CreateTenant Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是

响应

返回: CreateTenantResponse

示例

CreateTenant 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 "time"
9 openapiclient "github.com/fastcomments/fastcomments-go/client"
10)
11
12func main() {
13 tenantId := "tenantId_example" // string |
14 createTenantBody := *openapiclient.NewCreateTenantBody("Name_example", []openapiclient.APIDomainConfiguration{*openapiclient.NewAPIDomainConfiguration("Id_example", "Domain_example", time.Now())}) // CreateTenantBody |
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.DefaultAPI.CreateTenant(context.Background()).TenantId(tenantId).CreateTenantBody(createTenantBody).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.CreateTenant``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // response from `CreateTenant`: CreateTenantResponse
24 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.CreateTenant`: %v\n", resp)
25}
26

DeleteTenant Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
idstringpath是
surestringquery否

返回

返回: APIEmptyResponse

示例

DeleteTenant 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14 sure := "sure_example" // string | (可选)
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.DefaultAPI.DeleteTenant(context.Background(), id).TenantId(tenantId).Sure(sure).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.DeleteTenant``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `DeleteTenant` 的响应: APIEmptyResponse
24 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.DeleteTenant`: %v\n", resp)
25}
26

GetTenant Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
idstringpath是

响应

返回: GetTenantResponse

示例

GetTenant 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // 字符串 |
13 id := "id_example" // 字符串 |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.GetTenant(context.Background(), id).TenantId(tenantId).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetTenant``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `GetTenant` 的响应: GetTenantResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetTenant`: %v\n", resp)
24}
25

GetTenants Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
metastringquery否
skipnumberquery否

响应

返回: GetTenantsResponse

示例

GetTenants 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 meta := "meta_example" // string | (可选)
14 skip := float64(1.2) // float64 | (可选)
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.DefaultAPI.GetTenants(context.Background()).TenantId(tenantId).Meta(meta).Skip(skip).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetTenants``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `GetTenants` 的响应: GetTenantsResponse
24 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetTenants`: %v\n", resp)
25}
26

UpdateTenant Internal Link

参数

名称类型位置必需描述
tenantIdstringquery是
idstringpath是

响应

返回:APIEmptyResponse

示例

UpdateTenant 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14 updateTenantBody := *openapiclient.NewUpdateTenantBody() // UpdateTenantBody |
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.DefaultAPI.UpdateTenant(context.Background(), id).TenantId(tenantId).UpdateTenantBody(updateTenantBody).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.UpdateTenant``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `UpdateTenant` 的响应: APIEmptyResponse
24 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.UpdateTenant`: %v\n", resp)
25}
26

ChangeTicketState Internal Link

参数

名称类型位置必需描述
tenantIdstringquery是
userIdstringquery是
idstringpath是

响应

返回: ChangeTicketStateResponse

示例

ChangeTicketState 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 userId := "userId_example" // string |
14 id := "id_example" // string |
15 changeTicketStateBody := *openapiclient.NewChangeTicketStateBody(int32(123)) // ChangeTicketStateBody |
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.DefaultAPI.ChangeTicketState(context.Background(), id).TenantId(tenantId).UserId(userId).ChangeTicketStateBody(changeTicketStateBody).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.ChangeTicketState``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // 来自 `ChangeTicketState` 的响应: ChangeTicketStateResponse
25 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.ChangeTicketState`: %v\n", resp)
26}
27

CreateTicket Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
userIdstringquery是

响应

返回: CreateTicketResponse

示例

CreateTicket 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 userId := "userId_example" // string |
14 createTicketBody := *openapiclient.NewCreateTicketBody("Subject_example") // CreateTicketBody |
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.DefaultAPI.CreateTicket(context.Background()).TenantId(tenantId).UserId(userId).CreateTicketBody(createTicketBody).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.CreateTicket``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `CreateTicket` 的响应: CreateTicketResponse
24 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.CreateTicket`: %v\n", resp)
25}
26

GetTicket Internal Link

参数

名称类型位置必需描述
tenantIdstringquery是
idstringpath是
userIdstringquery否

响应

返回:GetTicketResponse

示例

GetTicket 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14 userId := "userId_example" // string | (可选)
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.DefaultAPI.GetTicket(context.Background(), id).TenantId(tenantId).UserId(userId).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetTicket``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `GetTicket` 的响应: GetTicketResponse
24 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetTicket`: %v\n", resp)
25}
26

GetTickets Internal Link


参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
userIdstringquery否
statenumberquery否
skipnumberquery否
limitnumberquery否

响应

返回: GetTicketsResponse

示例

GetTickets 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 userId := "userId_example" // string | (可选)
14 state := float64(1.2) // float64 | (可选)
15 skip := float64(1.2) // float64 | (可选)
16 limit := float64(1.2) // float64 | (可选)
17
18 configuration := openapiclient.NewConfiguration()
19 apiClient := openapiclient.NewAPIClient(configuration)
20 resp, r, err := apiClient.DefaultAPI.GetTickets(context.Background()).TenantId(tenantId).UserId(userId).State(state).Skip(skip).Limit(limit).Execute()
21 if err != nil {
22 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetTickets``: %v\n", err)
23 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
24 }
25 // 来自 `GetTickets` 的响应: GetTicketsResponse
26 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetTickets`: %v\n", resp)
27}
28

GetTranslations Internal Link


参数

名称类型位置必需描述
namespacestringpath是
componentstringpath是
localestringquery否
useFullTranslationIdsbooleanquery否

响应

返回: GetTranslationsResponse

示例

GetTranslations 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 namespace := "namespace_example" // string |
13 component := "component_example" // string |
14 locale := "locale_example" // string | (可选)
15 useFullTranslationIds := true // bool | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.PublicAPI.GetTranslations(context.Background(), namespace, component).Locale(locale).UseFullTranslationIds(useFullTranslationIds).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.GetTranslations``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // 来自 `GetTranslations` 的响应: GetTranslationsResponse
25 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.GetTranslations`: %v\n", resp)
26}
27

UploadImage Internal Link

上传并调整图像尺寸

参数

NameTypeLocationRequiredDescription
tenantIdstringpathYes
sizePresetstringqueryNo尺寸预设: "Default" (1000x1000px) 或 "CrossPlatform" (为流行设备创建尺寸)
urlIdstringqueryNo上传发生所在的页面 id,用于配置

响应

返回: UploadImageResponse

示例

UploadImage 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 file := os.NewFile(1234, "some_file") // *os.File |
14 sizePreset := openapiclient.SizePreset("Default") // SizePreset | 尺寸预设: \"Default\" (1000x1000px) 或 \"CrossPlatform\" (为流行设备创建尺寸) (optional)
15 urlId := "urlId_example" // string | 上传发生所在的页面 id,用于配置 (optional)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.PublicAPI.UploadImage(context.Background(), tenantId).File(file).SizePreset(sizePreset).UrlId(urlId).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.UploadImage``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // 来自 `UploadImage` 的响应:UploadImageResponse
25 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.UploadImage`: %v\n", resp)
26}
27

GetUserBadgeProgressById Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstring查询是
idstring路径是

响应

返回: APIGetUserBadgeProgressResponse

示例

GetUserBadgeProgressById 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.GetUserBadgeProgressById(context.Background(), id).TenantId(tenantId).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetUserBadgeProgressById``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `GetUserBadgeProgressById` 的响应: APIGetUserBadgeProgressResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetUserBadgeProgressById`: %v\n", resp)
24}
25

GetUserBadgeProgressByUserId Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
userIdstringpath是

响应

返回: APIGetUserBadgeProgressResponse

示例

GetUserBadgeProgressByUserId 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 userId := "userId_example" // string |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.GetUserBadgeProgressByUserId(context.Background(), userId).TenantId(tenantId).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetUserBadgeProgressByUserId``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // response from `GetUserBadgeProgressByUserId`: APIGetUserBadgeProgressResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetUserBadgeProgressByUserId`: %v\n", resp)
24}
25

GetUserBadgeProgressList Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
userIdstringquery否
limitnumberquery否
skipnumberquery否

响应

返回: APIGetUserBadgeProgressListResponse

示例

GetUserBadgeProgressList 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 userId := "userId_example" // string | (可选)
14 limit := float64(1.2) // float64 | (可选)
15 skip := float64(1.2) // float64 | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.DefaultAPI.GetUserBadgeProgressList(context.Background()).TenantId(tenantId).UserId(userId).Limit(limit).Skip(skip).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetUserBadgeProgressList``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // 来自 `GetUserBadgeProgressList` 的响应: APIGetUserBadgeProgressListResponse
25 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetUserBadgeProgressList`: %v\n", resp)
26}
27

CreateUserBadge Internal Link

参数

名称类型位置必需描述
tenantIdstringquery是

响应

返回: APICreateUserBadgeResponse

示例

CreateUserBadge 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 createUserBadgeParams := *openapiclient.NewCreateUserBadgeParams("UserId_example", "BadgeId_example") // CreateUserBadgeParams |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.CreateUserBadge(context.Background()).TenantId(tenantId).CreateUserBadgeParams(createUserBadgeParams).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.CreateUserBadge``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `CreateUserBadge` 的响应: APICreateUserBadgeResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.CreateUserBadge`: %v\n", resp)
24}
25

DeleteUserBadge Internal Link

参数

名称类型位置必填描述
tenantIdstringqueryYes
idstringpathYes

响应

返回:APIEmptySuccessResponse

示例

DeleteUserBadge 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // 字符串 |
13 id := "id_example" // 字符串 |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.DeleteUserBadge(context.Background(), id).TenantId(tenantId).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.DeleteUserBadge``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `DeleteUserBadge` 的响应:APIEmptySuccessResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.DeleteUserBadge`: %v\n", resp)
24}
25

GetUserBadge Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
idstringpath是

响应

返回: APIGetUserBadgeResponse

示例

GetUserBadge 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.GetUserBadge(context.Background(), id).TenantId(tenantId).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetUserBadge``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // `GetUserBadge` 的响应: APIGetUserBadgeResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetUserBadge`: %v\n", resp)
24}
25

GetUserBadges Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
userIdstringquery否
badgeIdstringquery否
typenumberquery否
displayedOnCommentsbooleanquery否
limitnumberquery否
skipnumberquery否

响应

返回: APIGetUserBadgesResponse

示例

GetUserBadges 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 userId := "userId_example" // string | (可选)
14 badgeId := "badgeId_example" // string | (可选)
15 type_ := float64(1.2) // float64 | (可选)
16 displayedOnComments := true // bool | (可选)
17 limit := float64(1.2) // float64 | (可选)
18 skip := float64(1.2) // float64 | (可选)
19
20 configuration := openapiclient.NewConfiguration()
21 apiClient := openapiclient.NewAPIClient(configuration)
22 resp, r, err := apiClient.DefaultAPI.GetUserBadges(context.Background()).TenantId(tenantId).UserId(userId).BadgeId(badgeId).Type_(type_).DisplayedOnComments(displayedOnComments).Limit(limit).Skip(skip).Execute()
23 if err != nil {
24 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetUserBadges``: %v\n", err)
25 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
26 }
27 // 来自 `GetUserBadges` 的响应: APIGetUserBadgesResponse
28 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetUserBadges`: %v\n", resp)
29}
30

UpdateUserBadge Internal Link

参数

名称类型位置必填描述
tenantIdstringquery是
idstringpath是

响应

返回:APIEmptySuccessResponse

示例

UpdateUserBadge 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string | 租户 ID
13 id := "id_example" // string | 标识
14 updateUserBadgeParams := *openapiclient.NewUpdateUserBadgeParams() // UpdateUserBadgeParams | 更新用户徽章参数
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.DefaultAPI.UpdateUserBadge(context.Background(), id).TenantId(tenantId).UpdateUserBadgeParams(updateUserBadgeParams).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.UpdateUserBadge``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `UpdateUserBadge` 的响应:APIEmptySuccessResponse
24 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.UpdateUserBadge`: %v\n", resp)
25}
26

GetUserNotificationCount Internal Link

参数

名称类型位置必需描述
tenantIdstringquery是
ssostringquery否

响应

返回:GetUserNotificationCountResponse

示例

GetUserNotificationCount 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 sso := "sso_example" // string | (可选)
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.PublicAPI.GetUserNotificationCount(context.Background()).TenantId(tenantId).Sso(sso).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.GetUserNotificationCount``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `GetUserNotificationCount` 的响应: GetUserNotificationCountResponse
23 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.GetUserNotificationCount`: %v\n", resp)
24}
25

GetUserNotifications Internal Link

参数

名称类型位置必需描述
tenantIdstringquery是
urlIdstringquery否用于确定当前页面是否已订阅。
pageSizeintegerquery否
afterIdstringquery否
includeContextbooleanquery否
afterCreatedAtintegerquery否
unreadOnlybooleanquery否
dmOnlybooleanquery否
noDmbooleanquery否
includeTranslationsbooleanquery否
includeTenantNotificationsbooleanquery否
ssostringquery否

响应

返回: GetMyNotificationsResponse

示例

GetUserNotifications 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 urlId := "urlId_example" // string | 用于确定当前页面是否已订阅。 (可选)
14 pageSize := int32(56) // int32 | (可选)
15 afterId := "afterId_example" // string | (可选)
16 includeContext := true // bool | (可选)
17 afterCreatedAt := int64(789) // int64 | (可选)
18 unreadOnly := true // bool | (可选)
19 dmOnly := true // bool | (可选)
20 noDm := true // bool | (可选)
21 includeTranslations := true // bool | (可选)
22 includeTenantNotifications := true // bool | (可选)
23 sso := "sso_example" // string | (可选)
24
25 configuration := openapiclient.NewConfiguration()
26 apiClient := openapiclient.NewAPIClient(configuration)
27 resp, r, err := apiClient.PublicAPI.GetUserNotifications(context.Background()).TenantId(tenantId).UrlId(urlId).PageSize(pageSize).AfterId(afterId).IncludeContext(includeContext).AfterCreatedAt(afterCreatedAt).UnreadOnly(unreadOnly).DmOnly(dmOnly).NoDm(noDm).IncludeTranslations(includeTranslations).IncludeTenantNotifications(includeTenantNotifications).Sso(sso).Execute()
28 if err != nil {
29 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.GetUserNotifications``: %v\n", err)
30 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
31 }
32 // 来自 `GetUserNotifications` 的响应: GetMyNotificationsResponse
33 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.GetUserNotifications`: %v\n", resp)
34}
35

ResetUserNotificationCount Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
ssostringquery否

响应

返回: ResetUserNotificationsResponse

示例

ResetUserNotificationCount 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 sso := "sso_example" // string | (可选)
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.PublicAPI.ResetUserNotificationCount(context.Background()).TenantId(tenantId).Sso(sso).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.ResetUserNotificationCount``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `ResetUserNotificationCount` 的响应: ResetUserNotificationsResponse
23 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.ResetUserNotificationCount`: %v\n", resp)
24}
25

ResetUserNotifications Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
afterIdstringquery否
afterCreatedAtintegerquery否
unreadOnlybooleanquery否
dmOnlybooleanquery否
noDmbooleanquery否
ssostringquery否

响应

返回: ResetUserNotificationsResponse

示例

ResetUserNotifications 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 afterId := "afterId_example" // string | (可选)
14 afterCreatedAt := int64(789) // int64 | (可选)
15 unreadOnly := true // bool | (可选)
16 dmOnly := true // bool | (可选)
17 noDm := true // bool | (可选)
18 sso := "sso_example" // string | (可选)
19
20 configuration := openapiclient.NewConfiguration()
21 apiClient := openapiclient.NewAPIClient(configuration)
22 resp, r, err := apiClient.PublicAPI.ResetUserNotifications(context.Background()).TenantId(tenantId).AfterId(afterId).AfterCreatedAt(afterCreatedAt).UnreadOnly(unreadOnly).DmOnly(dmOnly).NoDm(noDm).Sso(sso).Execute()
23 if err != nil {
24 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.ResetUserNotifications``: %v\n", err)
25 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
26 }
27 // 来自 `ResetUserNotifications` 的响应:ResetUserNotificationsResponse
28 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.ResetUserNotifications`: %v\n", resp)
29}
30

UpdateUserNotificationCommentSubscriptionStatus Internal Link

为特定评论启用或禁用通知。

参数

NameTypeLocationRequiredDescription
tenantIdstringqueryYes
notificationIdstringpathYes
optedInOrOutstringpathYes
commentIdstringqueryYes
ssostringqueryNo

响应

返回: UpdateUserNotificationCommentSubscriptionStatusResponse

示例

UpdateUserNotificationCommentSubscriptionStatus 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 notificationId := "notificationId_example" // string |
14 optedInOrOut := "optedInOrOut_example" // string |
15 commentId := "commentId_example" // string |
16 sso := "sso_example" // string | (可选)
17
18 configuration := openapiclient.NewConfiguration()
19 apiClient := openapiclient.NewAPIClient(configuration)
20 resp, r, err := apiClient.PublicAPI.UpdateUserNotificationCommentSubscriptionStatus(context.Background(), notificationId, optedInOrOut).TenantId(tenantId).CommentId(commentId).Sso(sso).Execute()
21 if err != nil {
22 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.UpdateUserNotificationCommentSubscriptionStatus``: %v\n", err)
23 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
24 }
25 // 来自 `UpdateUserNotificationCommentSubscriptionStatus` 的响应: UpdateUserNotificationCommentSubscriptionStatusResponse
26 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.UpdateUserNotificationCommentSubscriptionStatus`: %v\n", resp)
27}
28

UpdateUserNotificationPageSubscriptionStatus Internal Link

为页面启用或禁用通知。当用户订阅某个页面时,会为新的根评论创建通知,并且还会

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
urlIdstringquery是
urlstringquery是
pageTitlestringquery是
subscribedOrUnsubscribedstringpath是
ssostringquery否

响应

返回: UpdateUserNotificationPageSubscriptionStatusResponse

示例

UpdateUserNotificationPageSubscriptionStatus 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 urlId := "urlId_example" // string |
14 url := "url_example" // string |
15 pageTitle := "pageTitle_example" // string |
16 subscribedOrUnsubscribed := "subscribedOrUnsubscribed_example" // string |
17 sso := "sso_example" // string | (可选)
18
19 configuration := openapiclient.NewConfiguration()
20 apiClient := openapiclient.NewAPIClient(configuration)
21 resp, r, err := apiClient.PublicAPI.UpdateUserNotificationPageSubscriptionStatus(context.Background(), subscribedOrUnsubscribed).TenantId(tenantId).UrlId(urlId).Url(url).PageTitle(pageTitle).Sso(sso).Execute()
22 if err != nil {
23 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.UpdateUserNotificationPageSubscriptionStatus``: %v\n", err)
24 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
25 }
26 // response from `UpdateUserNotificationPageSubscriptionStatus`: UpdateUserNotificationPageSubscriptionStatusResponse
27 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.UpdateUserNotificationPageSubscriptionStatus`: %v\n", resp)
28}
29

UpdateUserNotificationStatus Internal Link


参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
notificationIdstringpath是
newStatusstringpath是
ssostringquery否

响应

返回: UpdateUserNotificationStatusResponse

示例

UpdateUserNotificationStatus 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 notificationId := "notificationId_example" // string |
14 newStatus := "newStatus_example" // string |
15 sso := "sso_example" // string | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.PublicAPI.UpdateUserNotificationStatus(context.Background(), notificationId, newStatus).TenantId(tenantId).Sso(sso).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.UpdateUserNotificationStatus``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // response from `UpdateUserNotificationStatus`: UpdateUserNotificationStatusResponse
25 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.UpdateUserNotificationStatus`: %v\n", resp)
26}
27

GetUserPresenceStatuses Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringqueryYes
urlIdWSstringqueryYes
userIdsstringqueryYes

响应

返回:GetUserPresenceStatusesResponse

示例

GetUserPresenceStatuses 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // 字符串 |
13 urlIdWS := "urlIdWS_example" // 字符串 |
14 userIds := "userIds_example" // 字符串 |
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.PublicAPI.GetUserPresenceStatuses(context.Background()).TenantId(tenantId).UrlIdWS(urlIdWS).UserIds(userIds).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.GetUserPresenceStatuses``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // response from `GetUserPresenceStatuses`: GetUserPresenceStatusesResponse
24 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.GetUserPresenceStatuses`: %v\n", resp)
25}
26

SearchUsers Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringpath是
urlIdstringquery是
usernameStartsWithstringquery否
mentionGroupIdsarrayquery否
ssostringquery否
searchSectionstringquery否

响应

返回: SearchUsersResult

示例

SearchUsers 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 urlId := "urlId_example" // string |
14 usernameStartsWith := "usernameStartsWith_example" // string | (可选)
15 mentionGroupIds := []string{"Inner_example"} // []string | (可选)
16 sso := "sso_example" // string | (可选)
17 searchSection := "searchSection_example" // string | (可选)
18
19 configuration := openapiclient.NewConfiguration()
20 apiClient := openapiclient.NewAPIClient(configuration)
21 resp, r, err := apiClient.PublicAPI.SearchUsers(context.Background(), tenantId).UrlId(urlId).UsernameStartsWith(usernameStartsWith).MentionGroupIds(mentionGroupIds).Sso(sso).SearchSection(searchSection).Execute()
22 if err != nil {
23 fmt.Fprintf(os.Stderr, "Error when calling `PublicAPI.SearchUsers``: %v\n", err)
24 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
25 }
26 // response from `SearchUsers`: SearchUsersResult
27 fmt.Fprintf(os.Stdout, "Response from `PublicAPI.SearchUsers`: %v\n", resp)
28}
29

GetUser Internal Link

参数

名称类型位置必需描述
tenantIdstringquery是
idstringpath是

响应

返回: GetUserResponse

示例

GetUser 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.GetUser(context.Background(), id).TenantId(tenantId).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetUser``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `GetUser` 的响应: GetUserResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetUser`: %v\n", resp)
24}
25

CreateVote Internal Link


参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
commentIdstringquery是
directionstringquery是
userIdstringquery否
anonUserIdstringquery否

响应

返回: VoteResponse

示例

CreateVote 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 commentId := "commentId_example" // string |
14 direction := "direction_example" // string |
15 userId := "userId_example" // string | (可选)
16 anonUserId := "anonUserId_example" // string | (可选)
17
18 configuration := openapiclient.NewConfiguration()
19 apiClient := openapiclient.NewAPIClient(configuration)
20 resp, r, err := apiClient.DefaultAPI.CreateVote(context.Background()).TenantId(tenantId).CommentId(commentId).Direction(direction).UserId(userId).AnonUserId(anonUserId).Execute()
21 if err != nil {
22 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.CreateVote``: %v\n", err)
23 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
24 }
25 // 来自 `CreateVote` 的响应: VoteResponse
26 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.CreateVote`: %v\n", resp)
27}
28

DeleteVote Internal Link

参数

NameTypeLocationRequiredDescription
tenantIdstringquery是
idstringpath是
editKeystringquery否

响应

返回: VoteDeleteResponse

示例

DeleteVote 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 id := "id_example" // string |
14 editKey := "editKey_example" // string | (可选)
15
16 configuration := openapiclient.NewConfiguration()
17 apiClient := openapiclient.NewAPIClient(configuration)
18 resp, r, err := apiClient.DefaultAPI.DeleteVote(context.Background(), id).TenantId(tenantId).EditKey(editKey).Execute()
19 if err != nil {
20 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.DeleteVote``: %v\n", err)
21 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
22 }
23 // 来自 `DeleteVote` 的响应: VoteDeleteResponse
24 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.DeleteVote`: %v\n", resp)
25}
26

GetVotes Internal Link

参数

名称类型位置必填描述
tenantIdstringqueryYes
urlIdstringqueryYes

响应

返回: GetVotesResponse

示例

GetVotes 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 urlId := "urlId_example" // string |
14
15 configuration := openapiclient.NewConfiguration()
16 apiClient := openapiclient.NewAPIClient(configuration)
17 resp, r, err := apiClient.DefaultAPI.GetVotes(context.Background()).TenantId(tenantId).UrlId(urlId).Execute()
18 if err != nil {
19 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetVotes``: %v\n", err)
20 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
21 }
22 // 来自 `GetVotes` 的响应: GetVotesResponse
23 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetVotes`: %v\n", resp)
24}
25

GetVotesForUser Internal Link

参数

名称类型位置必需描述
tenantIdstringquery是
urlIdstringquery是
userIdstringquery否
anonUserIdstringquery否

响应

返回: GetVotesForUserResponse

示例

GetVotesForUser 示例
Copy Copy
1
2package main
3
4import (
5 "context"
6 "fmt"
7 "os"
8 openapiclient "github.com/fastcomments/fastcomments-go/client"
9)
10
11func main() {
12 tenantId := "tenantId_example" // string |
13 urlId := "urlId_example" // string |
14 userId := "userId_example" // string | (可选)
15 anonUserId := "anonUserId_example" // string | (可选)
16
17 configuration := openapiclient.NewConfiguration()
18 apiClient := openapiclient.NewAPIClient(configuration)
19 resp, r, err := apiClient.DefaultAPI.GetVotesForUser(context.Background()).TenantId(tenantId).UrlId(urlId).UserId(userId).AnonUserId(anonUserId).Execute()
20 if err != nil {
21 fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetVotesForUser``: %v\n", err)
22 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23 }
24 // 来自 `GetVotesForUser` 的响应: GetVotesForUserResponse
25 fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetVotesForUser`: %v\n", resp)
26}
27

需要帮助?

如果您在使用 Go SDK 时遇到任何问题或有疑问,请:

贡献

欢迎贡献!请访问 GitHub 仓库 以查看贡献指南。