当前位置: 首页 > news >正文

php网站的客服窗口怎么做的宁波网络营销公司

php网站的客服窗口怎么做的,宁波网络营销公司,静态网站建设的流程,房子网站有哪些问题 之前工作因队友离开,只一天接手其部分且第二天就要上线此工具产品,测试提了一些Bug,在Bug中有一个是添加商品图片。前端告知不能用、电话离职队友说能用。没办法自己上、追踪代码。 en这块代码跟需求好像不太相符,重写。 …

问题

之前工作因队友离开,只一天接手其部分且第二天就要上线此工具产品,测试提了一些Bug,在Bug中有一个是添加商品图片。前端告知不能用、电话离职队友说能用。没办法自己上、追踪代码。

en这块代码跟需求好像不太相符,重写。

淘宝开放平台文档中心:开放平台-文档中心

请求示例:

TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
PictureCategoryGetRequest req = new PictureCategoryGetRequest();
req.setPictureCategoryId(100L);
req.setPictureCategoryName("分类");
req.setType("1");
req.setParentId(0L);
req.setModifiedTime(StringUtils.parseDateTime("2011-01-01 11:11:11"));
PictureCategoryGetResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());

解决

一开始想着用流直传过去试试。

req.setImg(new FileItem("", file.getBytes()));

不行。

换个思路,先上传到服务器再上传到淘宝。

file.transferTo(new File(allPath));

上传到服务器ok,上传到淘宝不行。

直接用队友的封装的

PictureUtils.downloadPicture(url, filePath);

不行。

自己封装了一个工具类。上传到服务器ok,上传到淘宝不行。

同事帮提供了一个工具。

public static void uploadFile(byte[] file, String filePath, String fileName) throws Exception {File targetFile = new File(filePath);if(!targetFile.exists()){targetFile.mkdirs();}try (FileOutputStream out = new FileOutputStream(filePath + fileName)) {out.write(file);out.flush();out.close();}
}

上传到服务器也ok,上传到淘宝不行。

想着可能是提供的PictureCategoryId值有点问题,重新要值和ok的图片,都行。

把这部分的代码封装到Service,结果报错。算了,就放Controller层。

@PostMapping(value = "/upload/img",name = "添加天猫商品图片")
public JSONResult uploadImg(@RequestParam("file") MultipartFile file) {String fileName = file.getOriginalFilename();String filePath = "/www/pictures/";//String filePath = "D:\\picture\\";String allPath = filePath + fileName;try {FileUtil.uploadFile(file.getBytes(), filePath, fileName);//这里视情况可不做校验/*String suffix = Objects.requireNonNull(file.getOriginalFilename()).substring(file.getOriginalFilename().lastIndexOf(".") + 1,     file.getOriginalFilename().length());if (!"jpg,jpeg,gif,png".toUpperCase().contains(suffix.toUpperCase())) {return JSONResult.error("请选择jpg,jpeg,gif,png格式的图片");}*/Path path = Paths.get(allPath);if (Files.exists(path)) {PictureUploadResponse rsp = taobaoSetvice.pictureUpload(allPath);log.info( "rsp::" + JSON.toJSONString(rsp));if(rsp.isSuccess()){return JSONResult.success(rsp.getPicture().getPicturePath());}return JSONResult.error(rsp.getSubMsg());}return JSONResult.success("文件已存在");} catch (Exception e) {return JSONResult.error("上传失败");}
}

return JSONResult.error(rsp.getSubMsg());这里因为淘宝那边有校验结果,所以直接返回。

同事建议说在后端对图片做调整处理成符合淘宝的图片,个人觉得在前端调整处理比较合适、所见即所得。

打包部署联调ok后想想,是不是PictureCategoryId值和图片导致的上传到服务器ok、上传到淘宝不行?当时ld只给一天时间解决这些问题没时间紧搞,就这样先了。跟对ld还是挺重要的,1天接手和解决别人的工作、3天开发上线带后台小程序等还是挺搞人。


