Commit 108e13bb by 宋毅

tj

parent c8e15d2d
......@@ -14,7 +14,7 @@ import java.util.Map;
* @author shiming.zhao
* @date 2019/04/18
*/
public class Testuploadossapi {
public class TestUploadOssApi {
// 上传文件
private String localFilePath = "F:\\swch\\commons-io-2.6\\aaa.jpg";
......
package com.example.aliossjava.common;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import com.alibaba.fastjson.JSONObject;
import java.util.Map;
//@RestController
public class uploadossapi {
//
//
// @Autowired
// private companyName companyName;
//
// /*
// * @RequestMapping 路由映射的注解
// * */
// @RequestMapping(value = "/uploadfile",method = RequestMethod.POST)
// public boolean myGetList(@RequestBody @Valid String a){
// try {
// System.out.println(a);
// JSONObject jsonObject = JSONObject.parseObject(a);
// String ossurl=jsonObject.getString("ossurl");
// String filedir=jsonObject.getString("filedir");
// String objectName=jsonObject.getString("objectName");
// String encodePolicy=jsonObject.getString("encodePolicy");
// String signature=jsonObject.getString("signature");
// String endpoint=jsonObject.getString("endpoint");
// String accessKeyId=jsonObject.getString("accessKeyId");
// String bucketName=jsonObject.getString("bucketName");
// utilupload utilupload=new utilupload();
// utilupload.doUpload(ossurl,endpoint,accessKeyId,bucketName,filedir,objectName,encodePolicy,signature);
// return true;
// } catch (Exception e) {
// return false;
// }
// }
//
//
// /**
// *
// * @param baseinfo
// * @return
// * @throws Exception
// */
// @ResponseBody
// @RequestMapping(value = "/getNames",method = RequestMethod.POST)
// public Map<String,Object> companyName(@RequestBody @Valid String baseinfo) throws Exception {
//
// try {
// JSONObject jsonObject = JSONObject.parseObject(baseinfo);
// String region=jsonObject.getString("region");
// String type=jsonObject.getString("type");
// String modality=jsonObject.getString("modality");
// String nameNum=jsonObject.getString("nameNum");
// String goodName=jsonObject.getString("goodName");
// Integer from = jsonObject.getInteger("from");
// Integer size = jsonObject.getInteger("size");
// return companyName.nameList(region, type, modality, nameNum, goodName,from,size);
// } catch (Exception e) {
// return null;
// }
// }
//
// /*
// * @RequestMapping 路由映射的注解
// * */
// @RequestMapping(value = "/hello",method = RequestMethod.GET)
// public void helloworlds(){
// try {
// System.out.println("fdfd");
//// testuploadossapi testuploadossapi=new testuploadossapi();
//// testuploadossapi.doUpload();
// } catch (Exception e) {
// System.err.println("Send post request exception: " + e);
// }
// }
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment