public void changeAccountStatus(int id, int accountStatus) { Seller seller = sellerMapper.getSellerById(id); seller.setAccountStatus(accountStatus); sellerMapper.updateSeller(seller); if (accountStatus == AccountStatus.SUSPEND) { // 冻结账号,停售所有产品 productService.changeProductsOfSeller(id, ProductStatus.Unsellable); } else if (accountStatus == AccountStatus.OK) { productService.changeProductsOfSeller(id, ProductStatus.Sellable); } emailService.sendEmailWhenAdminChangeAccountStatus(seller.getEmail()); }
public void updateSeller(Seller seller) { sellerMapper.updateSeller(seller); }