-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathSysToken.java
More file actions
149 lines (126 loc) · 4.8 KB
/
SysToken.java
File metadata and controls
149 lines (126 loc) · 4.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
/*
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.dinky.data.model;
import org.dinky.mybatis.model.DateBaseEntity;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("dinky_sys_token")
@ApiModel(value = "SysToken", description = "System Token Information")
public class SysToken extends DateBaseEntity<SysToken> implements Serializable {
private static final long serialVersionUID = 3579444102399317143L;
@TableId(value = "id", type = IdType.AUTO)
@ApiModelProperty(
value = "ID",
dataType = "Integer",
example = "1",
notes = "Unique identifier for the system token")
private Integer id;
@ApiModelProperty(value = "Token Value", dataType = "String", notes = "Value of the system token")
private String tokenValue;
@ApiModelProperty(
value = "User ID",
dataType = "Integer",
example = "1001",
notes = "ID of the user associated with the token")
private Integer userId;
@ApiModelProperty(
value = "Role ID",
dataType = "Integer",
example = "2001",
notes = "ID of the role associated with the token")
private Integer roleId;
@ApiModelProperty(
value = "Tenant ID",
dataType = "Integer",
example = "3001",
notes = "ID of the tenant associated with the token")
private Integer tenantId;
@ApiModelProperty(value = "Expire Type", dataType = "Integer", example = "1", notes = "Type of token expiration")
private Integer expireType;
@ApiModelProperty(value = "Expire Start Time", dataType = "Date", notes = "Start time for token expiration")
private Date expireStartTime;
@ApiModelProperty(value = "Expire End Time", dataType = "Date", notes = "End time for token expiration")
private Date expireEndTime;
@ApiModelProperty(
value = "Creator",
dataType = "Integer",
example = "1001",
notes = "ID of the user who created the token")
private Integer creator;
@ApiModelProperty(
value = "updater",
dataType = "Integer",
example = "1002",
notes = "ID of the user who last updated the token")
private Integer updater;
@TableField(exist = false)
@ApiModelProperty(
value = "User Name",
dataType = "String",
example = "John Doe",
notes = "Name of the associated user")
private String userName;
@TableField(exist = false)
@ApiModelProperty(
value = "Role Name",
dataType = "String",
example = "ROLE_ADMIN",
notes = "Name of the associated role")
private String roleName;
@TableField(exist = false)
@ApiModelProperty(
value = "Tenant Code",
dataType = "String",
example = "TENANT001",
notes = "Code representing the associated tenant")
private String tenantCode;
@TableField(exist = false)
@ApiModelProperty(
value = "Expire Time Range",
dataType = "List<LocalDateTime>",
notes = "List of timestamps indicating the time range for token expiration")
private List<LocalDateTime> expireTimeRange;
private Source source;
@Getter
@AllArgsConstructor
public enum Source {
LOGIN(1),
CUSTOM(2);
@EnumValue
private final int type;
}
}