适配postgres数据库
This commit is contained in:
@@ -10,7 +10,8 @@ import java.util.List;
|
||||
@Repository
|
||||
public interface UserApiKeyMapper {
|
||||
|
||||
@SelectKey(statement = "SELECT LAST_INSERT_ID() AS id", keyProperty = "id", before = false, resultType = Integer.class)
|
||||
@SelectKey(databaseId = "postgresql", statement = "SELECT currval('wvp_user_api_key_id_seq'::regclass) AS id", keyProperty = "id", before = false, resultType = Integer.class)
|
||||
@SelectKey(databaseId = "mysql", statement = "SELECT LAST_INSERT_ID() AS id", keyProperty = "id", before = false, resultType = Integer.class)
|
||||
@Insert("INSERT INTO wvp_user_api_key (user_id, app, api_key, expired_at, remark, enable, create_time, update_time) VALUES" +
|
||||
"(#{userId}, #{app}, #{apiKey}, #{expiredAt}, #{remark}, #{enable}, #{createTime}, #{updateTime})")
|
||||
int add(UserApiKey userApiKey);
|
||||
|
||||
@@ -38,7 +38,7 @@ public class UserApiKey implements Serializable {
|
||||
* 过期时间(null=永不过期)
|
||||
*/
|
||||
@Schema(description = "过期时间(null=永不过期)")
|
||||
private String expiredAt;
|
||||
private long expiredAt;
|
||||
|
||||
/**
|
||||
* 备注信息
|
||||
@@ -101,11 +101,11 @@ public class UserApiKey implements Serializable {
|
||||
this.apiKey = apiKey;
|
||||
}
|
||||
|
||||
public String getExpiredAt() {
|
||||
public long getExpiredAt() {
|
||||
return expiredAt;
|
||||
}
|
||||
|
||||
public void setExpiredAt(String expiredAt) {
|
||||
public void setExpiredAt(long expiredAt) {
|
||||
this.expiredAt = expiredAt;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user