<commit_before>package studentcapture.login;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import studentcapture.datalayer.*;

@RestController
public class LoginDBController {
	
	@RequestMapping(value = "/register", method = RequestMethod.POST)
	public void registerUser(
							 @RequestParam(value="firstname", required = true) String firstName,
							 @RequestParam(value="lastname", required = true)  String lastName,
							 @RequestParam(value="email", required = true)     String email,
							 @RequestParam(value="username", required = true)  String username,
							 @RequestParam(value="password", required = true)  String password
							 ) {
	    
	    System.out.println(firstName + lastName + email + username + password);
		UserAccount user = new UserAccount(firstName, lastName, email, username, password);
	}
}<commit_msg>Registration method partially implemented<commit_after>package studentcapture.login;

import java.net.URI;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriComponentsBuilder;

import studentcapture.datalayer.*;


/**
 * Controller for handling HTTP requests related to the login page.
 * @author <NAME>
 *
 */
@RestController
public class LoginDBController {
	
	private static final String dbURI = "https://localhost:8443";
    
    @Autowired
    private RestTemplate requestSender;
    
    /**
     * Registers a new user.
     * @param firstName
     * @param lastName
     * @param email
     * @param username
     * @param password
     */
	@RequestMapping(value = "/register", method = RequestMethod.POST)
	public void registerUser(
							 @RequestParam(value="firstname", required = true) String firstName,
							 @RequestParam(value="lastname", required = true)  String lastName,
							 @RequestParam(value="email", required = true)     String email,
							 @RequestParam(value="username", required = true)  String username,
							 @RequestParam(value="password", required = true)  String password
							 ) {
	    LoginAuthentication loginAuth = new LoginAuthentication();
	    if(loginAuth.checkUser(username, password)) {
	    	//Send error that user already exists
	    	return;
	    }
	    
	    URI targetUrl = UriComponentsBuilder.fromUriString(dbURI)
	    		.path("DB/register")
	    		.queryParam("username", username)
	    		.queryParam("fName", firstName)
	    		.queryParam("lName", lastName)
	    		.queryParam("pNr", "123")
	    		.queryParam("pwd", password)
	    		.build()
	    		.toUri();
	   
	    Boolean response = requestSender.getForObject(targetUrl, Boolean.class);
	   
	    if(response) {
	    	//registration successful
	    	System.out.println("Registration Success");
	    } else {
	    	//registration failed
	    	System.out.println("Registration failed");
	    }
	}
}
{'fraction_non_alphanumeric': 0.10799396681749623, 'fraction_numerical': 0.0021116138763197585, 'mean_word_length': 3.743919885550787, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3953035', 'n_tokens_mistral': 993, 'n_tokens_neox': 871, 'n_words': 199}