更新文档内容
This commit is contained in:
593
api_question.go
593
api_question.go
@@ -1,9 +1,7 @@
|
||||
/*
|
||||
answer
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
answer api
|
||||
|
||||
API version: v0.0.1
|
||||
API version: 1.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
@@ -271,119 +269,6 @@ func (a *QuestionApiService) AnswerApiV1QuestionAnswerPostExecute(r ApiAnswerApi
|
||||
return localVarReturnValue, localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiAnswerApiV1QuestionClosemsglistGetRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *QuestionApiService
|
||||
}
|
||||
|
||||
func (r ApiAnswerApiV1QuestionClosemsglistGetRequest) Execute() (*HandlerRespBody, *http.Response, error) {
|
||||
return r.ApiService.AnswerApiV1QuestionClosemsglistGetExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
AnswerApiV1QuestionClosemsglistGet close question msg list
|
||||
|
||||
close question msg list
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiAnswerApiV1QuestionClosemsglistGetRequest
|
||||
*/
|
||||
func (a *QuestionApiService) AnswerApiV1QuestionClosemsglistGet(ctx context.Context) ApiAnswerApiV1QuestionClosemsglistGetRequest {
|
||||
return ApiAnswerApiV1QuestionClosemsglistGetRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return HandlerRespBody
|
||||
func (a *QuestionApiService) AnswerApiV1QuestionClosemsglistGetExecute(r ApiAnswerApiV1QuestionClosemsglistGetRequest) (*HandlerRespBody, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *HandlerRespBody
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "QuestionApiService.AnswerApiV1QuestionClosemsglistGet")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/answer/api/v1/question/closemsglist"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
if r.ctx != nil {
|
||||
// API Key Authentication
|
||||
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
|
||||
if apiKey, ok := auth["ApiKeyAuth"]; ok {
|
||||
var key string
|
||||
if apiKey.Prefix != "" {
|
||||
key = apiKey.Prefix + " " + apiKey.Key
|
||||
} else {
|
||||
key = apiKey.Key
|
||||
}
|
||||
localVarHeaderParams["Authorization"] = key
|
||||
}
|
||||
}
|
||||
}
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarReturnValue, localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: err.Error(),
|
||||
}
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiAnswerApiV1QuestionDeleteRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *QuestionApiService
|
||||
@@ -633,6 +518,255 @@ func (a *QuestionApiService) AnswerApiV1QuestionInfoGetExecute(r ApiAnswerApiV1Q
|
||||
return localVarReturnValue, localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiAnswerApiV1QuestionInviteGetRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *QuestionApiService
|
||||
id *string
|
||||
}
|
||||
|
||||
// Question ID
|
||||
func (r ApiAnswerApiV1QuestionInviteGetRequest) Id(id string) ApiAnswerApiV1QuestionInviteGetRequest {
|
||||
r.id = &id
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiAnswerApiV1QuestionInviteGetRequest) Execute() (string, *http.Response, error) {
|
||||
return r.ApiService.AnswerApiV1QuestionInviteGetExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
AnswerApiV1QuestionInviteGet get question invite user info
|
||||
|
||||
get question invite user info
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiAnswerApiV1QuestionInviteGetRequest
|
||||
*/
|
||||
func (a *QuestionApiService) AnswerApiV1QuestionInviteGet(ctx context.Context) ApiAnswerApiV1QuestionInviteGetRequest {
|
||||
return ApiAnswerApiV1QuestionInviteGetRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return string
|
||||
func (a *QuestionApiService) AnswerApiV1QuestionInviteGetExecute(r ApiAnswerApiV1QuestionInviteGetRequest) (string, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue string
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "QuestionApiService.AnswerApiV1QuestionInviteGet")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/answer/api/v1/question/invite"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
if r.id == nil {
|
||||
return localVarReturnValue, nil, reportError("id is required and must be specified")
|
||||
}
|
||||
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "id", r.id, "")
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
if r.ctx != nil {
|
||||
// API Key Authentication
|
||||
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
|
||||
if apiKey, ok := auth["ApiKeyAuth"]; ok {
|
||||
var key string
|
||||
if apiKey.Prefix != "" {
|
||||
key = apiKey.Prefix + " " + apiKey.Key
|
||||
} else {
|
||||
key = apiKey.Key
|
||||
}
|
||||
localVarHeaderParams["Authorization"] = key
|
||||
}
|
||||
}
|
||||
}
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarReturnValue, localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: err.Error(),
|
||||
}
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiAnswerApiV1QuestionInvitePutRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *QuestionApiService
|
||||
data *SchemaQuestionUpdateInviteUser
|
||||
}
|
||||
|
||||
// question
|
||||
func (r ApiAnswerApiV1QuestionInvitePutRequest) Data(data SchemaQuestionUpdateInviteUser) ApiAnswerApiV1QuestionInvitePutRequest {
|
||||
r.data = &data
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiAnswerApiV1QuestionInvitePutRequest) Execute() (*HandlerRespBody, *http.Response, error) {
|
||||
return r.ApiService.AnswerApiV1QuestionInvitePutExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
AnswerApiV1QuestionInvitePut update question invite user
|
||||
|
||||
update question invite user
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiAnswerApiV1QuestionInvitePutRequest
|
||||
*/
|
||||
func (a *QuestionApiService) AnswerApiV1QuestionInvitePut(ctx context.Context) ApiAnswerApiV1QuestionInvitePutRequest {
|
||||
return ApiAnswerApiV1QuestionInvitePutRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return HandlerRespBody
|
||||
func (a *QuestionApiService) AnswerApiV1QuestionInvitePutExecute(r ApiAnswerApiV1QuestionInvitePutRequest) (*HandlerRespBody, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodPut
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *HandlerRespBody
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "QuestionApiService.AnswerApiV1QuestionInvitePut")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/answer/api/v1/question/invite"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
if r.data == nil {
|
||||
return localVarReturnValue, nil, reportError("data is required and must be specified")
|
||||
}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{"application/json"}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = r.data
|
||||
if r.ctx != nil {
|
||||
// API Key Authentication
|
||||
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
|
||||
if apiKey, ok := auth["ApiKeyAuth"]; ok {
|
||||
var key string
|
||||
if apiKey.Prefix != "" {
|
||||
key = apiKey.Prefix + " " + apiKey.Key
|
||||
} else {
|
||||
key = apiKey.Key
|
||||
}
|
||||
localVarHeaderParams["Authorization"] = key
|
||||
}
|
||||
}
|
||||
}
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarReturnValue, localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: err.Error(),
|
||||
}
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiAnswerApiV1QuestionOperationPutRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *QuestionApiService
|
||||
@@ -761,12 +895,47 @@ func (a *QuestionApiService) AnswerApiV1QuestionOperationPutExecute(r ApiAnswerA
|
||||
type ApiAnswerApiV1QuestionPageGetRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *QuestionApiService
|
||||
data *SchemaQuestionPageReq
|
||||
page *int32
|
||||
pageSize *int32
|
||||
order *string
|
||||
tag *string
|
||||
username *string
|
||||
inDays *int32
|
||||
}
|
||||
|
||||
// QuestionPageReq
|
||||
func (r ApiAnswerApiV1QuestionPageGetRequest) Data(data SchemaQuestionPageReq) ApiAnswerApiV1QuestionPageGetRequest {
|
||||
r.data = &data
|
||||
// page
|
||||
func (r ApiAnswerApiV1QuestionPageGetRequest) Page(page int32) ApiAnswerApiV1QuestionPageGetRequest {
|
||||
r.page = &page
|
||||
return r
|
||||
}
|
||||
|
||||
// page_size
|
||||
func (r ApiAnswerApiV1QuestionPageGetRequest) PageSize(pageSize int32) ApiAnswerApiV1QuestionPageGetRequest {
|
||||
r.pageSize = &pageSize
|
||||
return r
|
||||
}
|
||||
|
||||
// order cond
|
||||
func (r ApiAnswerApiV1QuestionPageGetRequest) Order(order string) ApiAnswerApiV1QuestionPageGetRequest {
|
||||
r.order = &order
|
||||
return r
|
||||
}
|
||||
|
||||
// tag
|
||||
func (r ApiAnswerApiV1QuestionPageGetRequest) Tag(tag string) ApiAnswerApiV1QuestionPageGetRequest {
|
||||
r.tag = &tag
|
||||
return r
|
||||
}
|
||||
|
||||
// username
|
||||
func (r ApiAnswerApiV1QuestionPageGetRequest) Username(username string) ApiAnswerApiV1QuestionPageGetRequest {
|
||||
r.username = &username
|
||||
return r
|
||||
}
|
||||
|
||||
// in_days
|
||||
func (r ApiAnswerApiV1QuestionPageGetRequest) InDays(inDays int32) ApiAnswerApiV1QuestionPageGetRequest {
|
||||
r.inDays = &inDays
|
||||
return r
|
||||
}
|
||||
|
||||
@@ -809,12 +978,27 @@ func (a *QuestionApiService) AnswerApiV1QuestionPageGetExecute(r ApiAnswerApiV1Q
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
if r.data == nil {
|
||||
return localVarReturnValue, nil, reportError("data is required and must be specified")
|
||||
}
|
||||
|
||||
if r.page != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "")
|
||||
}
|
||||
if r.pageSize != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "")
|
||||
}
|
||||
if r.order != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "order", r.order, "")
|
||||
}
|
||||
if r.tag != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "tag", r.tag, "")
|
||||
}
|
||||
if r.username != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "username", r.username, "")
|
||||
}
|
||||
if r.inDays != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "in_days", r.inDays, "")
|
||||
}
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{"application/json"}
|
||||
localVarHTTPContentTypes := []string{}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
@@ -830,8 +1014,6 @@ func (a *QuestionApiService) AnswerApiV1QuestionPageGetExecute(r ApiAnswerApiV1Q
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = r.data
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, err
|
||||
@@ -1602,160 +1784,3 @@ func (a *QuestionApiService) AnswerApiV1QuestionStatusPutExecute(r ApiAnswerApiV
|
||||
|
||||
return localVarReturnValue, localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiPersonalQuestionPageGetRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *QuestionApiService
|
||||
username *string
|
||||
order *string
|
||||
page *string
|
||||
pagesize *string
|
||||
}
|
||||
|
||||
// username
|
||||
func (r ApiPersonalQuestionPageGetRequest) Username(username string) ApiPersonalQuestionPageGetRequest {
|
||||
r.username = &username
|
||||
return r
|
||||
}
|
||||
|
||||
// order
|
||||
func (r ApiPersonalQuestionPageGetRequest) Order(order string) ApiPersonalQuestionPageGetRequest {
|
||||
r.order = &order
|
||||
return r
|
||||
}
|
||||
|
||||
// page
|
||||
func (r ApiPersonalQuestionPageGetRequest) Page(page string) ApiPersonalQuestionPageGetRequest {
|
||||
r.page = &page
|
||||
return r
|
||||
}
|
||||
|
||||
// pagesize
|
||||
func (r ApiPersonalQuestionPageGetRequest) Pagesize(pagesize string) ApiPersonalQuestionPageGetRequest {
|
||||
r.pagesize = &pagesize
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiPersonalQuestionPageGetRequest) Execute() (*HandlerRespBody, *http.Response, error) {
|
||||
return r.ApiService.PersonalQuestionPageGetExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
PersonalQuestionPageGet UserList
|
||||
|
||||
UserList
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiPersonalQuestionPageGetRequest
|
||||
*/
|
||||
func (a *QuestionApiService) PersonalQuestionPageGet(ctx context.Context) ApiPersonalQuestionPageGetRequest {
|
||||
return ApiPersonalQuestionPageGetRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return HandlerRespBody
|
||||
func (a *QuestionApiService) PersonalQuestionPageGetExecute(r ApiPersonalQuestionPageGetRequest) (*HandlerRespBody, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *HandlerRespBody
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "QuestionApiService.PersonalQuestionPageGet")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/personal/question/page"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
if r.username == nil {
|
||||
return localVarReturnValue, nil, reportError("username is required and must be specified")
|
||||
}
|
||||
if r.order == nil {
|
||||
return localVarReturnValue, nil, reportError("order is required and must be specified")
|
||||
}
|
||||
if r.page == nil {
|
||||
return localVarReturnValue, nil, reportError("page is required and must be specified")
|
||||
}
|
||||
if r.pagesize == nil {
|
||||
return localVarReturnValue, nil, reportError("pagesize is required and must be specified")
|
||||
}
|
||||
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "username", r.username, "")
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "order", r.order, "")
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "")
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "pagesize", r.pagesize, "")
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
if r.ctx != nil {
|
||||
// API Key Authentication
|
||||
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
|
||||
if apiKey, ok := auth["ApiKeyAuth"]; ok {
|
||||
var key string
|
||||
if apiKey.Prefix != "" {
|
||||
key = apiKey.Prefix + " " + apiKey.Key
|
||||
} else {
|
||||
key = apiKey.Key
|
||||
}
|
||||
localVarHeaderParams["Authorization"] = key
|
||||
}
|
||||
}
|
||||
}
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarReturnValue, localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: err.Error(),
|
||||
}
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user