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