apputil

package
v0.0.0-...-07bc221 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAppNotExist       = errors.New("app not exist")
	ErrAppSecretNotMatch = errors.New("app secret not match")
)

Functions

func CheckAppSecret

func CheckAppSecret(appId string, appSecret string) error

CheckAppSecret @description: 检查appSecret

func CheckGateway

func CheckGateway(gateway string) bool

CheckGateway 检测应用网关合法性

func CheckIfUserApp

func CheckIfUserApp(appId string, userId int) (bool, error)

CheckIfUserApp 判断是否为该用户的app

func CheckName

func CheckName(name string) bool

CheckName 检测应用名称合法性

func CheckRedirectUriIsMatchUserGateway

func CheckRedirectUriIsMatchUserGateway(redirectUri string, GateWay string) bool

CheckRedirectUriIsMatchUserGateway @description: 检测回调地址是否匹配用户网关

func CreateApp

func CreateApp(userId int, appName string) (bool, error)

func DeleteUserApp

func DeleteUserApp(appId string) (bool, error)

DeleteUserApp 删除用户App

func GetUserAppCount

func GetUserAppCount(userId int) (int, error)

GetUserAppCount 获取用户的app数量

func ReGenerateSecret

func ReGenerateSecret(appId string) (string, error)

ReGenerateSecret 重新生成新的 appSecret

Types

type AppBaseStruct

type AppBaseStruct struct {
	Id       int    `json:"id"`
	AppId    string `json:"app_id"`
	AppName  string `json:"app_name"`
	CreateAt int64  `json:"create_time"`
}

func GetUserAppList

func GetUserAppList(userId, limit, offset int) ([]AppBaseStruct, error)

GetUserAppList @description: 获取用户app列表

type AppErr

type AppErr = error

type AppFullInfoStruct

type AppFullInfoStruct struct {
	Id         int    `json:"id"`
	AppUserId  int    `json:"user_id"`
	AppId      string `json:"app_id"`
	AppName    string `json:"app_name"`
	AppSecret  string `json:"app_secret"`
	AppGateway string `json:"app_gateway"`
	CreateAt   int64  `json:"create_time"`
}

func GetAppInfo

func GetAppInfo(appId string) (AppFullInfoStruct, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL