package edu.prlab.tyler.iotgateway.gateway.config;

import edu.prlab.tyler.iotgateway.gateway.pojo.auth.User;
import edu.prlab.tyler.iotgateway.gateway.services.UserService;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

@Component
public class DefaultData implements ApplicationRunner {
    private UserService userService;

    public DefaultData(UserService userService) {
        this.userService = userService;
    }

    @Override
    public void run(ApplicationArguments args) throws Exception {
        User defaultUser = userService.registerNewUser(User.builder().username("testUser0").password("testUser0").build()).get();
        System.out.println(defaultUser.toString());
    }
}
