add article
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
//nolint:unused
|
||||
package handlers
|
||||
|
||||
import (
|
||||
@@ -12,6 +13,7 @@ import (
|
||||
"tyapi-server/internal/application/finance"
|
||||
"tyapi-server/internal/application/finance/dto/commands"
|
||||
"tyapi-server/internal/application/finance/dto/queries"
|
||||
_ "tyapi-server/internal/application/finance/dto/responses"
|
||||
"tyapi-server/internal/shared/interfaces"
|
||||
)
|
||||
|
||||
@@ -570,9 +572,9 @@ func (h *FinanceHandler) GetAlipayOrderStatus(c *gin.Context) {
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param request body finance.ApplyInvoiceRequest true "申请开票请求"
|
||||
// @Success 200 {object} response.Response{data=finance.InvoiceApplicationResponse}
|
||||
// @Failure 400 {object} response.Response
|
||||
// @Failure 500 {object} response.Response
|
||||
// @Success 200 {object} interfaces.APIResponse{data=dto.InvoiceApplicationResponse}
|
||||
// @Failure 400 {object} interfaces.APIResponse
|
||||
// @Failure 500 {object} interfaces.APIResponse
|
||||
// @Router /api/v1/invoices/apply [post]
|
||||
func (h *FinanceHandler) ApplyInvoice(c *gin.Context) {
|
||||
var req finance.ApplyInvoiceRequest
|
||||
@@ -601,9 +603,9 @@ func (h *FinanceHandler) ApplyInvoice(c *gin.Context) {
|
||||
// @Description 获取用户的发票信息
|
||||
// @Tags 发票管理
|
||||
// @Produce json
|
||||
// @Success 200 {object} response.Response{data=finance.InvoiceInfoResponse}
|
||||
// @Failure 400 {object} response.Response
|
||||
// @Failure 500 {object} response.Response
|
||||
// @Success 200 {object} interfaces.APIResponse{data=dto.InvoiceInfoResponse}
|
||||
// @Failure 400 {object} interfaces.APIResponse
|
||||
// @Failure 500 {object} interfaces.APIResponse
|
||||
// @Router /api/v1/invoices/info [get]
|
||||
func (h *FinanceHandler) GetUserInvoiceInfo(c *gin.Context) {
|
||||
userID := c.GetString("user_id")
|
||||
@@ -628,9 +630,9 @@ func (h *FinanceHandler) GetUserInvoiceInfo(c *gin.Context) {
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param request body finance.UpdateInvoiceInfoRequest true "更新发票信息请求"
|
||||
// @Success 200 {object} response.Response
|
||||
// @Failure 400 {object} response.Response
|
||||
// @Failure 500 {object} response.Response
|
||||
// @Success 200 {object} interfaces.APIResponse
|
||||
// @Failure 400 {object} interfaces.APIResponse
|
||||
// @Failure 500 {object} interfaces.APIResponse
|
||||
// @Router /api/v1/invoices/info [put]
|
||||
func (h *FinanceHandler) UpdateUserInvoiceInfo(c *gin.Context) {
|
||||
var req finance.UpdateInvoiceInfoRequest
|
||||
@@ -662,9 +664,9 @@ func (h *FinanceHandler) UpdateUserInvoiceInfo(c *gin.Context) {
|
||||
// @Param page query int false "页码" default(1)
|
||||
// @Param page_size query int false "每页数量" default(10)
|
||||
// @Param status query string false "状态筛选"
|
||||
// @Success 200 {object} response.Response{data=finance.InvoiceRecordsResponse}
|
||||
// @Failure 400 {object} response.Response
|
||||
// @Failure 500 {object} response.Response
|
||||
// @Success 200 {object} interfaces.APIResponse{data=dto.InvoiceRecordsResponse}
|
||||
// @Failure 400 {object} interfaces.APIResponse
|
||||
// @Failure 500 {object} interfaces.APIResponse
|
||||
// @Router /api/v1/invoices/records [get]
|
||||
func (h *FinanceHandler) GetUserInvoiceRecords(c *gin.Context) {
|
||||
userID := c.GetString("user_id")
|
||||
@@ -703,8 +705,8 @@ func (h *FinanceHandler) GetUserInvoiceRecords(c *gin.Context) {
|
||||
// @Produce application/octet-stream
|
||||
// @Param application_id path string true "申请ID"
|
||||
// @Success 200 {file} file
|
||||
// @Failure 400 {object} response.Response
|
||||
// @Failure 500 {object} response.Response
|
||||
// @Failure 400 {object} interfaces.APIResponse
|
||||
// @Failure 500 {object} interfaces.APIResponse
|
||||
// @Router /api/v1/invoices/{application_id}/download [get]
|
||||
func (h *FinanceHandler) DownloadInvoiceFile(c *gin.Context) {
|
||||
userID := c.GetString("user_id")
|
||||
@@ -739,9 +741,9 @@ func (h *FinanceHandler) DownloadInvoiceFile(c *gin.Context) {
|
||||
// @Description 获取用户当前可开票的金额
|
||||
// @Tags 发票管理
|
||||
// @Produce json
|
||||
// @Success 200 {object} response.Response{data=finance.AvailableAmountResponse}
|
||||
// @Failure 400 {object} response.Response
|
||||
// @Failure 500 {object} response.Response
|
||||
// @Success 200 {object} interfaces.APIResponse{data=dto.AvailableAmountResponse}
|
||||
// @Failure 400 {object} interfaces.APIResponse
|
||||
// @Failure 500 {object} interfaces.APIResponse
|
||||
// @Router /api/v1/invoices/available-amount [get]
|
||||
func (h *FinanceHandler) GetAvailableAmount(c *gin.Context) {
|
||||
userID := c.GetString("user_id")
|
||||
@@ -771,9 +773,9 @@ func (h *FinanceHandler) GetAvailableAmount(c *gin.Context) {
|
||||
// @Param status query string false "状态筛选:pending/completed/rejected"
|
||||
// @Param start_time query string false "开始时间 (格式: 2006-01-02 15:04:05)"
|
||||
// @Param end_time query string false "结束时间 (格式: 2006-01-02 15:04:05)"
|
||||
// @Success 200 {object} response.Response{data=finance.PendingApplicationsResponse}
|
||||
// @Failure 400 {object} response.Response
|
||||
// @Failure 500 {object} response.Response
|
||||
// @Success 200 {object} interfaces.APIResponse{data=dto.PendingApplicationsResponse}
|
||||
// @Failure 400 {object} interfaces.APIResponse
|
||||
// @Failure 500 {object} interfaces.APIResponse
|
||||
// @Router /api/v1/admin/invoices/pending [get]
|
||||
func (h *FinanceHandler) GetPendingApplications(c *gin.Context) {
|
||||
page, _ := strconv.Atoi(c.DefaultQuery("page", "1"))
|
||||
@@ -808,9 +810,9 @@ func (h *FinanceHandler) GetPendingApplications(c *gin.Context) {
|
||||
// @Param application_id path string true "申请ID"
|
||||
// @Param file formData file true "发票文件"
|
||||
// @Param admin_notes formData string false "管理员备注"
|
||||
// @Success 200 {object} response.Response
|
||||
// @Failure 400 {object} response.Response
|
||||
// @Failure 500 {object} response.Response
|
||||
// @Success 200 {object} interfaces.APIResponse
|
||||
// @Failure 400 {object} interfaces.APIResponse
|
||||
// @Failure 500 {object} interfaces.APIResponse
|
||||
// @Router /api/v1/admin/invoices/{application_id}/approve [post]
|
||||
func (h *FinanceHandler) ApproveInvoiceApplication(c *gin.Context) {
|
||||
applicationID := c.Param("application_id")
|
||||
@@ -860,9 +862,9 @@ func (h *FinanceHandler) ApproveInvoiceApplication(c *gin.Context) {
|
||||
// @Produce json
|
||||
// @Param application_id path string true "申请ID"
|
||||
// @Param request body finance.RejectInvoiceRequest true "拒绝申请请求"
|
||||
// @Success 200 {object} response.Response
|
||||
// @Failure 400 {object} response.Response
|
||||
// @Failure 500 {object} response.Response
|
||||
// @Success 200 {object} interfaces.APIResponse
|
||||
// @Failure 400 {object} interfaces.APIResponse
|
||||
// @Failure 500 {object} interfaces.APIResponse
|
||||
// @Router /api/v1/admin/invoices/{application_id}/reject [post]
|
||||
func (h *FinanceHandler) RejectInvoiceApplication(c *gin.Context) {
|
||||
applicationID := c.Param("application_id")
|
||||
@@ -893,8 +895,8 @@ func (h *FinanceHandler) RejectInvoiceApplication(c *gin.Context) {
|
||||
// @Produce application/octet-stream
|
||||
// @Param application_id path string true "申请ID"
|
||||
// @Success 200 {file} file
|
||||
// @Failure 400 {object} response.Response
|
||||
// @Failure 500 {object} response.Response
|
||||
// @Failure 400 {object} interfaces.APIResponse
|
||||
// @Failure 500 {object} interfaces.APIResponse
|
||||
// @Router /api/v1/admin/invoices/{application_id}/download [get]
|
||||
func (h *FinanceHandler) AdminDownloadInvoiceFile(c *gin.Context) {
|
||||
applicationID := c.Param("application_id")
|
||||
@@ -918,13 +920,16 @@ func (h *FinanceHandler) AdminDownloadInvoiceFile(c *gin.Context) {
|
||||
c.Data(http.StatusOK, "application/pdf", result.FileContent)
|
||||
}
|
||||
|
||||
// DebugEventSystem 调试事件系统状态
|
||||
// @Summary 调试事件系统状态
|
||||
// @Description 获取事件系统的调试信息
|
||||
// @Tags 调试
|
||||
// DebugEventSystem 调试事件系统
|
||||
// @Summary 调试事件系统
|
||||
// @Description 调试事件系统,用于测试事件触发和处理
|
||||
// @Tags 系统调试
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Success 200 {object} map[string]interface{}
|
||||
// @Router /api/v1/debug/events [get]
|
||||
// @Security Bearer
|
||||
// @Success 200 {object} map[string]interface{} "调试成功"
|
||||
// @Failure 500 {object} map[string]interface{} "服务器内部错误"
|
||||
// @Router /api/v1/debug/event-system [post]
|
||||
func (h *FinanceHandler) DebugEventSystem(c *gin.Context) {
|
||||
h.logger.Info("🔍 请求事件系统调试信息")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user