definitions: entity.Application: properties: created_at: type: string id: type: integer name: type: string updated_at: type: string user_id: type: string type: object entity.ApplicationToken: properties: application: $ref: '#/definitions/entity.Application' application_id: type: integer created_at: type: string id: type: integer token: type: string updated_at: type: string type: object entity.Category: properties: application: $ref: '#/definitions/entity.Application' application_id: type: integer id: type: integer name: type: string type: object entity.Post: properties: application: $ref: '#/definitions/entity.Application' application_id: type: integer category: $ref: '#/definitions/entity.Category' category_id: type: integer content: type: string created_at: type: string id: type: integer processed: type: boolean target_id: type: string title: type: string updated_at: type: string vectorized: type: boolean type: object page.PagedResult-entity_Category: properties: count: type: integer data: items: $ref: '#/definitions/entity.Category' type: array page: description: 当前页码 type: integer page_size: description: 每页大小 type: integer total_count: description: 数据总条数 type: integer total_pages: description: 总页数 type: integer type: object page.PagedResult-entity_Post: properties: count: type: integer data: items: $ref: '#/definitions/entity.Post' type: array page: description: 当前页码 type: integer page_size: description: 每页大小 type: integer total_count: description: 数据总条数 type: integer total_pages: description: 总页数 type: integer type: object request.ApplicationCreateRequest: properties: name: type: string type: object request.CategorySaveRequest: properties: name: type: string required: - name type: object request.PostSaveRequest: properties: category_id: type: integer content: type: string target_id: type: string title: type: string required: - category_id - content - target_id - title type: object request.UserDislikePost: properties: external_user_id: type: string post_id: type: integer type: object request.UserLikePost: properties: external_user_id: type: string post_id: type: integer type: object request.UserSuggestsRequest: properties: category_id: type: integer external_user_id: type: string required: - category_id - external_user_id type: object response.ResponseBody: properties: data: {} error: type: string message: type: string success: type: boolean type: object info: contact: {} title: Recommender API version: "1.0" paths: /api/v1/application/{application_id}/tokens: get: consumes: - application/json description: 获取应用程序的 Token 列表 parameters: - in: path name: application_id type: integer produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/response.ResponseBody' - properties: data: items: $ref: '#/definitions/entity.ApplicationToken' type: array type: object "400": description: Bad Request schema: $ref: '#/definitions/response.ResponseBody' security: - ApiKeyAuth: [] summary: 获取应用程序的 Token 列表 tags: - applications post: consumes: - application/json description: 获取应用程序的 Token 列表 parameters: - in: path name: application_id type: integer - description: 创建应用程序的请求 in: body name: ApplicationCreateRequest required: true schema: $ref: '#/definitions/request.ApplicationCreateRequest' produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/response.ResponseBody' - properties: data: $ref: '#/definitions/entity.ApplicationToken' type: object "400": description: Bad Request schema: $ref: '#/definitions/response.ResponseBody' security: - ApiKeyAuth: [] summary: 获取应用程序的 Token 列表 tags: - applications /api/v1/applications: get: consumes: - application/json description: 列出当前用户下的应用程序列表 produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/response.ResponseBody' - properties: data: items: $ref: '#/definitions/entity.Application' type: array type: object "400": description: Bad Request schema: $ref: '#/definitions/response.ResponseBody' security: - ApiKeyAuth: [] summary: List Applications tags: - applications post: consumes: - application/json description: 创建一个应用程序 parameters: - description: 创建应用程序的请求 in: body name: ApplicationCreateRequest required: true schema: $ref: '#/definitions/request.ApplicationCreateRequest' produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/response.ResponseBody' - properties: data: items: $ref: '#/definitions/entity.Application' type: array type: object "400": description: Bad Request schema: $ref: '#/definitions/response.ResponseBody' security: - ApiKeyAuth: [] summary: 创建并保存一个应用程序 tags: - applications /applications/v1/categories: get: consumes: - application/json description: 列出分类 produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/response.ResponseBody' - properties: data: $ref: '#/definitions/page.PagedResult-entity_Category' type: object "400": description: Bad Request schema: $ref: '#/definitions/response.ResponseBody' security: - ApiKeyAuth: [] summary: 列出分类 tags: - application_api post: consumes: - application/json description: 新建分类 parameters: - description: body in: body name: CategorySaveRequest required: true schema: $ref: '#/definitions/request.CategorySaveRequest' produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/response.ResponseBody' - properties: data: $ref: '#/definitions/entity.Application' type: object "400": description: Bad Request schema: $ref: '#/definitions/response.ResponseBody' security: - ApiKeyAuth: [] summary: 新建分类 tags: - application_api /applications/v1/categories/{category_id}: delete: consumes: - application/json description: 删除分类 parameters: - in: path name: category_id required: true type: integer produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/response.ResponseBody' - properties: data: $ref: '#/definitions/entity.Category' type: object "400": description: Bad Request schema: $ref: '#/definitions/response.ResponseBody' security: - ApiKeyAuth: [] summary: 删除分类 tags: - application_api get: consumes: - application/json description: 获取 Post parameters: - in: path name: category_id required: true type: integer produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/response.ResponseBody' - properties: data: $ref: '#/definitions/entity.Category' type: object "400": description: Bad Request schema: $ref: '#/definitions/response.ResponseBody' security: - ApiKeyAuth: [] summary: 获取 Post tags: - application_api /applications/v1/info: get: consumes: - application/json description: 当前的应用程序信息 produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/response.ResponseBody' - properties: data: $ref: '#/definitions/entity.Application' type: object "400": description: Bad Request schema: $ref: '#/definitions/response.ResponseBody' security: - ApiKeyAuth: [] summary: Current Application Info tags: - application_api /applications/v1/post/{post_id}: delete: consumes: - application/json description: 删除 Post parameters: - in: path name: post_id required: true type: integer produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/response.ResponseBody' - properties: data: $ref: '#/definitions/entity.Post' type: object "400": description: Bad Request schema: $ref: '#/definitions/response.ResponseBody' security: - ApiKeyAuth: [] summary: 删除 Post tags: - application_api get: consumes: - application/json description: 获取 Post parameters: - in: path name: post_id required: true type: integer produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/response.ResponseBody' - properties: data: $ref: '#/definitions/entity.Post' type: object "400": description: Bad Request schema: $ref: '#/definitions/response.ResponseBody' security: - ApiKeyAuth: [] summary: 获取 Post tags: - application_api /applications/v1/posts: get: consumes: - application/json description: 列出 Posts produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/response.ResponseBody' - properties: data: $ref: '#/definitions/page.PagedResult-entity_Post' type: object "400": description: Bad Request schema: $ref: '#/definitions/response.ResponseBody' security: - ApiKeyAuth: [] summary: 列出 Posts tags: - application_api post: consumes: - application/json description: 新建资源 parameters: - description: body in: body name: PostSaveRequest required: true schema: $ref: '#/definitions/request.PostSaveRequest' produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/response.ResponseBody' - properties: data: $ref: '#/definitions/entity.Post' type: object "400": description: Bad Request schema: $ref: '#/definitions/response.ResponseBody' security: - ApiKeyAuth: [] summary: 新建资源 tags: - application_api /applications/v1/users/_dislike: post: consumes: - application/json description: 从用户的标签喜好中移除内容 parameters: - description: UserDislikePost in: body name: UserDislikePost required: true schema: $ref: '#/definitions/request.UserDislikePost' produces: - application/json responses: "400": description: Bad Request schema: $ref: '#/definitions/response.ResponseBody' security: - ApiKeyAuth: [] summary: Dislike tags: - application_api /applications/v1/users/_like: post: consumes: - application/json description: 将标签附加到用户名 parameters: - description: UserLikePost in: body name: UserLikePost required: true schema: $ref: '#/definitions/request.UserLikePost' produces: - application/json responses: "400": description: Bad Request schema: $ref: '#/definitions/response.ResponseBody' security: - ApiKeyAuth: [] summary: Like tags: - application_api /applications/v1/users/_suggest: post: consumes: - application/json description: 推荐资源 parameters: - description: UserSuggestsRequest in: body name: UserSuggestsRequest required: true schema: $ref: '#/definitions/request.UserSuggestsRequest' produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/response.ResponseBody' - properties: data: items: $ref: '#/definitions/entity.Post' type: array type: object "400": description: Bad Request schema: $ref: '#/definitions/response.ResponseBody' security: - ApiKeyAuth: [] summary: Suggest tags: - application_api securityDefinitions: ApiKeyAuth: in: header name: Authorization type: apiKey swagger: "2.0"