Documentation ¶
Index ¶
- Constants
- Variables
- func GetAuthUser() (user *User)
- func GetCurrentChannel(c *gin.Context) string
- func GetCurrentPlatform(c *gin.Context) string
- func GetCurrentSource(c *gin.Context) string
- func GetCurrentUUID(c *gin.Context) string
- func GetRequestLocale(c *gin.Context) string
- func GetSessionLocale(c *gin.Context) string
- func IsPlatformSF(c *gin.Context, platform string) bool
- func ParseAuthorization(authHeader string) (claims jwt.Claims, err error)
- func ParseTokenFromSignedTokenString(tokenString string) (*jwt.Token, error)
- func SetAuthUser(user *User)
- func SetupSSHKeyPath(ssh *SSHConfig)
- type AppService
- type AuthService
- type ClientProfileService
- type ConfigService
- type MerchantService
- type Service
- type UserService
- type WelcomeService
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_PLATFORM = []string{ PLATFORM_SALESFORCE, PLATFORM_WECHAT_MINI_PROGRAM, PLATFORM_IOS, PLATFORM_ANDROID, PLATFORM_RETAIL, PLATFORM_JD, PLATFORM_TMALL, PLATFORM_DIANPING, PLATFORM_ALL, PLATFORM_MGM, PLATFORM_APP, PLATFORM_WEBSITE, PLATFORM_TAIPEI_OLD_CYCLE_SYSTEM, }
View Source
var ARRAY_TIMEZONE = []string{ LOCALE_EN, LOCALE_CN, LOCALE_TW, }
Functions ¶
func GetAuthUser ¶
func GetAuthUser() (user *User)
func GetCurrentChannel ¶
func GetCurrentSource ¶
func GetCurrentUUID ¶
func GetRequestLocale ¶
func GetSessionLocale ¶
func ParseAuthorization ¶
func SetAuthUser ¶
func SetAuthUser(user *User)
func SetupSSHKeyPath ¶
func SetupSSHKeyPath(ssh *SSHConfig)
Types ¶
type AppService ¶
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 ¶
func NewMerchantService ¶
func NewMerchantService(c *gin.Context) *MerchantService
type Service ¶
func NewService ¶
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
Source Files ¶
Click to show internal directories.
Click to hide internal directories.