dengbiao 5 days ago
parent
commit
0e39252fb5
16 changed files with 80 additions and 17 deletions
  1. +2
    -2
      app/hdl/hdl_config.go
  2. +13
    -0
      app/hdl/hdl_demo.go
  3. +2
    -0
      app/hdl/hdl_member_center.go
  4. +2
    -2
      app/lib/alipay/face.go
  5. +1
    -0
      app/md/md_college.go
  6. +1
    -0
      app/md/md_member_center.go
  7. +1
    -0
      app/md/md_user_feedback.go
  8. +1
    -1
      app/md/realname_auth_base.go
  9. +1
    -0
      app/router/router.go
  10. +2
    -1
      app/svc/svc_college.go
  11. +11
    -0
      app/svc/svc_common.go
  12. +2
    -1
      app/svc/svc_user_feedback.go
  13. +1
    -1
      app/svc/svc_user_real_name.go
  14. +16
    -5
      docs/docs.go
  15. +14
    -2
      docs/swagger.json
  16. +10
    -2
      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")


+ 13
- 0
app/hdl/hdl_demo.go View File

@@ -4,8 +4,10 @@ import (
"applet/app/e"
"applet/app/lib/aes"
"applet/app/lib/aes/md"
md2 "applet/app/md"
"applet/app/svc"
"applet/app/utils"
"code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git/rabbit"
"encoding/json"
"github.com/gin-gonic/gin"
"io/ioutil"
@@ -43,6 +45,17 @@ func Demo(c *gin.Context) {
}, nil)
return
}
func Demo1(c *gin.Context) {
ch, err := rabbit.Cfg.Pool.GetChannel()
if err == nil {
defer ch.Release()
}
arg := md2.AdvertisingWatch{Id: "3"}
err = ch.PublishV2(md2.EggAdvertisingQueueExchange, arg, md2.EggAdvertisingSmash)
if err != nil {
ch.PublishV2(md2.EggAdvertisingQueueExchange, arg, md2.EggAdvertisingSmash)
}
}

