service

package
v0.0.0-...-89505e1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const InExpiredDays = InExpiredMonths * 30
View Source
const InExpiredMonths = 3
View Source
const InExpiredSecond = InExpiredDays * 24 * 60 * 60
View Source
const LOCALE_CN = "zh_CN"
View Source
const LOCALE_EN = "en_US"
View Source
const LOCALE_TW = "zh_TW"
View Source
const OS_TYPE_ANDROID = 2
View Source
const OS_TYPE_IOS = 1
View Source
const PLATFORM_ALL = "All"
View Source
const PLATFORM_ANDROID = "Android"
View Source
const PLATFORM_APP = "App"
View Source
const PLATFORM_DIANPING = "DianPing"
View Source
const PLATFORM_IOS = "iOS"
View Source
const PLATFORM_JD = "JD"
View Source
const PLATFORM_MGM = "MGM"
View Source
const PLATFORM_RETAIL = "Retail"
View Source
const PLATFORM_SALESFORCE = "Salesforce"
View Source
const PLATFORM_TAIPEI_OLD_CYCLE_SYSTEM = "Taipei Old Cycle System"
View Source
const PLATFORM_TMALL = "TMall"
View Source
const PLATFORM_WEBSITE = "Website"
View Source
const PLATFORM_WECHAT_MINI_PROGRAM = "WeChat Mini Program"
View Source
const REQUEST_TIMEZONE = carbon.Taipei
View Source
const TIMEZONE = carbon.UCT

Variables

View Source
var (
	StrPublicKeyPath  string
	StrPrivateKeyPath string
)
View Source
var ARRAY_LOCALE = []string{
	LOCALE_EN,
	LOCALE_CN,
	LOCALE_TW,
}
View Source
var ARRAY_OS_TYPE = []int{
	OS_TYPE_IOS,
	OS_TYPE_ANDROID,
}
View Source
var ARRAY_TIMEZONE = []string{
	LOCALE_EN,
	LOCALE_CN,
	LOCALE_TW,
}

Functions

func GetAuthUser

func GetAuthUser() (user *User)

func GetCurrentChannel

func GetCurrentChannel(c *gin.Context) string

func GetCurrentPlatform

func GetCurrentPlatform(c *gin.Context) string

*

** 静态函数

func GetCurrentSource

func GetCurrentSource(c *gin.Context) string

func GetCurrentUUID

func GetCurrentUUID(c *gin.Context) string

func GetRequestLocale

func GetRequestLocale(c *gin.Context) string

func GetSessionLocale

func GetSessionLocale(c *gin.Context) string

func IsPlatformSF

func IsPlatformSF(c *gin.Context, platform string) bool

func ParseAuthorization

func ParseAuthorization(authHeader string) (claims jwt.Claims, err error)

func ParseTokenFromSignedTokenString

func ParseTokenFromSignedTokenString(tokenString string) (*jwt.Token, error)

func SetAuthUser

func SetAuthUser(user *User)

func SetupSSHKeyPath

func SetupSSHKeyPath(ssh *SSHConfig)

Types

type AppService

type AppService struct {
	App *models.App
}

func NewAppService

func NewAppService(c *gin.Context) *AppService

func (*AppService) Create

func (service *AppService) Create() *models.App

type AuthService

type AuthService struct {
	User *User
}

func NewAuthService

func NewAuthService() (r *AuthService)

func (*AuthService) CreateToken

func (srv *AuthService) CreateToken(user *User) (string, bool)

type ClientProfileService

type ClientProfileService struct {
	Service *Service
}

func NewClientProfileService

func NewClientProfileService(context *gin.Context) (r *ClientProfileService)

type ConfigService

type ConfigService struct {
	Config *models.MerchantToAppConfig
}

func NewConfigService

func NewConfigService(c *gin.Context) *ConfigService

type MerchantService

type MerchantService struct {
	Merchant *models.Merchant
}

func NewMerchantService

func NewMerchantService(c *gin.Context) *MerchantService

type Service

type Service struct {
	Context *gin.Context
}

func NewService

func NewService(ctx *gin.Context) (r *Service)

type UserService

type UserService struct {
	Service *Service
	User    *User
}

func NewUserService

func NewUserService(ctx *gin.Context) (r *UserService)

func (*UserService) GetUser

func (srv *UserService) GetUser(userName string) (user *User, r int)

type WelcomeService

type WelcomeService struct {
	User *User
}

func NewWelcomeService

func NewWelcomeService() (r *WelcomeService)

func (*WelcomeService) GetWelcome

func (srv *WelcomeService) GetWelcome() string

func (*WelcomeService) GetWelcomeAPI

func (srv *WelcomeService) GetWelcomeAPI() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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