public ActionResult Edit(UpdateLinkInput modle) { this.Service.Update(modle); return(this.SuccessMsg("编辑成功")); }
/// <summary> /// Update a link. /// </summary> /// <exception cref="VmosoApiClient.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="key">Link key.</param> /// <param name="input">UpdateLink Input</param> /// <returns>ApiResponse of UpdateLinkResult</returns> public ApiResponse <UpdateLinkResult> UpdateLinkWithHttpInfo(string key, UpdateLinkInput input) { // verify the required parameter 'key' is set if (key == null) { throw new ApiException(400, "Missing required parameter 'key' when calling LinkApi->UpdateLink"); } // verify the required parameter 'input' is set if (input == null) { throw new ApiException(400, "Missing required parameter 'input' when calling LinkApi->UpdateLink"); } var localVarPath = "/links/{key}"; var localVarPathParams = new Dictionary <String, String>(); var localVarQueryParams = new Dictionary <String, String>(); var localVarHeaderParams = new Dictionary <String, String>(Configuration.DefaultHeader); var localVarFormParams = new Dictionary <String, String>(); var localVarFileParams = new Dictionary <String, FileParameter>(); Object localVarPostBody = null; // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { }; String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { "json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json localVarPathParams.Add("format", "json"); if (key != null) { localVarPathParams.Add("key", Configuration.ApiClient.ParameterToString(key)); // path parameter } if (input != null && input.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(input); // http body (model) parameter } else { localVarPostBody = input; // byte array } // authentication (vmoso_auth) required if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("X-CV-Authorization"))) { localVarHeaderParams["X-CV-Authorization"] = Configuration.GetApiKeyWithPrefix("X-CV-Authorization"); } // make the HTTP request IRestResponse localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("UpdateLink", localVarResponse); if (exception != null) { throw exception; } } return(new ApiResponse <UpdateLinkResult>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (UpdateLinkResult)Configuration.ApiClient.Deserialize(localVarResponse, typeof(UpdateLinkResult)))); }
/// <summary> /// Update a link. /// </summary> /// <exception cref="VmosoApiClient.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="key">Link key.</param> /// <param name="input">UpdateLink Input</param> /// <returns>Task of UpdateLinkResult</returns> public async System.Threading.Tasks.Task <UpdateLinkResult> UpdateLinkAsync(string key, UpdateLinkInput input) { ApiResponse <UpdateLinkResult> localVarResponse = await UpdateLinkAsyncWithHttpInfo(key, input); return(localVarResponse.Data); }
/// <summary> /// Update a link. /// </summary> /// <exception cref="VmosoApiClient.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="key">Link key.</param> /// <param name="input">UpdateLink Input</param> /// <returns>UpdateLinkResult</returns> public UpdateLinkResult UpdateLink(string key, UpdateLinkInput input) { ApiResponse <UpdateLinkResult> localVarResponse = UpdateLinkWithHttpInfo(key, input); return(localVarResponse.Data); }