service

package
v0.0.0-...-4aec9fb Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenticationService

type AuthenticationService interface {

	// Students-微信小程序
	GetOpenid(ctx context.Context, code string) (status bool, errinfo string, data *UserRes)

	// Admin-Web
	AdminLogin(ctx context.Context, name string, password string) (status bool, errinfo string, data string)

	// 企业
	EnterpriseLogin(ctx context.Context, name string, password string) (status bool, errinfo string, data string)

	// 登出
	Logout(ctx context.Context) (status bool, errinfo string, data string)
}

AuthenticationService describes the service.

func New

func New(middleware []Middleware) AuthenticationService

New returns a AuthenticationService with all of the expected middleware wired in.

func NewBasicAuthenticationService

func NewBasicAuthenticationService() AuthenticationService

NewBasicAuthenticationService returns a naive, stateless implementation of AuthenticationService.

type Middleware

Middleware describes a service middleware.

func LoggingMiddleware

func LoggingMiddleware(logger log.Logger) Middleware

LoggingMiddleware takes a logger as a dependency and returns a AuthenticationService Middleware.

type UserRes

type UserRes struct {
	Openid string `json:"openid"`
	Token  string `json:"token"`
}

User验证Response

type WeChatRes

type WeChatRes struct {
	Openid      string `json:"openid"`
	Session_key string `json:"session_key"`
	Errcode     int    `json:"errcode"`
	Errmsg      string `json:"errmsg"`
}

WeChatRes 微信服务器Response

Jump to

Keyboard shortcuts

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