From b27eb1ecb843ea4e0a73035832384361fbcde5bc Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Fri, 22 Nov 2024 16:25:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E7=99=BB=E5=BD=95=20?= =?UTF-8?q?=E6=89=BE=E5=9B=9E=E5=AF=86=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/docs.go | 136 ++++++++++++++++++++++++++++++++++++++++++++-- docs/swagger.json | 131 +++++++++++++++++++++++++++++++++++++++++++- docs/swagger.yaml | 88 +++++++++++++++++++++++++++++- go.mod | 2 +- 4 files changed, 350 insertions(+), 7 deletions(-) diff --git a/docs/docs.go b/docs/docs.go index 1e19bb1..75ee109 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -1,4 +1,5 @@ -// Package docs Code generated by swaggo/swag. DO NOT EDIT +// Code generated by swaggo/swag. DO NOT EDIT. + package docs import "github.com/swaggo/swag" @@ -386,6 +387,46 @@ const docTemplate = `{ } } }, + "/api/v1/findPassword": { + "post": { + "description": "注册", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "注册" + ], + "summary": "注册", + "parameters": [ + { + "description": "注册参数", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.FindPasswordReq" + } + } + ], + "responses": { + "200": { + "description": "登录成功返回", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, "/api/v1/homePage/adRule": { "get": { "description": "视频奖励规则(获取)", @@ -753,7 +794,9 @@ const docTemplate = `{ "name": "req", "in": "body", "required": true, - "schema": {} + "schema": { + "type": "object" + } } ], "responses": { @@ -810,6 +853,46 @@ const docTemplate = `{ } } } + }, + "/api/v1/wechatLogin": { + "post": { + "description": "微信登陆", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "微信登陆" + ], + "summary": "微信登陆", + "parameters": [ + { + "description": "注册参数", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.WechatLoginReq" + } + } + ], + "responses": { + "200": { + "description": "登录成功返回", + "schema": { + "$ref": "#/definitions/md.LoginResponse" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } } }, "definitions": { @@ -1032,6 +1115,25 @@ const docTemplate = `{ } } }, + "md.FindPasswordReq": { + "type": "object", + "required": [ + "mobile" + ], + "properties": { + "code": { + "type": "string", + "example": "验证码" + }, + "mobile": { + "type": "string" + }, + "password": { + "type": "string", + "example": "密码 如 123" + } + } + }, "md.HomePageResp": { "type": "object", "properties": { @@ -1330,6 +1432,10 @@ const docTemplate = `{ "type": "string", "example": "微信openId" }, + "password": { + "type": "string", + "example": "密码 如 123" + }, "sex": { "description": "性别(0:未知 1:男 2:女)", "type": "integer" @@ -1468,6 +1574,9 @@ const docTemplate = `{ "md.UserInfoResp": { "type": "object", "properties": { + "id": { + "type": "string" + }, "invite_code": { "type": "string" }, @@ -1482,6 +1591,27 @@ const docTemplate = `{ "type": "string" } } + }, + "md.WechatLoginReq": { + "type": "object", + "properties": { + "avatar": { + "type": "string", + "example": "头像" + }, + "nickname": { + "type": "string", + "example": "昵称" + }, + "open_id": { + "type": "string", + "example": "微信openId" + }, + "union_id": { + "type": "string", + "example": "微信UnionId" + } + } } } }` @@ -1496,8 +1626,6 @@ var SwaggerInfo = &swag.Spec{ Description: "APP客户端-Api接口", InfoInstanceName: "swagger", SwaggerTemplate: docTemplate, - LeftDelim: "{{", - RightDelim: "}}", } func init() { diff --git a/docs/swagger.json b/docs/swagger.json index 11b3add..ca3ed6a 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -380,6 +380,46 @@ } } }, + "/api/v1/findPassword": { + "post": { + "description": "注册", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "注册" + ], + "summary": "注册", + "parameters": [ + { + "description": "注册参数", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.FindPasswordReq" + } + } + ], + "responses": { + "200": { + "description": "登录成功返回", + "schema": { + "type": "string" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, "/api/v1/homePage/adRule": { "get": { "description": "视频奖励规则(获取)", @@ -747,7 +787,9 @@ "name": "req", "in": "body", "required": true, - "schema": {} + "schema": { + "type": "object" + } } ], "responses": { @@ -804,6 +846,46 @@ } } } + }, + "/api/v1/wechatLogin": { + "post": { + "description": "微信登陆", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "微信登陆" + ], + "summary": "微信登陆", + "parameters": [ + { + "description": "注册参数", + "name": "req", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/md.WechatLoginReq" + } + } + ], + "responses": { + "200": { + "description": "登录成功返回", + "schema": { + "$ref": "#/definitions/md.LoginResponse" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } } }, "definitions": { @@ -1026,6 +1108,25 @@ } } }, + "md.FindPasswordReq": { + "type": "object", + "required": [ + "mobile" + ], + "properties": { + "code": { + "type": "string", + "example": "验证码" + }, + "mobile": { + "type": "string" + }, + "password": { + "type": "string", + "example": "密码 如 123" + } + } + }, "md.HomePageResp": { "type": "object", "properties": { @@ -1324,6 +1425,10 @@ "type": "string", "example": "微信openId" }, + "password": { + "type": "string", + "example": "密码 如 123" + }, "sex": { "description": "性别(0:未知 1:男 2:女)", "type": "integer" @@ -1462,6 +1567,9 @@ "md.UserInfoResp": { "type": "object", "properties": { + "id": { + "type": "string" + }, "invite_code": { "type": "string" }, @@ -1476,6 +1584,27 @@ "type": "string" } } + }, + "md.WechatLoginReq": { + "type": "object", + "properties": { + "avatar": { + "type": "string", + "example": "头像" + }, + "nickname": { + "type": "string", + "example": "昵称" + }, + "open_id": { + "type": "string", + "example": "微信openId" + }, + "union_id": { + "type": "string", + "example": "微信UnionId" + } + } } } } \ No newline at end of file diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 965a906..90b4909 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -150,6 +150,19 @@ definitions: example: 一键登录的token type: string type: object + md.FindPasswordReq: + properties: + code: + example: 验证码 + type: string + mobile: + type: string + password: + example: 密码 如 123 + type: string + required: + - mobile + type: object md.HomePageResp: properties: egg_energy_now_price: @@ -357,6 +370,9 @@ definitions: open_id: example: 微信openId type: string + password: + example: 密码 如 123 + type: string sex: description: 性别(0:未知 1:男 2:女) type: integer @@ -452,6 +468,8 @@ definitions: type: object md.UserInfoResp: properties: + id: + type: string invite_code: type: string is_bind_extend: @@ -462,6 +480,21 @@ definitions: phone: type: string type: object + md.WechatLoginReq: + properties: + avatar: + example: 头像 + type: string + nickname: + example: 昵称 + type: string + open_id: + example: 微信openId + type: string + union_id: + example: 微信UnionId + type: string + type: object host: ddxq.izhim.com info: contact: @@ -714,6 +747,32 @@ paths: summary: 一键登录 tags: - 一键登录 + /api/v1/findPassword: + post: + consumes: + - application/json + description: 注册 + parameters: + - description: 注册参数 + in: body + name: req + required: true + schema: + $ref: '#/definitions/md.FindPasswordReq' + produces: + - application/json + responses: + "200": + description: 登录成功返回 + schema: + type: string + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 注册 + tags: + - 注册 /api/v1/homePage/adRule: get: consumes: @@ -952,7 +1011,8 @@ paths: in: body name: req required: true - schema: {} + schema: + type: object produces: - application/json responses: @@ -993,4 +1053,30 @@ paths: summary: 用户信息 tags: - 用户信息 + /api/v1/wechatLogin: + post: + consumes: + - application/json + description: 微信登陆 + parameters: + - description: 注册参数 + in: body + name: req + required: true + schema: + $ref: '#/definitions/md.WechatLoginReq' + produces: + - application/json + responses: + "200": + description: 登录成功返回 + schema: + $ref: '#/definitions/md.LoginResponse' + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 微信登陆 + tags: + - 微信登陆 swagger: "2.0" diff --git a/go.mod b/go.mod index 4ac74ad..6b075f4 100644 --- a/go.mod +++ b/go.mod @@ -40,6 +40,7 @@ require ( github.com/gin-contrib/sessions v1.0.1 github.com/go-sql-driver/mysql v1.8.1 github.com/gocolly/colly v1.2.0 + github.com/olivere/elastic/v7 v7.0.32 github.com/shopspring/decimal v1.3.1 github.com/tidwall/gjson v1.14.1 ) @@ -94,7 +95,6 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/nxadm/tail v1.4.8 // indirect - github.com/olivere/elastic/v7 v7.0.32 // indirect github.com/pelletier/go-toml/v2 v2.2.1 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d // indirect