Переглянути джерело

基本配置

广告位
master
huangjiajun 3 дні тому
джерело
коміт
4ceb8f3b9a
16 змінених файлів з 1099 додано та 51 видалено
  1. +35
    -0
      app/hdl/hdl_advertising.go
  2. +32
    -0
      app/hdl/hdl_article.go
  3. +45
    -0
      app/hdl/hdl_config.go
  4. +5
    -1
      app/hdl/hdl_login.go
  5. +6
    -3
      app/hdl/hdl_user.go
  6. +37
    -0
      app/md/md_advertising.go
  7. +10
    -0
      app/md/md_config.go
  8. +1
    -0
      app/md/md_user.go
  9. +14
    -7
      app/router/router.go
  10. +103
    -0
      app/svc/svc_advertising.go
  11. +22
    -1
      app/svc/svc_common.go
  12. +283
    -4
      docs/docs.go
  13. +281
    -1
      docs/swagger.json
  14. +192
    -1
      docs/swagger.yaml
  15. +1
    -1
      go.mod
  16. +32
    -32
      static/html/article.html

+ 35
- 0
app/hdl/hdl_advertising.go Переглянути файл

@@ -0,0 +1,35 @@
package hdl

import (
"applet/app/svc"
"github.com/gin-gonic/gin"
)

// Advertising
// @Summary 广告位
// @Tags 广告位
// @Description 广告位
// @Accept json
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @Success 200 {object} md.AdvertisingResp "具体数据"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/v1/advertising [get]
func Advertising(c *gin.Context) {
svc.Advertising(c)
}

// AdvertisingDetail
// @Summary 广告位详情
// @Tags 广告位详情
// @Description 广告位详情
// @Accept json
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @Param req body md.AdvertisingReq true "注册参数"
// @Success 200 {object} md.AdvertisingSpace "具体数据"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/v1/advertising/detail [post]
func AdvertisingDetail(c *gin.Context) {
svc.AdvertisingDetail(c)
}

+ 32
- 0
app/hdl/hdl_article.go Переглянути файл

@@ -0,0 +1,32 @@
package hdl

import (
"applet/app/db"
"applet/app/e"
"code.fnuoos.com/EggPlanet/egg_models.git/src/implement"
"github.com/gin-gonic/gin"
"html/template"
"net/http"
)

func ArticleHtml(c *gin.Context) {
articleId := c.Query("article_id")
if articleId == "" {
e.OutErr(c, e.ERR_INVALID_ARGS)
return
}
NewArticleDb := implement.NewArticleDb(db.Db)
article, err := NewArticleDb.GetArticle(articleId)
if err != nil {
e.OutErr(c, e.ERR_DB_ORM)
return
}
if article.Id == 0 {
e.OutErr(c, e.ERR_NO_DATA)
return
}
c.HTML(http.StatusOK, "article.html", gin.H{
"title": template.HTML(article.Title),
"content": article.Content,
})
}

+ 45
- 0
app/hdl/hdl_config.go Переглянути файл

@@ -0,0 +1,45 @@
package hdl

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"
"fmt"
"github.com/gin-gonic/gin"
)

// Config
// @Summary 基本配置
// @Tags 基本配置
// @Description 基本配置
// @Accept json
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @Success 200 {object} md.ConfigResp "具体数据"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/v1/config [get]
func Config(c *gin.Context) {
res := md.ConfigResp{}
eg := db.Db
NewArticleDb := implement.NewArticleDb(eg)
article, _ := NewArticleDb.ArticleCateByTypeId("1")
if article != nil {
res.Title = article.Title
res.Content = article.Content
}
userArticle, _ := NewArticleDb.ArticleCateByTypeId("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))
}
privacyArticle, _ := NewArticleDb.ArticleCateByTypeId("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))
}
e.OutSuc(c, res, nil)
return
}

+ 5
- 1
app/hdl/hdl_login.go Переглянути файл

