|
|
@@ -13,6 +13,7 @@ import com.template.model.result.CommonResult;
|
|
|
import com.template.services.BlacklistOrderService;
|
|
|
import com.template.services.BlacklistService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
@@ -90,5 +91,18 @@ public class BlacklistController implements BlacklistControllerAPI {
|
|
|
}
|
|
|
return CommonResult.fail();
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ // 每月定期清空黑名单表
|
|
|
+ @Scheduled(cron = "0 0 2 1 * ? ")
|
|
|
+// @Scheduled(cron = "0 0/1 * * * ?")
|
|
|
+ public void deleteBlacklist(){
|
|
|
+// 先删除黑名单订单
|
|
|
+ blacklistOrderService.remove(new LambdaQueryWrapper<>());
|
|
|
+// 删除黑名单
|
|
|
+ blacklistService.remove(new LambdaQueryWrapper<>());
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|