| | |
| | | import com.panzhihua.applets.umf.UmfPayUtil; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.utlis.MimeTypeUtils; |
| | | import net.coobird.thumbnailator.Thumbnails; |
| | | import org.apache.commons.io.FilenameUtils; |
| | | import org.apache.commons.lang3.RandomUtils; |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import static com.panzhihua.common.utlis.FileTypeUploadUtils.assertAllowed; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | |
| | | private CommunityService communityService; |
| | | @Resource |
| | | private MinioUtil minioUtil; |
| | | @Resource |
| | | private UmfPayUtil umfPayUtil; |
| | | |
| | | public static void main(String[] args) { |
| | | // int nextInt = RandomUtils.nextInt(99999, 1000000); |
| | |
| | | @PostMapping(value = "/uploadimages", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R uploadImages(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | | try { |
| | | assertAllowed(file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION); |
| | | String extension = FilenameUtils.getExtension(file.getOriginalFilename()); |
| | | String name = UUID.randomUUID().toString().replaceAll("-", "") + "." + extension; |
| | | String imageUrl = minioUtil.upload(file, name); |
| | |
| | | @PostMapping(value = "/uploadimagescompress", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R uploadImagesComPress(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | | try { |
| | | assertAllowed(file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION); |
| | | String extension = FilenameUtils.getExtension(file.getOriginalFilename()); |
| | | String uuid=UUID.randomUUID().toString().replaceAll("-", ""); |
| | | String name = uuid + "."+ extension; |
| | |
| | | @ApiOperation("uu洗车下单接口") |
| | | @GetMapping("/uuPay") |
| | | public R uuPay(@RequestParam("orderid") String orderid,@RequestParam("openid")String openid,@RequestParam("amount")String amount){ |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | try { |
| | | sftp.download("/mnt/data/web/excel/", "53461_.key.p8", "D:/mnt/data/web/file/53461_.key.p8"); |
| | | } catch (SftpException e) { |
| | | e.printStackTrace(); |
| | | } catch (FileNotFoundException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | sftp.logout(); |
| | | UmfPayUtil umfPayUtil=new UmfPayUtil(); |
| | | Map map=umfPayUtil.pay(openid, DateUtils.getCurrentDateString(),openid,amount); |
| | | Map map=umfPayUtil.pay(orderid, DateUtils.getCurrentDateString(),openid,amount); |
| | | return R.ok(map); |
| | | } |
| | | } |