api

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package api provides shared API handlers and utilities for article creation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUserIDFromCtx

func GetUserIDFromCtx(c *gin.Context, fallback int) int

GetUserIDFromCtx extracts the user ID from the gin context with proper type handling.

func HandleCreateArticleAPI

func HandleCreateArticleAPI(c *gin.Context)

HandleCreateArticleAPI handles POST /api/v1/tickets/:ticket_id/articles.

func HandleListTicketsAPI

func HandleListTicketsAPI(c *gin.Context)

HandleListTicketsAPI handles GET /api/v1/tickets.

func HandleUpdateTicketAPI

func HandleUpdateTicketAPI(c *gin.Context)

HandleUpdateTicketAPI handles PUT /api/v1/tickets/:id.

Types

type PaginationInfo

type PaginationInfo struct {
	Page       int  `json:"page"`
	PerPage    int  `json:"per_page"`
	Total      int  `json:"total"`
	TotalPages int  `json:"total_pages"`
	HasNext    bool `json:"has_next"`
	HasPrev    bool `json:"has_prev"`
}

PaginationInfo contains pagination metadata.

type TicketListResponse

type TicketListResponse struct {
	Success    bool                     `json:"success"`
	Data       []map[string]interface{} `json:"data"`
	Pagination PaginationInfo           `json:"pagination"`
	Error      string                   `json:"error,omitempty"`
}

TicketListResponse represents the response for ticket list API.

Jump to

Keyboard shortcuts

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