Skip to content

Commit

Permalink
#116 - Add Init User Data βœοΈπŸ“—:octocat:⬆
Browse files Browse the repository at this point in the history
  • Loading branch information
hendisantika committed Sep 5, 2023
1 parent 1c73ef0 commit e17724e
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
package com.hendisantika;

import com.hendisantika.entity.User;
import com.hendisantika.repository.UserRepository;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class SpringbootAdminlte3TemplateApplication {
Expand All @@ -10,4 +14,14 @@ public static void main(String[] args) {
SpringApplication.run(SpringbootAdminlte3TemplateApplication.class, args);
}

@Bean
public CommandLineRunner demo(UserRepository userRepository) {
return (args) -> {
userRepository.save(new User(1L, "hendi", "[email protected]", "hendi123"));
userRepository.save(new User(2L, "kakashi", "[email protected]", "hendi123"));
userRepository.save(new User(3L, "naruto", "[email protected]", "hendi123"));
userRepository.save(new User(4L, "sasuke", "[email protected]", "hendi123"));
userRepository.save(new User(5L, "sakura", "[email protected]", "hendi123"));
};
}
}

0 comments on commit e17724e

Please sign in to comment.