|  | @@ -0,0 +1,93 @@
 | 
	
		
			
				|  |  | +package cn.newfeifan.mall.module.product.controller.admin.spuapplylog;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +import cn.newfeifan.mall.framework.common.pojo.CommonResult;
 | 
	
		
			
				|  |  | +import cn.newfeifan.mall.framework.common.pojo.PageParam;
 | 
	
		
			
				|  |  | +import cn.newfeifan.mall.framework.common.pojo.PageResult;
 | 
	
		
			
				|  |  | +import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
 | 
	
		
			
				|  |  | +import cn.newfeifan.mall.framework.excel.core.util.ExcelUtils;
 | 
	
		
			
				|  |  | +import cn.newfeifan.mall.framework.operatelog.core.annotations.OperateLog;
 | 
	
		
			
				|  |  | +import cn.newfeifan.mall.module.product.controller.admin.spuapplylog.vo.SpuApplyLogPageReqVO;
 | 
	
		
			
				|  |  | +import cn.newfeifan.mall.module.product.controller.admin.spuapplylog.vo.SpuApplyLogRespVO;
 | 
	
		
			
				|  |  | +import cn.newfeifan.mall.module.product.controller.admin.spuapplylog.vo.SpuApplyLogSaveReqVO;
 | 
	
		
			
				|  |  | +import cn.newfeifan.mall.module.product.dal.dataobject.spuapplylog.SpuApplyLogDO;
 | 
	
		
			
				|  |  | +import cn.newfeifan.mall.module.product.service.spuapplylog.SpuApplyLogService;
 | 
	
		
			
				|  |  | +import io.swagger.v3.oas.annotations.Operation;
 | 
	
		
			
				|  |  | +import io.swagger.v3.oas.annotations.Parameter;
 | 
	
		
			
				|  |  | +import io.swagger.v3.oas.annotations.tags.Tag;
 | 
	
		
			
				|  |  | +import org.springframework.security.access.prepost.PreAuthorize;
 | 
	
		
			
				|  |  | +import org.springframework.validation.annotation.Validated;
 | 
	
		
			
				|  |  | +import org.springframework.web.bind.annotation.*;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +import javax.annotation.Resource;
 | 
	
		
			
				|  |  | +import javax.servlet.http.HttpServletResponse;
 | 
	
		
			
				|  |  | +import javax.validation.Valid;
 | 
	
		
			
				|  |  | +import java.io.IOException;
 | 
	
		
			
				|  |  | +import java.util.List;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +import static cn.newfeifan.mall.framework.common.pojo.CommonResult.success;
 | 
	
		
			
				|  |  | +import static cn.newfeifan.mall.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +@Tag(name = "管理后台 - 商品审核记录")
 | 
	
		
			
				|  |  | +@RestController
 | 
	
		
			
				|  |  | +@RequestMapping("/product/spu-apply-log")
 | 
	
		
			
				|  |  | +@Validated
 | 
	
		
			
				|  |  | +public class SpuApplyLogController {
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Resource
 | 
	
		
			
				|  |  | +    private SpuApplyLogService spuApplyLogService;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @PostMapping("/create")
 | 
	
		
			
				|  |  | +    @Operation(summary = "创建商品审核记录")
 | 
	
		
			
				|  |  | +    @PreAuthorize("@ss.hasPermission('product:spu-apply-log:create')")
 | 
	
		
			
				|  |  | +    public CommonResult<Long> createSpuApplyLog(@Valid @RequestBody SpuApplyLogSaveReqVO createReqVO) {
 | 
	
		
			
				|  |  | +        return success(spuApplyLogService.createSpuApplyLog(createReqVO));
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @PutMapping("/update")
 | 
	
		
			
				|  |  | +    @Operation(summary = "更新商品审核记录")
 | 
	
		
			
				|  |  | +    @PreAuthorize("@ss.hasPermission('product:spu-apply-log:update')")
 | 
	
		
			
				|  |  | +    public CommonResult<Boolean> updateSpuApplyLog(@Valid @RequestBody SpuApplyLogSaveReqVO updateReqVO) {
 | 
	
		
			
				|  |  | +        spuApplyLogService.updateSpuApplyLog(updateReqVO);
 | 
	
		
			
				|  |  | +        return success(true);
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @DeleteMapping("/delete")
 | 
	
		
			
				|  |  | +    @Operation(summary = "删除商品审核记录")
 | 
	
		
			
				|  |  | +    @Parameter(name = "id", description = "编号", required = true)
 | 
	
		
			
				|  |  | +    @PreAuthorize("@ss.hasPermission('product:spu-apply-log:delete')")
 | 
	
		
			
				|  |  | +    public CommonResult<Boolean> deleteSpuApplyLog(@RequestParam("id") Long id) {
 | 
	
		
			
				|  |  | +        spuApplyLogService.deleteSpuApplyLog(id);
 | 
	
		
			
				|  |  | +        return success(true);
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @GetMapping("/get")
 | 
	
		
			
				|  |  | +    @Operation(summary = "获得商品审核记录")
 | 
	
		
			
				|  |  | +    @Parameter(name = "id", description = "编号", required = true, example = "1024")
 | 
	
		
			
				|  |  | +    @PreAuthorize("@ss.hasPermission('product:spu-apply-log:query')")
 | 
	
		
			
				|  |  | +    public CommonResult<SpuApplyLogRespVO> getSpuApplyLog(@RequestParam("id") Long id) {
 | 
	
		
			
				|  |  | +        SpuApplyLogDO spuApplyLog = spuApplyLogService.getSpuApplyLog(id);
 | 
	
		
			
				|  |  | +        return success(BeanUtils.toBean(spuApplyLog, SpuApplyLogRespVO.class));
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @GetMapping("/page")
 | 
	
		
			
				|  |  | +    @Operation(summary = "获得商品审核记录分页")
 | 
	
		
			
				|  |  | +    @PreAuthorize("@ss.hasPermission('product:spu-apply-log:query')")
 | 
	
		
			
				|  |  | +    public CommonResult<PageResult<SpuApplyLogRespVO>> getSpuApplyLogPage(@Valid SpuApplyLogPageReqVO pageReqVO) {
 | 
	
		
			
				|  |  | +        PageResult<SpuApplyLogDO> pageResult = spuApplyLogService.getSpuApplyLogPage(pageReqVO);
 | 
	
		
			
				|  |  | +        return success(BeanUtils.toBean(pageResult, SpuApplyLogRespVO.class));
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @GetMapping("/export-excel")
 | 
	
		
			
				|  |  | +    @Operation(summary = "导出商品审核记录 Excel")
 | 
	
		
			
				|  |  | +    @PreAuthorize("@ss.hasPermission('product:spu-apply-log:export')")
 | 
	
		
			
				|  |  | +    @OperateLog(type = EXPORT)
 | 
	
		
			
				|  |  | +    public void exportSpuApplyLogExcel(@Valid SpuApplyLogPageReqVO pageReqVO,
 | 
	
		
			
				|  |  | +              HttpServletResponse response) throws IOException {
 | 
	
		
			
				|  |  | +        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
 | 
	
		
			
				|  |  | +        List<SpuApplyLogDO> list = spuApplyLogService.getSpuApplyLogPage(pageReqVO).getList();
 | 
	
		
			
				|  |  | +        // 导出 Excel
 | 
	
		
			
				|  |  | +        ExcelUtils.write(response, "商品审核记录.xls", "数据", SpuApplyLogRespVO.class,
 | 
	
		
			
				|  |  | +                        BeanUtils.toBean(list, SpuApplyLogRespVO.class));
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +}
 |