测试注解日志
This commit is contained in:
@@ -21,8 +21,8 @@ allprojects {
|
|||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
ext {
|
ext {
|
||||||
version '0.5.2'
|
version '0.6.0'
|
||||||
gaea_version = '0.6.1'
|
gaea_version = '0.7.0'
|
||||||
spring_version = "2.3.0.RELEASE"
|
spring_version = "2.3.0.RELEASE"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.synebula.zeus.app.component
|
||||||
|
|
||||||
|
import com.synebula.gaea.app.component.aop.AppAspect
|
||||||
|
import org.aspectj.lang.annotation.Aspect
|
||||||
|
import org.aspectj.lang.annotation.Pointcut
|
||||||
|
import org.springframework.stereotype.Component
|
||||||
|
|
||||||
|
@Aspect
|
||||||
|
@Component
|
||||||
|
class ZeusAspect : AppAspect() {
|
||||||
|
|
||||||
|
@Pointcut("execution(* com.synebula.zeus.app.controller..*(..))")
|
||||||
|
override fun func() {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,12 +10,18 @@ import com.synebula.gaea.mongo.repository.MongoRepository
|
|||||||
import com.synebula.gaea.query.IQuery
|
import com.synebula.gaea.query.IQuery
|
||||||
import com.synebula.zeus.domain.service.contr.component.IUserNotifier
|
import com.synebula.zeus.domain.service.contr.component.IUserNotifier
|
||||||
import org.springframework.context.annotation.Bean
|
import org.springframework.context.annotation.Bean
|
||||||
|
import org.springframework.context.annotation.ComponentScan
|
||||||
import org.springframework.context.annotation.Configuration
|
import org.springframework.context.annotation.Configuration
|
||||||
import org.springframework.context.annotation.Primary
|
import org.springframework.context.annotation.Primary
|
||||||
import org.springframework.data.mongodb.core.MongoTemplate
|
import org.springframework.data.mongodb.core.MongoTemplate
|
||||||
|
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
|
@ComponentScan(
|
||||||
|
basePackages = [
|
||||||
|
"com.synebula.gaea.app.component"
|
||||||
|
]
|
||||||
|
)
|
||||||
open class ZeusBeans {
|
open class ZeusBeans {
|
||||||
@Bean
|
@Bean
|
||||||
@Primary
|
@Primary
|
||||||
|
|||||||
@@ -9,10 +9,9 @@ import org.springframework.stereotype.Component
|
|||||||
@Component
|
@Component
|
||||||
@ComponentScan(
|
@ComponentScan(
|
||||||
basePackages = [
|
basePackages = [
|
||||||
"com.synebula.gaea.app.component",
|
|
||||||
"com.synebula.zeus.domain.service.impl",
|
"com.synebula.zeus.domain.service.impl",
|
||||||
"com.synebula.zeus.query.impl"
|
"com.synebula.zeus.query.impl"
|
||||||
],
|
],
|
||||||
includeFilters = [Filter(type = FilterType.CUSTOM, classes = [AllTypeFilter::class])]
|
includeFilters = [Filter(type = FilterType.CUSTOM, classes = [AllTypeFilter::class])]
|
||||||
)
|
)
|
||||||
class ZeusSpring
|
class ZeusServices
|
||||||
@@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RestController
|
|||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/sign")
|
@RequestMapping("/sign")
|
||||||
class SignInOutApp(template: MongoTemplate, override var logger: ILogger?) : IApplication {
|
open class SignInOutApp(template: MongoTemplate, override var logger: ILogger?) : IApplication {
|
||||||
var query: IUserQuery = UserQuery(template)
|
var query: IUserQuery = UserQuery(template)
|
||||||
|
|
||||||
override var name: String = "用户登录管理"
|
override var name: String = "用户登录管理"
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RestController
|
|||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/groups")
|
@RequestMapping("/groups")
|
||||||
class GroupApp(
|
open class GroupApp(
|
||||||
service: IGroupService,
|
service: IGroupService,
|
||||||
query: IQuery,
|
query: IQuery,
|
||||||
logger: ILogger
|
logger: ILogger
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RestController
|
|||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/roles")
|
@RequestMapping("/roles")
|
||||||
class RoleApp(
|
open class RoleApp(
|
||||||
service: IRoleService,
|
service: IRoleService,
|
||||||
query: IQuery,
|
query: IQuery,
|
||||||
logger: ILogger
|
logger: ILogger
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.*
|
|||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/users")
|
@RequestMapping("/users")
|
||||||
class UserApp(
|
open class UserApp(
|
||||||
service: IUserService,
|
service: IUserService,
|
||||||
query: IQuery,
|
query: IQuery,
|
||||||
logger: ILogger
|
logger: ILogger
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.RestController
|
|||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/interfaces")
|
@RequestMapping("/interfaces")
|
||||||
class InterfaceApp(
|
open class InterfaceApp(
|
||||||
service: IInterfaceService,
|
service: IInterfaceService,
|
||||||
logger: ILogger,
|
logger: ILogger,
|
||||||
var interfaceQuery: IInterfaceQuery
|
var interfaceQuery: IInterfaceQuery
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.synebula.zeus.app.controller.rbac.resource
|
|||||||
|
|
||||||
import com.synebula.gaea.app.Application
|
import com.synebula.gaea.app.Application
|
||||||
import com.synebula.gaea.app.component.HttpMessage
|
import com.synebula.gaea.app.component.HttpMessage
|
||||||
|
import com.synebula.gaea.app.component.aop.annotation.ModuleName
|
||||||
import com.synebula.gaea.log.ILogger
|
import com.synebula.gaea.log.ILogger
|
||||||
import com.synebula.zeus.domain.service.cmd.rbac.resource.PageCmd
|
import com.synebula.zeus.domain.service.cmd.rbac.resource.PageCmd
|
||||||
import com.synebula.zeus.domain.service.contr.rbac.resource.IPageService
|
import com.synebula.zeus.domain.service.contr.rbac.resource.IPageService
|
||||||
@@ -14,7 +15,8 @@ import org.springframework.web.bind.annotation.RestController
|
|||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/pages")
|
@RequestMapping("/pages")
|
||||||
class PageApp(
|
@ModuleName("页面")
|
||||||
|
open class PageApp(
|
||||||
service: IPageService,
|
service: IPageService,
|
||||||
logger: ILogger,
|
logger: ILogger,
|
||||||
var pageQuery: IPageQuery
|
var pageQuery: IPageQuery
|
||||||
@@ -23,11 +25,15 @@ class PageApp(
|
|||||||
service, pageQuery, logger
|
service, pageQuery, logger
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
override fun list(params: LinkedHashMap<String, Any>): HttpMessage {
|
||||||
|
return super.list(params)
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/in-system/{system}/permission/{role}")
|
@GetMapping("/in-system/{system}/permission/{role}")
|
||||||
fun withSystemPermission(@PathVariable system: String, @PathVariable role: String): HttpMessage {
|
fun withSystemPermission(@PathVariable system: String, @PathVariable role: String): HttpMessage {
|
||||||
return this.safeExecute("获取有权资源列表失败") { msg ->
|
val msg = HttpMessage()
|
||||||
msg.data = this.pageQuery.withPermission(role, system)
|
msg.data = this.pageQuery.withPermission(role, system)
|
||||||
}
|
return msg
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/permission/{role}")
|
@GetMapping("/permission/{role}")
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RestController
|
|||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/permissions")
|
@RequestMapping("/permissions")
|
||||||
class PermissionApp(
|
open class PermissionApp(
|
||||||
service: IPermissionService,
|
service: IPermissionService,
|
||||||
query: IPermissionQuery,
|
query: IPermissionQuery,
|
||||||
logger: ILogger
|
logger: ILogger
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.RestController
|
|||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/systems")
|
@RequestMapping("/systems")
|
||||||
class SystemApp(
|
open class SystemApp(
|
||||||
service: ISystemService,
|
service: ISystemService,
|
||||||
logger: ILogger,
|
logger: ILogger,
|
||||||
var systemQuery: ISystemQuery
|
var systemQuery: ISystemQuery
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class UserService(
|
|||||||
logger: ILogger,
|
logger: ILogger,
|
||||||
groupService: IGroupService,
|
groupService: IGroupService,
|
||||||
roleService: IRoleService,
|
roleService: IRoleService,
|
||||||
var userNotifier: IUserNotifier
|
var userNotifier: IUserNotifier?
|
||||||
) : Service<User, String>(User::class.java, repository, converter, logger), IUserService {
|
) : Service<User, String>(User::class.java, repository, converter, logger), IUserService {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
@@ -50,7 +50,7 @@ class UserService(
|
|||||||
user.token = UUID.randomUUID().toString()
|
user.token = UUID.randomUUID().toString()
|
||||||
user.alive = false
|
user.alive = false
|
||||||
this.repository.add(user, this.clazz)
|
this.repository.add(user, this.clazz)
|
||||||
userNotifier.added(user.id!!, user.name, user.token!!)
|
userNotifier?.added(user.id!!, user.name, user.token!!)
|
||||||
return DataMessage(user.id!!)
|
return DataMessage(user.id!!)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,7 +108,7 @@ class UserService(
|
|||||||
return if (user.alive) {
|
return if (user.alive) {
|
||||||
user.token = UUID.randomUUID().toString()
|
user.token = UUID.randomUUID().toString()
|
||||||
this.repository.update(user, this.clazz)
|
this.repository.update(user, this.clazz)
|
||||||
userNotifier.forgot(user.id!!, user.name, user.token!!)
|
userNotifier?.forgot(user.id!!, user.name, user.token!!)
|
||||||
DataMessage()
|
DataMessage()
|
||||||
} else
|
} else
|
||||||
DataMessage(Status.Failure, "用户还未激活, 请先激活用户")
|
DataMessage(Status.Failure, "用户还未激活, 请先激活用户")
|
||||||
|
|||||||
Reference in New Issue
Block a user