Browse Source

微信登录

找回密码
adv_callback
huangjiajun 1 month ago
parent
commit
b27eb1ecb8
4 changed files with 350 additions and 7 deletions
  1. +132
    -4
      docs/docs.go
  2. +130
    -1
      docs/swagger.json
  3. +87
    -1
      docs/swagger.yaml
  4. +1
    -1
      go.mod

+ 132
- 4
docs/docs.go View File

@@ -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() {


+ 130
- 1
docs/swagger.json View File

@@ -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"
}
}
}
}
}

+ 87
- 1
docs/swagger.yaml View File

@@ -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"

+ 1
- 1
go.mod View File

@@ -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


Loading…
Cancel
Save