Commit bf6b5664 authored by tangtuo's avatar tangtuo

前台系统加入下载文件接口

nft详情接口加入平台是否存档等字段
parent 07de0da1
...@@ -50,20 +50,28 @@ public class NftVo { ...@@ -50,20 +50,28 @@ public class NftVo {
@ApiModelProperty("简介") @ApiModelProperty("简介")
private String synopsis; private String synopsis;
@ApiModelProperty("平台存档 0-不存档 1-加密存档")
private Integer isArchives;
@ApiModelProperty("授权阅读 0-不需要授权 1-需要授权")
private Integer isGrant;
@ApiModelProperty("关于nft") @ApiModelProperty("关于nft")
private String aboutNft; private String aboutNft;
public NftVo(Nft nft, User user){ public NftVo(Nft nft, User user) {
this.id = nft.getId(); this.id = nft.getId();
this.author = nft.getAuthor(); this.author = nft.getAuthor();
this.name = nft.getName(); this.name = nft.getName();
this.theme=nft.getTheme(); this.theme = nft.getTheme();
this.fileHash = nft.getFileHash(); this.fileHash = nft.getFileHash();
this.nftId = nft.getNftId(); this.nftId = nft.getNftId();
this.synopsis = nft.getSynopsis(); this.synopsis = nft.getSynopsis();
this.publisher = user.getNickname(); this.publisher = user.getNickname();
this.avatar = user.getAvatar(); this.avatar = user.getAvatar();
this.wallet=user.getWallet(); this.wallet = user.getWallet();
this.publishTime = DateUtil.format(nft.getPublishTime(), "yyyy/MM/dd HH:mm:ss"); this.publishTime = DateUtil.format(nft.getPublishTime(), "yyyy/MM/dd HH:mm:ss");
this.isArchives = nft.getIsArchives();
this.isGrant = nft.getIsGrant();
} }
} }
...@@ -190,4 +190,11 @@ public class NftController { ...@@ -190,4 +190,11 @@ public class NftController {
NftCertificateVo vo = new NftCertificateVo(nft, user, qrCode); NftCertificateVo vo = new NftCertificateVo(nft, user, qrCode);
return ResponseModel.success(vo); return ResponseModel.success(vo);
} }
@Authentication
@ApiOperation(value = "下载文件")
@PostMapping("/download/{id}")
public void download(@ApiParam(value = "nft主键") @PathVariable Integer id) {
nftService.download(id);
}
} }
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