diff --git a/src/zeus.app/src/main/kotlin/com/synebula/zeus/app/config/ZeusBeans.kt b/src/zeus.app/src/main/kotlin/com/synebula/zeus/app/config/ZeusBeans.kt index f8fd379..03210e0 100644 --- a/src/zeus.app/src/main/kotlin/com/synebula/zeus/app/config/ZeusBeans.kt +++ b/src/zeus.app/src/main/kotlin/com/synebula/zeus/app/config/ZeusBeans.kt @@ -12,9 +12,12 @@ import com.synebula.gaea.mongo.repository.MongoRepository import com.synebula.gaea.mongo.repository.MongoRepositoryTyped import com.synebula.gaea.query.IQuery import com.synebula.gaea.query.IQueryTyped +import org.springframework.boot.web.servlet.FilterRegistrationBean import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration import org.springframework.data.mongodb.core.MongoTemplate +import org.springframework.web.filter.CharacterEncodingFilter + @Configuration open class ZeusBeans { @@ -45,5 +48,4 @@ open class ZeusBeans { } } } - } \ No newline at end of file diff --git a/src/zeus.app/src/main/kotlin/com/synebula/zeus/app/controller/rbac/RoleApp.kt b/src/zeus.app/src/main/kotlin/com/synebula/zeus/app/controller/rbac/RoleApp.kt new file mode 100644 index 0000000..af8fb88 --- /dev/null +++ b/src/zeus.app/src/main/kotlin/com/synebula/zeus/app/controller/rbac/RoleApp.kt @@ -0,0 +1,21 @@ +package com.synebula.zeus.app.controller.rbac + +import com.synebula.gaea.app.UnionTypedApp +import com.synebula.gaea.log.ILogger +import com.synebula.gaea.query.IQueryTyped +import com.synebula.zeus.domain.service.cmd.rbac.RoleCmd +import com.synebula.zeus.domain.service.contr.rbac.IRoleService +import com.synebula.zeus.query.view.RoleView +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController + +@RestController +@RequestMapping("/roles") +class RoleApp( + service: IRoleService, + query: IQueryTyped, + logger: ILogger +) : UnionTypedApp( + "用户信息", RoleView::class.java, + service, query, logger +) \ No newline at end of file diff --git a/src/zeus.app/src/main/kotlin/com/synebula/zeus/app/controller/UserApp.kt b/src/zeus.app/src/main/kotlin/com/synebula/zeus/app/controller/rbac/UserApp.kt similarity index 74% rename from src/zeus.app/src/main/kotlin/com/synebula/zeus/app/controller/UserApp.kt rename to src/zeus.app/src/main/kotlin/com/synebula/zeus/app/controller/rbac/UserApp.kt index 0f49060..02cd059 100644 --- a/src/zeus.app/src/main/kotlin/com/synebula/zeus/app/controller/UserApp.kt +++ b/src/zeus.app/src/main/kotlin/com/synebula/zeus/app/controller/rbac/UserApp.kt @@ -1,4 +1,4 @@ -package com.synebula.zeus.app.controller +package com.synebula.zeus.app.controller.rbac import com.synebula.gaea.app.UnionTypedApp import com.synebula.gaea.app.component.HttpMessage @@ -10,18 +10,19 @@ import com.synebula.zeus.domain.service.contr.rbac.IUserService import com.synebula.zeus.query.view.UserView import org.springframework.beans.factory.annotation.Autowired import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.PathVariable import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RestController @RestController @RequestMapping("/users") class UserApp( - service: IUserService, - query: IQueryTyped, - logger: ILogger + service: IUserService, + query: IQueryTyped, + logger: ILogger ) : UnionTypedApp( - "用户信息", UserView::class.java, - service, query, logger + "用户信息", UserView::class.java, + service, query, logger ) { @Autowired lateinit var userAdded: IUserAdded @@ -38,9 +39,10 @@ class UserApp( * @param key 用户ID */ @GetMapping("/{key}/active") - fun active(key: String) { + fun active(@PathVariable key: String): String { this.safeExecute("激活用户出现异常") { (this.service as IUserService).active(key) } + return "

激活成功!

" } } \ No newline at end of file diff --git a/src/zeus.domain/src/main/kotlin/com/synebula/zeus/domain/service/contr/rbac/IRoleService.kt b/src/zeus.domain/src/main/kotlin/com/synebula/zeus/domain/service/contr/rbac/IRoleService.kt new file mode 100644 index 0000000..f4ad941 --- /dev/null +++ b/src/zeus.domain/src/main/kotlin/com/synebula/zeus/domain/service/contr/rbac/IRoleService.kt @@ -0,0 +1,7 @@ +package com.synebula.zeus.domain.service.contr.rbac + +import com.synebula.gaea.domain.service.IService + +interface IRoleService : IService { + +} \ No newline at end of file diff --git a/src/zeus.domain/src/main/kotlin/com/synebula/zeus/domain/service/impl/rbac/RoleService.kt b/src/zeus.domain/src/main/kotlin/com/synebula/zeus/domain/service/impl/rbac/RoleService.kt new file mode 100644 index 0000000..03857bb --- /dev/null +++ b/src/zeus.domain/src/main/kotlin/com/synebula/zeus/domain/service/impl/rbac/RoleService.kt @@ -0,0 +1,11 @@ +package com.synebula.zeus.domain.service.impl.rbac + +import com.synebula.gaea.data.IObjectConverter +import com.synebula.gaea.domain.repository.IRepository +import com.synebula.gaea.domain.service.Service +import com.synebula.gaea.log.ILogger +import com.synebula.zeus.domain.model.rbac.Role +import com.synebula.zeus.domain.service.contr.rbac.IRoleService + +class RoleService(repository: IRepository, converter: IObjectConverter, logger: ILogger) : + Service(Role::class.java, repository, converter, logger), IRoleService \ No newline at end of file