Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangtien2k3 committed Aug 12, 2023
1 parent c456e0d commit 7898a1d
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

import com.hoangtien2k3.blogapi.entity.Category;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface CategoryRepository extends JpaRepository<Category, Long> {

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

import com.hoangtien2k3.blogapi.entity.Comment;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CommentRepository extends JpaRepository<Comment, Long> {
List<Comment> findByPostId(long postId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

import com.hoangtien2k3.blogapi.entity.Post;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface PostRepository extends JpaRepository<Post, Long> {

List<Post> findByCategoryId(Long categoryId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

import com.hoangtien2k3.blogapi.entity.Role;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.Optional;

@Repository
public interface RoleRepository extends JpaRepository<Role, Long> {
Optional<Role> findByName(String name);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

import com.hoangtien2k3.blogapi.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.Optional;

@Repository
public interface UserRepository extends JpaRepository<User, Long> {

Optional<User> findByEmail(String email);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ public class PasswordGeneratorEncoder {
public static void main(String[] args) {
PasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
System.out.println(passwordEncoder.encode("admin"));
System.out.println(passwordEncoder.encode("ramesh"));
System.out.println(passwordEncoder.encode("12042003"));
}
}
2 changes: 1 addition & 1 deletion src/main/resources/application-dev.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
spring.datasource.url = jdbc:mysql://localhost:3306/myblog?useSSL=false&serverTimezone=UTC
spring.datasource.username = root
spring.datasource.password = root
spring.datasource.password = 12042003

# hibernate properties
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQLDialect
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application-qa.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
spring.datasource.url = jdbc:mysql://localhost:3306/myblog?useSSL=false&serverTimezone=UTC
spring.datasource.username = root
spring.datasource.password = root
spring.datasource.password = 12042003

# hibernate properties
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQLDialect
Expand Down
2 changes: 1 addition & 1 deletion target/classes/application-dev.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
spring.datasource.url = jdbc:mysql://localhost:3306/myblog?useSSL=false&serverTimezone=UTC
spring.datasource.username = root
spring.datasource.password = root
spring.datasource.password = 12042003

# hibernate properties
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQLDialect
Expand Down
2 changes: 1 addition & 1 deletion target/classes/application-qa.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
spring.datasource.url = jdbc:mysql://localhost:3306/myblog?useSSL=false&serverTimezone=UTC
spring.datasource.username = root
spring.datasource.password = root
spring.datasource.password = 12042003

# hibernate properties
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQLDialect
Expand Down

0 comments on commit 7898a1d

Please sign in to comment.