|
@@ -1,49 +1,19 @@
|
|
|
package com.sky.controller.admin;
|
|
|
|
|
|
-import com.aliyun.oss.ClientException;
|
|
|
-import com.aliyun.oss.OSS;
|
|
|
-import com.aliyun.oss.OSSClientBuilder;
|
|
|
-import com.aliyun.oss.OSSException;
|
|
|
-import com.aliyun.oss.common.auth.CredentialsProviderFactory;
|
|
|
-import com.aliyun.oss.common.auth.EnvironmentVariableCredentialsProvider;
|
|
|
-
|
|
|
-import java.io.ByteArrayInputStream;
|
|
|
-
|
|
|
-import com.aliyun.oss.OSS;
|
|
|
-import com.aliyun.oss.OSSClientBuilder;
|
|
|
-import com.aliyun.oss.OSSException;
|
|
|
-import com.aliyun.oss.common.auth.CredentialsProviderFactory;
|
|
|
-import com.aliyun.oss.common.auth.EnvironmentVariableCredentialsProvider;
|
|
|
-import com.sky.constant.JwtClaimsConstant;
|
|
|
import com.sky.dto.EmployeeLoginDTO;
|
|
|
import com.sky.entity.Employee;
|
|
|
-import com.sky.entity.landimg;
|
|
|
+import com.sky.entity.TLandimg;
|
|
|
import com.sky.properties.JwtProperties;
|
|
|
import com.sky.result.Result;
|
|
|
import com.sky.service.EmployeeService;
|
|
|
import com.sky.utils.AliOssUtil;
|
|
|
-import com.sky.utils.JwtUtil;
|
|
|
-import com.sky.vo.EmployeeLoginVO;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.core.io.Resource;
|
|
|
-import org.springframework.core.io.UrlResource;
|
|
|
-import org.springframework.http.HttpHeaders;
|
|
|
-import org.springframework.http.MediaType;
|
|
|
-import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
-import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
|
|
|
|
|
|
-import java.io.ByteArrayInputStream;
|
|
|
-import java.io.File;
|
|
|
import java.io.IOException;
|
|
|
-import java.net.MalformedURLException;
|
|
|
-import java.nio.file.Path;
|
|
|
-import java.nio.file.Paths;
|
|
|
-import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
import java.util.UUID;
|
|
|
/**
|
|
|
* @Author zhangyifan
|
|
@@ -81,19 +51,25 @@ public class EmployeeController {
|
|
|
|
|
|
}
|
|
|
|
|
|
+// /**
|
|
|
+// * 上传表单信息
|
|
|
+// *
|
|
|
+// * @return
|
|
|
+// */
|
|
|
+// @PostMapping("/getLandImg")
|
|
|
+// public Result<String> getLandImg(@RequestBody TLandimg landimg) {
|
|
|
+// System.out.println("这是site: " + landimg.getSite() + " author: " + landimg.getAuthor());
|
|
|
+// employeeService.postform(landimg.getAuthor(), landimg.getSite(), landimg.getPzdt(), landimg.getImgurl());
|
|
|
+// return Result.success();
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
- * 上传表单信息
|
|
|
- *
|
|
|
+ * 把拍照的图片上传到服务器 然后把url地址返回
|
|
|
+ * @param photo
|
|
|
* @return
|
|
|
+ * @throws IOException
|
|
|
*/
|
|
|
- @PostMapping("/getLandImg")
|
|
|
- public Result<String> getLandImg(@RequestBody landimg landimg) {
|
|
|
- System.out.println("这是site: " + landimg.getSite() + " author: " + landimg.getAuthor());
|
|
|
- employeeService.postform(landimg.getAuthor(), landimg.getSite(), landimg.getPzdt(), landimg.getImgurl());
|
|
|
- return Result.success();
|
|
|
- }
|
|
|
-
|
|
|
- /*图片的上传*/
|
|
|
@PostMapping("/geturl")
|
|
|
public Result uploadPhoto(@RequestParam("photo") MultipartFile photo) throws IOException {
|
|
|
// System.out.println("photo" + photo);
|
|
@@ -109,39 +85,9 @@ public class EmployeeController {
|
|
|
} catch (IOException e) {
|
|
|
log.error("上传失败");
|
|
|
}
|
|
|
-
|
|
|
-// String uploadDir = "E:/App/";
|
|
|
-// // 获取文件名
|
|
|
-// String originalFilename = photo.getOriginalFilename();
|
|
|
-//
|
|
|
-//
|
|
|
-// try {
|
|
|
-// // 保存文件到服务器
|
|
|
-// File file = new File(uploadDir + originalFilename);
|
|
|
-// photo.transferTo(file);
|
|
|
-// // 构建图片的 URL 地址
|
|
|
-// String fileUrl = ServletUriComponentsBuilder.fromCurrentContextPath()
|
|
|
-// .path("/admin/employee/uploads/")
|
|
|
-// .path(originalFilename)
|
|
|
-// .toUriString();
|
|
|
-//
|
|
|
-// return Result.success(fileUrl);
|
|
|
-// } catch (IOException e) {
|
|
|
-// e.printStackTrace();
|
|
|
-// return Result.success("error");
|
|
|
-// }
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- /*图片的导出与下载*/
|
|
|
-// @GetMapping("/uploads/{fileName:.+}")
|
|
|
-// public Result savaFile(@PathVariable String fileName){
|
|
|
-// System.out.println("这是fielname" + FilePath);
|
|
|
-// return Result.success(FilePath);
|
|
|
-// }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 登录
|
|
|
*
|
|
@@ -182,13 +128,4 @@ public class EmployeeController {
|
|
|
return Result.success();
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 根据手机号查询出该专家的已经填报的所有信息
|
|
|
- */
|
|
|
- @GetMapping("/getlandimgbyphone")
|
|
|
- public Result<List<landimg>> getLandimgByPhone(@RequestParam String phone){
|
|
|
- return Result.success(employeeService.getLandimgByPhone(phone));
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
}
|