mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-11 03:58:14 +00:00
[feature][common]Add permission management to chat model.
This commit is contained in:
@@ -32,9 +32,12 @@ public class DatabaseReq extends RecordInfo {
|
||||
private String description;
|
||||
|
||||
private String schema;
|
||||
|
||||
private String url;
|
||||
|
||||
private List<String> admins = Lists.newArrayList();
|
||||
|
||||
private List<String> viewers = Lists.newArrayList();
|
||||
|
||||
private Integer isOpen = 0;
|
||||
}
|
||||
|
||||
@@ -28,6 +28,8 @@ public class DatabaseResp extends RecordInfo {
|
||||
|
||||
private List<String> viewers = Lists.newArrayList();
|
||||
|
||||
private Integer isOpen = 0;
|
||||
|
||||
private String type;
|
||||
|
||||
private String url;
|
||||
@@ -48,6 +50,10 @@ public class DatabaseResp extends RecordInfo {
|
||||
|
||||
private boolean hasEditPermission = false;
|
||||
|
||||
public boolean isPublic() {
|
||||
return isOpen != null && isOpen == 1;
|
||||
}
|
||||
|
||||
public String getHost() {
|
||||
Pattern p = Pattern.compile("jdbc:(?<db>\\w+):.*((//)|@)(?<host>.+):(?<port>\\d+).*");
|
||||
Matcher m = p.matcher(url);
|
||||
|
||||
Reference in New Issue
Block a user