Commit 0d7e2330 by 陶光胜

小程序二维码

parent 983d54a8
package com.gic.enterprise.dto;
import java.io.Serializable;
public class AppletQrcodePathDTO implements Serializable {
private String fileId;
private String url;
private String downloadUrl;
private String path;
public String getFileId() {
return fileId;
}
public void setFileId(String fileId) {
this.fileId = fileId;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getDownloadUrl() {
return downloadUrl;
}
public void setDownloadUrl(String downloadUrl) {
this.downloadUrl = downloadUrl;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
}
......@@ -2,11 +2,11 @@ package com.gic.enterprise.service;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.enterprise.dto.AppletQrcodeDTO;
import com.gic.enterprise.dto.AppletQrcodePathDTO;
import java.util.Map;
public interface AppletQrcodeApiService {
ServiceResponse<Map<String, Object>> takeAppletQrcode(Integer enterpriseId, String appid, String path, String params);
ServiceResponse<AppletQrcodePathDTO> takeAppletQrcode(Integer enterpriseId, String appid, String path, String params);
ServiceResponse<AppletQrcodeDTO> getAppletQrcode(Integer id);
}
......@@ -2,6 +2,7 @@ package com.gic.enterprise.service.outer.impl;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.enterprise.dto.AppletQrcodeDTO;
import com.gic.enterprise.dto.AppletQrcodePathDTO;
import com.gic.enterprise.entity.TabAppletQrcode;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.service.AppletQrcodeApiService;
......@@ -23,7 +24,7 @@ public class AppletQrcodeApiServiceImpl implements AppletQrcodeApiService {
private WeixinWxaFunService weixinWxaFunService;
@Override
public ServiceResponse<Map<String, Object>> takeAppletQrcode(Integer enterpriseId, String appid, String path, String params) {
public ServiceResponse<AppletQrcodePathDTO> takeAppletQrcode(Integer enterpriseId, String appid, String path, String params) {
TabAppletQrcode tabAppletQrcode = new TabAppletQrcode();
tabAppletQrcode.setAppid(appid);
tabAppletQrcode.setEnterpriseId(enterpriseId);
......@@ -35,12 +36,12 @@ public class AppletQrcodeApiServiceImpl implements AppletQrcodeApiService {
Map<String, Object> result = wxaQrcode.getResult();
byte[] contents = (byte[]) result.get("content");
UploadResult uploadResult = QQCloudPicUtils.uploadLocalPicStream("pic01", "", contents);
Map<String, Object> pic = new HashMap<>();
pic.put("fileId", uploadResult.getFileId());
pic.put("url", uploadResult.getUrl());
pic.put("downloadUrl", uploadResult.getDownloadUrl());
pic.put("path", path+"?pageId="+i);
ServiceResponse.success(pic);
AppletQrcodePathDTO qrcodePathDTO = new AppletQrcodePathDTO();
qrcodePathDTO.setFileId(uploadResult.getFileId());
qrcodePathDTO.setUrl(uploadResult.getUrl());
qrcodePathDTO.setDownloadUrl(uploadResult.getDownloadUrl());
qrcodePathDTO.setPath(path+"?pageId="+i);
ServiceResponse.success(qrcodePathDTO);
}
return ServiceResponse.failure(ErrorCode.SYSTEM_ERROR.getCode(), "生成小程序二维码异常");
}
......
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