Documentation ¶
Index ¶
- func GetEventMeta(ctx context.Context, action string, beginTime time.Time, err error) (eventId, message string, status bool, took time.Duration)
- type CommonService
- type LoggingService
- type Service
- type SessionService
- type Set
- func (s Set) AppAuthentication(ctx context.Context, key string, secret string) (*models.App, error)
- func (s Set) Authentication(ctx context.Context, method models.AuthMeta_Method, ...) (user *models.User, err error)
- func (s Set) Authorization(ctx context.Context, user *models.User, method string) bool
- func (s Set) AutoMigrate(ctx context.Context) error
- func (s Set) BatchPatchI18n(ctx context.Context, i18ns []models.I18nTranslate) (err error)
- func (s Set) CreateApp(ctx context.Context, app *models.App) (err error)
- func (s Set) CreateAppKey(ctx context.Context, appId string, name string) (appKey *models.AppKey, err error)
- func (s Set) CreatePage(ctx context.Context, page *models.PageConfig) error
- func (s Set) CreatePageData(ctx context.Context, pageId string, data *json.RawMessage) error
- func (s Set) CreateRole(ctx context.Context, role *models.Role) (err error)
- func (s Set) CreateTOTP(ctx context.Context, id string, secret string) error
- func (s Set) CreateToken(ctx context.Context, tokenType models.TokenType, data interface{}) (token *models.Token, err error)
- func (s Set) CreateUser(ctx context.Context, user *models.User) (err error)
- func (s Set) DeleteApp(ctx context.Context, id string) (err error)
- func (s Set) DeleteAppKey(ctx context.Context, appId string, id []string) (affected int64, err error)
- func (s Set) DeleteApps(ctx context.Context, id ...string) (total int64, err error)
- func (s Set) DeleteLoginSession(ctx context.Context, sessionId string) error
- func (s Set) DeletePages(ctx context.Context, ids []string) error
- func (s Set) DeleteRoles(ctx context.Context, ids []string) error
- func (s Set) DeleteToken(ctx context.Context, tokenType models.TokenType, id string) (err error)
- func (s Set) DeleteUser(ctx context.Context, id string) (err error)
- func (s Set) DeleteUsers(ctx context.Context, id []string) (total int64, err error)
- func (s Set) DownloadFile(ctx context.Context, id string) (f io.ReadCloser, mimiType, fileName string, err error)
- func (s Set) GetAppAccessControl(ctx context.Context, app *models.App, o ...opts.WithGetAppOptions) (err error)
- func (s Set) GetAppIcons(ctx context.Context, current int64, pageSize int64) (count int64, keys []*models.Model, err error)
- func (s Set) GetAppInfo(ctx context.Context, o ...opts.WithGetAppOptions) (app *models.App, err error)
- func (s Set) GetAppKeyFromKey(ctx context.Context, key string) (appKey *models.AppKey, err error)
- func (s Set) GetAppKeys(ctx context.Context, appId string, current int64, pageSize int64) (count int64, keys []*models.AppKey, err error)
- func (s Set) GetAppRoleByUserId(ctx context.Context, appId string, userId string) (role *models.AppRole, err error)
- func (s Set) GetApps(ctx context.Context, keywords string, filter map[string]interface{}, ...) (total int64, apps []*models.App, err error)
- func (s Set) GetEventLogs(ctx context.Context, filters map[string]string, keywords string, current int64, ...) (count int64, event []*models.EventLog, err error)
- func (s Set) GetEvents(ctx context.Context, filters map[string]string, keywords string, ...) (count int64, event []*models.Event, err error)
- func (s Set) GetIssuerByAppId(ctx context.Context, appId string) (jwtutils.JWTIssuer, error)
- func (s Set) GetOAuthTokenByAuthorizationCode(ctx context.Context, code, clientId string) (accessToken, refreshToken string, expiresIn int, err error)
- func (s Set) GetPage(ctx context.Context, id string) (*models.PageConfig, error)
- func (s Set) GetPageData(ctx context.Context, pageId string, id string) (*models.PageData, error)
- func (s Set) GetPageDatas(ctx context.Context, filters map[string]string, keywords string, current int64, ...) (int64, []*models.PageData, error)
- func (s Set) GetPages(ctx context.Context, filter map[string]interface{}, keywords string, ...) (int64, []*models.PageConfig, error)
- func (s Set) GetPermissions(ctx context.Context, keywords string, current int64, pageSize int64) (count int64, permissions []*models.Permission, err error)
- func (s Set) GetProxyConfig(ctx context.Context, host string) (*models.AppProxyConfig, error)
- func (s Set) GetRoles(ctx context.Context, keywords string, current, pageSize int64) (count int64, roles []*models.Role, err error)
- func (s Set) GetSessionByToken(ctx context.Context, id string, tokenType models.TokenType, ...) (err error)
- func (s Set) GetSessions(ctx context.Context, userId string, current, size int64) (int64, []*models.Token, error)
- func (s Set) GetTOTPSecrets(ctx context.Context, ids []string) ([]string, error)
- func (s Set) GetUser(ctx context.Context, options ...opts.WithGetUserOptions) (user *models.User, err error)
- func (s Set) GetUserAndAppService() UserAndAppService
- func (s Set) GetUserInfo(ctx context.Context, id string, username string) (user *models.User, err error)
- func (s Set) GetUserInfoByUsernameAndEmail(ctx context.Context, username, email string) (users *models.User, err error)
- func (s Set) GetUsers(ctx context.Context, keywords string, status models.UserMeta_UserStatus, ...) (total int64, users models.Users, err error)
- func (s Set) InitData(ctx context.Context, username string) error
- func (s Set) InsertWeakPassword(ctx context.Context, passwords ...string) error
- func (s Set) LoadSystemConfig(ctx context.Context) error
- func (s Set) PatchApp(ctx context.Context, fields map[string]interface{}) (err error)
- func (s Set) PatchAppI18n(ctx context.Context, appId string, options *models.AppI18NOptions) (err error)
- func (s Set) PatchApps(ctx context.Context, patch []map[string]interface{}) (total int64, err error)
- func (s Set) PatchPageDatas(ctx context.Context, patch []models.PageData) error
- func (s Set) PatchPages(ctx context.Context, patch []map[string]interface{}) error
- func (s Set) PatchSystemConfig(ctx context.Context, prefix string, patch map[string]interface{}) error
- func (s Set) PatchUser(ctx context.Context, user map[string]interface{}) (err error)
- func (s Set) PatchUserExtData(ctx context.Context, userId string, patch map[string]interface{}) (err error)
- func (s Set) PatchUsers(ctx context.Context, patch []map[string]interface{}) (total int64, err error)
- func (s Set) PostEventLog(ctx context.Context, ...) (err error)
- func (s Set) RefreshOAuthTokenByAuthorizationCode(ctx context.Context, token, clientId, clientSecret string) (accessToken, refreshToken string, expiresIn int, err error)
- func (s Set) RefreshOAuthTokenByPassword(ctx context.Context, token, username, password string) (accessToken, refreshToken string, expiresIn int, err error)
- func (s Set) RegisterPermission(ctx context.Context, permissions models.Permissions) error
- func (s Set) ResetPassword(ctx context.Context, id string, password string) (err error)
- func (s Set) SendEmail(ctx context.Context, data map[string]interface{}, topic string, to ...string) error
- func (s Set) SendProxyRequest(ctx context.Context, r *gohttp.Request, proxyConfig *models.AppProxyConfig, ...) (*gohttp.Response, error)
- func (s Set) UpdateApp(ctx context.Context, app *models.App, updateColumns ...string) (err error)
- func (s Set) UpdatePage(ctx context.Context, page *models.PageConfig) error
- func (s Set) UpdatePageData(ctx context.Context, pageId string, id string, data *json.RawMessage) error
- func (s Set) UpdateRole(ctx context.Context, role *models.Role) (err error)
- func (s Set) UpdateToken(ctx context.Context, id string, tokenType models.TokenType, data interface{}) (err error)
- func (s Set) UpdateTokenExpires(ctx context.Context, id string, expiry time.Time) (err error)
- func (s Set) UpdateUser(ctx context.Context, user *models.User, updateColumns ...string) (err error)
- func (s Set) UpdateUserSession(ctx context.Context, userId string) (err error)
- func (s Set) UploadFile(ctx context.Context, name, contentType string, f io.Reader) (fileKey string, err error)
- func (s Set) VerifyPassword(ctx context.Context, username string, password string, ...) (user *models.User, err error)
- func (s Set) VerifyPasswordById(ctx context.Context, userId, password string, allowPasswordExpired bool) (user *models.User)
- func (s Set) VerifyToken(ctx context.Context, token string, tokenType models.TokenType, ...) bool
- func (s Set) VerifyUserStatus(ctx context.Context, user *models.User, allowPasswordExpired bool) (err error)
- func (s Set) VerifyWeakPassword(ctx context.Context, password string) error
- type UserAndAppService
- type UserAndAppServices
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CommonService ¶
type CommonService interface { RecordUploadFile(ctx context.Context, name string, path string, contentType string, size int64) (id string, err error) UpdateFileOwner(ctx context.Context, fileId string, owner string) (err error) GetFilesByOwner(ctx context.Context, owner string, current int64, pageSize int64) (count int64, files []*models.Model, err error) GetFileInfoFromId(ctx context.Context, id string) (fileName, mimiType, filePath string, err error) CreateRole(ctx context.Context, role *models.Role) (err error) UpdateRole(ctx context.Context, role *models.Role) (err error) GetRoles(ctx context.Context, keywords string, current, pageSize int64) (count int64, roles []*models.Role, err error) GetPermissions(ctx context.Context, keywords string, current int64, pageSize int64) (count int64, permissions []*models.Permission, err error) DeleteRoles(ctx context.Context, ids []string) error RegisterPermission(ctx context.Context, permissions models.Permissions) error CreateOrUpdateRoleByName(ctx context.Context, role *models.Role) error Authorization(ctx context.Context, roles []string, method string) bool BatchPatchI18n(ctx context.Context, i18ns []models.I18nTranslate) (err error) GetUserExtendedData(ctx context.Context, id string) (*models.UserExt, error) GetUsersExtendedData(ctx context.Context, id []string) ([]*models.UserExt, error) PatchUserExtData(ctx context.Context, id string, patch map[string]interface{}) error GetProxyConfig(ctx context.Context, host string) (*models.AppProxyConfig, error) UpdateAppProxyConfig(ctx context.Context, proxy *models.AppProxy) error GetAppProxyConfig(ctx context.Context, appId string) (proxy *models.AppProxy, err error) UpdateAppAccessControl(ctx context.Context, app *models.App) error UpdateUserAccessControl(ctx context.Context, userId string, appUsers models.Apps) error GetAppAccessControl(ctx context.Context, appId string, o ...opts.WithGetAppOptions) (users models.AppUsers, roles models.AppRoles, err error) GetAppRoleByUserId(ctx context.Context, appId string, userId string) (role *models.AppRole, err error) AppAuthorization(ctx context.Context, key string, secret string) (id string, err error) CreateAppKey(ctx context.Context, appId, name string) (*models.AppKey, error) DeleteAppKeys(ctx context.Context, appId string, id []string) (affected int64, err error) GetAppKeys(ctx context.Context, appId string, current, pageSize int64) (count int64, keyPairs []*models.AppKey, err error) GetAppKeyFromKey(ctx context.Context, key string) (appKey *models.AppKey, err error) GetPages(ctx context.Context, filter map[string]interface{}, keywords string, current int64, size int64) (int64, []*models.PageConfig, error) CreatePage(ctx context.Context, page *models.PageConfig) error UpdatePage(ctx context.Context, page *models.PageConfig) error DeletePages(ctx context.Context, ids []string) error GetPage(ctx context.Context, id string) (*models.PageConfig, error) PatchPages(ctx context.Context, patch []map[string]interface{}) error GetPageDatas(ctx context.Context, filters map[string]string, keywords string, current int64, size int64) (int64, []*models.PageData, error) GetPageData(ctx context.Context, pageId string, id string) (*models.PageData, error) CreatePageData(ctx context.Context, pageId string, data *json.RawMessage) error UpdatePageData(ctx context.Context, pageId string, id string, data *json.RawMessage) error PatchPageDatas(ctx context.Context, patch []models.PageData) error CreateTOTP(ctx context.Context, ids string, secret string) error GetTOTPSecrets(ctx context.Context, ids []string) ([]string, error) PatchSystemConfig(ctx context.Context, prefix string, patch map[string]interface{}) error GetSystemConfig(ctx context.Context, prefix string) (map[string]interface{}, error) VerifyAndRecordHistoryPassword(ctx context.Context, id string, password string) error UpdateLoginTime(ctx context.Context, id string) error VerifyWeakPassword(ctx context.Context, password string) error InsertWeakPassword(ctx context.Context, passwords ...string) error GetAppRoles(ctx context.Context, id string) (models.AppRoles, error) DeleteAppProxy(ctx context.Context, id ...string) error DeleteAppAccessControl(ctx context.Context, id ...string) error DeleteI18nBySourceId(ctx context.Context, id ...string) error GetI18n(ctx context.Context, source string, sourceId string, field string) (map[string]string, error) PatchAppOAuthConfig(ctx context.Context, auth2 *models.AppOAuth2) error GetAppOAuthConfig(ctx context.Context, id string) (*models.AppOAuth2, error) FindAppByKeywords(ctx context.Context, keywords string, skip int64, limit int64) ([]string, int64) // contains filtered or unexported methods }
func NewCommonService ¶
func NewCommonService(ctx context.Context) CommonService
type LoggingService ¶
type LoggingService interface { PostEventLog(ctx context.Context, eventId, userId, username, clientIP, loc, action, message string, status bool, took time.Duration, log ...interface{}) error GetEvents(ctx context.Context, filters map[string]string, keywords string, startTime time.Time, endTime time.Time, current int64, size int64) (count int64, event []*models.Event, err error) GetEventLogs(ctx context.Context, filters map[string]string, keywords string, current int64, size int64) (count int64, event []*models.EventLog, err error) // contains filtered or unexported methods }
func NewLoggingService ¶
func NewLoggingService(ctx context.Context) LoggingService
type Service ¶
type Service interface { InitData(ctx context.Context, username string) error DeleteLoginSession(ctx context.Context, session string) error GetSessionByToken(ctx context.Context, id string, tokenType models.TokenType, receiver interface{}) error VerifyPassword(ctx context.Context, username string, password string, allowPasswordExpired bool) (user *models.User, err error) VerifyPasswordById(ctx context.Context, userId, password string, allowPasswordExpired bool) (user *models.User) VerifyUserStatus(ctx context.Context, user *models.User, allowPasswordExpired bool) (err error) GetOAuthTokenByAuthorizationCode(ctx context.Context, code, clientId string) (accessToken, refreshToken string, expiresIn int, err error) RefreshOAuthTokenByAuthorizationCode(ctx context.Context, token, clientId, clientSecret string) (accessToken, refreshToken string, expiresIn int, err error) RefreshOAuthTokenByPassword(ctx context.Context, token, username, password string) (accessToken, refreshToken string, expiresIn int, err error) GetSessions(ctx context.Context, userId string, current int64, size int64) (int64, []*models.Token, error) DeleteToken(ctx context.Context, tokenType models.TokenType, id string) (err error) UploadFile(ctx context.Context, name, contentType string, f io.Reader) (fileKey string, err error) DownloadFile(ctx context.Context, id string) (f io.ReadCloser, mimiType, fileName string, err error) CreateRole(ctx context.Context, role *models.Role) (err error) UpdateRole(ctx context.Context, role *models.Role) (err error) GetRoles(ctx context.Context, keywords string, current, pageSize int64) (count int64, roles []*models.Role, err error) GetPermissions(ctx context.Context, keywords string, current int64, pageSize int64) (count int64, permissions []*models.Permission, err error) DeleteRoles(ctx context.Context, ids []string) error GetUsers(ctx context.Context, keywords string, status models.UserMeta_UserStatus, appId string, current, pageSize int64) (total int64, users models.Users, err error) PatchUsers(ctx context.Context, patch []map[string]interface{}) (count int64, err error) DeleteUsers(ctx context.Context, id []string) (count int64, err error) UpdateUser(ctx context.Context, user *models.User, updateColumns ...string) (err error) GetUserInfo(ctx context.Context, id, username string) (user *models.User, err error) GetUser(ctx context.Context, options ...opts.WithGetUserOptions) (user *models.User, err error) GetUserInfoByUsernameAndEmail(ctx context.Context, username, email string) (user *models.User, err error) CreateUser(ctx context.Context, user *models.User) (err error) PatchUser(ctx context.Context, user map[string]interface{}) (err error) DeleteUser(ctx context.Context, id string) error PatchUserExtData(ctx context.Context, id string, m map[string]interface{}) error Authentication(ctx context.Context, method models.AuthMeta_Method, algorithm sign.AuthAlgorithm, key, secret, payload, signStr string) (*models.User, error) GetApps(ctx context.Context, keywords string, filter map[string]interface{}, current, pageSize int64) (total int64, apps []*models.App, err error) PatchApps(ctx context.Context, patch []map[string]interface{}) (total int64, err error) DeleteApps(ctx context.Context, id ...string) (total int64, err error) UpdateApp(ctx context.Context, app *models.App, updateColumns ...string) (err error) GetAppInfo(ctx context.Context, options ...opts.WithGetAppOptions) (app *models.App, err error) GetAppRoleByUserId(ctx context.Context, appId string, userId string) (role *models.AppRole, err error) GetIssuerByAppId(ctx context.Context, appId string) (issuer jwtutils.JWTIssuer, err error) CreateApp(ctx context.Context, app *models.App) (err error) PatchApp(ctx context.Context, fields map[string]interface{}) (err error) DeleteApp(ctx context.Context, id string) (err error) PatchAppI18n(ctx context.Context, appId string, options *models.AppI18NOptions) (err error) ResetPassword(ctx context.Context, id, password string) error UpdateToken(ctx context.Context, id string, tokenType models.TokenType, data interface{}) (err error) UpdateUserSession(ctx context.Context, userId string) (err error) CreateToken(ctx context.Context, tokenType models.TokenType, data interface{}) (token *models.Token, err error) VerifyToken(ctx context.Context, token string, tokenType models.TokenType, receiver interface{}, relationId ...string) bool SendEmail(ctx context.Context, data map[string]interface{}, topic string, to ...string) error Authorization(ctx context.Context, user *models.User, method string) bool RegisterPermission(ctx context.Context, permissions models.Permissions) error GetProxyConfig(ctx context.Context, host string) (*models.AppProxyConfig, error) SendProxyRequest(ctx context.Context, r *gohttp.Request, proxyConfig *models.AppProxyConfig, proxyURL *models.AppProxyUrl) (*gohttp.Response, error) AppAuthentication(ctx context.Context, username string, password string) (*models.App, error) CreateAppKey(ctx context.Context, appId string, name string) (appKey *models.AppKey, err error) GetAppKeys(ctx context.Context, appId string, current int64, pageSize int64) (count int64, keys []*models.AppKey, err error) GetAppIcons(ctx context.Context, current int64, pageSize int64) (count int64, keys []*models.Model, err error) DeleteAppKey(ctx context.Context, appId string, id []string) (affected int64, err error) GetAppKeyFromKey(ctx context.Context, key string) (appKey *models.AppKey, err error) DeletePages(ctx context.Context, strings []string) error UpdatePage(ctx context.Context, role *models.PageConfig) error CreatePage(ctx context.Context, page *models.PageConfig) error GetPages(ctx context.Context, filter map[string]interface{}, keywords string, current int64, size int64) (int64, []*models.PageConfig, error) GetPage(ctx context.Context, id string) (*models.PageConfig, error) PatchPages(ctx context.Context, pages []map[string]interface{}) error PatchPageDatas(ctx context.Context, patch []models.PageData) error UpdatePageData(ctx context.Context, pageId string, id string, data *json.RawMessage) error CreatePageData(ctx context.Context, pageId string, data *json.RawMessage) error GetPageData(ctx context.Context, pageId string, id string) (*models.PageData, error) GetPageDatas(ctx context.Context, filters map[string]string, keywords string, current int64, size int64) (int64, []*models.PageData, error) CreateTOTP(ctx context.Context, ids string, secret string) error GetTOTPSecrets(ctx context.Context, ids []string) ([]string, error) PatchSystemConfig(ctx context.Context, prefix string, patch map[string]interface{}) error LoadSystemConfig(ctx context.Context) error PostEventLog(ctx context.Context, eventId, userId, username, clientIP, action, message string, status bool, took time.Duration, log ...interface{}) error GetEvents(ctx context.Context, filters map[string]string, keywords string, startTime time.Time, endTime time.Time, current int64, size int64) (count int64, event []*models.Event, err error) GetEventLogs(ctx context.Context, filters map[string]string, keywords string, current int64, size int64) (count int64, event []*models.EventLog, err error) InsertWeakPassword(ctx context.Context, passwords ...string) error VerifyWeakPassword(ctx context.Context, password string) error UpdateTokenExpires(ctx context.Context, id string, expiry time.Time) error BatchPatchI18n(ctx context.Context, i18ns []models.I18nTranslate) (err error) // contains filtered or unexported methods }
type SessionService ¶
type SessionService interface { GetSessions(ctx context.Context, userId string, current int64, size int64) (int64, []*models.Token, error) RefreshOAuthTokenByAuthorizationCode(ctx context.Context, token, clientId, clientSecret string) (accessToken, refreshToken string, expiresIn int, err error) RefreshOAuthTokenByPassword(ctx context.Context, token, username, password string) (accessToken, refreshToken string, expiresIn int, err error) DeleteToken(ctx context.Context, tokenType models.TokenType, id string) (err error) GetToken(ctx context.Context, token string, tokenType models.TokenType, relationId ...string) (*models.Token, error) CreateToken(ctx context.Context, token *models.Token) error UpdateToken(ctx context.Context, token *models.Token) error Counter(ctx context.Context, seed string, expireTime *time.Time, num ...int64) (err error) GetCounter(ctx context.Context, seed string) (count int64, err error) UpdateTokenExpires(ctx context.Context, id string, expiry time.Time) error // contains filtered or unexported methods }
func NewSessionService ¶
func NewSessionService(ctx context.Context) SessionService
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
func (Set) AppAuthentication ¶
func (Set) Authentication ¶
func (s Set) Authentication(ctx context.Context, method models.AuthMeta_Method, algorithm sign.AuthAlgorithm, key, secret, payload, signStr string) (user *models.User, err error)
Authentication
@Description[en-US]: Authenticate the user's request. @Description[zh-CN]: 对用户请求进行身份认证。 @param ctx context.Context @param method models.AuthMeta_Method @param algorithm sign.AuthAlgorithm @param key string @param secret string @param payload string @param signStr string @return user []*models.User @return err error
func (Set) Authorization ¶
func (Set) BatchPatchI18n ¶
func (Set) CreateAppKey ¶
func (Set) CreatePage ¶
func (Set) CreatePageData ¶
func (Set) CreateTOTP ¶
func (Set) CreateToken ¶
func (Set) CreateUser ¶
CreateUser
@Description[en-US]: Create a user. @Description[zh-CN]: 创建用户。 @param ctx context.Context @param user *models.User @return err error
func (Set) DeleteAppKey ¶
func (Set) DeleteApps ¶
func (Set) DeleteLoginSession ¶
func (Set) DeleteToken ¶
func (Set) DeleteUser ¶
DeleteUser
@Description[en-US]: Delete a user. @Description[zh-CN]: 删除用户。 @param ctx context.Context @param id string @return error
func (Set) DeleteUsers ¶
DeleteUsers
@Description[en-US]: Delete users in batch. @Description[zh-CN]: 批量删除用户。 @param ctx context.Context @param ids []string @return count int64 @return err error
func (Set) DownloadFile ¶
func (Set) GetAppAccessControl ¶
func (Set) GetAppIcons ¶
func (Set) GetAppInfo ¶
func (Set) GetAppKeyFromKey ¶
func (Set) GetAppKeys ¶
func (Set) GetAppRoleByUserId ¶
func (Set) GetEventLogs ¶
func (Set) GetIssuerByAppId ¶ added in v1.4.3
func (Set) GetOAuthTokenByAuthorizationCode ¶
func (Set) GetPageData ¶
func (Set) GetPageDatas ¶
func (Set) GetPermissions ¶
func (Set) GetProxyConfig ¶
func (Set) GetSessionByToken ¶
func (Set) GetSessions ¶
func (Set) GetTOTPSecrets ¶
func (Set) GetUser ¶
func (s Set) GetUser(ctx context.Context, options ...opts.WithGetUserOptions) (user *models.User, err error)
GetUser
@Description[en-US]: Get user info. @Description[zh-CN]: 获取用户信息 @param ctx context.Context @param options opts.WithGetUserOptions @return userDetail *models.User @return err error
func (Set) GetUserAndAppService ¶
func (s Set) GetUserAndAppService() UserAndAppService
func (Set) GetUserInfo ¶
func (s Set) GetUserInfo(ctx context.Context, id string, username string) (user *models.User, err error)
GetUserInfo
@Description[en-US]: Obtain user information through ID or username. @Description[zh-CN]: 通过ID或用户名获取用户信息。 @param ctx context.Context @param id string @param username string @return userDetail *models.User @return err error
func (Set) GetUserInfoByUsernameAndEmail ¶
func (Set) GetUsers ¶
func (s Set) GetUsers(ctx context.Context, keywords string, status models.UserMeta_UserStatus, appId string, current, pageSize int64) (total int64, users models.Users, err error)
GetUsers
@Description[en-US]: Get user list. @Description[zh-CN]: 获取用户列表。 @param ctx context.Context @param keywords string @param status models.UserMeta_UserStatus @param appId string @param current int64 @param pageSize int64 @return total int64 @return users []*models.User @return err error
func (Set) InsertWeakPassword ¶
func (Set) PatchAppI18n ¶
func (Set) PatchPageDatas ¶
func (Set) PatchPages ¶
func (Set) PatchSystemConfig ¶
func (Set) PatchUser ¶
PatchUser
@Description[en-US]: Incremental update user. @Description[zh-CN]: 增量更新用户。 @param ctx context.Context @param user map[string]interface{} @return err error
func (Set) PatchUserExtData ¶
func (s Set) PatchUserExtData(ctx context.Context, userId string, patch map[string]interface{}) (err error)
PatchUserExtData
@Description[en-US]: Incremental update user. @Description[zh-CN]: 增量更新用户扩展信息。 @param ctx context.Context @param id string @param patch map[string]interface{} @return err error
func (Set) PatchUsers ¶
func (s Set) PatchUsers(ctx context.Context, patch []map[string]interface{}) (total int64, err error)
PatchUsers
@Description[en-US]: Incrementally update information of multiple users. @Description[zh-CN]: 增量更新多个用户的信息。 @param ctx context.Context @param patch []map[string]interface{} @return count int64 @return err error
func (Set) PostEventLog ¶
func (Set) RefreshOAuthTokenByAuthorizationCode ¶
func (Set) RefreshOAuthTokenByPassword ¶
func (Set) RegisterPermission ¶
func (Set) ResetPassword ¶
func (Set) SendProxyRequest ¶
func (Set) UpdatePage ¶
func (Set) UpdatePageData ¶
func (Set) UpdateToken ¶
func (Set) UpdateTokenExpires ¶
func (Set) UpdateUser ¶
func (s Set) UpdateUser(ctx context.Context, user *models.User, updateColumns ...string) (err error)
UpdateUser
@Description[en-US]: Update user information. @Description[zh-CN]: 更新用户信息. @param ctx context.Context @param user *models.User @param updateColumns ...string @return err error
func (Set) UpdateUserSession ¶
func (Set) UploadFile ¶
func (Set) VerifyPassword ¶
func (s Set) VerifyPassword(ctx context.Context, username string, password string, allowPasswordExpired bool) (user *models.User, err error)
VerifyPassword
@Description[en-US]: Verify password for user. @Description[zh-CN]: 验证用户密码。 @param ctx context.Context @param username string @param password string @return users []*models.User
func (Set) VerifyPasswordById ¶
func (s Set) VerifyPasswordById(ctx context.Context, userId, password string, allowPasswordExpired bool) (user *models.User)
VerifyPasswordById
@Description[en-US]: Verify the user's password through ID. @Description[zh-CN]: 通过ID验证用户密码。 @param ctx context.Context @param id string @param password string @return users []*models.User
func (Set) VerifyToken ¶
func (Set) VerifyUserStatus ¶
type UserAndAppService ¶
type UserAndAppService interface { Name() string GetUsers(ctx context.Context, keywords string, status models.UserMeta_UserStatus, appId string, current, pageSize int64) (total int64, users []*models.User, err error) PatchUsers(ctx context.Context, patch []map[string]interface{}) (count int64, err error) DeleteUsers(ctx context.Context, id []string) (count int64, err error) UpdateUser(ctx context.Context, user *models.User, updateColumns ...string) (err error) GetUserInfo(ctx context.Context, id string, username string) (*models.User, error) GetUser(ctx context.Context, options *opts.GetUserOptions) (*models.User, error) CreateUser(ctx context.Context, user *models.User) (err error) PatchUser(ctx context.Context, user map[string]interface{}) (err error) DeleteUser(ctx context.Context, id string) error VerifyPassword(ctx context.Context, username string, password string) *models.User GetApps(ctx context.Context, keywords string, filter map[string]interface{}, current, pageSize int64) (total int64, apps []*models.App, err error) PatchApps(ctx context.Context, patch []map[string]interface{}) (total int64, err error) DeleteApps(ctx context.Context, id ...string) (total int64, err error) UpdateApp(ctx context.Context, app *models.App, updateColumns ...string) (err error) GetAppInfo(ctx context.Context, o ...opts.WithGetAppOptions) (app *models.App, err error) CreateApp(ctx context.Context, app *models.App) (err error) PatchApp(ctx context.Context, fields map[string]interface{}) (err error) DeleteApp(ctx context.Context, id string) (err error) ResetPassword(ctx context.Context, id string, password string) error GetUserInfoByUsernameAndEmail(ctx context.Context, username, email string) (*models.User, error) VerifyPasswordById(ctx context.Context, id, password string) (user *models.User) GetUsersById(ctx context.Context, id []string) (models.Users, error) // contains filtered or unexported methods }
func NewUserAndAppService ¶
func NewUserAndAppService(ctx context.Context) UserAndAppService
type UserAndAppServices ¶
type UserAndAppServices []UserAndAppService
Source Files ¶
Click to show internal directories.
Click to hide internal directories.