Pārlūkot izejas kodu

Update predecate package and swagger

master
lslesinh pirms 2 gadiem
vecāks
revīzija
ceafeaca6a
5 mainītis faili ar 15 papildinājumiem un 19 dzēšanām
  1. +4
    -2
      gradle/profile_dev.gradle
  2. +1
    -1
      gradle/profile_prod.gradle
  3. +7
    -5
      src/main/java/vn/azteam/tpf/TPFApp.java
  4. +2
    -11
      src/main/java/vn/azteam/tpf/web/rest/TBCropResource.java
  5. +1
    -0
      src/main/resources/config/application-dev.yml

+ 4
- 2
gradle/profile_dev.gradle Parādīt failu

@@ -1,7 +1,7 @@
import org.gradle.internal.os.OperatingSystem

apply plugin: 'org.springframework.boot'
apply plugin: 'com.moowork.node'
apply plugin: 'com.github.node-gradle.gulp'

dependencies {
compile "org.springframework.boot:spring-boot-devtools"
@@ -14,7 +14,9 @@ if (project.hasProperty('no-liquibase')) {
if (project.hasProperty('tls')) {
profiles += ',tls'
}

if (project.hasProperty('swagger')) {
profiles += ',swagger'
}
bootRun {
args = []
}

+ 1
- 1
gradle/profile_prod.gradle Parādīt failu

@@ -1,6 +1,6 @@
apply plugin: 'org.springframework.boot'
apply plugin: 'com.gorylenko.gradle-git-properties'
apply plugin: 'com.moowork.node'
apply plugin: 'com.github.node-gradle.gulp'

dependencies {
testCompile "com.h2database:h2"

+ 7
- 5
src/main/java/vn/azteam/tpf/TPFApp.java Parādīt failu

@@ -40,11 +40,13 @@ import java.util.List;

@SpringBootApplication
@EnableConfigurationProperties({LiquibaseProperties.class, ApplicationProperties.class})
@SecurityScheme(
name = "Authorization",
type = SecuritySchemeType.APIKEY,
in = SecuritySchemeIn.HEADER
)
//@SecurityScheme(
// name = "api",
// type = SecuritySchemeType.HTTP,
// bearerFormat = "JWT",
// scheme = "bearer",
// in = SecuritySchemeIn.HEADER
//)
public class TPFApp {

private static final Logger log = LoggerFactory.getLogger(TPFApp.class);

+ 2
- 11
src/main/java/vn/azteam/tpf/web/rest/TBCropResource.java Parādīt failu

@@ -42,7 +42,7 @@ import static vn.azteam.tpf.security.contants.Contants.*;
*/
@RestController
@RequestMapping("/api")
@SecurityRequirement(name = "api")
//@SecurityRequirement(name = "api")
public class TBCropResource {

private final Logger log = LoggerFactory.getLogger(TBCropResource.class);
@@ -222,10 +222,6 @@ public class TBCropResource {
Comparator.nullsFirst(Comparator.naturalOrder())).reversed())
.collect(Collectors.toList());

//Authorize get list crop by current user
// result = result.stream()
// .filter(item -> userRoleUtil.currentUserHasPermissionByCropId(item.getId()))
// .collect(Collectors.toList());
Page<TBCropDTO> pageResult = pageableUtil.changeTBCropDTOToPageFromList(result, pageable);
for(TBCropDTO itemResult : result) {
logger.error("Start date: " + itemResult.getStartDate());
@@ -351,18 +347,13 @@ public class TBCropResource {
@GetMapping("/tb-crops-scan-qrCode/{qrCode}")
@Timed
public ResponseEntity<TBCropDetailDTO> getTBCropScanQRCode(@PathVariable String qrCode, Pageable pageable) {
Optional<UserDTO> currentUser = userService.getCurrentUserDTO();
Long currentUserId = currentUser.get().getId();

TBCropCriteria tbCropCriteria = new TBCropCriteria();
StringFilter qrCodeFilter = new StringFilter();
qrCodeFilter.setEquals(qrCode);
tbCropCriteria.setQrCode(qrCodeFilter);

List<TBCropDTO> tBCropDTOs = tBCropQueryService.findByCriteria(tbCropCriteria);
List<TBCropDTO> listTBCropDTOs = new ArrayList<>();
List<TBCropDTO> listTBCropDTOs;
if (tBCropDTOs.size() > 0) {
//@CUONGLT - Filter scope customer's data
listTBCropDTOs = tBCropDTOs.stream()
.filter(item -> userRoleUtil.currentUserHasPermissionByCropId(item.getId()))
.collect(Collectors.toList());

+ 1
- 0
src/main/resources/config/application-dev.yml Parādīt failu

@@ -59,6 +59,7 @@ spring:
prepStmtCacheSize: 250
prepStmtCacheSqlLimit: 2048
useServerPrepStmts: true
maximum-pool-size: 20
jpa:
database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
database: MYSQL

Notiek ielāde…
Atcelt
Saglabāt