Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
IncomeCalculator
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
neel
IncomeCalculator
Commits
bb9f7965
Commit
bb9f7965
authored
Sep 02, 2020
by
neel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SQL server migration key to property changes
parent
2f3ab201
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
19 additions
and
12 deletions
+19
-12
src/main/java/com/ic/constant/DBConfig.java
+1
-1
src/main/java/com/ic/constant/TemplateConfig.java
+1
-1
src/main/java/com/ic/modules/auth/model/Configurations.java
+1
-1
src/main/java/com/ic/modules/auth/model/Templates.java
+1
-1
src/main/java/com/ic/modules/auth/payload/ConfigurationsDto.java
+1
-1
src/main/java/com/ic/modules/auth/payload/TemplatesDto.java
+1
-1
src/main/java/com/ic/modules/auth/service/impl/ConfigurationsServiceImpl.java
+5
-1
src/main/java/com/ic/modules/auth/service/impl/TemplatesServiceImpl.java
+5
-1
src/main/java/com/ic/modules/auth/service/impl/UserServiceImpl.java
+3
-4
No files found.
src/main/java/com/ic/constant/DBConfig.java
View file @
bb9f7965
...
@@ -35,7 +35,7 @@ public class DBConfig {
...
@@ -35,7 +35,7 @@ public class DBConfig {
for
(
Configurations
configuration
:
configurations
)
{
for
(
Configurations
configuration
:
configurations
)
{
System
.
out
.
println
(
"configurations"
);
System
.
out
.
println
(
"configurations"
);
System
.
out
.
println
(
configurations
);
System
.
out
.
println
(
configurations
);
configs
.
put
(
configuration
.
get
Ke
y
(),
configuration
.
getValue
());
configs
.
put
(
configuration
.
get
Propert
y
(),
configuration
.
getValue
());
System
.
out
.
println
(
"configs"
);
System
.
out
.
println
(
"configs"
);
System
.
out
.
println
(
configs
);
System
.
out
.
println
(
configs
);
...
...
src/main/java/com/ic/constant/TemplateConfig.java
View file @
bb9f7965
...
@@ -30,7 +30,7 @@ public class TemplateConfig {
...
@@ -30,7 +30,7 @@ public class TemplateConfig {
List
<
Templates
>
templates
=
templatesService
.
findAll
();
List
<
Templates
>
templates
=
templatesService
.
findAll
();
configs
=
new
JSONObject
();
configs
=
new
JSONObject
();
for
(
Templates
configuration
:
templates
)
{
for
(
Templates
configuration
:
templates
)
{
configs
.
put
(
configuration
.
get
Ke
y
(),
configuration
.
getValue
());
configs
.
put
(
configuration
.
get
Propert
y
(),
configuration
.
getValue
());
}
}
}
}
public
String
getValue
(
String
key
)
{
public
String
getValue
(
String
key
)
{
...
...
src/main/java/com/ic/modules/auth/model/Configurations.java
View file @
bb9f7965
...
@@ -26,7 +26,7 @@ public class Configurations{
...
@@ -26,7 +26,7 @@ public class Configurations{
@NotBlank
@NotBlank
@Column
(
length
=
50
)
@Column
(
length
=
50
)
private
String
ke
y
;
private
String
propert
y
;
@NotBlank
@NotBlank
@Column
(
length
=
500
)
@Column
(
length
=
500
)
...
...
src/main/java/com/ic/modules/auth/model/Templates.java
View file @
bb9f7965
...
@@ -27,7 +27,7 @@ public class Templates{
...
@@ -27,7 +27,7 @@ public class Templates{
@NotBlank
@NotBlank
@Column
(
length
=
50
)
@Column
(
length
=
50
)
private
String
ke
y
;
private
String
propert
y
;
@NotBlank
@NotBlank
@Lob
@Lob
...
...
src/main/java/com/ic/modules/auth/payload/ConfigurationsDto.java
View file @
bb9f7965
...
@@ -28,7 +28,7 @@ public class ConfigurationsDto{
...
@@ -28,7 +28,7 @@ public class ConfigurationsDto{
private
String
isFrontEnd
;
private
String
isFrontEnd
;
public
ConfigurationsDto
(
Configurations
configurations
)
{
public
ConfigurationsDto
(
Configurations
configurations
)
{
this
.
key
=
configurations
.
get
Ke
y
();
this
.
key
=
configurations
.
get
Propert
y
();
this
.
value
=
configurations
.
getValue
();
this
.
value
=
configurations
.
getValue
();
this
.
description
=
configurations
.
getDescription
();
this
.
description
=
configurations
.
getDescription
();
this
.
isFrontEnd
=
configurations
.
getIsFrontEnd
();
this
.
isFrontEnd
=
configurations
.
getIsFrontEnd
();
...
...
src/main/java/com/ic/modules/auth/payload/TemplatesDto.java
View file @
bb9f7965
...
@@ -28,7 +28,7 @@ public class TemplatesDto{
...
@@ -28,7 +28,7 @@ public class TemplatesDto{
private
TemplateType
type
;
private
TemplateType
type
;
public
TemplatesDto
(
Templates
template
)
{
public
TemplatesDto
(
Templates
template
)
{
this
.
key
=
template
.
get
Ke
y
();
this
.
key
=
template
.
get
Propert
y
();
this
.
value
=
template
.
getValue
();
this
.
value
=
template
.
getValue
();
this
.
type
=
template
.
getType
();
this
.
type
=
template
.
getType
();
}
}
...
...
src/main/java/com/ic/modules/auth/service/impl/ConfigurationsServiceImpl.java
View file @
bb9f7965
...
@@ -4,6 +4,8 @@ import java.util.List;
...
@@ -4,6 +4,8 @@ import java.util.List;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Isolation
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.ic.constant.DBConfig
;
import
com.ic.constant.DBConfig
;
import
com.ic.exception.ResourceNotFoundException
;
import
com.ic.exception.ResourceNotFoundException
;
...
@@ -26,7 +28,7 @@ public class ConfigurationsServiceImpl implements ConfigurationsService {
...
@@ -26,7 +28,7 @@ public class ConfigurationsServiceImpl implements ConfigurationsService {
configRepo
.
findByKey
(
dto
.
getKey
()).
orElseThrow
(()->
new
ResourceNotFoundException
(
"Config"
,
"key"
,
dto
.
getKey
()));
configRepo
.
findByKey
(
dto
.
getKey
()).
orElseThrow
(()->
new
ResourceNotFoundException
(
"Config"
,
"key"
,
dto
.
getKey
()));
}
else
{
}
else
{
configuration
=
new
Configurations
();
configuration
=
new
Configurations
();
configuration
.
set
Ke
y
(
dto
.
getKey
());
configuration
.
set
Propert
y
(
dto
.
getKey
());
}
}
configuration
.
setValue
(
dto
.
getValue
());
configuration
.
setValue
(
dto
.
getValue
());
configuration
.
setDescription
(
dto
.
getDescription
());
configuration
.
setDescription
(
dto
.
getDescription
());
...
@@ -34,9 +36,11 @@ public class ConfigurationsServiceImpl implements ConfigurationsService {
...
@@ -34,9 +36,11 @@ public class ConfigurationsServiceImpl implements ConfigurationsService {
return
configRepo
.
save
(
configuration
);
return
configRepo
.
save
(
configuration
);
}
}
@Transactional
(
isolation
=
Isolation
.
READ_UNCOMMITTED
)
public
List
<
Configurations
>
findAll
(){
public
List
<
Configurations
>
findAll
(){
return
configRepo
.
findAll
();
return
configRepo
.
findAll
();
}
}
@Transactional
(
isolation
=
Isolation
.
READ_UNCOMMITTED
)
public
Configurations
findByKey
(
String
key
)
{
public
Configurations
findByKey
(
String
key
)
{
return
configRepo
.
findByKey
(
key
).
orElseThrow
(()->
new
ResourceNotFoundException
(
"Config"
,
"key"
,
key
));
return
configRepo
.
findByKey
(
key
).
orElseThrow
(()->
new
ResourceNotFoundException
(
"Config"
,
"key"
,
key
));
}
}
...
...
src/main/java/com/ic/modules/auth/service/impl/TemplatesServiceImpl.java
View file @
bb9f7965
...
@@ -4,6 +4,8 @@ import java.util.List;
...
@@ -4,6 +4,8 @@ import java.util.List;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Isolation
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.ic.constant.TemplateConfig
;
import
com.ic.constant.TemplateConfig
;
import
com.ic.exception.ResourceNotFoundException
;
import
com.ic.exception.ResourceNotFoundException
;
...
@@ -27,7 +29,7 @@ public class TemplatesServiceImpl implements TemplatesService {
...
@@ -27,7 +29,7 @@ public class TemplatesServiceImpl implements TemplatesService {
configRepo
.
findByKey
(
dto
.
getKey
()).
orElseThrow
(()->
new
ResourceNotFoundException
(
"Template"
,
"key"
,
dto
.
getKey
()));
configRepo
.
findByKey
(
dto
.
getKey
()).
orElseThrow
(()->
new
ResourceNotFoundException
(
"Template"
,
"key"
,
dto
.
getKey
()));
}
else
{
}
else
{
configuration
=
new
Templates
();
configuration
=
new
Templates
();
configuration
.
set
Ke
y
(
dto
.
getKey
());
configuration
.
set
Propert
y
(
dto
.
getKey
());
}
}
configuration
.
setValue
(
dto
.
getValue
());
configuration
.
setValue
(
dto
.
getValue
());
configuration
.
setType
(
dto
.
getType
());
configuration
.
setType
(
dto
.
getType
());
...
@@ -35,9 +37,11 @@ public class TemplatesServiceImpl implements TemplatesService {
...
@@ -35,9 +37,11 @@ public class TemplatesServiceImpl implements TemplatesService {
return
configRepo
.
save
(
configuration
);
return
configRepo
.
save
(
configuration
);
}
}
@Transactional
(
isolation
=
Isolation
.
READ_UNCOMMITTED
)
public
List
<
Templates
>
findAll
(){
public
List
<
Templates
>
findAll
(){
return
configRepo
.
findAll
();
return
configRepo
.
findAll
();
}
}
@Transactional
(
isolation
=
Isolation
.
READ_UNCOMMITTED
)
public
Templates
findByKey
(
String
key
)
{
public
Templates
findByKey
(
String
key
)
{
return
configRepo
.
findByKey
(
key
).
orElseThrow
(()->
new
ResourceNotFoundException
(
"Template"
,
"key"
,
key
));
return
configRepo
.
findByKey
(
key
).
orElseThrow
(()->
new
ResourceNotFoundException
(
"Template"
,
"key"
,
key
));
}
}
...
...
src/main/java/com/ic/modules/auth/service/impl/UserServiceImpl.java
View file @
bb9f7965
package
com
.
ic
.
modules
.
auth
.
service
.
impl
;
package
com
.
ic
.
modules
.
auth
.
service
.
impl
;
import
java.util.List
;
import
java.util.Optional
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -10,10 +7,10 @@ import org.springframework.data.domain.Page;
...
@@ -10,10 +7,10 @@ import org.springframework.data.domain.Page;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.security.crypto.password.PasswordEncoder
;
import
org.springframework.security.crypto.password.PasswordEncoder
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Isolation
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.ic.exception.ResourceNotFoundException
;
import
com.ic.modules.auth.model.User
;
import
com.ic.modules.auth.model.User
;
import
com.ic.modules.auth.payload.UserDto
;
import
com.ic.modules.auth.payload.UserDto
;
import
com.ic.modules.auth.repository.UserRepository
;
import
com.ic.modules.auth.repository.UserRepository
;
...
@@ -30,6 +27,7 @@ public class UserServiceImpl implements UserService {
...
@@ -30,6 +27,7 @@ public class UserServiceImpl implements UserService {
@Override
@Override
@Transactional
(
isolation
=
Isolation
.
READ_UNCOMMITTED
)
public
Page
<
User
>
findAll
(
Pageable
pageable
)
{
public
Page
<
User
>
findAll
(
Pageable
pageable
)
{
return
userRepository
.
findAll
(
pageable
);
return
userRepository
.
findAll
(
pageable
);
}
}
...
@@ -66,6 +64,7 @@ public class UserServiceImpl implements UserService {
...
@@ -66,6 +64,7 @@ public class UserServiceImpl implements UserService {
}
}
@Override
@Override
@Transactional
(
isolation
=
Isolation
.
READ_UNCOMMITTED
)
public
User
findById
(
String
id
)
{
public
User
findById
(
String
id
)
{
User
user
=
userRepository
.
findByUserId
(
id
.
trim
());
User
user
=
userRepository
.
findByUserId
(
id
.
trim
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment