feat(新增-商品管理): 商品审核
Signed-off-by: bunny <1319900154@qq.com>
This commit is contained in:
parent
315659d1f7
commit
50f376d312
|
@ -65,4 +65,11 @@ public class ProductController {
|
|||
productService.deleteById(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@Operation(summary = "商品审核", description = "商品审核")
|
||||
@GetMapping("/updateAuditStatus/{id}/{auditStatus}")
|
||||
public Result<Product> updateAuditStatus(@PathVariable Long id, @PathVariable Integer auditStatus) {
|
||||
productService.updateAuditStatus(id, auditStatus);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
|
@ -43,4 +43,12 @@ public interface ProductService {
|
|||
* @param id 删除ID
|
||||
*/
|
||||
void deleteById(Long id);
|
||||
|
||||
/**
|
||||
* 商品审核
|
||||
*
|
||||
* @param id 审核ID
|
||||
* @param auditStatus 审核状态
|
||||
*/
|
||||
void updateAuditStatus(Long id, Integer auditStatus);
|
||||
}
|
||||
|
|
|
@ -134,4 +134,24 @@ public class ProductServiceImpl implements ProductService {
|
|||
productSkuMapper.deleteByProductId(id); // 根据商品id删除商品的sku数据
|
||||
productDetailsMapper.deleteByProductId(id); // 根据商品的id删除商品的详情数据
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品审核
|
||||
*
|
||||
* @param id 审核ID
|
||||
* @param auditStatus 审核状态
|
||||
*/
|
||||
@Override
|
||||
public void updateAuditStatus(Long id, Integer auditStatus) {
|
||||
Product product = new Product();
|
||||
product.setId(id);
|
||||
if (auditStatus == 1) {
|
||||
product.setAuditStatus(1);
|
||||
product.setAuditMessage("审批通过");
|
||||
} else {
|
||||
product.setAuditStatus(-1);
|
||||
product.setAuditMessage("审批不通过");
|
||||
}
|
||||
productMapper.updateById(product);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue