Commit e4b1bc5a authored by tangtuo's avatar tangtuo

debug

parent a7b4dc77
......@@ -46,15 +46,4 @@ public class CollectionNftVo {
@ApiModelProperty("是否已委托上架 0-否 1-是")
private Integer isEntrust;
public CollectionNftVo(Nft nft, Category category) {
this.id = nft.getId();
this.nftId = nft.getNftId();
this.category = category.getCategoryName();
this.name = nft.getName();
this.cover = nft.getCover();
this.isCommemorate = nft.getIsCommemorate();
this.fileUrl = nft.getFileUrl();
this.publishTime = nft.getPublishTime();
this.isEntrust = nft.getIsEntrust();
}
}
......@@ -39,4 +39,12 @@ public interface EntrustShelfService extends IService<EntrustShelf> {
* @return
*/
PageInfo<EntrustShelf> getPages(Integer pageNum, Integer pageSize, String telephone, String name, String from, String to);
/**
* 根据nft哈希查询详情
*
* @param nftHash
* @return
*/
EntrustShelf getByNftHash(String nftHash);
}
......@@ -86,4 +86,11 @@ public class EntrustShelfServiceImpl extends ServiceImpl<EntrustShelfMapper, Ent
}
return new PageInfo<>(this.list(queryWrapper));
}
@Override
public EntrustShelf getByNftHash(String nftHash) {
QueryWrapper<EntrustShelf> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("nft_hash", nftHash);
return this.getOne(queryWrapper);
}
}
......@@ -79,6 +79,8 @@
a.nft_id,
a.nft_hash,
a.file_url,
a.is_entrust,
a.publish_time,
a.is_commemorate,
b.category_name as category
from tb_nft a left join tb_category b on a.category_id = b.id
......
......@@ -35,10 +35,10 @@ public class EntrustShelfController {
return ResponseModel.success(entrustShelfService.submit(entrustShelf));
}
@GetMapping("/detail/{id}")
@GetMapping("/detail/{nftHash}")
@ApiOperation(value = "根据id查询委托详情")
public ResponseModel<EntrustShelf> getById(@PathVariable Integer id) {
return ResponseModel.success(entrustShelfService.getById(id));
public ResponseModel<EntrustShelf> getById(@PathVariable String nftHash) {
return ResponseModel.success(entrustShelfService.getByNftHash(nftHash));
}
@PostMapping("/update")
......
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