-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* jwt implementation changes * fixed issues * fixed issue * user fetch from redis concept * user fetch concept modify * Update build-on-pull-request.yml * Update package.yml * Update build-on-pull-request.yml * Update package.yml * Update sast.yml * error fixed * minor error fix --------- Co-authored-by: IN40068837 <[email protected]> Co-authored-by: sandipkarmakar3 <[email protected]> Co-authored-by: sandipkarmakar3 <[email protected]>
- Loading branch information
1 parent
7fe11c4
commit 5e16b7d
Showing
18 changed files
with
567 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.wipro.fhir.config; | ||
|
||
import org.springframework.cache.annotation.EnableCaching; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.data.redis.connection.RedisConnectionFactory; | ||
import org.springframework.data.redis.core.RedisTemplate; | ||
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; | ||
import org.springframework.data.redis.serializer.StringRedisSerializer; | ||
import org.springframework.session.data.redis.config.ConfigureRedisAction; | ||
|
||
import com.wipro.fhir.data.users.User; | ||
|
||
@Configuration | ||
@EnableCaching | ||
public class RedisConfig { | ||
|
||
@Bean | ||
public ConfigureRedisAction configureRedisAction() { | ||
return ConfigureRedisAction.NO_OP; | ||
} | ||
|
||
@Bean | ||
public RedisTemplate<String, User> redisTemplate(RedisConnectionFactory factory) { | ||
RedisTemplate<String, User> template = new RedisTemplate<>(); | ||
template.setConnectionFactory(factory); | ||
|
||
// Use StringRedisSerializer for keys (userId) | ||
template.setKeySerializer(new StringRedisSerializer()); | ||
|
||
// Use Jackson2JsonRedisSerializer for values (Users objects) | ||
Jackson2JsonRedisSerializer<User> serializer = new Jackson2JsonRedisSerializer<>(User.class); | ||
template.setValueSerializer(serializer); | ||
|
||
return template; | ||
} | ||
|
||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.wipro.fhir.data.users; | ||
|
||
import java.io.Serializable; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.Table; | ||
import lombok.Data; | ||
|
||
@Entity | ||
@Table(name = "m_user") | ||
@Data | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class User implements Serializable { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "UserID") | ||
private Long userID; | ||
@Column(name = "userName") | ||
private String userName; | ||
@Column(name = "Deleted", insertable = false, updatable = true) | ||
private Boolean deleted; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.wipro.fhir.repo.user; | ||
|
||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.repository.CrudRepository; | ||
import org.springframework.data.repository.query.Param; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import com.wipro.fhir.data.users.User; | ||
|
||
@Repository | ||
public interface UserLoginRepo extends CrudRepository<User, Long> { | ||
|
||
@Query(" SELECT u FROM User u WHERE u.userID = :userID AND u.deleted = false ") | ||
public User getUserByUserID(@Param("userID") Long userID); | ||
|
||
} |
Oops, something went wrong.