api

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

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