Rev 35610 | Blame | Compare with Previous | Last modification | View Log | RSS feed
package com.smartdukaan.cron.controller;import com.smartdukaan.cron.migrations.RunOnceTasks;import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.http.ResponseEntity;import org.springframework.web.bind.annotation.GetMapping;import org.springframework.web.bind.annotation.RequestParam;import org.springframework.web.bind.annotation.RestController;@RestControllerpublic class ExposeController {private static final Logger LOGGER = LogManager.getLogger(ExposeController.class);@Autowiredprivate RunOnceTasks runOnceTasks;@GetMapping("/expose")public ResponseEntity<?> expose() {return ResponseEntity.ok("This is use for Expose");}/*** Resolve old Sales/RBM Escalation tickets created before September 30, 2025.* Usage: GET /resolveOldEscalationTickets?dryRun=true (preview only)* GET /resolveOldEscalationTickets?dryRun=false (actual execution)*/@GetMapping("/resolveOldEscalationTickets")public ResponseEntity<?> resolveOldEscalationTickets(@RequestParam(defaultValue = "true") boolean dryRun) {try {LOGGER.info("resolveOldEscalationTickets called with dryRun={}", dryRun);String result = runOnceTasks.resolveOldEscalationTickets(dryRun);return ResponseEntity.ok(result);} catch (Exception e) {LOGGER.error("Error in resolveOldEscalationTickets", e);return ResponseEntity.status(500).body("Error: " + e.getMessage());}}}