//package com.ruoyi.study.utils; // // //public class Sample { // // /** // * description : // *
使用凭据初始化账号Client
// * @return Client // * // * @throws Exception // */ // public static com.aliyun.teaopenapi.Client createClient() throws Exception { // // 工程代码建议使用更安全的无AK方式,凭据配置方式请参见:https://help.aliyun.com/document_detail/378657.html。 // com.aliyun.credentials.Client credential = new com.aliyun.credentials.Client(); // com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config() // .setCredential(credential); // // Endpoint 请参考 https://api.aliyun.com/product/Dysmsapi // config.endpoint = "dysmsapi.aliyuncs.com"; // return new com.aliyun.teaopenapi.Client(config); // } // // /** // * description : // *API 相关
// * // * @param path string Path parameters // * @return OpenApi.Params // */ // public static com.aliyun.teaopenapi.models.Params createApiInfo() throws Exception { // com.aliyun.teaopenapi.models.Params params = new com.aliyun.teaopenapi.models.Params() // // 接口名称 // .setAction("SendSms") // // 接口版本 // .setVersion("2017-05-25") // // 接口协议 // .setProtocol("HTTPS") // // 接口 HTTP 方法 // .setMethod("POST") // .setAuthType("AK") // .setStyle("RPC") // // 接口 PATH // .setPathname("/") // // 接口请求体内容格式 // .setReqBodyType("json") // // 接口响应体内容格式 // .setBodyType("json"); // return params; // } // // public static void main(String[] args_) throws Exception { // // com.aliyun.teaopenapi.Client client = Sample.createClient(); // com.aliyun.teaopenapi.models.Params params = Sample.createApiInfo(); // // query params // java.util.Map