golib

package module
v0.0.0-...-50f8553 Latest Latest
Warning

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

Go to latest
Published: May 11, 2020 License: MIT Imports: 4 Imported by: 0

README

golib

介绍

日常整理的用到的go库

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChekAuthAndGetUserInfoForControllers

func ChekAuthAndGetUserInfoForControllers(tokenString string) (*ResultData, *TokenUserInfo, error)

func CreateJwtTokenUserInfo

func CreateJwtTokenUserInfo(userId int, userUserName string, userType int) (string, error)

Types

type ResultData

type ResultData struct {
	ResultCode int         `json:"resultCode"`
	ResultMsg  string      `json:"resultMsg"`
	Data       interface{} `json:"data"`
}

func CreateResult

func CreateResult(data interface{}, code int, msg interface{}) *ResultData

type TokenUserInfo

type TokenUserInfo struct {
	UserId       int    `json:userId`
	UserUserName string `json:userUserName`
	UserType     int    `json:userType` //1普通 2管理员
	jwt.StandardClaims
}

func ParseJwtTokenUserInfo

func ParseJwtTokenUserInfo(tokenString string) (*TokenUserInfo, error)

Directories

Path Synopsis
db
db

Jump to

Keyboard shortcuts

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