api

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Admin

type Admin struct {
	gorm.Model
	UserName string    `gorm:"column:user_name"`
	Password string    `gorm:"column:password"`
	Token    string    `gorm:"column:token"`
	Timeout  time.Time `gorm:"column:timeout"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(s *svc.Context) *Client

func (*Client) AuthMiddleware

func (c *Client) AuthMiddleware(ctx *gin.Context)

AuthMiddleware 授权中间件

func (*Client) Run

func (c *Client) Run() error

func (*Client) ValidToken

func (c *Client) ValidToken(ctx *gin.Context)

ValidToken 获取合法token

type GetTokenRequest

type GetTokenRequest struct {
	UserName string `json:"user_name"`
	PassWord string `json:"password"`
}

type GetTokenResponse

type GetTokenResponse struct {
	Ts    int64  `json:"Ts"`
	Token string `json:"Token"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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