| 37149 |
amit |
1 |
package com.spice.profitmandi.dao.entity.fofo;
|
|
|
2 |
|
|
|
3 |
import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
|
4 |
|
|
|
5 |
import javax.persistence.Column;
|
|
|
6 |
import javax.persistence.Entity;
|
|
|
7 |
import javax.persistence.GeneratedValue;
|
|
|
8 |
import javax.persistence.GenerationType;
|
|
|
9 |
import javax.persistence.Id;
|
|
|
10 |
import javax.persistence.Table;
|
|
|
11 |
import java.io.Serializable;
|
|
|
12 |
import java.time.LocalDateTime;
|
|
|
13 |
|
|
|
14 |
/**
|
|
|
15 |
* Third-party API client. Authenticates /external/** endpoints in
|
|
|
16 |
* profitmandi-web via the X-Api-Key header; only the SHA-256 hash of the key
|
|
|
17 |
* is stored. Visible stores are mapped in {@link ApiClientStore}.
|
|
|
18 |
*/
|
|
|
19 |
@Entity
|
|
|
20 |
@Table(name = "fofo.api_client")
|
|
|
21 |
public class ApiClient implements Serializable {
|
|
|
22 |
|
|
|
23 |
private static final long serialVersionUID = 1L;
|
|
|
24 |
|
|
|
25 |
@Id
|
|
|
26 |
@Column(name = "id", columnDefinition = "int(10) unsigned")
|
|
|
27 |
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
|
28 |
private int id;
|
|
|
29 |
|
|
|
30 |
@Column(name = "name")
|
|
|
31 |
private String name;
|
|
|
32 |
|
|
|
33 |
@JsonIgnore
|
|
|
34 |
@Column(name = "api_key_hash")
|
|
|
35 |
private String apiKeyHash;
|
|
|
36 |
|
|
|
37 |
@Column(name = "active")
|
|
|
38 |
private boolean active;
|
|
|
39 |
|
|
|
40 |
@Column(name = "create_timestamp", insertable = false, updatable = false)
|
|
|
41 |
private LocalDateTime createTimestamp;
|
|
|
42 |
|
|
|
43 |
@Column(name = "update_timestamp", insertable = false, updatable = false)
|
|
|
44 |
private LocalDateTime updateTimestamp;
|
|
|
45 |
|
|
|
46 |
public int getId() {
|
|
|
47 |
return id;
|
|
|
48 |
}
|
|
|
49 |
|
|
|
50 |
public void setId(int id) {
|
|
|
51 |
this.id = id;
|
|
|
52 |
}
|
|
|
53 |
|
|
|
54 |
public String getName() {
|
|
|
55 |
return name;
|
|
|
56 |
}
|
|
|
57 |
|
|
|
58 |
public void setName(String name) {
|
|
|
59 |
this.name = name;
|
|
|
60 |
}
|
|
|
61 |
|
|
|
62 |
public String getApiKeyHash() {
|
|
|
63 |
return apiKeyHash;
|
|
|
64 |
}
|
|
|
65 |
|
|
|
66 |
public void setApiKeyHash(String apiKeyHash) {
|
|
|
67 |
this.apiKeyHash = apiKeyHash;
|
|
|
68 |
}
|
|
|
69 |
|
|
|
70 |
public boolean isActive() {
|
|
|
71 |
return active;
|
|
|
72 |
}
|
|
|
73 |
|
|
|
74 |
public void setActive(boolean active) {
|
|
|
75 |
this.active = active;
|
|
|
76 |
}
|
|
|
77 |
|
|
|
78 |
public LocalDateTime getCreateTimestamp() {
|
|
|
79 |
return createTimestamp;
|
|
|
80 |
}
|
|
|
81 |
|
|
|
82 |
public LocalDateTime getUpdateTimestamp() {
|
|
|
83 |
return updateTimestamp;
|
|
|
84 |
}
|
|
|
85 |
}
|