|
@@ -1,64 +0,0 @@
|
|
|
-package com.gxzc.zen.controller
|
|
|
-
|
|
|
-import com.gxzc.zen.api.bus.model.SysDic
|
|
|
-import com.gxzc.zen.api.bus.service.ISysDicService
|
|
|
-import com.gxzc.zen.api.sys.mapper.SysDeptMapper
|
|
|
-import com.gxzc.zen.api.sys.model.SysDept
|
|
|
-import com.gxzc.zen.api.sys.service.ISysDeptService
|
|
|
-import com.gxzc.zen.orm.annotation.DynamicDataSource
|
|
|
-import com.gxzc.zen.orm.contants.DSKey
|
|
|
-import org.slf4j.LoggerFactory
|
|
|
-import org.springframework.beans.factory.annotation.Autowired
|
|
|
-import org.springframework.stereotype.Controller
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping
|
|
|
-
|
|
|
-
|
|
|
-@Controller
|
|
|
-@RequestMapping("example")
|
|
|
-class ExampleController {
|
|
|
- companion object {
|
|
|
- private val logger = LoggerFactory.getLogger(ExampleController::class.java)
|
|
|
- }
|
|
|
-
|
|
|
- @Autowired
|
|
|
- lateinit var sysDeptService: ISysDeptService
|
|
|
-
|
|
|
- @Autowired
|
|
|
- lateinit var sysDicService: ISysDicService
|
|
|
-
|
|
|
- @Autowired
|
|
|
- lateinit var sysDeptMapper: SysDeptMapper
|
|
|
-
|
|
|
-// @Autowired
|
|
|
-// lateinit var sysParamService: ISysParamService
|
|
|
-
|
|
|
- @RequestMapping("/test")
|
|
|
- fun test() {
|
|
|
- val dept = SysDept().also {
|
|
|
- it.deptName = "test"
|
|
|
- it.principal = "create"
|
|
|
- it.sort = Integer(1)
|
|
|
- }
|
|
|
-// for (i in 1..1000) {
|
|
|
-// sysDeptService.insert(dept)
|
|
|
-// }
|
|
|
- sysDeptMapper.insert(dept)
|
|
|
-
|
|
|
- logger.info("count: {}", sysDeptService.custom())
|
|
|
- }
|
|
|
-
|
|
|
- @RequestMapping("/test2")
|
|
|
- @DynamicDataSource(DSKey.DSKEY_SYS)
|
|
|
- fun test2() {
|
|
|
- val sysDic = SysDic().also {
|
|
|
- it.key = "hehe"
|
|
|
- it.value = "hehe"
|
|
|
- it.sort = Integer(1)
|
|
|
- }
|
|
|
-// for (i in 1..1000) {
|
|
|
-// sysDicService.insert(sysDic)
|
|
|
-// }
|
|
|
- // sysDicService.insert(sysDic)
|
|
|
- logger.info("count: {}", sysDicService.custom())
|
|
|
- }
|
|
|
-}
|