Connecting my MongoDB database table to my react website (package error?)

Im trying to create an event log showing the before and after image of each record added, modified, or deactivated should be generated each time data changes by any of the users. The event logs must be kept on a table. The user id and the time and date of the user who made change to the data must be saved. Each event must have a unique auto generated ID. To keep my self from being overwhelmed, I just trie the login/out part.

in my EventsController.java form, I keep getting error signals for the ** parts:

package superioraccountingsoftware.com.Accounting;

// Import your models and service
*import superioraccountingsoftware.com.Accounting.models.Event;
import superioraccountingsoftware.com.Accounting.services.EventsService;*
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/events")
public class EventsController {

    @Autowired
    private EventsService eventsService;  // Inject the service that handles event logging

    @PostMapping("/log")
    public ResponseEntity<String> logEvent(@RequestParam String userId, @RequestParam String eventType) {
        if (userId == null || eventType == null) {
            return ResponseEntity.badRequest().body("Missing userId or eventType");
        }

        // Delegate event logging to the service
        Event event = eventsService.logEvent(userId, eventType);

        return ResponseEntity.ok("Event logged successfully with ID: " + event.getId());
    }
}

Any ideas on how to fix this error?