Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
UPSMF
uphrh-smf-user
Commits
eb13f652
Unverified
Commit
eb13f652
authored
2 years ago
by
sarojsingh2021
Committed by
GitHub
2 years ago
Browse files
Options
Download
Plain Diff
Merge pull request #7 from UPHRH-platform/institute-district
Institute district
parents
169b3f98
c411d177
master
delete-user-fix
No related merge requests found
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
src/main/java/com/tarento/retail/controller/AuthenticationController.java
+4
-1
...m/tarento/retail/controller/AuthenticationController.java
src/main/java/com/tarento/retail/dao/InstituteCoursesDao.java
+17
-0
...main/java/com/tarento/retail/dao/InstituteCoursesDao.java
src/main/java/com/tarento/retail/model/InstituteCourses.java
+22
-1
src/main/java/com/tarento/retail/model/InstituteCourses.java
src/main/java/com/tarento/retail/model/UserProfile.java
+10
-0
src/main/java/com/tarento/retail/model/UserProfile.java
src/main/java/com/tarento/retail/service/UserService.java
+2
-0
src/main/java/com/tarento/retail/service/UserService.java
src/main/java/com/tarento/retail/service/impl/UserServiceImpl.java
+10
-0
...java/com/tarento/retail/service/impl/UserServiceImpl.java
with
65 additions
and
2 deletions
+65
-2
src/main/java/com/tarento/retail/controller/AuthenticationController.java
+
4
−
1
View file @
eb13f652
...
...
@@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.RestController;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.tarento.retail.config.JwtTokenUtil
;
import
com.tarento.retail.dto.UserDto
;
import
com.tarento.retail.model.InstituteCourses
;
import
com.tarento.retail.model.LoginDto
;
import
com.tarento.retail.model.LoginUser
;
import
com.tarento.retail.model.Role
;
...
...
@@ -142,7 +143,9 @@ public class AuthenticationController {
null
);
LOGGER
.
info
(
"Fetched Roles Assigned for the User"
);
userProfile
.
setRoles
(
userRoles
);
List
<
InstituteCourses
>
instituteCourses
=
userService
.
findAllInstituteCourses
(
userProfile
.
getId
());
userProfile
.
setInstituteCourses
(
instituteCourses
);
return
ResponseGenerator
.
successResponse
(
userProfile
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/main/java/com/tarento/retail/dao/InstituteCoursesDao.java
0 → 100644
+
17
−
0
View file @
eb13f652
package
com.tarento.retail.dao
;
import
java.util.List
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.data.repository.CrudRepository
;
import
org.springframework.stereotype.Repository
;
import
com.tarento.retail.model.InstituteCourses
;
@Repository
public
interface
InstituteCoursesDao
extends
CrudRepository
<
InstituteCourses
,
Long
>{
List
<
InstituteCourses
>
findByProfileId
(
Long
userId
);
}
This diff is collapsed.
Click to expand it.
src/main/java/com/tarento/retail/model/InstituteCourses.java
+
22
−
1
View file @
eb13f652
...
...
@@ -2,6 +2,12 @@ package com.tarento.retail.model;
import
java.util.Date
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
lombok.AllArgsConstructor
;
import
lombok.EqualsAndHashCode
;
import
lombok.Getter
;
...
...
@@ -15,20 +21,35 @@ import lombok.ToString;
@NoArgsConstructor
@Setter
@ToString
@Entity
@Table
(
name
=
"institute_courses"
)
public
class
InstituteCourses
{
@Id
@GeneratedValue
@Column
(
name
=
"id"
)
private
Long
id
;
@Column
(
name
=
"district_name"
)
private
String
districtName
;
@Column
(
name
=
"center_code"
)
private
String
centerCode
;
@Column
(
name
=
"degree"
)
private
String
degree
;
@Column
(
name
=
"course"
)
private
String
course
;
@Column
(
name
=
"applied_year"
)
private
String
appliedYear
;
@Column
(
name
=
"sector"
)
private
String
sector
;
@Column
(
name
=
"profile_id"
)
private
Long
profileId
;
//Fk UserProfile
@Column
(
name
=
"created_date"
)
private
Date
createdDate
;
@Column
(
name
=
"created_by"
)
private
Long
createdBy
;
@Column
(
name
=
"updated_date"
)
private
Date
updatedDate
;
@Column
(
name
=
"updated_by"
)
private
Long
updatedBy
;
}
This diff is collapsed.
Click to expand it.
src/main/java/com/tarento/retail/model/UserProfile.java
+
10
−
0
View file @
eb13f652
...
...
@@ -32,6 +32,7 @@ public class UserProfile extends User {
private
List
<
Long
>
roleId
;
private
String
countryCode
;
private
Long
countryId
;
private
List
<
InstituteCourses
>
instituteCourses
;
public
Long
getCountryId
()
{
return
countryId
;
...
...
@@ -204,4 +205,13 @@ public class UserProfile extends User {
this
.
roleId
=
roleId
;
}
public
List
<
InstituteCourses
>
getInstituteCourses
()
{
return
instituteCourses
;
}
public
void
setInstituteCourses
(
List
<
InstituteCourses
>
instituteCourses
)
{
this
.
instituteCourses
=
instituteCourses
;
}
}
This diff is collapsed.
Click to expand it.
src/main/java/com/tarento/retail/service/UserService.java
+
2
−
0
View file @
eb13f652
...
...
@@ -252,4 +252,6 @@ public interface UserService {
Boolean
softDeleteUser
(
UserDto
userDto
);
List
<
InstituteCourses
>
findAllInstituteCourses
(
Long
userId
);
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/main/java/com/tarento/retail/service/impl/UserServiceImpl.java
+
10
−
0
View file @
eb13f652
...
...
@@ -28,6 +28,7 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.multipart.MultipartFile
;
import
com.tarento.retail.dao.InstituteCoursesDao
;
import
com.tarento.retail.dao.RoleDao
;
import
com.tarento.retail.dao.UserDao
;
import
com.tarento.retail.dto.CountryDto
;
...
...
@@ -71,6 +72,9 @@ public class UserServiceImpl implements UserDetailsService, UserService {
@Autowired
private
BCryptPasswordEncoder
bcryptEncoder
;
@Autowired
private
InstituteCoursesDao
instituteCoursesDao
;
public
List
<
Action
>
findAllActionsByRoleID
(
List
<
Integer
>
roleID
)
{
List
<
Action
>
actions
=
new
ArrayList
<
Action
>();
...
...
@@ -186,6 +190,11 @@ public class UserServiceImpl implements UserDetailsService, UserService {
}
return
roleList
;
}
@Override
public
List
<
InstituteCourses
>
findAllInstituteCourses
(
Long
userId
){
return
instituteCoursesDao
.
findByProfileId
(
userId
);
}
@Override
public
Set
<
Action
>
findAllActionsByUser
(
Long
userId
,
String
orgId
)
{
...
...
@@ -579,6 +588,7 @@ public class UserServiceImpl implements UserDetailsService, UserService {
LOGGER
.
error
(
String
.
format
(
Constants
.
EXCEPTION_METHOD
,
"validateUserOTP"
,
e
.
getMessage
()));
}
return
Boolean
.
FALSE
;
}
@Override
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets