Browse Source

实名认证

master
huangjiajun 5 days ago
parent
commit
57fe0d1261
7 changed files with 650 additions and 174 deletions
  1. +2
    -2
      app/hdl/hdl_config.go
  2. +2
    -2
      app/lib/alipay/face.go
  3. +1
    -1
      app/md/realname_auth_base.go
  4. +1
    -1
      app/svc/svc_college.go
  5. +242
    -63
      docs/docs.go
  6. +242
    -63
      docs/swagger.json
  7. +160
    -42
      docs/swagger.yaml

+ 2
- 2
app/hdl/hdl_config.go View File

@@ -36,12 +36,12 @@ func Config(c *gin.Context) {
userArticle, _ := NewArticleDb.ArticleByTypeId("2")
if userArticle != nil {
res.UserTitle = userArticle.Title
res.UserUrl = fmt.Sprintf("%s%s?article_id=%s", svc.GetSysCfgStr("wap_host"), "/api/v1/article/html", utils.AnyToString(userArticle.Id))
res.UserUrl = fmt.Sprintf("%s%s?id=%s&is_hide=1", svc.GetSysCfgStr("wap_host"), "/#/pages/course-detail-page/course-detail-page", utils.AnyToString(userArticle.Id))
}
privacyArticle, _ := NewArticleDb.ArticleByTypeId("3")
if privacyArticle != nil {
res.PrivacyTitle = privacyArticle.Title
res.PrivacyUrl = fmt.Sprintf("%s%s?article_id=%s", svc.GetSysCfgStr("wap_host"), "/api/v1/article/html", utils.AnyToString(userArticle.Id))
res.PrivacyUrl = fmt.Sprintf("%s%s?id=%s&is_hide=1", svc.GetSysCfgStr("wap_host"), "/#/pages/course-detail-page/course-detail-page", utils.AnyToString(userArticle.Id))
}
res.OssUrl = svc.GetOssDomain()
appCloudBundleData := svc.GetSysCfgStr("app_cloud_bundle_data")


+ 2
- 2
app/lib/alipay/face.go View File

@@ -10,7 +10,7 @@ import (

func FacePrepareAlipayCode(method string, params map[string]string) (interface{}, error) {
sysCfgDb := implement.NewSysCfgDb(db.Db, cache.GetPool().Get())
sysCfgMap := sysCfgDb.SysCfgFindWithDb(enum.AlipayAppId, enum.AlipayPrivateKey, enum.AlipayPublicKey, enum.AlipayPublicContentRSA2, enum.AlipayRootContent, enum.AppPublicContent)
sysCfgMap := sysCfgDb.SysCfgFindWithDb("alipay_face_url", enum.AlipayAppId, enum.AlipayPrivateKey, enum.AlipayPublicKey, enum.AlipayPublicContentRSA2, enum.AlipayRootContent, enum.AppPublicContent)

// 获取私钥和APPID
var paySet = &PayData{
@@ -21,7 +21,7 @@ func FacePrepareAlipayCode(method string, params map[string]string) (interface{}
AlipayRootContent: sysCfgMap[enum.AlipayRootContent],
AppPublicContent: sysCfgMap[enum.AppPublicContent],
}
notifyURL := "http://ddxq.izhim.com/api/v1/callback/alipay/face"
notifyURL := sysCfgMap["alipay_face_url"]
var param interface{}
var err error
switch method {


+ 1
- 1
app/md/realname_auth_base.go View File

@@ -1,7 +1,7 @@
package md

type RealNameAuthBasicData struct {
AuthState string `json:"auth_state" example:"0未审核 1通过 2拒绝"`
AuthState string `json:"auth_state" example:"0未申请 1申请中 2申请通过 3申请失败"`
}
type RealNameAuthAddRequest struct {
RealName string `json:"real_name"`


+ 1
- 1
app/svc/svc_college.go View File

@@ -76,7 +76,7 @@ func CollegeDetail(c *gin.Context, uid int) {
if article != nil {
data = md.CollegeDetailResp{
Id: utils.IntToStr(article.Id),
Url: fmt.Sprintf("%s%s?article_id=%s", GetSysCfgStr("wap_host"), "/api/v1/article/html", utils.AnyToString(article.Id)),
Url: fmt.Sprintf("%s%s?id=%s&is_hide=1", GetSysCfgStr("wap_host"), "/#/pages/course-detail-page/course-detail-page", utils.AnyToString(article.Id)),
Title: article.Title,
Content: article.Content,
IsLike: "0",


+ 242
- 63
docs/docs.go View File

@@ -860,6 +860,91 @@ const docTemplate = `{
}
}
},
"/api/v1/faceRealName/base": {
"get": {
"description": "实名认证-分类",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"实名认证"
],
"summary": "实名认证-基础信息",
"parameters": [
{
"type": "string",
"description": "验证参数Bearer和token空格拼接",
"name": "Authorization",
"in": "header",
"required": true
}
],
"responses": {
"200": {
"description": "具体数据",
"schema": {
"$ref": "#/definitions/md.RealNameAuthBasicData"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/v1/faceRealName/save": {
"post": {
"description": "实名认证-保存",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"实名认证"
],
"summary": "实名认证-保存",
"parameters": [
{
"type": "string",
"description": "验证参数Bearer和token空格拼接",
"name": "Authorization",
"in": "header",
"required": true
},
{
"description": "参数",
"name": "req",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.RealNameAuthAddRequest"
}
}
],
"responses": {
"200": {
"description": "具体数据",
"schema": {
"$ref": "#/definitions/md.RealNameAuthResp"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/v1/fastLogin": {
"post": {
"description": "一键登录",
@@ -2614,6 +2699,53 @@ const docTemplate = `{
}
}
},
"/api/v1/wallet/withdraw/apply": {
"post": {
"description": "发起提现",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"钱包"
],
"summary": "蛋蛋星球-钱包-发起提现",
"parameters": [
{
"type": "string",
"description": "验证参数Bearer和token空格拼接",
"name": "Authorization",
"in": "header",
"required": true
},
{
"description": "具体参数",
"name": "req",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.WithdrawApplyReq"
}
}
],
"responses": {
"200": {
"description": "success",
"schema": {
"type": "string"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/v1/wallet/withdraw/index": {
"get": {
"description": "提现余额(获取)",
@@ -2711,68 +2843,6 @@ const docTemplate = `{
}
}
},
"code_fnuoos_com_EggPlanet_egg_models_git_src_model.ImSendRedPackageOrd": {
"type": "object",
"properties": {
"amount": {
"type": "string"
},
"create_time": {
"type": "string"
},
"id": {
"type": "integer"
},
"im_data": {
"type": "string"
},
"im_uid": {
"type": "integer"
},
"ord_no": {
"type": "string"
},
"received_im_user_ids": {
"type": "string"
},
"received_times": {
"type": "string"
},
"received_user_amount": {
"type": "string"
},
"received_user_ids": {
"type": "string"
},
"red_packet_balance_amount": {
"type": "string"
},
"red_packet_balance_nums": {
"type": "integer"
},
"red_packet_nums": {
"type": "integer"
},
"red_packet_type": {
"type": "integer"
},
"state": {
"type": "integer"
},
"uid": {
"type": "integer"
},
"update_time": {
"type": "string"
},
"wait_draw_im_user_ids": {
"type": "string"
},
"wait_draw_user_ids": {
"type": "string"
}
}
},
"comm.AccessRecordsReq": {
"type": "object",
"properties": {
@@ -3073,6 +3143,9 @@ const docTemplate = `{
"type": "string",
"example": "软件使用协议内容"
},
"down_url": {
"type": "string"
},
"guide": {
"type": "array",
"items": {
@@ -3971,6 +4044,37 @@ const docTemplate = `{
}
}
},
"md.RealNameAuthAddRequest": {
"type": "object",
"properties": {
"card_no": {
"type": "string"
},
"real_name": {
"type": "string"
}
}
},
"md.RealNameAuthBasicData": {
"type": "object",
"properties": {
"auth_state": {
"type": "string",
"example": "0未申请 1申请中 2申请通过 3申请失败"
}
}
},
"md.RealNameAuthResp": {
"type": "object",
"properties": {
"oid": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"md.RealTimePriceResp": {
"type": "object",
"properties": {
@@ -3999,7 +4103,7 @@ const docTemplate = `{
"description": "红包详情信息",
"allOf": [
{
"$ref": "#/definitions/code_fnuoos_com_EggPlanet_egg_models_git_src_model.ImSendRedPackageOrd"
"$ref": "#/definitions/model.ImSendRedPackageOrd"
}
]
},
@@ -4599,6 +4703,19 @@ const docTemplate = `{
}
}
},
"md.WithdrawApplyReq": {
"type": "object",
"properties": {
"amount": {
"description": "金额",
"type": "string"
},
"kind": {
"description": "提现方式(1:支付宝 2:微信)",
"type": "integer"
}
}
},
"md.WithdrawGetAmountResp": {
"type": "object",
"properties": {
@@ -4608,6 +4725,68 @@ const docTemplate = `{
}
}
},
"model.ImSendRedPackageOrd": {
"type": "object",
"properties": {
"amount": {
"type": "string"
},
"create_time": {
"type": "string"
},
"id": {
"type": "integer"
},
"im_data": {
"type": "string"
},
"im_uid": {
"type": "integer"
},
"ord_no": {
"type": "string"
},
"received_im_user_ids": {
"type": "string"
},
"received_times": {
"type": "string"
},
"received_user_amount": {
"type": "string"
},
"received_user_ids": {
"type": "string"
},
"red_packet_balance_amount": {
"type": "string"
},
"red_packet_balance_nums": {
"type": "integer"
},
"red_packet_nums": {
"type": "integer"
},
"red_packet_type": {
"type": "integer"
},
"state": {
"type": "integer"
},
"uid": {
"type": "integer"
},
"update_time": {
"type": "string"
},
"wait_draw_im_user_ids": {
"type": "string"
},
"wait_draw_user_ids": {
"type": "string"
}
}
},
"pb.SendRedPacketResp": {
"type": "object",
"properties": {


+ 242
- 63
docs/swagger.json View File

@@ -853,6 +853,91 @@
}
}
},
"/api/v1/faceRealName/base": {
"get": {
"description": "实名认证-分类",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"实名认证"
],
"summary": "实名认证-基础信息",
"parameters": [
{
"type": "string",
"description": "验证参数Bearer和token空格拼接",
"name": "Authorization",
"in": "header",
"required": true
}
],
"responses": {
"200": {
"description": "具体数据",
"schema": {
"$ref": "#/definitions/md.RealNameAuthBasicData"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/v1/faceRealName/save": {
"post": {
"description": "实名认证-保存",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"实名认证"
],
"summary": "实名认证-保存",
"parameters": [
{
"type": "string",
"description": "验证参数Bearer和token空格拼接",
"name": "Authorization",
"in": "header",
"required": true
},
{
"description": "参数",
"name": "req",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.RealNameAuthAddRequest"
}
}
],
"responses": {
"200": {
"description": "具体数据",
"schema": {
"$ref": "#/definitions/md.RealNameAuthResp"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/v1/fastLogin": {
"post": {
"description": "一键登录",
@@ -2607,6 +2692,53 @@
}
}
},
"/api/v1/wallet/withdraw/apply": {
"post": {
"description": "发起提现",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"钱包"
],
"summary": "蛋蛋星球-钱包-发起提现",
"parameters": [
{
"type": "string",
"description": "验证参数Bearer和token空格拼接",
"name": "Authorization",
"in": "header",
"required": true
},
{
"description": "具体参数",
"name": "req",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.WithdrawApplyReq"
}
}
],
"responses": {
"200": {
"description": "success",
"schema": {
"type": "string"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/v1/wallet/withdraw/index": {
"get": {
"description": "提现余额(获取)",
@@ -2704,68 +2836,6 @@
}
}
},
"code_fnuoos_com_EggPlanet_egg_models_git_src_model.ImSendRedPackageOrd": {
"type": "object",
"properties": {
"amount": {
"type": "string"
},
"create_time": {
"type": "string"
},
"id": {
"type": "integer"
},
"im_data": {
"type": "string"
},
"im_uid": {
"type": "integer"
},
"ord_no": {
"type": "string"
},
"received_im_user_ids": {
"type": "string"
},
"received_times": {
"type": "string"
},
"received_user_amount": {
"type": "string"
},
"received_user_ids": {
"type": "string"
},
"red_packet_balance_amount": {
"type": "string"
},
"red_packet_balance_nums": {
"type": "integer"
},
"red_packet_nums": {
"type": "integer"
},
"red_packet_type": {
"type": "integer"
},
"state": {
"type": "integer"
},
"uid": {
"type": "integer"
},
"update_time": {
"type": "string"
},
"wait_draw_im_user_ids": {
"type": "string"
},
"wait_draw_user_ids": {
"type": "string"
}
}
},
"comm.AccessRecordsReq": {
"type": "object",
"properties": {
@@ -3066,6 +3136,9 @@
"type": "string",
"example": "软件使用协议内容"
},
"down_url": {
"type": "string"
},
"guide": {
"type": "array",
"items": {
@@ -3964,6 +4037,37 @@
}
}
},
"md.RealNameAuthAddRequest": {
"type": "object",
"properties": {
"card_no": {
"type": "string"
},
"real_name": {
"type": "string"
}
}
},
"md.RealNameAuthBasicData": {
"type": "object",
"properties": {
"auth_state": {
"type": "string",
"example": "0未申请 1申请中 2申请通过 3申请失败"
}
}
},
"md.RealNameAuthResp": {
"type": "object",
"properties": {
"oid": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"md.RealTimePriceResp": {
"type": "object",
"properties": {
@@ -3992,7 +4096,7 @@
"description": "红包详情信息",
"allOf": [
{
"$ref": "#/definitions/code_fnuoos_com_EggPlanet_egg_models_git_src_model.ImSendRedPackageOrd"
"$ref": "#/definitions/model.ImSendRedPackageOrd"
}
]
},
@@ -4592,6 +4696,19 @@
}
}
},
"md.WithdrawApplyReq": {
"type": "object",
"properties": {
"amount": {
"description": "金额",
"type": "string"
},
"kind": {
"description": "提现方式(1:支付宝 2:微信)",
"type": "integer"
}
}
},
"md.WithdrawGetAmountResp": {
"type": "object",
"properties": {
@@ -4601,6 +4718,68 @@
}
}
},
"model.ImSendRedPackageOrd": {
"type": "object",
"properties": {
"amount": {
"type": "string"
},
"create_time": {
"type": "string"
},
"id": {
"type": "integer"
},
"im_data": {
"type": "string"
},
"im_uid": {
"type": "integer"
},
"ord_no": {
"type": "string"
},
"received_im_user_ids": {
"type": "string"
},
"received_times": {
"type": "string"
},
"received_user_amount": {
"type": "string"
},
"received_user_ids": {
"type": "string"
},
"red_packet_balance_amount": {
"type": "string"
},
"red_packet_balance_nums": {
"type": "integer"
},
"red_packet_nums": {
"type": "integer"
},
"red_packet_type": {
"type": "integer"
},
"state": {
"type": "integer"
},
"uid": {
"type": "integer"
},
"update_time": {
"type": "string"
},
"wait_draw_im_user_ids": {
"type": "string"
},
"wait_draw_user_ids": {
"type": "string"
}
}
},
"pb.SendRedPacketResp": {
"type": "object",
"properties": {


+ 160
- 42
docs/swagger.yaml View File

@@ -12,47 +12,6 @@ definitions:
description: 总数据量
type: integer
type: object
code_fnuoos_com_EggPlanet_egg_models_git_src_model.ImSendRedPackageOrd:
properties:
amount:
type: string
create_time:
type: string
id:
type: integer
im_data:
type: string
im_uid:
type: integer
ord_no:
type: string
received_im_user_ids:
type: string
received_times:
type: string
received_user_amount:
type: string
received_user_ids:
type: string
red_packet_balance_amount:
type: string
red_packet_balance_nums:
type: integer
red_packet_nums:
type: integer
red_packet_type:
type: integer
state:
type: integer
uid:
type: integer
update_time:
type: string
wait_draw_im_user_ids:
type: string
wait_draw_user_ids:
type: string
type: object
comm.AccessRecordsReq:
properties:
index:
@@ -261,6 +220,8 @@ definitions:
content:
example: 软件使用协议内容
type: string
down_url:
type: string
guide:
items:
$ref: '#/definitions/md.Guide'
@@ -884,6 +845,26 @@ definitions:
description: 可用能量
type: string
type: object
md.RealNameAuthAddRequest:
properties:
card_no:
type: string
real_name:
type: string
type: object
md.RealNameAuthBasicData:
properties:
auth_state:
example: 0未申请 1申请中 2申请通过 3申请失败
type: string
type: object
md.RealNameAuthResp:
properties:
oid:
type: string
url:
type: string
type: object
md.RealTimePriceResp:
properties:
is_rises:
@@ -903,7 +884,7 @@ definitions:
properties:
detail:
allOf:
- $ref: '#/definitions/code_fnuoos_com_EggPlanet_egg_models_git_src_model.ImSendRedPackageOrd'
- $ref: '#/definitions/model.ImSendRedPackageOrd'
description: 红包详情信息
list:
description: 领取红包用户列表
@@ -1316,12 +1297,62 @@ definitions:
example: 微信UnionId
type: string
type: object
md.WithdrawApplyReq:
properties:
amount:
description: 金额
type: string
kind:
description: 提现方式(1:支付宝 2:微信)
type: integer
type: object
md.WithdrawGetAmountResp:
properties:
amount:
description: 余额
type: string
type: object
model.ImSendRedPackageOrd:
properties:
amount:
type: string
create_time:
type: string
id:
type: integer
im_data:
type: string
im_uid:
type: integer
ord_no:
type: string
received_im_user_ids:
type: string
received_times:
type: string
received_user_amount:
type: string
received_user_ids:
type: string
red_packet_balance_amount:
type: string
red_packet_balance_nums:
type: integer
red_packet_nums:
type: integer
red_packet_type:
type: integer
state:
type: integer
uid:
type: integer
update_time:
type: string
wait_draw_im_user_ids:
type: string
wait_draw_user_ids:
type: string
type: object
pb.SendRedPacketResp:
properties:
seq:
@@ -1893,6 +1924,62 @@ paths:
summary: 基本配置
tags:
- 基本配置
/api/v1/faceRealName/base:
get:
consumes:
- application/json
description: 实名认证-分类
parameters:
- description: 验证参数Bearer和token空格拼接
in: header
name: Authorization
required: true
type: string
produces:
- application/json
responses:
"200":
description: 具体数据
schema:
$ref: '#/definitions/md.RealNameAuthBasicData'
"400":
description: 具体错误
schema:
$ref: '#/definitions/md.Response'
summary: 实名认证-基础信息
tags:
- 实名认证
/api/v1/faceRealName/save:
post:
consumes:
- application/json
description: 实名认证-保存
parameters:
- description: 验证参数Bearer和token空格拼接
in: header
name: Authorization
required: true
type: string
- description: 参数
in: body
name: req
required: true
schema:
$ref: '#/definitions/md.RealNameAuthAddRequest'
produces:
- application/json
responses:
"200":
description: 具体数据
schema:
$ref: '#/definitions/md.RealNameAuthResp'
"400":
description: 具体错误
schema:
$ref: '#/definitions/md.Response'
summary: 实名认证-保存
tags:
- 实名认证
/api/v1/fastLogin:
post:
consumes:
@@ -3050,6 +3137,37 @@ paths:
summary: 蛋蛋星球-钱包-余额明细(获取)
tags:
- 钱包
/api/v1/wallet/withdraw/apply:
post:
consumes:
- application/json
description: 发起提现
parameters:
- description: 验证参数Bearer和token空格拼接
in: header
name: Authorization
required: true
type: string
- description: 具体参数
in: body
name: req
required: true
schema:
$ref: '#/definitions/md.WithdrawApplyReq'
produces:
- application/json
responses:
"200":
description: success
schema:
type: string
"400":
description: 具体错误
schema:
$ref: '#/definitions/md.Response'
summary: 蛋蛋星球-钱包-发起提现
tags:
- 钱包
/api/v1/wallet/withdraw/index:
get:
consumes:


Loading…
Cancel
Save