You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
808 B
28 lines
808 B
package com.pqh.qqbot
|
|
|
|
import org.slf4j.Logger
|
|
import org.slf4j.LoggerFactory
|
|
import org.springframework.beans.factory.annotation.Autowired
|
|
import org.springframework.web.bind.annotation.PostMapping
|
|
import org.springframework.web.bind.annotation.RestController
|
|
|
|
@RestController
|
|
class TestController {
|
|
|
|
private val data=ArrayList<TestQQBot.Account>()
|
|
|
|
private val logger: Logger = LoggerFactory.getLogger(TestController::class.java)
|
|
|
|
@Autowired
|
|
private lateinit var bot:TestQQBot
|
|
|
|
@PostMapping("runBot")
|
|
fun runBot(account:TestQQBot.Account):JSONResponse<TestQQBot.Account>{
|
|
if(data.contains(account)){
|
|
logger.info("机器人已存在${account.qqId}")
|
|
}else {
|
|
bot.initBot(account)
|
|
}
|
|
return JSONResponse(Result.OK,account)
|
|
}
|
|
} |