1.阿里云图片上传工具类
package com.cashier.util;
import java.io.InputStream;
import java.net.URL;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import org.springframework.web.multipart.MultipartFile;
import com.aliyun.oss.OSSClient;
import com.aliyun.oss.model.LifecycleRule;
import com.aliyun.oss.model.LifecycleRule.RuleStatus;
import com.aliyun.oss.model.PutObjectResult;
import com.aliyun.oss.model.SetBucketLifecycleRequest;
/**
* 上传图片后返回路径和格式
* @author
*
*/
public class UpdateFile {
private static String endpoint = "http://oss-cn-XXXXXXX.aliyuncs.com";
private static String accessKeyId = "XXXXXXXXXXXXX";
private static String accessKeySecret = "XXXXXXXXXXXXXXXXXXXXXXXXXXX";
private static String bucketName = "XXXXXX";
private static String picLocation="XXX/";
private static String Key = "key";