数藏浏览器\批量截图接口
This commit is contained in:
parent
7f7ddf675c
commit
b28bf89498
@ -114,4 +114,12 @@ public class ZNft extends Model<ZNft> {
|
||||
* 2023/4/18 新增字段
|
||||
*/
|
||||
private Integer scoreAmount;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Timestamp payTime;
|
||||
private String txHash;
|
||||
private String sender;
|
||||
private String receiver;
|
||||
private String senderName;
|
||||
|
||||
}
|
||||
|
||||
@ -3,7 +3,11 @@ package com.cpop.nftmeta.api.controller;
|
||||
import cn.hutool.core.img.ImgUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.extra.qrcode.QrCodeUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.cpop.nftmeta.api.entity.Nft;
|
||||
import com.cpop.nftmeta.api.service.*;
|
||||
import com.cpop.nftmeta.api.vo.BrowserVo;
|
||||
import com.cpop.nftmeta.common.context.CUserInfo;
|
||||
import com.cpop.nftmeta.common.context.UserContext;
|
||||
import com.cpop.nftmeta.common.entity.ZMemberNft;
|
||||
@ -13,13 +17,17 @@ import com.cpop.nftmeta.common.enums.NftFunction;
|
||||
import com.cpop.nftmeta.common.vo.R;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Api(tags = "藏品模块")
|
||||
@RestController
|
||||
@ -103,4 +111,49 @@ public class NftController {
|
||||
public R exchangeMemberNft(@PathVariable Integer memberNftId){
|
||||
return nftInterestService.exchangeByMemberNftId(memberNftId);
|
||||
}
|
||||
|
||||
@ApiOperation("数藏浏览器")
|
||||
@GetMapping("/browser")
|
||||
public R browser(@RequestParam("blockAddr") String blockAddr){
|
||||
QueryWrapper<Nft> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("blockaddr",blockAddr);
|
||||
Nft one = nftService.getOne(queryWrapper);
|
||||
if (ObjectUtil.isNull(one)){
|
||||
return R.fail("未找到该库存");
|
||||
}
|
||||
BrowserVo vo = new BrowserVo();
|
||||
BeanUtils.copyProperties(one,vo);
|
||||
if (!vo.getCode().startsWith("SHU") && !vo.getCode().startsWith("NIU") && !vo.getCode().startsWith("HU")
|
||||
&& !vo.getCode().startsWith("TU")&& !vo.getCode().startsWith("LONG")&& !vo.getCode().startsWith("SHE")){
|
||||
vo.setSenderName("普普文化集团有限公司");
|
||||
vo.setStockState("在库");
|
||||
}else {
|
||||
vo.setStockState("已出库");
|
||||
}
|
||||
|
||||
return R.success(vo);
|
||||
}
|
||||
|
||||
@ApiOperation("浏览器数藏列表")
|
||||
@GetMapping("/browser/list")
|
||||
public R browserList(@RequestParam("current") Integer current, @RequestParam("size") Integer size){
|
||||
QueryWrapper<Nft> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.likeRight("code", "ZHU-");
|
||||
queryWrapper.orderByAsc("creation_time");
|
||||
List<Nft> list = nftService.list(queryWrapper);
|
||||
List<BrowserVo> voList = list.stream().map(item -> {
|
||||
BrowserVo vo = new BrowserVo();
|
||||
BeanUtils.copyProperties(item,vo);
|
||||
if (!vo.getCode().startsWith("SHU") && !vo.getCode().startsWith("NIU") && !vo.getCode().startsWith("HU")
|
||||
&& !vo.getCode().startsWith("TU")&& !vo.getCode().startsWith("LONG")&& !vo.getCode().startsWith("SHE")){
|
||||
vo.setSenderName("普普文化集团有限公司");
|
||||
vo.setStockState("在库");
|
||||
}else {
|
||||
vo.setStockState("已出库");
|
||||
}
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
return R.success(voList);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,15 @@
|
||||
package com.cpop.nftmeta.api.vo;
|
||||
|
||||
import com.cpop.nftmeta.common.entity.ZNft;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Version: 1.0
|
||||
* @since: 2025/9/5
|
||||
* @author: yxz
|
||||
*/
|
||||
@Data
|
||||
public class BrowserVo extends ZNft {
|
||||
private String stockState;
|
||||
|
||||
}
|
||||
@ -23,7 +23,7 @@ public class NftTest {
|
||||
private FileStorageService fileStorageService;
|
||||
@Autowired
|
||||
private ZNftService nftService;
|
||||
@Test
|
||||
/* @Test
|
||||
public void issueNFT() throws IOException {
|
||||
// 指定要读取的目录
|
||||
File directory = new File("C:\\Users\\POP\\Desktop\\screenshots");
|
||||
@ -54,5 +54,5 @@ public class NftTest {
|
||||
} else {
|
||||
System.out.println("The directory does not exist or is not a directory.");
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user