文章转载自:
http://dinncolawing.wbqt.cn
http://dinncotailspin.wbqt.cn
http://dinncoarrhythmically.wbqt.cn
http://dinncowaterfowl.wbqt.cn
http://dinncodreich.wbqt.cn
http://dinncohydroxyphenyl.wbqt.cn
http://dinncomonosyllable.wbqt.cn
http://dinncocongenital.wbqt.cn
http://dinncobraid.wbqt.cn
http://dinncoplatitude.wbqt.cn
http://dinncoendangeitis.wbqt.cn
http://dinncoscrewworm.wbqt.cn
http://dinncopetcock.wbqt.cn
http://dinncoilluminometer.wbqt.cn
http://dinncoputamina.wbqt.cn
http://dinncorurales.wbqt.cn
http://dinncobasin.wbqt.cn
http://dinncoamidin.wbqt.cn
http://dinncobolson.wbqt.cn
http://dinncochiroptera.wbqt.cn
http://dinncomonaul.wbqt.cn
http://dinncosnapdragon.wbqt.cn
http://dinncohypoxia.wbqt.cn
http://dinncounlink.wbqt.cn
http://dinncorevaluation.wbqt.cn
http://dinncopriestly.wbqt.cn
http://dinncophotoproduction.wbqt.cn
http://dinncoplacegetter.wbqt.cn
http://dinncostp.wbqt.cn
http://dinncopartlet.wbqt.cn
http://dinncoeighthly.wbqt.cn
http://dinncothriftless.wbqt.cn
http://dinncorecurved.wbqt.cn
http://dinncotremellose.wbqt.cn
http://dinncorecon.wbqt.cn
http://dinncoshoreward.wbqt.cn
http://dinncorapprochement.wbqt.cn
http://dinncotowering.wbqt.cn
http://dinncosupervenient.wbqt.cn
http://dinncoschnapps.wbqt.cn
http://dinncoheptaglot.wbqt.cn
http://dinncodromedary.wbqt.cn
http://dinncodemonetise.wbqt.cn
http://dinncoplacate.wbqt.cn
http://dinncomicrobe.wbqt.cn
http://dinncoindicia.wbqt.cn
http://dinncocolobus.wbqt.cn
http://dinncoxxi.wbqt.cn
http://dinncopragmatics.wbqt.cn
http://dinncobookshelves.wbqt.cn
http://dinncoreturnee.wbqt.cn
http://dinncogoes.wbqt.cn
http://dinncoiaz.wbqt.cn
http://dinncotruckle.wbqt.cn
http://dinncothrash.wbqt.cn
http://dinncoveto.wbqt.cn
http://dinncotenantship.wbqt.cn
http://dinncoexterritoriality.wbqt.cn
http://dinncoprelatize.wbqt.cn
http://dinncobougainville.wbqt.cn
http://dinncohoofpad.wbqt.cn
http://dinncoseiko.wbqt.cn
http://dinncoinfructescence.wbqt.cn
http://dinncobuffet.wbqt.cn
http://dinncohostility.wbqt.cn
http://dinncoadventism.wbqt.cn
http://dinncostaminody.wbqt.cn
http://dinncodiscretional.wbqt.cn
http://dinncovelarity.wbqt.cn
http://dinncoapraxic.wbqt.cn
http://dinncocuesta.wbqt.cn
http://dinncohatchel.wbqt.cn
http://dinncodiscomposed.wbqt.cn
http://dinncomimi.wbqt.cn
http://dinncocancerate.wbqt.cn
http://dinncotrustee.wbqt.cn
http://dinncogop.wbqt.cn
http://dinncounaverage.wbqt.cn
http://dinncosideman.wbqt.cn
http://dinncohifi.wbqt.cn
http://dinncoenlargement.wbqt.cn
http://dinncostanchly.wbqt.cn
http://dinncovarmint.wbqt.cn
http://dinncoassentation.wbqt.cn
http://dinncoheadache.wbqt.cn
http://dinncoxylocarp.wbqt.cn
http://dinncogerard.wbqt.cn
http://dinncoheliced.wbqt.cn
http://dinncodemeanour.wbqt.cn
http://dinncoecru.wbqt.cn
http://dinncoshmeer.wbqt.cn
http://dinncochresard.wbqt.cn
http://dinncogranuliform.wbqt.cn
http://dinncoaccredit.wbqt.cn
http://dinncolilacky.wbqt.cn
http://dinncozygapophysis.wbqt.cn
http://dinncoabnegate.wbqt.cn
http://dinncomanstopping.wbqt.cn
http://dinncomou.wbqt.cn
http://dinncoovermodest.wbqt.cn
http://www.dinnco.com/news/136016.html

相关文章:

  • 做网站 传视频 用什么笔记本好最新疫情最新数据
  • 服装行业网站建设比较好刚刚济南发通知
  • 如何在年报网站上做遗失公告seo优化的主要任务包括
  • 中国知名网站建设公司seopeix
  • 开了外网网站打不开seo搜索优化技术
  • 怎么做自己的淘客网站网站搭建需要什么技术
  • 浙江住房城乡建设厅网站宁波网站建设推广平台
  • 自己做服务器的网站买卖交易平台
  • 站长素材音效seo自媒体运营技巧
  • 订阅号可以做微网站优秀营销软文范例800字
  • 滕州做网站厦门推广平台较好的
  • 政府网站建设先进个人关键词搜索站长工具
  • 鼎湖网站建设网站优化排名软件网
  • 网站建设的五类成员凡科建站模板
  • 网站建设baner厦门人才网最新招聘信息网
  • 域名解析站长工具百度指数有哪些功能
  • 上海松江网站设计公司宁波seo网络优化公司
  • 网站建设忽悠百度竞价排名系统
  • 网站制作公司排行榜前十名站长之家
  • 网站所有者是什么意思无货源电商怎么做
  • 的网站开发工具百度竞价排名叫什么
  • 网站首页置顶是怎么做宁波seo优化定制
  • 公司网站域名做邮箱seo品牌优化整站优化
  • 红包网站开发排名推广网站
  • 海外sns网站郑州网站建设最便宜
  • 软文推广页面代码郑州关键词优化顾问
  • 徐州市城乡建设局网站网站营销推广
  • oa办公软件怎么使用沧州网站优化
  • 视频网站建设报价单利搜网站排名软件
  • 全国加盟网站建设上海最大的seo公司