| | |
| | | import cc.mrbird.febs.common.controller.BaseController; |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.common.enumerates.ProductEnum; |
| | | import cc.mrbird.febs.mall.dto.AdminMallProductNftDto; |
| | | import cc.mrbird.febs.mall.dto.MallNewsInfoDto; |
| | | import cc.mrbird.febs.mall.entity.MallNewsCategory; |
| | | import cc.mrbird.febs.mall.entity.MallNewsInfo; |
| | | import cc.mrbird.febs.mall.entity.*; |
| | | import cc.mrbird.febs.mall.mapper.MallProductNftMapper; |
| | | import cc.mrbird.febs.mall.service.IMallNewsInfoService; |
| | | import cc.mrbird.febs.mall.vo.AdminMallProductNftVo; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | public class AdminNewsInfoController extends BaseController { |
| | | |
| | | private final IMallNewsInfoService mallNewsInfoService; |
| | | private final MallProductNftMapper mallProductNftMapper; |
| | | |
| | | /** |
| | | * NFT预约产品 |
| | | */ |
| | | @GetMapping("getProductNFTList") |
| | | public FebsResponse getProductNFTList(MallProductNft mallProductNft, QueryRequest request) { |
| | | Map<String, Object> data = getDataTable(mallNewsInfoService.getProductNFTList(mallProductNft, request)); |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | |
| | | /** |
| | | * NFT预约产品-新增 |
| | | */ |
| | | @PostMapping("addProductNFT") |
| | | @ControllerEndpoint(operation = "NFT预约产品-新增", exceptionMessage = "操作失败") |
| | | public FebsResponse addProductNFT(@Valid AdminMallProductNftDto adminMallProductNftDto) { |
| | | return mallNewsInfoService.addProductNFT(adminMallProductNftDto); |
| | | } |
| | | |
| | | @PostMapping(value = "/upNFT/{id}") |
| | | public FebsResponse upNFT(@PathVariable Long id) { |
| | | MallProductNft mallProductNft = mallProductNftMapper.selectById(id); |
| | | mallProductNft.setState(ProductEnum.PRODUCT_NFT_OPEN.getValue()); |
| | | mallProductNftMapper.updateById(mallProductNft); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @PostMapping(value = "/unUpNFT/{id}") |
| | | public FebsResponse unUpNFT(@PathVariable Long id) { |
| | | MallProductNft mallProductNft = mallProductNftMapper.selectById(id); |
| | | mallProductNft.setState(ProductEnum.PRODUCT_NFT_CLOSE.getValue()); |
| | | mallProductNftMapper.updateById(mallProductNft); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | /** |
| | | * NFT预约产品-删除 |
| | | */ |
| | | @GetMapping("delNFT/{id}") |
| | | @ControllerEndpoint(operation = " 新闻中心-删除", exceptionMessage = "操作失败") |
| | | public FebsResponse delNFT(@NotNull(message = "{required}") @PathVariable Long id) { |
| | | return mallNewsInfoService.delNFT(id); |
| | | } |
| | | |
| | | /** |
| | | * NFT预约产品-更新 |
| | | */ |
| | | @PostMapping("nftInfoUpdate") |
| | | @ControllerEndpoint(operation = "NFT预约产品-更新", exceptionMessage = "操作失败") |
| | | public FebsResponse nftInfoUpdate(@Valid MallProductNft mallProductNft) { |
| | | return mallNewsInfoService.nftInfoUpdate(mallProductNft); |
| | | } |
| | | |
| | | /** |
| | | * 用户NFT预约列表 |
| | | */ |
| | | @GetMapping("getBuyList") |
| | | public FebsResponse getBuyList(MallProductBuy mallProductBuy, QueryRequest request) { |
| | | Map<String, Object> data = getDataTable(mallNewsInfoService.getBuyList(mallProductBuy, request)); |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | |
| | | /** |
| | | * 用户NFT提现列表 |
| | | */ |
| | | @GetMapping("getSellList") |
| | | public FebsResponse getSellList(MallProductSell mallProductSell, QueryRequest request) { |
| | | Map<String, Object> data = getDataTable(mallNewsInfoService.getSellList(mallProductSell, request)); |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | |
| | | /** |
| | | * 新闻中心-列表 |