Browse Source

引导页

版本记录等
adv_callback
huangjiajun 1 month ago
parent
commit
34b7598b31
11 changed files with 401 additions and 12 deletions
  1. +35
    -0
      app/hdl/hdl_config.go
  2. +7
    -1
      app/hdl/hdl_login.go
  3. +12
    -0
      app/hdl/hdl_member_center.go
  4. +27
    -7
      app/md/md_config.go
  5. +5
    -0
      app/md/md_member_center.go
  6. +1
    -1
      app/router/router.go
  7. +2
    -2
      app/svc/svc_common.go
  8. +117
    -0
      docs/docs.go
  9. +117
    -0
      docs/swagger.json
  10. +77
    -0
      docs/swagger.yaml
  11. +1
    -1
      go.mod

+ 35
- 0
app/hdl/hdl_config.go View File

@@ -8,8 +8,10 @@ import (
"applet/app/svc"
"applet/app/utils"
"code.fnuoos.com/EggPlanet/egg_models.git/src/implement"
"encoding/json"
"fmt"
"github.com/gin-gonic/gin"
"github.com/tidwall/gjson"
)

// Config
@@ -42,6 +44,39 @@ func Config(c *gin.Context) {
res.PrivacyUrl = fmt.Sprintf("%s%s?article_id=%s", svc.GetSysCfgStr("wap_host"), "/api/v1/article/html", utils.AnyToString(userArticle.Id))
}
res.OssUrl = svc.GetOssDomain()
appCloudBundleData := svc.GetSysCfgStr("app_cloud_bundle_data")
guideStr := gjson.Get(appCloudBundleData, "guide").String()
Guide := make([]md.Guide, 0)
json.Unmarshal([]byte(guideStr), &Guide)
res.Guide = Guide
e.OutSuc(c, res, nil)
return
}

// Version
// @Summary 版本记录
// @Tags 基本配置
// @Description 版本记录
// @Accept json
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @Success 200 {object} md.VersionResp "具体数据"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/v1/version [get]
func Version(c *gin.Context) {
appVersion := svc.GetSysCfgStr("app_version")
version := make([]md.Version, 0)
json.Unmarshal([]byte(appVersion), &version)
res := md.VersionResp{Version: version, IsAuditVersion: "0"}
NewCloudBundleDb := implement.NewCloudBundleDb(db.Db)
os := "1"
if c.GetHeader("platform") == "iOS" {
os = "2"
}
data, _ := NewCloudBundleDb.GetCloudBundleVersion(os, c.GetHeader("appversionname"))
if data != nil {
res.IsAuditVersion = utils.IntToStr(data.IsAuditing)
}
e.OutSuc(c, res, nil)
return
}


+ 7
- 1
app/hdl/hdl_login.go View File

@@ -356,7 +356,13 @@ func commReq(c *gin.Context, req md.RegisterReq) {
}
return 0
}()

