ario_server/apis/public/ticket.api
shanshanzhong c582087c0f
Some checks failed
Build docker and publish / build (20.15.1) (push) Failing after 6m27s
refactor: 更新项目引用路径从perfect-panel/ppanel-server到perfect-panel/server
feat: 添加版本和构建时间变量
fix: 修正短信队列类型注释错误
style: 清理未使用的代码和测试文件
docs: 更新安装文档中的下载链接
chore: 迁移数据库脚本添加日志和订阅配置
2025-10-13 01:33:03 -07:00

70 lines
1.6 KiB
Plaintext

syntax = "v1"
info (
title: "Ticket API"
desc: "API for ppanel"
author: "Tension"
email: "tension@ppanel.com"
version: "0.0.1"
)
import "../types.api"
type (
GetUserTicketListResponse {
Total int64 `json:"total"`
List []Ticket `json:"list"`
}
CreateUserTicketRequest {
Title string `json:"title"`
Description string `json:"description"`
}
GetUserTicketListRequest {
Page int `form:"page"`
Size int `form:"size"`
Status *uint8 `form:"status,omitempty"`
Search string `form:"search,omitempty"`
}
GetUserTicketDetailRequest {
Id int64 `form:"id" validate:"required"`
}
UpdateUserTicketStatusRequest {
Id int64 `json:"id" validate:"required"`
Status *uint8 `json:"status" validate:"required"`
}
CreateUserTicketFollowRequest {
TicketId int64 `json:"ticket_id"`
From string `json:"from"`
Type uint8 `json:"type"`
Content string `json:"content"`
}
)
@server (
prefix: v1/public/ticket
group: public/ticket
middleware: AuthMiddleware,DeviceMiddleware
)
service ppanel {
@doc "Get ticket list"
@handler GetUserTicketList
get /list (GetUserTicketListRequest) returns (GetUserTicketListResponse)
@doc "Get ticket detail"
@handler GetUserTicketDetails
get /detail (GetUserTicketDetailRequest) returns (Ticket)
@doc "Update ticket status"
@handler UpdateUserTicketStatus
put / (UpdateUserTicketStatusRequest)
@doc "Create ticket follow"
@handler CreateUserTicketFollow
post /follow (CreateUserTicketFollowRequest)
@doc "Create ticket"
@handler CreateUserTicket
post / (CreateUserTicketRequest)
}