dto

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoginUser

type LoginUser struct {
	Token     string   `json:"token,omitempty"`     // stored token used for inter-service REST calls; not included when generating a new token
	TokenType string   `json:"tokenType,omitempty"` // token purpose: "access" or "refresh"
	UserId    uint64   `json:"userId"`
	Username  string   `json:"username"`
	ProductId uint64   `json:"productId"`
	Roles     []string `json:"roles"`
}

LoginUser holds the claims embedded inside a JWT token for an authenticated user. Fields such as UserId, Username, ProductId, and Roles must not use omitempty so that zero values are always serialised.

type ResponseMessage

type ResponseMessage struct {
	Code    int    `json:"code"`              // 0: success; others: failed
	Message string `json:"message,omitempty"` // omit in success response
	Data    any    `json:"data,omitempty"`    // omit in failed response
}

ResponseMessage is the standard response envelope returned by all API endpoints. Code 0 indicates success; any other value indicates failure.

Jump to

Keyboard shortcuts

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