{
  "openapi": "3.0.3",
  "info": {
    "title": "极狐GitLab官网 API",
    "description": "极狐GitLab官网的完整API文档，包括表单提交、用户认证、验证码、文件下载等功能。",
    "version": "1.0.0",
    "contact": {
      "name": "极狐GitLab团队",
      "email": "support@jihulab.com"
    }
  },
  "servers": [
    {
      "url": "http://localhost:3000",
      "description": "本地开发服务器"
    },
    {
      "url": "http://localhost:62032",
      "description": "CMS API 服务器"
    },
    {
      "url": "https://jihulab.com",
      "description": "生产环境"
    }
  ],
  "components": {
    "securitySchemes": {
      "sessionAuth": {
        "type": "apiKey",
        "in": "cookie",
        "name": "JSESSIONID",
        "description": "基于HTTP Session的用户认证"
      },
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "schemas": {
      "CommonResult": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "description": "状态码",
            "example": 200
          },
          "message": {
            "type": "string",
            "description": "响应消息",
            "example": "Submitted successfully"
          },
          "data": {
            "type": "object",
            "description": "响应数据",
            "nullable": true
          }
        }
      },
      "ContactFormRequest": {
        "type": "object",
        "required": ["name", "company", "phone", "email", "zixun"],
        "properties": {
          "name": {
            "type": "string",
            "description": "姓名",
            "example": "张三"
          },
          "company": {
            "type": "string",
            "description": "公司名称",
            "example": "极狐信息技术有限公司"
          },
          "phone": {
            "type": "string",
            "description": "电话号码",
            "example": "13800138000"
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "邮箱地址",
            "example": "zhangsan@example.com"
          },
          "zixun": {
            "type": "string",
            "description": "咨询内容",
            "example": "希望了解GitLab企业版的功能和价格"
          },
          "remark": {
            "type": "string",
            "description": "备注信息",
            "example": "希望尽快联系"
          },
          "formId": {
            "type": "string",
            "description": "表单ID",
            "example": "contact_form_001"
          },
          "utm_source": {
            "type": "string",
            "description": "营销来源",
            "example": "google"
          },
          "utm_medium": {
            "type": "string",
            "description": "营销媒介",
            "example": "cpc"
          },
          "utm_keyword": {
            "type": "string",
            "description": "营销关键词",
            "example": "gitlab"
          },
          "utm_content": {
            "type": "string",
            "description": "营销内容",
            "example": "banner_ad"
          }
        }
      },
      "UsersDO": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "用户ID",
            "example": 1
          },
          "mobile": {
            "type": "string",
            "description": "手机号",
            "example": "13800138000"
          },
          "name": {
            "type": "string",
            "description": "姓名",
            "example": "张三"
          },
          "company": {
            "type": "string",
            "description": "公司名称",
            "example": "极狐信息技术有限公司"
          }
        }
      },
      "LoginRequest": {
        "type": "object",
        "required": ["mobile", "company", "name", "verify"],
        "properties": {
          "mobile": {
            "type": "string",
            "description": "手机号码",
            "example": "13800138000"
          },
          "company": {
            "type": "string",
            "description": "公司名称",
            "example": "极狐信息技术有限公司"
          },
          "name": {
            "type": "string",
            "description": "用户姓名",
            "example": "张三"
          },
          "verify": {
            "type": "string",
            "description": "验证码",
            "example": "123456"
          }
        }
      },
      "CaptchaResponse": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "验证码key",
            "example": "captcha_key_123456"
          },
          "image": {
            "type": "string",
            "description": "Base64编码的验证码图片",
            "example": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
          }
        }
      },
      "ContactInsertRequest": {
        "type": "object",
        "required": ["name", "email", "message", "key", "code"],
        "properties": {
          "name": {
            "type": "string",
            "description": "姓名",
            "example": "张三"
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "邮箱地址",
            "example": "zhangsan@example.com"
          },
          "message": {
            "type": "string",
            "description": "留言内容",
            "example": "希望了解更多产品信息"
          },
          "key": {
            "type": "string",
            "description": "验证码key",
            "example": "captcha_key_123456"
          },
          "code": {
            "type": "string",
            "description": "验证码",
            "example": "ABCD"
          }
        }
      }
    }
  },
  "paths": {
    "/api/contact_form": {
      "post": {
        "tags": ["表单提交"],
        "summary": "联系表单提交",
        "description": "提交联系表单，支持防重复提交、邮件通知和CRM集成",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactFormRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "提交成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommonResult"
                }
              }
            }
          },
          "400": {
            "description": "请求参数错误或频繁提交",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/CommonResult"
                    },
                    {
                      "properties": {
                        "code": {
                          "example": 400
                        },
                        "message": {
                          "example": "请不要频繁提交"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/partner_form": {
      "get": {
        "tags": ["表单提交"],
        "summary": "合作伙伴表单提交",
        "description": "提交合作伙伴申请表单",
        "responses": {
          "200": {
            "description": "提交成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommonResult"
                }
              }
            }
          }
        }
      }
    },
    "/api/st_partner_form": {
      "get": {
        "tags": ["表单提交"],
        "summary": "ST合作伙伴表单提交",
        "description": "提交特定类型的合作伙伴申请",
        "responses": {
          "200": {
            "description": "提交成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommonResult"
                }
              }
            }
          }
        }
      }
    },
    "/api/send_verfiy": {
      "get": {
        "tags": ["用户认证"],
        "summary": "发送短信验证码",
        "description": "向指定手机号发送短信验证码",
        "parameters": [
          {
            "name": "mobile",
            "in": "query",
            "required": true,
            "description": "手机号码，必须符合中国手机号格式",
            "schema": {
              "type": "string",
              "pattern": "^1[3-9]\\d{9}$",
              "example": "13800138000"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "验证码发送成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommonResult"
                }
              }
            }
          },
          "400": {
            "description": "手机号格式错误",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/CommonResult"
                    },
                    {
                      "properties": {
                        "code": {
                          "example": 400
                        },
                        "message": {
                          "example": "电话信息有误"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/login": {
      "post": {
        "tags": ["用户认证"],
        "summary": "用户登录",
        "description": "基于手机号和验证码的用户登录",
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/LoginRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "登录成功",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/CommonResult"
                    },
                    {
                      "properties": {
                        "message": {
                          "example": "登录成功"
                        },
                        "data": {
                          "$ref": "#/components/schemas/UsersDO"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "登录失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommonResult"
                }
              }
            }
          }
        }
      }
    },
    "/api/upUser": {
      "post": {
        "tags": ["用户认证"],
        "summary": "更新用户信息",
        "description": "更新已登录用户的基本信息",
        "security": [
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "更新成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommonResult"
                }
              }
            }
          },
          "401": {
            "description": "未授权访问"
          }
        }
      }
    },
    "/api/updateUser": {
      "get": {
        "tags": ["用户认证"],
        "summary": "获取用户更新接口",
        "description": "用户信息更新的GET接口",
        "security": [
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "获取成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommonResult"
                }
              }
            }
          }
        }
      }
    },
    "/captcha/get": {
      "post": {
        "tags": ["验证码"],
        "summary": "获取图形验证码",
        "description": "生成并返回图形验证码",
        "responses": {
          "200": {
            "description": "验证码生成成功",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/CommonResult"
                    },
                    {
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/CaptchaResponse"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/contact/insert": {
      "post": {
        "tags": ["联系表单"],
        "summary": "联系表单插入（带验证码）",
        "description": "插入联系表单数据，需要图形验证码验证",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactInsertRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "插入成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommonResult"
                }
              }
            }
          },
          "400": {
            "description": "验证码错误或参数无效"
          }
        }
      }
    },
    "/index/contact/insert": {
      "post": {
        "tags": ["联系表单"],
        "summary": "首页联系表单插入",
        "description": "首页联系表单提交，无需验证码",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "example": "张三"
                  },
                  "email": {
                    "type": "string",
                    "format": "email",
                    "example": "zhangsan@example.com"
                  },
                  "message": {
                    "type": "string",
                    "example": "希望了解更多产品信息"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "提交成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommonResult"
                }
              }
            }
          }
        }
      }
    },
    "/document/download": {
      "get": {
        "tags": ["文件下载"],
        "summary": "文档下载",
        "description": "根据文件URL下载各种类型的文档",
        "parameters": [
          {
            "name": "fileUrl",
            "in": "query",
            "required": true,
            "description": "文件下载URL",
            "schema": {
              "type": "string",
              "format": "uri",
              "example": "https://example.com/document.pdf"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "文件下载成功",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/vnd.openxmlformats-officedocument.wordprocessingml.document": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "文件不存在"
          }
        }
      }
    },
    "/order/insert": {
      "post": {
        "tags": ["订单管理"],
        "summary": "订单插入",
        "description": "创建新订单记录",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "productName": {
                    "type": "string",
                    "example": "GitLab企业版"
                  },
                  "quantity": {
                    "type": "integer",
                    "example": 1
                  },
                  "customerInfo": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "example": "张三"
                      },
                      "company": {
                        "type": "string",
                        "example": "极狐信息技术有限公司"
                      },
                      "email": {
                        "type": "string",
                        "example": "zhangsan@example.com"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "订单创建成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommonResult"
                }
              }
            }
          }
        }
      }
    },
    "/submitResume": {
      "post": {
        "tags": ["简历投递"],
        "summary": "简历投递",
        "description": "处理简历文件上传和投递",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": ["resume"],
                "properties": {
                  "resume": {
                    "type": "string",
                    "format": "binary",
                    "description": "简历文件"
                  },
                  "name": {
                    "type": "string",
                    "description": "姓名",
                    "example": "张三"
                  },
                  "email": {
                    "type": "string",
                    "format": "email",
                    "description": "邮箱",
                    "example": "zhangsan@example.com"
                  },
                  "phone": {
                    "type": "string",
                    "description": "电话",
                    "example": "13800138000"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "简历投递成功",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/CommonResult"
                    },
                    {
                      "properties": {
                        "message": {
                          "example": "簡歷投遞成功，請靜候佳音"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "简历文件为空或格式错误",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/CommonResult"
                    },
                    {
                      "properties": {
                        "code": {
                          "example": 400
                        },
                        "message": {
                          "example": "簡歷文件不能為空"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/submitForm": {
      "get": {
        "tags": ["用户表单"],
        "summary": "提交表单信息",
        "description": "处理用户表单信息提交，支持事务处理",
        "responses": {
          "200": {
            "description": "表单提交成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommonResult"
                }
              }
            }
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "表单提交",
      "description": "各种表单提交相关接口"
    },
    {
      "name": "用户认证",
      "description": "用户登录、注册、信息更新相关接口"
    },
    {
      "name": "验证码",
      "description": "图形验证码和短信验证码相关接口"
    },
    {
      "name": "联系表单",
      "description": "联系表单插入和处理接口"
    },
    {
      "name": "文件下载",
      "description": "文档和文件下载相关接口"
    },
    {
      "name": "订单管理",
      "description": "订单创建和管理相关接口"
    },
    {
      "name": "简历投递",
      "description": "简历上传和投递相关接口"
    },
    {
      "name": "用户表单",
      "description": "用户表单信息提交接口"
    },
    {
      "name": "测试接口",
      "description": "系统测试相关接口"
    }
  ]
}