mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-14 22:25:19 +00:00
(feat)Support for managing large models with Dify #1830;2、add user access token; #1829; 3、support change password #1824 (#1839)
This commit is contained in:
@@ -3,6 +3,7 @@ package com.tencent.supersonic.auth.api.authentication.adaptor;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.tencent.supersonic.auth.api.authentication.pojo.Organization;
|
||||
import com.tencent.supersonic.auth.api.authentication.pojo.UserToken;
|
||||
import com.tencent.supersonic.auth.api.authentication.request.UserReq;
|
||||
import com.tencent.supersonic.common.pojo.User;
|
||||
|
||||
@@ -27,4 +28,16 @@ public interface UserAdaptor {
|
||||
List<User> getUserByOrg(String key);
|
||||
|
||||
Set<String> getUserAllOrgId(String userName);
|
||||
|
||||
String getPassword(String userName);
|
||||
|
||||
void resetPassword(String userName, String password, String newPassword);
|
||||
|
||||
UserToken generateToken(String name, String userName, long expireTime);
|
||||
|
||||
void deleteUserToken(Long id);
|
||||
|
||||
UserToken getUserToken(Long id);
|
||||
|
||||
List<UserToken> getUserTokens(String userName);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.tencent.supersonic.auth.api.authentication.pojo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UserToken {
|
||||
private Integer id;
|
||||
private String name;
|
||||
private String userName;
|
||||
private String token;
|
||||
private Long expireTime;
|
||||
private Date createDate;
|
||||
private Date expireDate;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.tencent.supersonic.auth.api.authentication.request;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class UserTokenReq {
|
||||
@NotBlank(message = "name can not be null")
|
||||
private String name;
|
||||
|
||||
@NotBlank(message = "expireTime can not be null")
|
||||
private long expireTime;
|
||||
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.tencent.supersonic.auth.api.authentication.pojo.Organization;
|
||||
import com.tencent.supersonic.auth.api.authentication.pojo.UserToken;
|
||||
import com.tencent.supersonic.auth.api.authentication.request.UserReq;
|
||||
import com.tencent.supersonic.common.pojo.User;
|
||||
|
||||
@@ -30,4 +31,16 @@ public interface UserService {
|
||||
List<User> getUserByOrg(String key);
|
||||
|
||||
List<Organization> getOrganizationTree();
|
||||
|
||||
String getPassword(String userName);
|
||||
|
||||
void resetPassword(String userName, String password, String newPassword);
|
||||
|
||||
UserToken generateToken(String name, String userName, long expireTime);
|
||||
|
||||
List<UserToken> getUserTokens(String userName);
|
||||
|
||||
UserToken getUserToken(Long id);
|
||||
|
||||
void deleteUserToken(Long id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user