数据库映射

This commit is contained in:
筱锋xiao_lfeng 2023-11-29 22:14:12 +08:00
parent 05a3bda985
commit 0ece4ca76d
3 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,8 @@
package com.xlf.dromstarkotlin.mapper
import org.apache.ibatis.annotations.Mapper
@Mapper
interface AccountMapper {
}

View File

@ -0,0 +1,22 @@
package com.xlf.dromstarkotlin.mapper
import com.xlf.dromstarkotlin.entity.doData.TokenDO
import org.apache.ibatis.annotations.Delete
import org.apache.ibatis.annotations.Insert
import org.apache.ibatis.annotations.Mapper
import org.apache.ibatis.annotations.Select
@Mapper
interface TokenMapper {
@Select("SELECT * FROM dormstar.ds_token")
fun getAllToken(): Array<TokenDO>?
@Select("SELECT * FROM dormstar.ds_token WHERE token = #{token}")
fun getToken(token: String): TokenDO?
@Delete("DELETE FROM dormstar.ds_token WHERE token = #{token}")
fun deleteToken(token: String): Boolean
@Insert("INSERT INTO dormstar.ds_token (user_id, token, user_agent, ip, created_at) VALUES (#{userId}, #{token}, #{userAgent}, #{ip}, #{createdAt})")
fun insertToken(token: TokenDO): Boolean
}

View File

@ -0,0 +1,4 @@
package com.xlf.dromstarkotlin.mapper
interface UserMapper {
}