update latest gradle & spring;
fix new spring package dependencies
This commit is contained in:
23
build.gradle
23
build.gradle
@@ -1,12 +1,13 @@
|
|||||||
buildscript {
|
buildscript {
|
||||||
ext {
|
ext {
|
||||||
kotlin_version = '1.6.10'
|
kotlin_version = '1.8.20'
|
||||||
spring_version = "2.7.0"
|
spring_version = "3.0.5"
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
|
maven { url 'https://maven.aliyun.com/repository/central' }
|
||||||
|
maven { url 'https://maven.aliyun.com/repository/public' }
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -22,14 +23,16 @@ subprojects {
|
|||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
|
maven { url 'https://maven.aliyun.com/repository/central' }
|
||||||
|
maven { url 'https://maven.aliyun.com/repository/public' }
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
|
maven { url 'https://maven.aliyun.com/repository/central' }
|
||||||
|
maven { url 'https://maven.aliyun.com/repository/public' }
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,16 +47,6 @@ subprojects {
|
|||||||
testApi group: 'junit', name: 'junit', version: '4.12'
|
testApi group: 'junit', name: 'junit', version: '4.12'
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceCompatibility = 1.8
|
|
||||||
targetCompatibility = 1.8
|
|
||||||
|
|
||||||
compileKotlin {
|
|
||||||
kotlinOptions.jvmTarget = "1.8"
|
|
||||||
}
|
|
||||||
compileTestKotlin {
|
|
||||||
kotlinOptions.jvmTarget = "1.8"
|
|
||||||
}
|
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
// repositories {
|
// repositories {
|
||||||
// maven {
|
// maven {
|
||||||
|
|||||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,5 @@
|
|||||||
#Mon May 18 17:21:26 CST 2020
|
#Mon May 18 17:21:26 CST 2020
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
@@ -3,14 +3,14 @@ package com.synebula.gaea.app.security
|
|||||||
import com.synebula.gaea.app.security.session.UserSessionManager
|
import com.synebula.gaea.app.security.session.UserSessionManager
|
||||||
import com.synebula.gaea.data.message.HttpMessageFactory
|
import com.synebula.gaea.data.message.HttpMessageFactory
|
||||||
import com.synebula.gaea.data.message.Status
|
import com.synebula.gaea.data.message.Status
|
||||||
|
import jakarta.servlet.FilterChain
|
||||||
|
import jakarta.servlet.ServletException
|
||||||
|
import jakarta.servlet.http.HttpServletRequest
|
||||||
|
import jakarta.servlet.http.HttpServletResponse
|
||||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken
|
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken
|
||||||
import org.springframework.security.core.context.SecurityContextHolder
|
import org.springframework.security.core.context.SecurityContextHolder
|
||||||
import org.springframework.web.filter.OncePerRequestFilter
|
import org.springframework.web.filter.OncePerRequestFilter
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import javax.servlet.FilterChain
|
|
||||||
import javax.servlet.ServletException
|
|
||||||
import javax.servlet.http.HttpServletRequest
|
|
||||||
import javax.servlet.http.HttpServletResponse
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -64,4 +64,5 @@ class WebAuthorization(
|
|||||||
response.flushBuffer()
|
response.flushBuffer()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class WebSecurity {
|
|||||||
// 设置Session的创建策略为:Spring Security永不创建HttpSession 不使用HttpSession来获取SecurityContext
|
// 设置Session的创建策略为:Spring Security永不创建HttpSession 不使用HttpSession来获取SecurityContext
|
||||||
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
|
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
|
||||||
// 除了登录接口其他资源都必须登录访问
|
// 除了登录接口其他资源都必须登录访问
|
||||||
.and().authorizeRequests().antMatchers(this.signInPath).permitAll().anyRequest().authenticated()
|
.and().authorizeHttpRequests().requestMatchers(this.signInPath).permitAll().anyRequest().authenticated()
|
||||||
// 添加鉴权拦截器
|
// 添加鉴权拦截器
|
||||||
.and().addFilterBefore(
|
.and().addFilterBefore(
|
||||||
WebAuthorization(httpMessageFactory, userSessionManager),
|
WebAuthorization(httpMessageFactory, userSessionManager),
|
||||||
@@ -62,7 +62,7 @@ class WebSecurity {
|
|||||||
@Bean
|
@Bean
|
||||||
@Throws(Exception::class)
|
@Throws(Exception::class)
|
||||||
fun ignoringCustomizer(): WebSecurityCustomizer {
|
fun ignoringCustomizer(): WebSecurityCustomizer {
|
||||||
return WebSecurityCustomizer { web -> web.ignoring().antMatchers(this.signInPath) }
|
return WebSecurityCustomizer { web -> web.ignoring().requestMatchers(this.signInPath) }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package com.synebula.gaea.jpa
|
|||||||
import com.synebula.gaea.query.IQuery
|
import com.synebula.gaea.query.IQuery
|
||||||
import com.synebula.gaea.query.Page
|
import com.synebula.gaea.query.Page
|
||||||
import com.synebula.gaea.query.Params
|
import com.synebula.gaea.query.Params
|
||||||
|
import jakarta.persistence.EntityManager
|
||||||
import org.springframework.data.jpa.repository.support.SimpleJpaRepository
|
import org.springframework.data.jpa.repository.support.SimpleJpaRepository
|
||||||
import javax.persistence.EntityManager
|
|
||||||
|
|
||||||
class JpaQuery<TView, ID>(override var clazz: Class<TView>, entityManager: EntityManager) : IQuery<TView, ID> {
|
class JpaQuery<TView, ID>(override var clazz: Class<TView>, entityManager: EntityManager) : IQuery<TView, ID> {
|
||||||
protected var repo: SimpleJpaRepository<TView, ID>
|
protected var repo: SimpleJpaRepository<TView, ID>
|
||||||
|
|||||||
@@ -2,13 +2,13 @@ package com.synebula.gaea.jpa
|
|||||||
|
|
||||||
import com.synebula.gaea.domain.model.IAggregateRoot
|
import com.synebula.gaea.domain.model.IAggregateRoot
|
||||||
import com.synebula.gaea.domain.repository.IRepository
|
import com.synebula.gaea.domain.repository.IRepository
|
||||||
|
import jakarta.persistence.EntityManager
|
||||||
import org.springframework.data.jpa.repository.JpaRepository
|
import org.springframework.data.jpa.repository.JpaRepository
|
||||||
import org.springframework.data.jpa.repository.support.SimpleJpaRepository
|
import org.springframework.data.jpa.repository.support.SimpleJpaRepository
|
||||||
import javax.persistence.EntityManager
|
|
||||||
|
|
||||||
|
|
||||||
class JpaRepository<TAggregateRoot : IAggregateRoot<ID>, ID>(
|
open class JpaRepository<TAggregateRoot : IAggregateRoot<ID>, ID>(
|
||||||
override var clazz: Class<TAggregateRoot>,
|
final override var clazz: Class<TAggregateRoot>,
|
||||||
entityManager: EntityManager
|
entityManager: EntityManager
|
||||||
) : IRepository<TAggregateRoot, ID> {
|
) : IRepository<TAggregateRoot, ID> {
|
||||||
protected var repo: JpaRepository<TAggregateRoot, ID>? = null
|
protected var repo: JpaRepository<TAggregateRoot, ID>? = null
|
||||||
|
|||||||
@@ -3,13 +3,13 @@ package com.synebula.gaea.jpa
|
|||||||
import com.synebula.gaea.data.date.DateTime
|
import com.synebula.gaea.data.date.DateTime
|
||||||
import com.synebula.gaea.query.Operator
|
import com.synebula.gaea.query.Operator
|
||||||
import com.synebula.gaea.query.Where
|
import com.synebula.gaea.query.Where
|
||||||
|
import jakarta.persistence.criteria.CriteriaBuilder
|
||||||
|
import jakarta.persistence.criteria.CriteriaQuery
|
||||||
|
import jakarta.persistence.criteria.Predicate
|
||||||
|
import jakarta.persistence.criteria.Root
|
||||||
import org.springframework.data.jpa.domain.Specification
|
import org.springframework.data.jpa.domain.Specification
|
||||||
import java.lang.reflect.Field
|
import java.lang.reflect.Field
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import javax.persistence.criteria.CriteriaBuilder
|
|
||||||
import javax.persistence.criteria.CriteriaQuery
|
|
||||||
import javax.persistence.criteria.Predicate
|
|
||||||
import javax.persistence.criteria.Root
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -137,7 +137,7 @@ fun Map<String, String>?.toSpecification(clazz: Class<*>): Specification<*> {
|
|||||||
predicates.add(predicate)
|
predicates.add(predicate)
|
||||||
} catch (e: NoSuchFieldException) {
|
} catch (e: NoSuchFieldException) {
|
||||||
throw Error(
|
throw Error(
|
||||||
"class [${field.declaringClass.name}] field [${field.name}] can't annotation [@Where(${operator.declaringClass.simpleName}.${operator.name})]",
|
"class [${field.declaringClass.name}] field [${field.name}] can't annotation [@Where(${operator.declaringJavaClass.simpleName}.${operator.name})]",
|
||||||
e
|
e
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.synebula.gaea.jpa.proxy
|
package com.synebula.gaea.jpa.proxy
|
||||||
|
|
||||||
import com.synebula.gaea.jpa.proxy.method.JpaMethodProxy
|
import com.synebula.gaea.jpa.proxy.method.JpaMethodProxy
|
||||||
|
import jakarta.persistence.EntityManager
|
||||||
import javassist.*
|
import javassist.*
|
||||||
import javassist.bytecode.AnnotationsAttribute
|
import javassist.bytecode.AnnotationsAttribute
|
||||||
import javassist.bytecode.MethodInfo
|
import javassist.bytecode.MethodInfo
|
||||||
@@ -24,7 +25,6 @@ import org.springframework.data.repository.Repository
|
|||||||
import java.lang.reflect.Method
|
import java.lang.reflect.Method
|
||||||
import java.lang.reflect.ParameterizedType
|
import java.lang.reflect.ParameterizedType
|
||||||
import java.lang.reflect.Type
|
import java.lang.reflect.Type
|
||||||
import javax.persistence.EntityManager
|
|
||||||
|
|
||||||
class JpaRepositoryProxy<T : Repository<S, ID>?, S, ID>(
|
class JpaRepositoryProxy<T : Repository<S, ID>?, S, ID>(
|
||||||
beanFactory: BeanFactory,
|
beanFactory: BeanFactory,
|
||||||
|
|||||||
@@ -3,13 +3,13 @@ package com.synebula.gaea.jpa.proxy.method.resolver
|
|||||||
import com.synebula.gaea.jpa.toSpecification
|
import com.synebula.gaea.jpa.toSpecification
|
||||||
import com.synebula.gaea.query.Order
|
import com.synebula.gaea.query.Order
|
||||||
import com.synebula.gaea.query.Params
|
import com.synebula.gaea.query.Params
|
||||||
|
import jakarta.persistence.EmbeddedId
|
||||||
|
import jakarta.persistence.Id
|
||||||
import org.springframework.data.domain.Page
|
import org.springframework.data.domain.Page
|
||||||
import org.springframework.data.domain.PageRequest
|
import org.springframework.data.domain.PageRequest
|
||||||
import org.springframework.data.domain.Pageable
|
import org.springframework.data.domain.Pageable
|
||||||
import org.springframework.data.domain.Sort
|
import org.springframework.data.domain.Sort
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import javax.persistence.EmbeddedId
|
|
||||||
import javax.persistence.Id
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页方法参数映射
|
* 分页方法参数映射
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import com.synebula.gaea.domain.event.AfterRemoveEvent
|
|||||||
import com.synebula.gaea.domain.event.BeforeRemoveEvent
|
import com.synebula.gaea.domain.event.BeforeRemoveEvent
|
||||||
import com.synebula.gaea.domain.model.IAggregateRoot
|
import com.synebula.gaea.domain.model.IAggregateRoot
|
||||||
import com.synebula.gaea.domain.repository.IRepository
|
import com.synebula.gaea.domain.repository.IRepository
|
||||||
import javax.annotation.Resource
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -25,9 +24,8 @@ open class Service<TRoot : IAggregateRoot<ID>, ID>(
|
|||||||
protected open var clazz: Class<TRoot>,
|
protected open var clazz: Class<TRoot>,
|
||||||
protected open var repository: IRepository<TRoot, ID>,
|
protected open var repository: IRepository<TRoot, ID>,
|
||||||
protected open var mapper: IObjectMapper,
|
protected open var mapper: IObjectMapper,
|
||||||
) : IService<ID> {
|
|
||||||
@Resource
|
|
||||||
protected open var bus: IBus<Any>? = null
|
protected open var bus: IBus<Any>? = null
|
||||||
|
) : IService<ID> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 增加对象
|
* 增加对象
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import com.synebula.gaea.domain.event.BeforeRemoveEvent
|
|||||||
import com.synebula.gaea.domain.model.IAggregateRoot
|
import com.synebula.gaea.domain.model.IAggregateRoot
|
||||||
import com.synebula.gaea.domain.repository.IRepository
|
import com.synebula.gaea.domain.repository.IRepository
|
||||||
import com.synebula.gaea.log.ILogger
|
import com.synebula.gaea.log.ILogger
|
||||||
import javax.annotation.Resource
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -25,9 +24,8 @@ open class SimpleService<TRoot : IAggregateRoot<ID>, ID>(
|
|||||||
protected open var clazz: Class<TRoot>,
|
protected open var clazz: Class<TRoot>,
|
||||||
protected open var repository: IRepository<TRoot, ID>,
|
protected open var repository: IRepository<TRoot, ID>,
|
||||||
override var logger: ILogger,
|
override var logger: ILogger,
|
||||||
) : ISimpleService<TRoot, ID> {
|
|
||||||
@Resource
|
|
||||||
protected open var bus: IBus<Any>? = null
|
protected open var bus: IBus<Any>? = null
|
||||||
|
) : ISimpleService<TRoot, ID> {
|
||||||
|
|
||||||
override fun add(root: TRoot): DataMessage<ID> {
|
override fun add(root: TRoot): DataMessage<ID> {
|
||||||
val msg = DataMessage<ID>()
|
val msg = DataMessage<ID>()
|
||||||
|
|||||||
Reference in New Issue
Block a user