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

import edu.prlab.tyler.iotgateway.gateway.pojo.auth.SensitiveUser;
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 {
        userService.registerNewUser(SensitiveUser.builder().account("testUser0").password("testUser0").build()).get();
    }
}
