Documentation
¶
Index ¶
- func GetDecryptedBodyData(ctx context.Context) (interface{}, bool)
- func GetDecryptedQueryData(ctx context.Context) (interface{}, bool)
- func GetOriginalRequest(ctx context.Context) (interface{}, bool)
- func ParseDeviceRequest(ctx context.Context, req interface{}) (interface{}, error)
- type DeviceConfig
- type DeviceRequest
- type DeviceResponse
- type RequestData
- type ResponseData
- type ServiceContext
- func (svc *ServiceContext) Auth() middleware.Middleware
- func (svc *ServiceContext) CORS() middleware.Middleware
- func (svc *ServiceContext) Device() middleware.Middleware
- func (svc *ServiceContext) Logger() middleware.Middleware
- func (svc *ServiceContext) Notify() middleware.Middleware
- func (svc *ServiceContext) PanDomain() middleware.Middleware
- func (svc *ServiceContext) Server() middleware.Middleware
- func (svc *ServiceContext) Trace() middleware.Middleware
- type UserService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDecryptedBodyData ¶
GetDecryptedBodyData 从上下文获取解密后的请求体数据
func GetDecryptedQueryData ¶
GetDecryptedQueryData 从上下文获取解密后的查询数据
func GetOriginalRequest ¶
GetOriginalRequest 从上下文获取原始请求数据
func ParseDeviceRequest ¶
ParseDeviceRequest 解析设备请求,自动处理加密数据
Types ¶
type DeviceConfig ¶
type DeviceConfig struct {
Enable bool `json:"enable"`
SecuritySecret string `json:"security_secret"`
}
DeviceConfig 设备配置
type DeviceRequest ¶
type DeviceRequest struct {
Data interface{} `json:"data"`
Time string `json:"time"`
}
DeviceRequest 设备请求结构
type DeviceResponse ¶
type DeviceResponse struct {
Data interface{} `json:"data"`
Time string `json:"time"`
}
DeviceResponse 设备响应结构
type ResponseData ¶
type ResponseData struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data"`
}
ResponseData 响应数据包装器
type ServiceContext ¶
type ServiceContext struct {
Config *conf.Server
Redis *redis.Client
UserModel UserService
DeviceConfig DeviceConfig
}
ServiceContext 服务上下文
func (*ServiceContext) Auth ¶
func (svc *ServiceContext) Auth() middleware.Middleware
Auth JWT 认证中间件 - 对齐旧项目语义
func (*ServiceContext) CORS ¶
func (svc *ServiceContext) CORS() middleware.Middleware
CORS 跨域中间件 - 100% 原始逻辑转换
func (*ServiceContext) Device ¶
func (svc *ServiceContext) Device() middleware.Middleware
Device 设备中间件 - 完整的AES加解密实现
func (*ServiceContext) Logger ¶
func (svc *ServiceContext) Logger() middleware.Middleware
Logger 日志中间件 - 100% 原始逻辑转换
func (*ServiceContext) Notify ¶
func (svc *ServiceContext) Notify() middleware.Middleware
Notify 通知中间件 - 100% 原始逻辑转换
func (*ServiceContext) PanDomain ¶
func (svc *ServiceContext) PanDomain() middleware.Middleware
PanDomain 泛域名中间件 - 100% 原始逻辑转换
func (*ServiceContext) Server ¶
func (svc *ServiceContext) Server() middleware.Middleware
Server 服务中间件 - 100% 原始逻辑转换
func (*ServiceContext) Trace ¶
func (svc *ServiceContext) Trace() middleware.Middleware
Trace 链路追踪中间件 - 100% 原始逻辑转换
Click to show internal directories.
Click to hide internal directories.