Skip to content

Commit

Permalink
final 0.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
MakkambaevDastan committed Nov 12, 2023
1 parent 216333a commit 235c524
Show file tree
Hide file tree
Showing 25 changed files with 359 additions and 1,484 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
#ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"]




##Maven Build
#FROM maven:3.8.3-openjdk-17 AS builder
#COPY pom.xml /app/
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,3 @@ JWT_SECRET_KEY=jwt_key
JWT_EXPIRATION=86400000 # a day
JWT_REFRESH_EXPIRATION=2592000000 # 30 day
```
=======
#datum
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.2.0</version>
</dependency>

<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>3.0.0</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/datum/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,19 @@
import jakarta.annotation.PostConstruct;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.servlet.function.RouterFunction;
import org.springframework.web.servlet.function.ServerResponse;

import java.net.URI;
import java.util.Random;
import java.util.TimeZone;
import java.util.regex.Pattern;

import static org.springframework.web.servlet.function.RequestPredicates.GET;
import static org.springframework.web.servlet.function.RouterFunctions.route;

@SpringBootApplication
public class Main {
public static final Random random = new Random();
Expand Down
84 changes: 0 additions & 84 deletions src/main/java/datum/app/Demo.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,97 +20,13 @@
@RequestMapping("/TEST")
@RequiredArgsConstructor
public class Demo {
// private final PersonRepository personRepository;

@GetMapping
public ResponseEntity<Object> get(
HttpServletRequest request,
HttpServletResponse response
) {
// Map<String, Object> map = new HashMap<>();
// map.put("getMethod", request.getMethod());
// map.put("getPathInfo", request.getPathInfo());
// map.put("getServletPath", request.getServletPath());
// map.put("getContextPath", request.getContextPath());
// map.put("getRequestURI", request.getRequestURI());
// map.put("getRequestURL", request.getRequestURL());
// map.put("getPathTranslated", request.getPathTranslated());
//
// return ResponseEntity.ok(map);
return ResponseEntity.ok(Map.of(1, "Hello, Get!"));
}
//
// @PostMapping
// public ResponseEntity<Object> post(
// HttpServletRequest request,
// HttpServletResponse response
// ) {
//// List<Person> persons = List.of(
//// Person.builder().firstname("person1").build(),
//// Person.builder().firstname("person2").build()
//// );
//// personRepository.saveAll(persons);
//// persons.get(0).setDeleted(true);
//// personRepository.save(persons.get(0));
//// var persons2 = personRepository.findAll();
//// return ResponseEntity.ok(List.of(persons, persons2));
// return ResponseEntity.ok("Hello, Post!");
// }
//
// @PutMapping
// public ResponseEntity<Object> put(
// HttpServletRequest request,
// HttpServletResponse response
// ) {
// return ResponseEntity.ok("Hello, Put!");
// }
//
// @DeleteMapping
// public ResponseEntity<Object> delete(
// HttpServletRequest request,
// HttpServletResponse response
// ) {
// return ResponseEntity.ok("Hello, Delete!");
// }
//
// @PatchMapping("/{var}/{id}")
// public ResponseEntity<Object> patch(
// HttpServletRequest request,
// HttpServletResponse response,
// @PathVariable("var") String var,
// @PathVariable("id") String id
// ) {
// return ResponseEntity.ok("Hello, " + var + " " + id);
////// UrlPathHelper
//// Map<String, Object> map = new HashMap<>();
//// map.put("var", var);
//// map.put("id", id);
//// map.put("getMethod", request.getMethod());
//// map.put("getPathInfo", request.getPathInfo());
//// map.put("getServletPath", request.getServletPath());
//// map.put("getContextPath", request.getContextPath());
//// map.put("getRequestURI", request.getRequestURI());
//// map.put("getRequestURL", request.getRequestURL());
//// map.put("getPathTranslated", request.getPathTranslated());
//// map.put("getRemoteUser", request.getRemoteUser());
//// map.put("getHttpServletMapping", request.getHttpServletMapping());
//// map.put("getQueryString", request.getQueryString());
//// map.put("getScheme", request.getScheme());
//// map.put("getTrailerFields", request.getTrailerFields());
//// map.put("getParameterMap", request.getParameterMap());
//// map.put("getProtocol", request.getProtocol());
//// map.put("getAttributeNames", request.getAttributeNames());
//// map.put("getAttribute", request.getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE));
//
//
//// return ResponseEntity.ok(map);
// }
//
// public ResponseEntity<Object> test(
// HttpServletRequest request,
// HttpServletResponse response
// ) {
// return ResponseEntity.ok("Hello, Patch!");
// }
}

1 change: 0 additions & 1 deletion src/main/java/datum/app/admin/dto/PersonDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
@NoArgsConstructor
@ToString
@Jacksonized
//@Schema(description = "Информация о человеке")
@Schema
public class PersonDTO implements Serializable {

Expand Down
5 changes: 0 additions & 5 deletions src/main/java/datum/authenticate/UserRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,22 @@ public interface UserRepository extends JpaRepository<User, Long> {
// boolean existsByEmailIgnoreCaseAndCodeIsNull(String email);
// boolean existsByEmailIgnoreCaseAndCodeIsNullAndLockedFalse(String email);

// @Transactional
@Modifying
@Query("UPDATE User a SET a.enabled = TRUE, a.locked=FALSE, a.code = NULL WHERE a.email = ?1 AND a.code = ?2")
void updateUserByEmailAndCode(String email, Integer code);

// @Transactional
@Modifying
@Query("UPDATE User a SET a.enabled = TRUE, a.locked=FALSE, a.code = NULL WHERE a.email = ?1")
void enableUserByEmail(String email);

//@Transactional
@Modifying
@Query("UPDATE User u SET u.password = null WHERE u.email = ?1 AND u.code = ?2")
boolean updateUserPasswordByEmailIgnoreCaseAndCode(String email, Integer code);

// @Transactional
@Modifying
@Query("UPDATE User u SET u.password = ?1 WHERE u.email = ?2")
boolean updateUserPasswordByEmailIgnoreCase(String password, String email);

// @Transactional
@Modifying
@Query("UPDATE User u SET u.password = ?1 WHERE u.email = ?2 AND u.password IS NULL")
boolean updatePasswordByEmail(String password, String email);
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/datum/config/OpenApiConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
@OpenAPIDefinition(
info = @Info(
// contact = @Contact(
// name = "Alibou",
// email = "contact@aliboucoding.com",
// url = "https://aliboucoding.com/course"
// name = "name",
// email = "contact@gmail.com",
// url = "https://example.com/"
// ),
description = "datum crm system",
title = "datum",
version = "1.0",
// license = @License(
// name = "Licence name",
// url = "https://some-url.com"
// url = "https://eaxmple.com"
// ),
termsOfService = "http://swagger.io/terms/"
),
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/datum/config/SecurityConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ public class SecurityConfiguration {
"/AUTHENTICATE/**",
"/TEST",
"/TEST/**",
"/v2/api-docs",
"/api",
"/api/**",
"/doc",
"/v3/api-docs",
"/v3/api-docs/**",
"/swagger-resources",
Expand Down
30 changes: 29 additions & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,32 @@ application:
secret_key: ${JWT_SECRET_KEY}
expiration: ${JWT_EXPIRATION}
refresh-token:
expiration: ${JWT_REFRESH_EXPIRATION}
expiration: ${JWT_REFRESH_EXPIRATION}
#springdoc:
# api-docs:
# path: /doc
# swagger-ui:
# path: /api


#springfox:
# documentation:
# swaggerUi:
# baseUrl: /api
# openApi:
# v3:
# path: /doc
# swagger:
# v2:
# path: /doc2

#springfox:
# documentation:
# swagger-ui:
# base-url: /api
# openapi:
# v3:
# path: /doc
# swagger:
# v2:
# path: /doc2
52 changes: 0 additions & 52 deletions src/main/resources/json.passport/kg2004.json

This file was deleted.

32 changes: 0 additions & 32 deletions src/main/resources/json.passport/kg20041.json

This file was deleted.

42 changes: 0 additions & 42 deletions src/main/resources/json.passport/kg20042.json

This file was deleted.

34 changes: 0 additions & 34 deletions src/main/resources/json.passport/kg20201.json

This file was deleted.

42 changes: 0 additions & 42 deletions src/main/resources/json.passport/kg20202.json

This file was deleted.

34 changes: 0 additions & 34 deletions src/main/resources/json.passport/kg20202_1.json

This file was deleted.

66 changes: 0 additions & 66 deletions src/main/resources/json.passport/ru1in.json

This file was deleted.

40 changes: 0 additions & 40 deletions src/main/resources/json.passport/ru2.json

This file was deleted.

66 changes: 0 additions & 66 deletions src/main/resources/json.passport/ru3in.json

This file was deleted.

56 changes: 0 additions & 56 deletions src/main/resources/json.passport/ru4ex.json

This file was deleted.

14 changes: 8 additions & 6 deletions src/main/resources/liquibase.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
spring:
liquibase:
change-log: classpath:db/changelog/db.changelog-master.yml
url: jdbc:postgresql://localhost:5432/datum
url: jdbc:postgresql://${DB_URL}:${DB_PORT}/${DB_DATABASE}
username: postgres
password: postgres
driver: org.postgresql.Driver
changeLogFile: src/main/resources/db/changelog/db.changelog-master.yml
outputChangeLogFile: src/main/resources/db/changelog/changelog-output.yml

referenceDriver: liquibase.ext.hibernate.database.connection.HibernateDriver
referenceUrl: hibernate:spring:at.frink.troubleshoot?
диалект: org.hibernate.dialect.MariaDB53Dialect&
hibernate.physical_naming_strategy: org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&
hibernate.physical_implicit_naming_strategy: org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy
#referenceDriver: liquibase.ext.hibernate.database.connection.HibernateDriver
#referenceUrl: hibernate:spring:at.frink.troubleshoot?
#диалект: org.hibernate.dialect.MariaDB53Dialect&
#hibernate.physical_naming_strategy: org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&
#hibernate.physical_implicit_naming_strategy: org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy


#referenceUrl: jdbc:postgresql://localhost:5432/datum
#referenceDriver: org.postgresql.Driver
#referenceUsername: postgres
Expand Down
Loading

0 comments on commit 235c524

Please sign in to comment.