func TestCreateSign(c *gin.Context) {
var args interface{}


+ 2
- 0
app/hdl/hdl_member_center.go View File

@@ -169,6 +169,7 @@ func MemberCenterGetBasic(c *gin.Context) {
Phone: user.Phone,
InviteCode: user.SystemInviteCode,
IsBindExtend: "0",
IsRealName: "0",
HeadImg: svc.GetOssUrl(user.Avatar),
}
if user.CustomInviteCode != "" {
@@ -177,6 +178,7 @@ func MemberCenterGetBasic(c *gin.Context) {
if user.ParentUid > 0 {
resp.IsBindExtend = "1"
}
resp.IsRealName = svc.CheckRealName(user.Id)
e.OutSuc(c, resp, nil)
return
}

+ 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
- 0
app/md/md_college.go View File

@@ -30,6 +30,7 @@ type CollegeDetailResp struct {
Content string `json:"content"`
IsLike string `json:"is_like" example:"是否点赞 0否 1是"`
CreateAt string `json:"create_at"`
AppName string `json:"app_name"`
WatchCount string `json:"watch_count" example:"学习数量"`
LikeCount string `json:"like_count" example:"点赞数量"`
ForwardCount string `json:"forward_count" example:"分享数量"`


+ 1
- 0
app/md/md_member_center.go View File

@@ -16,6 +16,7 @@ type MemberCenterGetBasicResp struct {
InviteCode string `json:"invite_code"`
HeadImg string `json:"head_img"`
IsBindExtend string `json:"is_bind_extend" example:"是否绑定了上级 0否 1是"`
IsRealName string `json:"is_real_name" example:"是否实名认证 0否 1是"`
}

type UserEggFlowReqRespList struct {


+ 1
- 0
app/md/md_user_feedback.go View File

@@ -12,6 +12,7 @@ type UserFeedbackRecordReq struct {
type UserFeedbackListResp struct {
Id string `json:"id"`
Title string `json:"title"`
Type string `json:"type"`
Label string `json:"label"`
Img []string `json:"img"`
Content string `json:"content"`


+ 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申请通过 3申请失败"`
}
type RealNameAuthAddRequest struct {
RealName string `json:"real_name"`


+ 1
- 0
app/router/router.go View File

@@ -51,6 +51,7 @@ func Init() *gin.Engine {
func route(r *gin.RouterGroup) {
r.StaticFS("/static", http.Dir("./static"))
r.GET("/test", hdl.Demo)
r.GET("/test1", hdl.Demo1)
r.Any("/createSign", hdl.CreateSign)
r.Any("/aesDecryptByECB", hdl.AesDecryptByECB)
r.GET("/article/html", hdl.ArticleHtml) //H5渲染的文章


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

@@ -76,9 +76,10 @@ 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,
AppName: GetSysCfgStr("app_name"),
IsLike: "0",
CreateAt: time.Unix(int64(article.CreatedAt), 0).Format("2006-01-02"),
WatchCount: NumFormat(article.WatchCount),


+ 11
- 0
app/svc/svc_common.go View File

@@ -55,6 +55,17 @@ func GetSysCfgStr(key string) string {

}

// 是否实名
func CheckRealName(uid int64) string {
IsRealName := "0"
NewUserRealNameAuthDb := implement.NewUserRealNameAuthDb(db.Db)
realName, _ := NewUserRealNameAuthDb.GetRealNameAuth(int(uid))
if realName != nil && realName.State == 1 {
IsRealName = "1"
}
return IsRealName
}

//存入用户的设备

func UserImeiAdd(c *gin.Context, uid int64) {


+ 2
- 1
app/svc/svc_user_feedback.go View File

@@ -48,7 +48,8 @@ func UserFeedbackList(c *gin.Context) {
json.Unmarshal([]byte(v.Img), &img)
tmp := md.UserFeedbackListResp{
Id: utils.IntToStr(v.Id),
Title: v.Type,
Type: v.Type,
Title: v.Title,
Img: img,
Content: v.Content,
State: "0",


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

@@ -33,7 +33,7 @@ func GetRealNameAuthBase(c *gin.Context) {
list.State = state
}
}
res.AuthState = utils.IntToStr(list.State + 1)
res.AuthState = utils.IntToStr(list.State)
if list.State == 0 { //人脸识别 支付了但是没扫脸的情况 设置成没审核状态
res.AuthState = "0"
}


+ 16
- 5
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"
@@ -2304,7 +2305,9 @@ const docTemplate = `{
"name": "req",
"in": "body",
"required": true,
"schema": {}
"schema": {
"type": "object"
}
}
],
"responses": {
@@ -3227,6 +3230,9 @@ const docTemplate = `{
"md.CollegeDetailResp": {
"type": "object",
"properties": {
"app_name": {
"type": "string"
},
"content": {
"type": "string"
},
@@ -4096,6 +4102,10 @@ const docTemplate = `{
"type": "string",
"example": "是否绑定了上级 0否 1是"
},
"is_real_name": {
"type": "string",
"example": "是否实名认证 0否 1是"
},
"level_name": {
"description": "会员等级名称",
"type": "string"
@@ -4248,7 +4258,7 @@ const docTemplate = `{
"properties": {
"auth_state": {
"type": "string",
"example": "0未审核 1通过 2拒绝"
"example": "0未申请 1申请通过 3申请失败"
}
}
},
@@ -4663,6 +4673,9 @@ const docTemplate = `{
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
}
},
@@ -4997,8 +5010,6 @@ var SwaggerInfo = &swag.Spec{
Description: "APP客户端-Api接口",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}

func init() {


+ 14
- 2
docs/swagger.json View File

@@ -2298,7 +2298,9 @@
"name": "req",
"in": "body",
"required": true,
"schema": {}
"schema": {
"type": "object"
}
}
],
"responses": {
@@ -3221,6 +3223,9 @@
"md.CollegeDetailResp": {
"type": "object",
"properties": {
"app_name": {
"type": "string"
},
"content": {
"type": "string"
},
@@ -4090,6 +4095,10 @@
"type": "string",
"example": "是否绑定了上级 0否 1是"
},
"is_real_name": {
"type": "string",
"example": "是否实名认证 0否 1是"
},
"level_name": {
"description": "会员等级名称",
"type": "string"
@@ -4242,7 +4251,7 @@
"properties": {
"auth_state": {
"type": "string",
"example": "0未审核 1通过 2拒绝"
"example": "0未申请 1申请通过 3申请失败"
}
}
},
@@ -4657,6 +4666,9 @@
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
}
},


+ 10
- 2
docs/swagger.yaml View File

@@ -190,6 +190,8 @@ definitions:
type: object
md.CollegeDetailResp:
properties:
app_name:
type: string
content:
type: string
create_at:
@@ -792,6 +794,9 @@ definitions:
is_bind_extend:
example: 是否绑定了上级 0否 1是
type: string
is_real_name:
example: 是否实名认证 0否 1是
type: string
level_name:
description: 会员等级名称
type: string
@@ -897,7 +902,7 @@ definitions:
md.RealNameAuthBasicData:
properties:
auth_state:
example: 0未审核 1通过 2拒绝
example: 0未申请 1申请通过 3申请失败
type: string
type: object
md.RealNameAuthResp:
@@ -1183,6 +1188,8 @@ definitions:
type: string
title:
type: string
type:
type: string
type: object
md.UserFeedbackRecordReq:
properties:
@@ -2916,7 +2923,8 @@ paths:
in: body
name: req
required: true
schema: {}
schema:
type: object
produces:
- application/json
responses:


Loading…
Cancel
Save