Commit 6d09c43b authored by tangtuo's avatar tangtuo

修改nft置顶 下架的逻辑

parent a9a3e640
......@@ -242,9 +242,12 @@ public class NftServiceImpl extends ServiceImpl<NftMapper, Nft> implements NftSe
@Override
public Boolean top(Integer id) {
Nft nft = new Nft();
Nft nft = getById(id);
// 未上架的nft不能置顶
if (SystemConstant.BOOLEAN_DATA_FALSE.equals(nft.getStatus())) {
throw GlobalException.newException(ResultCode.FAILED, "未上架的nft不能置顶");
}
nft.setIsTop(SystemConstant.BOOLEAN_DATA_TRUE);
nft.setId(id);
return updateById(nft);
}
......@@ -268,6 +271,7 @@ public class NftServiceImpl extends ServiceImpl<NftMapper, Nft> implements NftSe
public Boolean offShelf(Integer id) {
Nft nft = new Nft();
nft.setStatus(SystemConstant.BOOLEAN_DATA_FALSE);
nft.setIsTop(SystemConstant.BOOLEAN_DATA_FALSE);
nft.setId(id);
return updateById(nft);
}
......
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