@@ -154,7 +154,11 @@ func WechatLogin(c *gin.Context) {
userModel.OpenId = req.OpenID
userModel.Avatar = req.Avatar
userModel.Nickname = req.Nickname
newUserDb.UpdateUser(userModel, "open_id,avatar,nickname")
now := time.Now()
userModel.LastLoginAt = now.Format("2006-01-02 15:04:05")
userModel.LastLoginIp = utils.GetIP(c.Request)
userModel.UpdateAt = now.Format("2006-01-02 15:04:05")
newUserDb.UpdateUser(userModel, "open_id,avatar,nickname,last_login_ip,last_login_at,update_at")
token, err = svc.HandleLoginToken(userModel)
if err != nil {
e.OutErr(c, e.ERR, err.Error())


+ 6
- 3
app/hdl/hdl_user.go Переглянути файл

@@ -5,7 +5,6 @@ import (
"applet/app/md"
"applet/app/svc"
"applet/app/utils"
"fmt"
"github.com/gin-gonic/gin"
)

@@ -21,7 +20,6 @@ import (
// @Router /api/v1/userInfo [get]
func UserInfo(c *gin.Context) {
user := svc.GetUser(c)
fmt.Println(1233333)
res := md.UserInfoResp{
Id: utils.Int64ToStr(user.Id),
Phone: user.Phone,
@@ -29,6 +27,12 @@ func UserInfo(c *gin.Context) {
InviteCode: user.SystemInviteCode,
IsBindExtend: "0",
}
if user.Avatar == "" {
user.Avatar = svc.GetSysCfgStr("default_avatar")
}
if user.Avatar != "" {
res.HeadImg = svc.GetOssUrl(user.Avatar)
}
if user.CustomInviteCode != "" {
res.InviteCode = user.CustomInviteCode
}
@@ -36,6 +40,5 @@ func UserInfo(c *gin.Context) {
res.IsBindExtend = "1"
}
e.OutSuc(c, res, nil)
fmt.Println(1111111)
return
}

+ 37
- 0
app/md/md_advertising.go Переглянути файл

@@ -0,0 +1,37 @@
package md

type AdvertisingReq struct {
Id string `json:"id"`
}
type AdvertisingResp struct {
Basic AdvertisingBasic `json:"basic" `
Space []AdvertisingSpace `json:"space" `
Function []AdvertisingFunction `json:"function" `
Pop AdvertisingLimit `json:"pop" `
}
type AdvertisingBasic struct {
Info map[string]interface{} `json:"info" `
AndroidAdIsOpen string `json:"android_ad_is_open" example:"安卓广告是否开启(1:开启 0:不开启)"`
IosAdIsOpen string `json:"ios_ad_is_open" example:"ios广告是否开启(1:开启 0:不开启)"`
AndroidOpenAdIsOpen string `json:"android_open_ad_is_open" example:"安卓开屏广告是否开启(1:开启 0:不开启)"`
IosOpenAdIsOpen string `json:"ios_open_ad_is_open" example:"ios开屏广告是否开启(1:开启 0:不开启)"`
Voice string `json:"voice" example:"领取声音"`
}
type AdvertisingSpace struct {
Id string `json:"id" example:"id"`
Name string `json:"name" example:"名称"`
Kind string `json:"kind" example:"广告类型(1:开屏广告 2:插屏广告 3:激励视频 4:信息流广告)"`
Info map[string]interface{} `json:"info" `
CountingDown string `json:"counting_down" example:"倒计时 x秒"`
}
type AdvertisingFunction struct {
Name string `json:"name" example:"名称"`
Type string `json:"type" example:"位置"`
AdId string `json:"ad_id" example:"广告id"`
}
type AdvertisingLimit struct {
PublicImg string `json:"public_img" example:"公共弹窗图"`
PublicStr string `json:"public_str" example:"公共弹窗文字"`
WithdrawImg string `json:"withdraw_img" example:"提现弹窗图"`
WithdrawStr string `json:"withdraw_str" example:"提现弹窗文字"`
}

+ 10
- 0
app/md/md_config.go Переглянути файл

@@ -0,0 +1,10 @@
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:"隐私协议链接"`
}

+ 1
- 0
app/md/md_user.go Переглянути файл

@@ -5,5 +5,6 @@ type UserInfoResp struct {
Phone string `json:"phone"`
Nickname string `json:"nickname"`
InviteCode string `json:"invite_code"`
HeadImg string `json:"head_img"`
IsBindExtend string `json:"is_bind_extend" example:"是否绑定了上级 0否 1是"`
}

+ 14
- 7
app/router/router.go Переглянути файл

@@ -9,6 +9,7 @@ import (
"github.com/gin-gonic/gin"
swaggerFiles "github.com/swaggo/files"
ginSwagger "github.com/swaggo/gin-swagger"
"net/http"
)

// 初始化路由
@@ -31,6 +32,7 @@ func Init() *gin.Engine {
r.Use(gin.Logger())
}
r.Use(gin.Recovery())
r.Delims("<<<", ">>>").LoadHTMLGlob("static/html/*")

r.GET("/favicon.ico", func(c *gin.Context) {
c.Status(204)
@@ -47,18 +49,23 @@ func Init() *gin.Engine {
}

func route(r *gin.RouterGroup) {
r.StaticFS("/static", http.Dir("./static"))
r.GET("/test", hdl.Demo)
r.Any("/createSign", hdl.CreateSign)
r.Any("/aesDecryptByECB", hdl.AesDecryptByECB)
r.GET("/article/html", hdl.ArticleHtml) //H5渲染的文章
r.Use(mw.CheckSign)
r.Any("/testCreateSign", hdl.TestCreateSign)
r.POST("/smsSend", hdl.SmsSend) //发送短信
r.POST("/fastLogin", hdl.FastLogin) //一键登录
r.POST("/wechatLogin", hdl.WechatLogin) //微信登录
r.POST("/register", hdl.Register) //注册
r.POST("/login", hdl.Login) //登录
r.POST("/findPassword", hdl.FindPassword) //找回密码
r.Use(mw.Auth) // 以下接口需要JWT验证
r.GET("/config", hdl.Config) //基本配置
r.GET("/advertising", hdl.Advertising) //广告位
r.POST("/advertising/detail", hdl.AdvertisingDetail) //广告位
r.POST("/smsSend", hdl.SmsSend) //发送短信
r.POST("/fastLogin", hdl.FastLogin) //一键登录
r.POST("/wechatLogin", hdl.WechatLogin) //微信登录
r.POST("/register", hdl.Register) //注册
r.POST("/login", hdl.Login) //登录
r.POST("/findPassword", hdl.FindPassword) //找回密码
r.Use(mw.Auth) // 以下接口需要JWT验证
rComm(r.Group("/comm"))
r.GET("/userInfo", hdl.UserInfo) //用户基础信息
rHomePage := r.Group("/homePage")


+ 103
- 0
app/svc/svc_advertising.go Переглянути файл

@@ -0,0 +1,103 @@
package svc

import (
"applet/app/db"
"applet/app/e"
"applet/app/md"
"applet/app/utils"
"code.fnuoos.com/EggPlanet/egg_models.git/src/implement"
"encoding/json"
"github.com/gin-gonic/gin"
)

func Advertising(c *gin.Context) {
eg := db.Db

var res = md.AdvertisingResp{}
NewAdvertisingBasicDb := implement.NewAdvertisingBasicDb(eg)
NewAdvertisingBasic, _ := NewAdvertisingBasicDb.GetAdvertisingBasicDb()
if NewAdvertisingBasic != nil {
var info = make(map[string]interface{})
json.Unmarshal([]byte(NewAdvertisingBasic.Info), &info)
res.Basic = md.AdvertisingBasic{
Info: info,
AndroidAdIsOpen: utils.IntToStr(NewAdvertisingBasic.AndroidOpenAdIsOpen),
IosAdIsOpen: utils.IntToStr(NewAdvertisingBasic.IosAdIsOpen),
AndroidOpenAdIsOpen: utils.IntToStr(NewAdvertisingBasic.AndroidOpenAdIsOpen),
IosOpenAdIsOpen: utils.IntToStr(NewAdvertisingBasic.IosOpenAdIsOpen),
Voice: GetOssUrl(NewAdvertisingBasic.Voice),
}
}
NewAdvertisingLimitDb := implement.NewAdvertisingLimitDb(eg)
NewAdvertisingLimit, _ := NewAdvertisingLimitDb.GetAdvertisingLimit()
if NewAdvertisingLimit != nil {
res.Pop = md.AdvertisingLimit{
PublicImg: GetOssUrl(NewAdvertisingLimit.PublicImg),
PublicStr: NewAdvertisingLimit.PublicStr,
WithdrawImg: GetOssUrl(NewAdvertisingLimit.WithdrawImg),
WithdrawStr: NewAdvertisingLimit.WithdrawStr,
}
}
NewAdvertisingFunctionDb := implement.NewAdvertisingFunctionDb(eg)
NewAdvertisingFunction, _ := NewAdvertisingFunctionDb.AdvertisingFunctionAll()
AdvertisingFunctionTmp := make([]md.AdvertisingFunction, 0)
if NewAdvertisingFunction != nil {
for _, v := range *NewAdvertisingFunction {
tmp := md.AdvertisingFunction{
Name: v.Name,
Type: v.Type,
AdId: utils.IntToStr(v.AdId),
}
AdvertisingFunctionTmp = append(AdvertisingFunctionTmp, tmp)
}
}
res.Function = AdvertisingFunctionTmp
NewAdvertisingSpaceDb := implement.NewAdvertisingSpaceDb(eg)
NewAdvertisingSpace, _ := NewAdvertisingSpaceDb.AdvertisingSpaceAll()
NewAdvertisingSpaceTmp := make([]md.AdvertisingSpace, 0)
if NewAdvertisingSpace != nil {
for _, v := range *NewAdvertisingSpace {
var info = make(map[string]interface{})
json.Unmarshal([]byte(v.Info), &info)
tmp := md.AdvertisingSpace{
Id: utils.IntToStr(v.Id),
Name: v.Name,
Kind: utils.IntToStr(v.Kind),
Info: info,
CountingDown: utils.IntToStr(v.CountingDown),
}
NewAdvertisingSpaceTmp = append(NewAdvertisingSpaceTmp, tmp)
}
}
res.Space = NewAdvertisingSpaceTmp
e.OutSuc(c, res, nil)
return
}
func AdvertisingDetail(c *gin.Context) {
eg := db.Db
var req md.AdvertisingReq
err := c.ShouldBindJSON(&req)
if err != nil {
err = HandleValidateErr(err)
err1 := err.(e.E)
e.OutErr(c, err1.Code, err1.Error())
return
}
var res = md.AdvertisingSpace{}
NewAdvertisingSpaceDb := implement.NewAdvertisingSpaceDb(eg)
NewAdvertisingSpace, _ := NewAdvertisingSpaceDb.GetAdvertisingSpace(req.Id)
if NewAdvertisingSpace != nil {
var info = make(map[string]interface{})
json.Unmarshal([]byte(NewAdvertisingSpace.Info), &info)
tmp := md.AdvertisingSpace{
Id: utils.IntToStr(NewAdvertisingSpace.Id),
Name: NewAdvertisingSpace.Name,
Kind: utils.IntToStr(NewAdvertisingSpace.Kind),
Info: info,
CountingDown: utils.IntToStr(NewAdvertisingSpace.CountingDown),
}
res = tmp
}
e.OutSuc(c, res, nil)
return
}

+ 22
- 1
app/svc/svc_common.go Переглянути файл

@@ -1,6 +1,12 @@
package svc

import "applet/app/utils/logx"
import (
"applet/app/db"
"applet/app/utils/cache"
"applet/app/utils/logx"
"code.fnuoos.com/EggPlanet/egg_models.git/src/implement"
"strings"
)

// 简单的recover
func Rev() {
@@ -8,3 +14,18 @@ func Rev() {
_ = logx.Error(err)
}
}
func GetOssUrl(img string) string {
redisConn := cache.GetPool().Get()
sysCfgDb := implement.NewSysCfgDb(db.Db, redisConn)
sysCfg := sysCfgDb.SysCfgFindWithDb("file_bucket_scheme", "file_bucket_host")
if strings.Contains(img, "http") == false && img != "" {
img = sysCfg["file_bucket_scheme"] + "://" + sysCfg["file_bucket_host"] + img
}
return img
}
func GetSysCfgStr(key string) string {
redisConn := cache.GetPool().Get()
sysCfgDb := implement.NewSysCfgDb(db.Db, redisConn)
return sysCfgDb.SysCfgGetWithDb(key)

}

+ 283
- 4
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"
@@ -322,6 +323,91 @@ const docTemplate = `{
}
}
},
"/api/v1/advertising": {
"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.AdvertisingResp"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/v1/advertising/detail": {
"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.AdvertisingReq"
}
}
],
"responses": {
"200": {
"description": "具体数据",
"schema": {
"$ref": "#/definitions/md.AdvertisingSpace"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/v1/comm/getOssUrl": {
"get": {
"description": "上传许可链接(获取)",
@@ -360,6 +446,44 @@ const docTemplate = `{
}
}
},
"/api/v1/config": {
"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.ConfigResp"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/v1/fastLogin": {
"post": {
"description": "一键登录",
@@ -1026,7 +1150,9 @@ const docTemplate = `{
"name": "req",
"in": "body",
"required": true,
"schema": {}
"schema": {
"type": "object"
}
}
],
"responses": {
@@ -1143,6 +1269,129 @@ const docTemplate = `{
}
}
},
"md.AdvertisingBasic": {
"type": "object",
"properties": {
"android_ad_is_open": {
"type": "string",
"example": "安卓广告是否开启(1:开启 0:不开启)"
},
"android_open_ad_is_open": {
"type": "string",
"example": "安卓开屏广告是否开启(1:开启 0:不开启)"
},
"info": {
"type": "object",
"additionalProperties": true
},
"ios_ad_is_open": {
"type": "string",
"example": "ios广告是否开启(1:开启 0:不开启)"
},
"ios_open_ad_is_open": {
"type": "string",
"example": "ios开屏广告是否开启(1:开启 0:不开启)"
},
"voice": {
"type": "string",
"example": "领取声音"
}
}
},
"md.AdvertisingFunction": {
"type": "object",
"properties": {
"ad_id": {
"type": "string",
"example": "广告id"
},
"name": {
"type": "string",
"example": "名称"
},
"type": {
"type": "string",
"example": "位置"
}
}
},
"md.AdvertisingLimit": {
"type": "object",
"properties": {
"public_img": {
"type": "string",
"example": "公共弹窗图"
},
"public_str": {
"type": "string",
"example": "公共弹窗文字"
},
"withdraw_img": {
"type": "string",
"example": "提现弹窗图"
},
"withdraw_str": {
"type": "string",
"example": "提现弹窗文字"
}
}
},
"md.AdvertisingReq": {
"type": "object",
"properties": {
"id": {
"type": "string"
}
}
},
"md.AdvertisingResp": {
"type": "object",
"properties": {
"basic": {
"$ref": "#/definitions/md.AdvertisingBasic"
},
"function": {
"type": "array",
"items": {
"$ref": "#/definitions/md.AdvertisingFunction"
}
},
"pop": {
"$ref": "#/definitions/md.AdvertisingLimit"
},
"space": {
"type": "array",
"items": {
"$ref": "#/definitions/md.AdvertisingSpace"
}
}
}
},
"md.AdvertisingSpace": {
"type": "object",
"properties": {
"counting_down": {
"type": "string",
"example": "倒计时 x秒"
},
"id": {
"type": "string",
"example": "id"
},
"info": {
"type": "object",
"additionalProperties": true
},
"kind": {
"type": "string",
"example": "广告类型(1:开屏广告 2:插屏广告 3:激励视频 4:信息流广告)"
},
"name": {
"type": "string",
"example": "名称"
}
}
},
"md.BasalRateResp": {
"type": "object",
"properties": {
@@ -1180,6 +1429,35 @@ const docTemplate = `{
}
}
},
"md.ConfigResp": {
"type": "object",
"properties": {
"content": {
"type": "string",
"example": "软件使用协议内容"
},
"privacy_title": {
"type": "string",
"example": "隐私协议标题"
},
"privacy_url": {
"type": "string",
"example": "隐私协议链接"
},
"title": {
"type": "string",
"example": "软件使用协议标题"
},
"user_title": {
"type": "string",
"example": "用户协议标题"
},
"user_url": {
"type": "string",
"example": "用户协议链接"
}
}
},
"md.ContributionValueFlowNode": {
"type": "object",
"properties": {
@@ -1899,6 +2177,9 @@ const docTemplate = `{
"md.UserInfoResp": {
"type": "object",
"properties": {
"head_img": {
"type": "string"
},
"id": {
"type": "string"
},
@@ -1951,8 +2232,6 @@ var SwaggerInfo = &swag.Spec{
Description: "APP客户端-Api接口",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}

func init() {


+ 281
- 1
docs/swagger.json Переглянути файл

@@ -316,6 +316,91 @@
}
}
},
"/api/v1/advertising": {
"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.AdvertisingResp"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/v1/advertising/detail": {
"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.AdvertisingReq"
}
}
],
"responses": {
"200": {
"description": "具体数据",
"schema": {
"$ref": "#/definitions/md.AdvertisingSpace"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/v1/comm/getOssUrl": {
"get": {
"description": "上传许可链接(获取)",
@@ -354,6 +439,44 @@
}
}
},
"/api/v1/config": {
"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.ConfigResp"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/v1/fastLogin": {
"post": {
"description": "一键登录",
@@ -1020,7 +1143,9 @@
"name": "req",
"in": "body",
"required": true,
"schema": {}
"schema": {
"type": "object"
}
}
],
"responses": {
@@ -1137,6 +1262,129 @@
}
}
},
"md.AdvertisingBasic": {
"type": "object",
"properties": {
"android_ad_is_open": {
"type": "string",
"example": "安卓广告是否开启(1:开启 0:不开启)"
},
"android_open_ad_is_open": {
"type": "string",
"example": "安卓开屏广告是否开启(1:开启 0:不开启)"
},
"info": {
"type": "object",
"additionalProperties": true
},
"ios_ad_is_open": {
"type": "string",
"example": "ios广告是否开启(1:开启 0:不开启)"
},
"ios_open_ad_is_open": {
"type": "string",
"example": "ios开屏广告是否开启(1:开启 0:不开启)"
},
"voice": {
"type": "string",
"example": "领取声音"
}
}
},
"md.AdvertisingFunction": {
"type": "object",
"properties": {
"ad_id": {
"type": "string",
"example": "广告id"
},
"name": {
"type": "string",
"example": "名称"
},
"type": {
"type": "string",
"example": "位置"
}
}
},
"md.AdvertisingLimit": {
"type": "object",
"properties": {
"public_img": {
"type": "string",
"example": "公共弹窗图"
},
"public_str": {
"type": "string",
"example": "公共弹窗文字"
},
"withdraw_img": {
"type": "string",
"example": "提现弹窗图"
},
"withdraw_str": {
"type": "string",
"example": "提现弹窗文字"
}
}
},
"md.AdvertisingReq": {
"type": "object",
"properties": {
"id": {
"type": "string"
}
}
},
"md.AdvertisingResp": {
"type": "object",
"properties": {
"basic": {
"$ref": "#/definitions/md.AdvertisingBasic"
},
"function": {
"type": "array",
"items": {
"$ref": "#/definitions/md.AdvertisingFunction"
}
},
"pop": {
"$ref": "#/definitions/md.AdvertisingLimit"
},
"space": {
"type": "array",
"items": {
"$ref": "#/definitions/md.AdvertisingSpace"
}
}
}
},
"md.AdvertisingSpace": {
"type": "object",
"properties": {
"counting_down": {
"type": "string",
"example": "倒计时 x秒"
},
"id": {
"type": "string",
"example": "id"
},
"info": {
"type": "object",
"additionalProperties": true
},
"kind": {
"type": "string",
"example": "广告类型(1:开屏广告 2:插屏广告 3:激励视频 4:信息流广告)"
},
"name": {
"type": "string",
"example": "名称"
}
}
},
"md.BasalRateResp": {
"type": "object",
"properties": {
@@ -1174,6 +1422,35 @@
}
}
},
"md.ConfigResp": {
"type": "object",
"properties": {
"content": {
"type": "string",
"example": "软件使用协议内容"
},
"privacy_title": {
"type": "string",
"example": "隐私协议标题"
},
"privacy_url": {
"type": "string",
"example": "隐私协议链接"
},
"title": {
"type": "string",
"example": "软件使用协议标题"
},
"user_title": {
"type": "string",
"example": "用户协议标题"
},
"user_url": {
"type": "string",
"example": "用户协议链接"
}
}
},
"md.ContributionValueFlowNode": {
"type": "object",
"properties": {
@@ -1893,6 +2170,9 @@
"md.UserInfoResp": {
"type": "object",
"properties": {
"head_img": {
"type": "string"
},
"id": {
"type": "string"
},


+ 192
- 1
docs/swagger.yaml Переглянути файл

@@ -12,6 +12,92 @@ definitions:
description: 总数据量
type: integer
type: object
md.AdvertisingBasic:
properties:
android_ad_is_open:
example: 安卓广告是否开启(1:开启 0:不开启)
type: string
android_open_ad_is_open:
example: 安卓开屏广告是否开启(1:开启 0:不开启)
type: string
info:
additionalProperties: true
type: object
ios_ad_is_open:
example: ios广告是否开启(1:开启 0:不开启)
type: string
ios_open_ad_is_open:
example: ios开屏广告是否开启(1:开启 0:不开启)
type: string
voice:
example: 领取声音
type: string
type: object
md.AdvertisingFunction:
properties:
ad_id:
example: 广告id
type: string
name:
example: 名称
type: string
type:
example: 位置
type: string
type: object
md.AdvertisingLimit:
properties:
public_img:
example: 公共弹窗图
type: string
public_str:
example: 公共弹窗文字
type: string
withdraw_img:
example: 提现弹窗图
type: string
withdraw_str:
example: 提现弹窗文字
type: string
type: object
md.AdvertisingReq:
properties:
id:
type: string
type: object
md.AdvertisingResp:
properties:
basic:
$ref: '#/definitions/md.AdvertisingBasic'
function:
items:
$ref: '#/definitions/md.AdvertisingFunction'
type: array
pop:
$ref: '#/definitions/md.AdvertisingLimit'
space:
items:
$ref: '#/definitions/md.AdvertisingSpace'
type: array
type: object
md.AdvertisingSpace:
properties:
counting_down:
example: 倒计时 x秒
type: string
id:
example: id
type: string
info:
additionalProperties: true
type: object
kind:
example: 广告类型(1:开屏广告 2:插屏广告 3:激励视频 4:信息流广告)
type: string
name:
example: 名称
type: string
type: object
md.BasalRateResp:
properties:
basal_rate:
@@ -39,6 +125,27 @@ definitions:
description: 收益倒计时
type: string
type: object
md.ConfigResp:
properties:
content:
example: 软件使用协议内容
type: string
privacy_title:
example: 隐私协议标题
type: string
privacy_url:
example: 隐私协议链接
type: string
title:
example: 软件使用协议标题
type: string
user_title:
example: 用户协议标题
type: string
user_url:
example: 用户协议链接
type: string
type: object
md.ContributionValueFlowNode:
properties:
amount:
@@ -534,6 +641,8 @@ definitions:
type: object
md.UserInfoResp:
properties:
head_img:
type: string
id:
type: string
invite_code:
@@ -772,6 +881,62 @@ paths:
summary: 蛋蛋星球-添加好友-总速率(获取)
tags:
- 添加好友
/api/v1/advertising:
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.AdvertisingResp'
"400":
description: 具体错误
schema:
$ref: '#/definitions/md.Response'
summary: 广告位
tags:
- 广告位
/api/v1/advertising/detail:
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.AdvertisingReq'
produces:
- application/json
responses:
"200":
description: 具体数据
schema:
$ref: '#/definitions/md.AdvertisingSpace'
"400":
description: 具体错误
schema:
$ref: '#/definitions/md.Response'
summary: 广告位详情
tags:
- 广告位详情
/api/v1/comm/getOssUrl:
get:
consumes:
@@ -797,6 +962,31 @@ paths:
summary: 通用请求-对象存储-上传许可链接(获取)
tags:
- 对象存储
/api/v1/config:
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.ConfigResp'
"400":
description: 具体错误
schema:
$ref: '#/definitions/md.Response'
summary: 基本配置
tags:
- 基本配置
/api/v1/fastLogin:
post:
consumes:
@@ -1232,7 +1422,8 @@ paths:
in: body
name: req
required: true
schema: {}
schema:
type: object
produces:
- application/json
responses:


+ 1
- 1
go.mod Переглянути файл

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

require (
code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241122113411-25d1f2bb1ad8
code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241123072806-2fc832067f77
code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241123034858-48fbf35fcb21
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


+ 32
- 32
static/html/article.html Переглянути файл

@@ -1,22 +1,26 @@

<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{.title}}</title>
<title><<<.title>>></title>
</head>

<script src="https://cdn.jsdelivr.net/npm/vue@2.6.11"></script>
<!--<script src="http://ossn.izhim.net/vue.js"></script>-->

<style>
* {
padding: 0;
margin: 0;
margin: 0 1%;
overflow: auto;
user-select: text;
}

img {
max-width: 100%
}

#app {
padding: 1.5rem;
width: 100vw;
@@ -37,12 +41,12 @@
float: left;
}

.floatLeft>h4 {
.floatLeft > h4 {
display: inline-block;
font-size: 1rem;
}

.floatLeft>span {
.floatLeft > span {
border-left: 1px solid rgb(151, 150, 150);
padding-left: .5rem;
height: .8rem;
@@ -51,11 +55,12 @@
color: rgb(151, 150, 150);
margin-left: .2rem;
}

.floatRight {
float: right;
font-size: .8rem;
color: rgb(151, 150, 150);
}

.vHmtl {
@@ -64,32 +69,27 @@
height: auto;
}
</style>

<script>
window.onload = function () {
var insertDiv = document.getElementById("insert");
insertDiv.innerHTML = "<<<.content>>>";
};
</script>
<body>
<div id="app">
<header>
<h3>{{.title}}</h3>
<div class="slogan-time">
<div class="floatLeft">
<h4>{{.author}}</h4>
<span>{{.time}}</span>
</div>

<div class="floatRight">
{{.studyCount}}人已学习
</div>
</div>
</header>
<div class="vHmtl" v-html="hello"></div>
</div>
<div id="#app">
<header>
<h3 style="text-align: center;"><<<.title>>></h3>
</header>
<div class="vHmtl" id="insert"></div>
</div>
</body>
</html>
<script>
new Vue({
el: '#app', // 选择器
data: {
hello: '<p style="color:#ff0000">{{.content}}</p>'
}
})
</script>
<!--<script>-->
<!-- new Vue({-->
<!-- el: '#app', // 选择器-->
<!-- data: {-->
<!-- hello: '<p style="color:#ff0000"><<<.content>>></p>'-->
<!-- }-->
<!-- })-->
<!--</script>-->


Завантаження…
Відмінити
Зберегти