Skip to content

RecordIds 拼接参数异常 #18

@shell-echo

Description

@shell-echo
	var body struct {
		DataSheetID string `json:"datasheet_id"`
		RecordID    string `json:"record_id"`
	}
	if err := gin_context.ShouldBindJSON(&body); err != nil {
		gin_context.Set("resp", err)
		return
	}

	credential := common.NewCredential("**************")
	cpf := profile.NewClientProfile()
	datasheet, _ := vika.NewDatasheet(credential, body.DataSheetID, cpf)
	request := vika.NewDescribeRecordRequest()
	request.RecordIds = common.StringPtrs([]string{body.RecordID})
	records, err := datasheet.DescribeAllRecords(request)
	if err != nil {
		gin_context.Set("resp", err)
		return
	}

	for _, record := range records {
		fmt.Println(
			record.RecordId,
			record.CreatedAt,
		)
		for name, value := range *record.Fields {
			fmt.Println(name, value)
		}
		fmt.Println()
	}

	gin_context.Set("resp", "ok")

其中

        request.RecordIds = common.StringPtrs([]string{body.RecordID}) 

拼接的url 调试结果是

        https://api.vika.cn/fusion/v1/datasheets/datasheet_id/records?pageNum=1&pageSize=1000&recordIds.0=record_id

RecordIds 参数有点问题 recordIdsa.0

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions