1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- package com.gxzc.zen.controller
- import com.gxzc.zen.api.sys.model.SysDept
- import com.gxzc.zen.api.sys.service.ISysDeptService
- import com.gxzc.zen.mq.publisher.Sender
- import org.slf4j.LoggerFactory
- import org.springframework.beans.factory.annotation.Autowired
- import org.springframework.transaction.annotation.Transactional
- import org.springframework.web.bind.annotation.GetMapping
- import org.springframework.web.bind.annotation.RestController
- @RestController
- class ExampleController {
- companion object {
- private val logger = LoggerFactory.getLogger(ExampleController::class.java)
- }
- @Autowired
- lateinit var sysDeptService: ISysDeptService
- @Autowired
- lateinit var sender: Sender
- @GetMapping("test")
- @Transactional
- fun test() {
- // logger.info("a: {}", sysDeptService.selectCount(EntityWrapper<SysDept>().where("1","1000L")))
- // logger.info("b: {}", sysDeptMapper.selectCount(EntityWrapper<SysDept>()))
- sysDeptService.insert(SysDept().also {
- it.deptName = "ahaha"
- it.sort = 2
- it.principal = "a"
- })
- }
- @GetMapping("testMq")
- fun testMq() {
- for (i in 1..10) {
- sender.send("msg $i")
- // Thread.sleep(1000)
- }
- }
- }
|