if req.Nickname == "" && req.Mobile != "" {
appName := svc.GetSysCfgStr("app_name")
req.Nickname = appName + req.Mobile[len(req.Mobile)-4:]
}
if req.Avatar == "" {
req.Avatar = svc.GetSysCfgStr("default_avatar")
}
user = &model.User{
Phone: req.Mobile,
UnionId: req.UnionId,


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

@@ -4,6 +4,7 @@ import (
"applet/app/db"
"applet/app/e"
"applet/app/md"
"applet/app/svc"
"applet/app/utils"
"code.fnuoos.com/EggPlanet/egg_models.git/src/implement"
"code.fnuoos.com/EggPlanet/egg_models.git/src/model"
@@ -153,6 +154,17 @@ func MemberCenterGetBasic(c *gin.Context) {
Date: "29",
Ratio: "1:1000",
Amount: wallet.Amount,
Id: utils.Int64ToStr(user.Id),
Phone: user.Phone,
InviteCode: user.SystemInviteCode,
IsBindExtend: "0",
HeadImg: svc.GetOssUrl(user.Avatar),
}
if user.CustomInviteCode != "" {
resp.InviteCode = user.CustomInviteCode
}
if user.ParentUid > 0 {
resp.IsBindExtend = "1"
}
e.OutSuc(c, resp, nil)
return


+ 27
- 7
app/md/md_config.go View File

@@ -1,11 +1,31 @@
package md

type ConfigResp struct {
Title string `json:"title" example:"软件使用协议标题"`
Content string `json:"content" example:"软件使用协议内容"`
UserTitle string `json:"user_title" example:"用户协议标题"`
UserUrl string `json:"user_url" example:"用户协议链接"`
PrivacyTitle string `json:"privacy_title" example:"隐私协议标题"`
PrivacyUrl string `json:"privacy_url" example:"隐私协议链接"`
OssUrl string `json:"oss_url" example:"阿里云图片链接"`
Title string `json:"title" example:"软件使用协议标题"`
Content string `json:"content" example:"软件使用协议内容"`
UserTitle string `json:"user_title" example:"用户协议标题"`
UserUrl string `json:"user_url" example:"用户协议链接"`
PrivacyTitle string `json:"privacy_title" example:"隐私协议标题"`
PrivacyUrl string `json:"privacy_url" example:"隐私协议链接"`
OssUrl string `json:"oss_url" example:"阿里云图片链接"`
Guide []Guide `json:"guide"`
}
type VersionResp struct {
Version []Version `json:"version"`
IsAuditVersion string `json:"is_audit_version"`
}
type Version struct {
Type string `json:"type"`
Img string `json:"img"`
Name string `json:"name"`
Version string `json:"version"`
Url string `json:"url"`
Content string `json:"content"`
IsMust string `json:"is_must"`
}
type Guide struct {
BgImage string `json:"bg_image"`
BgImageUrl string `json:"bg_image_url"`
ContentImage string `json:"content_image"`
ContentImageUrl string `json:"content_image_url"`
}

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

@@ -11,6 +11,11 @@ type MemberCenterGetBasicResp struct {
Date string `json:"date"` // 兑换时间(每月x日)
Ratio string `json:"ratio"` // 兑换比例(x:y)
Amount string `json:"amount"` // 账户余额
Id string `json:"id"`
Phone string `json:"phone"`
InviteCode string `json:"invite_code"`
HeadImg string `json:"head_img"`
IsBindExtend string `json:"is_bind_extend" example:"是否绑定了上级 0否 1是"`
}

type UserEggFlowReqRespList struct {


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

@@ -58,6 +58,7 @@ func route(r *gin.RouterGroup) {
r.Any("/testCreateSign", hdl.TestCreateSign)
r.GET("/openApp/start", hdl.Start) //打开app调用
r.GET("/config", hdl.Config) //基本配置
r.GET("/version", hdl.Version) //版本数据
{
r.GET("/advertising", hdl.Advertising) //广告位
r.POST("/advertising/detail", hdl.AdvertisingDetail) //广告位
@@ -75,7 +76,6 @@ func route(r *gin.RouterGroup) {
r.Use(mw.Auth) // 以下接口需要JWT验证
rComm(r.Group("/comm"))
r.POST("/advertising/check", hdl.AdvertisingCheck) //广告位判断能不能看
r.GET("/userInfo", hdl.UserInfo) //用户基础信息
rHomePage := r.Group("/homePage")
{
rHomePage.GET("/index", hdl.HomePage) // 主页


+ 2
- 2
app/svc/svc_common.go View File

@@ -29,7 +29,7 @@ func GetOssDomain() string {
sysCfgDb := implement.NewSysCfgDb(db.Db, redisConn)
sysCfg := sysCfgDb.SysCfgFindWithDb("oss_domain", "oss_bucket_scheme")
http := sysCfg["oss_bucket_scheme"]
return http + "://" + sysCfg["oss_domain"]
return http + "://" + sysCfg["oss_domain"] + "/"
}
func GetOssUrl(img string) string {
redisConn := cache.GetPool().Get()
@@ -37,7 +37,7 @@ func GetOssUrl(img string) string {
sysCfg := sysCfgDb.SysCfgFindWithDb("oss_domain", "oss_bucket_scheme")
if strings.Contains(img, "http") == false && img != "" {
http := sysCfg["oss_bucket_scheme"]
img = http + "://" + sysCfg["oss_domain"] + img
img = http + "://" + sysCfg["oss_domain"] + "/" + img
}
return img
}


+ 117
- 0
docs/docs.go View File

@@ -2310,6 +2310,44 @@ const docTemplate = `{
}
}
},
"/api/v1/version": {
"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.VersionResp"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/v1/wallet/amountFlow": {
"get": {
"description": "余额明细(获取)",
@@ -2831,6 +2869,12 @@ const docTemplate = `{
"type": "string",
"example": "软件使用协议内容"
},
"guide": {
"type": "array",
"items": {
"$ref": "#/definitions/md.Guide"
}
},
"oss_url": {
"type": "string",
"example": "阿里云图片链接"
@@ -3340,6 +3384,23 @@ const docTemplate = `{
}
}
},
"md.Guide": {
"type": "object",
"properties": {
"bg_image": {
"type": "string"
},
"bg_image_url": {
"type": "string"
},
"content_image": {
"type": "string"
},
"content_image_url": {
"type": "string"
}
}
},
"md.HomePageResp": {
"type": "object",
"properties": {
@@ -3559,6 +3620,19 @@ const docTemplate = `{
"description": "蛋蛋分",
"type": "string"
},
"head_img": {
"type": "string"
},
"id": {
"type": "string"
},
"invite_code": {
"type": "string"
},
"is_bind_extend": {
"type": "string",
"example": "是否绑定了上级 0否 1是"
},
"level_name": {
"description": "会员等级名称",
"type": "string"
@@ -3567,6 +3641,9 @@ const docTemplate = `{
"description": "会员名称",
"type": "string"
},
"phone": {
"type": "string"
},
"ratio": {
"description": "兑换比例(x:y)",
"type": "string"
@@ -4173,6 +4250,46 @@ const docTemplate = `{
}
}
},
"md.Version": {
"type": "object",
"properties": {
"content": {
"type": "string"
},
"img": {
"type": "string"
},
"is_must": {
"type": "string"
},
"name": {
"type": "string"
},
"type": {
"type": "string"
},
"url": {
"type": "string"
},
"version": {
"type": "string"
}
}
},
"md.VersionResp": {
"type": "object",
"properties": {
"is_audit_version": {
"type": "string"
},
"version": {
"type": "array",
"items": {
"$ref": "#/definitions/md.Version"
}
}
}
},
"md.WalletFlowNode": {
"type": "object",
"properties": {


+ 117
- 0
docs/swagger.json View File

@@ -2303,6 +2303,44 @@
}
}
},
"/api/v1/version": {
"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.VersionResp"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/v1/wallet/amountFlow": {
"get": {
"description": "余额明细(获取)",
@@ -2824,6 +2862,12 @@
"type": "string",
"example": "软件使用协议内容"
},
"guide": {
"type": "array",
"items": {
"$ref": "#/definitions/md.Guide"
}
},
"oss_url": {
"type": "string",
"example": "阿里云图片链接"
@@ -3333,6 +3377,23 @@
}
}
},
"md.Guide": {
"type": "object",
"properties": {
"bg_image": {
"type": "string"
},
"bg_image_url": {
"type": "string"
},
"content_image": {
"type": "string"
},
"content_image_url": {
"type": "string"
}
}
},
"md.HomePageResp": {
"type": "object",
"properties": {
@@ -3552,6 +3613,19 @@
"description": "蛋蛋分",
"type": "string"
},
"head_img": {
"type": "string"
},
"id": {
"type": "string"
},
"invite_code": {
"type": "string"
},
"is_bind_extend": {
"type": "string",
"example": "是否绑定了上级 0否 1是"
},
"level_name": {
"description": "会员等级名称",
"type": "string"
@@ -3560,6 +3634,9 @@
"description": "会员名称",
"type": "string"
},
"phone": {
"type": "string"
},
"ratio": {
"description": "兑换比例(x:y)",
"type": "string"
@@ -4166,6 +4243,46 @@
}
}
},
"md.Version": {
"type": "object",
"properties": {
"content": {
"type": "string"
},
"img": {
"type": "string"
},
"is_must": {
"type": "string"
},
"name": {
"type": "string"
},
"type": {
"type": "string"
},
"url": {
"type": "string"
},
"version": {
"type": "string"
}
}
},
"md.VersionResp": {
"type": "object",
"properties": {
"is_audit_version": {
"type": "string"
},
"version": {
"type": "array",
"items": {
"$ref": "#/definitions/md.Version"
}
}
}
},
"md.WalletFlowNode": {
"type": "object",
"properties": {


+ 77
- 0
docs/swagger.yaml View File

@@ -256,6 +256,10 @@ definitions:
content:
example: 软件使用协议内容
type: string
guide:
items:
$ref: '#/definitions/md.Guide'
type: array
oss_url:
example: 阿里云图片链接
type: string
@@ -608,6 +612,17 @@ definitions:
- $ref: '#/definitions/pb.SendRedPacketResp'
description: im 返回体
type: object
md.Guide:
properties:
bg_image:
type: string
bg_image_url:
type: string
content_image:
type: string
content_image_url:
type: string
type: object
md.HomePageResp:
properties:
egg_energy_now_price:
@@ -763,12 +778,23 @@ definitions:
egg_score:
description: 蛋蛋分
type: string
head_img:
type: string
id:
type: string
invite_code:
type: string
is_bind_extend:
example: 是否绑定了上级 0否 1是
type: string
level_name:
description: 会员等级名称
type: string
nickname:
description: 会员名称
type: string
phone:
type: string
ratio:
description: 兑换比例(x:y)
type: string
@@ -1185,6 +1211,32 @@ definitions:
phone:
type: string
type: object
md.Version:
properties:
content:
type: string
img:
type: string
is_must:
type: string
name:
type: string
type:
type: string
url:
type: string
version:
type: string
type: object
md.VersionResp:
properties:
is_audit_version:
type: string
version:
items:
$ref: '#/definitions/md.Version'
type: array
type: object
md.WalletFlowNode:
properties:
after_amount:
@@ -2778,6 +2830,31 @@ paths:
summary: 用户信息
tags:
- 用户信息
/api/v1/version:
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.VersionResp'
"400":
description: 具体错误
schema:
$ref: '#/definitions/md.Response'
summary: 版本记录
tags:
- 基本配置
/api/v1/wallet/amountFlow:
get:
consumes:


+ 1
- 1
go.mod View File

@@ -32,7 +32,7 @@ require (
)

require (
code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241127023000-629023eee8c6
code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241127081813-15aa08a421b0
code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241126134228-b1047bfb8475
code.fnuoos.com/go_rely_warehouse/zyos_go_es.git v1.0.1-0.20241118083738-0f22da9ba0be
code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5


Loading…
Cancel
Save