记得上下班打卡 | git大法好,push需谨慎

Commit c0e58094 authored by jiangxiulong's avatar jiangxiulong

接口格式更改

parent 92e9c22a
...@@ -19,9 +19,26 @@ import java.io.Serializable; ...@@ -19,9 +19,26 @@ import java.io.Serializable;
@ApiModel @ApiModel
public class UploadVo implements Serializable { public class UploadVo implements Serializable {
@ApiModelProperty(value = "oss_files_id")
private String ossFilesId;
@ApiModelProperty(value = "源文件名称")
private String fileName;
@ApiModelProperty(value = "上传后的地址") @ApiModelProperty(value = "上传后的地址")
private String ossPath; private String ossPath;
@ApiModelProperty(value = "文件类型")
private String contentType; private String contentType;
@ApiModelProperty(value = "文件大小")
private Integer size; private Integer size;
@ApiModelProperty(value = "md5值判断文件是否相同")
private String md5str;
@ApiModelProperty(value = "buck_type")
private Integer buckType;
@ApiModelProperty(value = "上传人id")
private String uploaderUid;
@ApiModelProperty(value = "上传人姓名")
private String uploaderName;
@ApiModelProperty(value = "createdAt")
private String createdAt;
@ApiModelProperty(value = "updatedAt")
private String updatedAt;
} }
...@@ -347,7 +347,7 @@ ...@@ -347,7 +347,7 @@
maxFileCount: 1 maxFileCount: 1
}); });
$("#fileinput-demo-1").on("fileuploaded", function (event, data, previewId, index) { $("#fileinput-demo-1").on("fileuploaded", function (event, data, previewId, index) {
$("#img").val(data.response.ossPath) $("#img").val(data.response.data.ossPath)
}); });
}) })
</script> </script>
......
...@@ -484,7 +484,7 @@ ...@@ -484,7 +484,7 @@
maxFileCount: 1 maxFileCount: 1
}); });
$("#fileinput-demo-1").on("fileuploaded", function (event, data, previewId, index) { $("#fileinput-demo-1").on("fileuploaded", function (event, data, previewId, index) {
$("#coverImg").val(data.response.ossPath) $("#coverImg").val(data.response.data.ossPath)
}); });
}) })
</script> </script>
......
...@@ -539,7 +539,7 @@ ...@@ -539,7 +539,7 @@
}); });
$("#fileinput-demo-1").on("fileuploaded", function (event, data, previewId, index) { $("#fileinput-demo-1").on("fileuploaded", function (event, data, previewId, index) {
$("#coverImg").val(data.response.ossPath) $("#coverImg").val(data.response.data.ossPath)
}); });
}) })
</script> </script>
......
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
maxFileCount: 1 maxFileCount: 1
}); });
$("#fileinput-demo-1").on("fileuploaded", function (event, data, previewId, index) { $("#fileinput-demo-1").on("fileuploaded", function (event, data, previewId, index) {
$("#filePath").val(data.response.ossPath) $("#filePath").val(data.response.data.ossPath)
}); });
}) })
</script> </script>
......
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
initialPreviewConfig:[{"caption":filePath,"downloadUrl":"https://app.zhengzai.tv/" + filePath,"size":"","key":0}] initialPreviewConfig:[{"caption":filePath,"downloadUrl":"https://app.zhengzai.tv/" + filePath,"size":"","key":0}]
}); });
$("#fileinput-demo-1").on("fileuploaded", function (event, data, previewId, index) { $("#fileinput-demo-1").on("fileuploaded", function (event, data, previewId, index) {
$("#filePath").val(data.response.ossPath) $("#filePath").val(data.response.data.ossPath)
}); });
}) })
</script> </script>
......
...@@ -22,6 +22,7 @@ import io.swagger.annotations.Api; ...@@ -22,6 +22,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -64,7 +65,7 @@ public class AlOssController { ...@@ -64,7 +65,7 @@ public class AlOssController {
@ApiImplicitParam(type = "form", dataType = "Integer", name = "buckType", value = "buckType 1正常的任何文件上传 2apk上传", defaultValue = "1"), @ApiImplicitParam(type = "form", dataType = "Integer", name = "buckType", value = "buckType 1正常的任何文件上传 2apk上传", defaultValue = "1"),
@ApiImplicitParam(type = "form", dataType = "Integer", name = "resize", value = "resize", defaultValue = "0"), @ApiImplicitParam(type = "form", dataType = "Integer", name = "resize", value = "resize", defaultValue = "0"),
}) })
public UploadVo upload( public ResponseDto<UploadVo> upload(
@RequestParam MultipartFile file, @RequestParam MultipartFile file,
@RequestParam(defaultValue = "other") String pathName, @RequestParam(defaultValue = "other") String pathName,
@RequestParam(defaultValue = "1", required = false) int buckType, @RequestParam(defaultValue = "1", required = false) int buckType,
...@@ -87,7 +88,7 @@ public class AlOssController { ...@@ -87,7 +88,7 @@ public class AlOssController {
uploadVo.setOssPath(platformOssFiles.getOssPath()); uploadVo.setOssPath(platformOssFiles.getOssPath());
uploadVo.setSize(platformOssFiles.getSize()); uploadVo.setSize(platformOssFiles.getSize());
uploadVo.setContentType(platformOssFiles.getContentType()); uploadVo.setContentType(platformOssFiles.getContentType());
return uploadVo; return ResponseDto.success(uploadVo);
} }
String filename = file.getResource().getFilename();// time.jpeg String filename = file.getResource().getFilename();// time.jpeg
...@@ -133,10 +134,8 @@ public class AlOssController { ...@@ -133,10 +134,8 @@ public class AlOssController {
// 返回值 // 返回值
UploadVo uploadVo = new UploadVo(); UploadVo uploadVo = new UploadVo();
uploadVo.setOssPath(platformOssFilesDate.getOssPath()); BeanUtils.copyProperties(platformOssFilesDate, uploadVo);
uploadVo.setSize(platformOssFilesDate.getSize()); return ResponseDto.success(uploadVo);
uploadVo.setContentType(platformOssFilesDate.getContentType());
return uploadVo;
} }
} }
...@@ -3,6 +3,7 @@ package com.liquidnet.service.platform.controller.basicServices; ...@@ -3,6 +3,7 @@ package com.liquidnet.service.platform.controller.basicServices;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.liquidnet.common.cache.redis.util.RedisUtil; import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.kylin.constant.KylinRedisConst; import com.liquidnet.service.kylin.constant.KylinRedisConst;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
...@@ -57,12 +58,12 @@ public class WechatShareController { ...@@ -57,12 +58,12 @@ public class WechatShareController {
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "url", value = "url地址 注意 URL 一定要动态获取,不能 hardcode", required = true), @ApiImplicitParam(type = "query", dataType = "String", name = "url", value = "url地址 注意 URL 一定要动态获取,不能 hardcode", required = true),
}) })
public Map<String, String> zhengzai(@RequestParam String url) { public ResponseDto<Map<String, String>> zhengzai(@RequestParam String url) {
String accessToken = accessToken(zhengzaiAppid, zhengzaiSecret); String accessToken = accessToken(zhengzaiAppid, zhengzaiSecret);
String jsapiTicket = jsapiTicket(zhengzaiAppid, accessToken); String jsapiTicket = jsapiTicket(zhengzaiAppid, accessToken);
Map<String, String> ret = sign(jsapiTicket, url); Map<String, String> ret = sign(jsapiTicket, url);
return ret; return ResponseDto.success(ret);
} }
@GetMapping("/modernsky") @GetMapping("/modernsky")
...@@ -70,12 +71,12 @@ public class WechatShareController { ...@@ -70,12 +71,12 @@ public class WechatShareController {
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "url", value = "url地址 注意 URL 一定要动态获取,不能 hardcode", required = true), @ApiImplicitParam(type = "query", dataType = "String", name = "url", value = "url地址 注意 URL 一定要动态获取,不能 hardcode", required = true),
}) })
public Map<String, String> modernsky(@RequestParam String url) { public ResponseDto<Map<String, String>> modernsky(@RequestParam String url) {
String accessToken = accessToken(modernskyAppid, modernskySecret); String accessToken = accessToken(modernskyAppid, modernskySecret);
String jsapiTicket = jsapiTicket(modernskyAppid, accessToken); String jsapiTicket = jsapiTicket(modernskyAppid, accessToken);
Map<String, String> ret = sign(jsapiTicket, url); Map<String, String> ret = sign(jsapiTicket, url);
return ret; return ResponseDto.success(ret);
} }
public static Map<String, String> sign(String jsapi_ticket, String url) { public static Map<String, String> sign(String jsapi_ticket, String url) {
......
package com.liquidnet.service.platform.controller.basicServices; package com.liquidnet.service.platform.controller.basicServices;
import com.liquidnet.common.cache.redis.util.RedisUtil; import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.kylin.constant.KylinRedisConst; import com.liquidnet.service.kylin.constant.KylinRedisConst;
import com.liquidnet.service.kylin.dto.vo.admin.ZhengzaiAppVersionsVo; import com.liquidnet.service.kylin.dto.vo.admin.ZhengzaiAppVersionsVo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -37,7 +38,7 @@ public class ZhengzaiAppVersionsController { ...@@ -37,7 +38,7 @@ public class ZhengzaiAppVersionsController {
// @ApiImplicitParam(type = "query", dataType = "Integer", name = "isProduction", value = "是否是生产环境,1是 2否", required = true), // @ApiImplicitParam(type = "query", dataType = "Integer", name = "isProduction", value = "是否是生产环境,1是 2否", required = true),
}) })
// public ZhengzaiAppVersionsVo lastInfo(@RequestParam Integer type, @RequestParam Integer isProduction) { // public ZhengzaiAppVersionsVo lastInfo(@RequestParam Integer type, @RequestParam Integer isProduction) {
public ZhengzaiAppVersionsVo lastInfo(@RequestParam Integer type, @RequestParam Integer appType) { public ResponseDto<ZhengzaiAppVersionsVo> lastInfo(@RequestParam Integer type, @RequestParam Integer appType) {
ZhengzaiAppVersionsVo info = null; ZhengzaiAppVersionsVo info = null;
if (1 == appType) { if (1 == appType) {
if (1 == type) { if (1 == type) {
...@@ -53,7 +54,7 @@ public class ZhengzaiAppVersionsController { ...@@ -53,7 +54,7 @@ public class ZhengzaiAppVersionsController {
} }
} }
return info; return ResponseDto.success(info);
} }
} }
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