Browse Source

update

adv_callback
dengbiao 1 week ago
parent
commit
3a568657c5
17 changed files with 1096 additions and 233 deletions
  1. +33
    -0
      app/es/hdl/es.go
  2. +23
    -0
      app/es/md/es.go
  3. +6
    -6
      app/hdl/hdl_add_friend.go
  4. +15
    -0
      app/hdl/hdl_advertising.go
  5. +65
    -16
      app/hdl/hdl_callback_advertising.go
  6. +1
    -1
      app/hdl/hdl_home_page.go
  7. +10
    -1
      app/hdl/hdl_points_center.go
  8. +142
    -0
      app/hdl/hdl_user.go
  9. +6
    -6
      app/md/md_add_friend.go
  10. +3
    -0
      app/md/md_advertising.go
  11. +1
    -1
      app/md/md_home_page.go
  12. +14
    -1
      app/md/md_login.go
  13. +11
    -3
      app/router/router.go
  14. +22
    -0
      app/svc/svc_advertising.go
  15. +280
    -75
      docs/docs.go
  16. +278
    -72
      docs/swagger.json
  17. +186
    -51
      docs/swagger.yaml

+ 33
- 0
app/es/hdl/es.go View File

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

import (
"applet/app/utils"
"code.fnuoos.com/go_rely_warehouse/zyos_go_es.git/es"
"context"
"github.com/olivere/elastic/v7"
)

func EsSelect(ctx context.Context, index string, query elastic.Query, trackTotalHits bool, arg map[string]string) (*elastic.SearchResult, error) {
if arg["size"] == "" {
arg["size"] = arg["limit"]
}
result, err := es.EsClient.Search().
Index(index).
TrackTotalHits(trackTotalHits).
Query(query). // 设置查询条件
Size(utils.StrToInt(arg["size"])). // 设置分页参数 - 每页大小,设置为0,代表不返回搜索结果,仅返回聚合分析结果
From((utils.StrToInt(arg["p"]) - 1) * utils.StrToInt(arg["size"])).
Pretty(true). // 返回可读的json格式
Do(ctx)
return result, err
}
func EsSelectOne(ctx context.Context, index string, query elastic.Query, trackTotalHits bool) (*elastic.SearchResult, error) {
result, err := es.EsClient.Search().
Index(index).
TrackTotalHits(trackTotalHits).
Query(query). // 设置查询条件
Size(1). // 设置分页参数 - 每页大小,设置为0,代表不返回搜索结果,仅返回聚合分析结果
Pretty(true). // 返回可读的json格式
Do(ctx)
return result, err
}

+ 23
- 0
app/es/md/es.go View File

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

const EggUserShortLink = "egg_user_short_link"
const EggUserShortLinkMap = `
{
"settings" : {
"number_of_shards" : 2,
"number_of_replicas" : 1
},
"mappings":{
"properties":{
"uid":{
"type": "integer"
},
"link":{
"type": "keyword"
},
"short_link":{
"type": "keyword"
}
}
}
}`

+ 6
- 6
app/hdl/hdl_add_friend.go View File

@@ -736,8 +736,8 @@ func NineDimensionalSpace(c *gin.Context) {
}
list = append(list, md.SpaceListNode{
Name: utils.IntToStr(i) + "维",
MaxCount: utils.Float64ToStr(maxCount),
NowCount: utils.Int64ToStr(nowUserCount),
MaxCount: int(maxCount),
NowCount: int(nowUserCount),
})
spaceTotalNums += maxCount
}
@@ -750,11 +750,11 @@ func NineDimensionalSpace(c *gin.Context) {
resp := md.NineDimensionalSpaceResp{
Rows: utils.IntToStr(row),
Times: utils.IntToStr(times),
SpaceTotalNums: utils.Float64ToStr(spaceTotalNums),
SpaceNums: utils.Int64ToStr(hasUserCount),
SpaceTotalNums: int(spaceTotalNums),
SpaceNums: int(hasUserCount),
SpaceList: list,
ALotOfNums: utils.Float64ToStr(spaceTotalNums),
DayNum: utils.IntToStr(setting.SystemPunishReplaceValue),
ALotOfNums: int(spaceTotalNums),
DayNum: setting.SystemPunishReplaceValue,
}

e.OutSuc(c, resp, nil)


+ 15
- 0
app/hdl/hdl_advertising.go View File

@@ -48,3 +48,18 @@ func AdvertisingDetail(c *gin.Context) {
func AdvertisingCheck(c *gin.Context) {
svc.AdvertisingCheck(c)
}

// AdvertisingState
// @Summary 广告状态 看完之后拿到广告唯一值
// @Tags 广告位
// @Description 广告状态 看完之后拿到广告唯一值
// @Accept json
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @Param req body md.AdvertisingReq true "注册参数"
// @Success 200 {object} md.AdvertisingState "具体数据"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/v1/advertising/state [post]
func AdvertisingState(c *gin.Context) {
svc.AdvertisingState(c)
}

+ 65
- 16
app/hdl/hdl_callback_advertising.go View File

@@ -23,24 +23,13 @@ func CallbackChuanshanjia(c *gin.Context) {
sign := c.Query("sign")
extra := c.Query("extra")
id := gjson.Get(extra, "id").String()
types := gjson.Get(extra, "type").String()
phonePlatform := strings.ToLower(gjson.Get(extra, "platform").String())
platform := "chuanshanjia"
NewAdvertisingSpaceDb := implement.NewAdvertisingSpaceDb(db.Db)
space, _ := NewAdvertisingSpaceDb.GetAdvertisingSpace(id)
if space == nil {
isEnd, spaceKey := comm(c, id, primeRit, platform, phonePlatform)
if isEnd == 1 {
c.String(200, "{\"is_verify\":true,\"reason\":20000}")
return
}
spaceData := gjson.Get(space.Info, platform+"."+phonePlatform+"_ad_id").String()
spaceList := make([]map[string]string, 0)
json.Unmarshal([]byte(spaceData), &spaceList)
spaceKey := ""
for _, v := range spaceList {
if v["id"] == primeRit { //找到对应广告位的key
spaceKey = v["key"]
}
}
keyStr := spaceKey + ":" + transId
// 1. 使用SHA256算法计算摘要
hash := sha256.Sum256([]byte(keyStr))
@@ -51,10 +40,54 @@ func CallbackChuanshanjia(c *gin.Context) {
c.String(200, "{\"is_verify\":true,\"reason\":50002}")
return
}
isEnds := commDoing(c, platform, transId, userId, extra, primeRit)
if isEnds == 1 {
c.String(200, "{\"is_verify\":true,\"reason\":20000}")
return
}
c.String(200, "{\"is_verify\":true,\"reason\":20000}")
return
}
func CallbackYoulianghui(c *gin.Context) {
userId := c.Query("userid")
transId := c.Query("transid")
primeRit := c.Query("pid")
sign := c.Query("sig")
extra := c.Query("extrainfo")
id := gjson.Get(extra, "id").String()
phonePlatform := strings.ToLower(gjson.Get(extra, "platform").String())
platform := "youlianghui"
isEnd, spaceKey := comm(c, id, primeRit, platform, phonePlatform)
if isEnd == 1 {
c.String(200, "success")
return
}
keyStr := spaceKey + ":" + transId
// 1. 使用SHA256算法计算摘要
hash := sha256.Sum256([]byte(keyStr))
// 2. 将摘要转换为十六进制字符串
signStr := hex.EncodeToString(hash[:])
fmt.Println(signStr)
if strings.Contains(signStr, sign) == false {
c.String(200, "success")
return
}
isEnds := commDoing(c, platform, transId, userId, extra, primeRit)
if isEnds == 1 {
c.String(200, "success")
return
}
c.String(200, "success")
return
}

// 公共处理
func commDoing(c *gin.Context, platform, transId, userId, extra, primeRit string) int {
types := gjson.Get(extra, "type").String()
exist, _ := db.Db.Where("platform=? and oid=?", platform, transId).Exist(&model.AdvertisingCallback{})
if exist {
c.String(200, "{\"is_verify\":true,\"reason\":20000}")
return
return 1
}
var tmp = model.AdvertisingCallback{
Platform: platform,
@@ -83,6 +116,22 @@ func CallbackChuanshanjia(c *gin.Context) {
ch.PublishV2(md.EggAdvertisingQueueExchange, arg, md.EggAdvertisingSign)
}
}
c.String(200, "{\"is_verify\":true,\"reason\":20000}")
return
return 0
}
func comm(c *gin.Context, id, primeRit, platform, phonePlatform string) (int, string) {
NewAdvertisingSpaceDb := implement.NewAdvertisingSpaceDb(db.Db)
space, _ := NewAdvertisingSpaceDb.GetAdvertisingSpace(id)
if space == nil {
return 1, ""
}
spaceData := gjson.Get(space.Info, platform+"."+phonePlatform+"_ad_id").String()
spaceList := make([]map[string]string, 0)
json.Unmarshal([]byte(spaceData), &spaceList)
spaceKey := ""
for _, v := range spaceList {
if v["id"] == primeRit { //找到对应广告位的key
spaceKey = v["key"]
}
}
return 0, spaceKey
}

+ 1
- 1
app/hdl/hdl_home_page.go View File

@@ -313,7 +313,7 @@ func RealTimePrice(c *gin.Context) {
}

resp := md.RealTimePriceResp{
UserCount: utils.AnyToString(userCount),
UserCount: utils.AnyToInt64(userCount),
NowPrice: utils.AnyToString(nowPrice),
IsRises: isRisesResp,
Rises: utils.AnyToString(risesValue),


+ 10
- 1
app/hdl/hdl_points_center.go View File

@@ -746,7 +746,16 @@ func GetEggPointRecord(c *gin.Context) {

list, nowScore, indexNum, err := svc.GetEggPointRecordBase(now, user.Id, page, limit)
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
resp := md.GetEggPointRecordResp{
NowScore: "0",
List: nil,
Paginate: md.Paginate{
Limit: limit,
Page: page,
Total: 0,
},
}
e.OutSuc(c, resp, nil)
return
}



+ 142
- 0
app/hdl/hdl_user.go View File

@@ -3,13 +3,23 @@ package hdl
import (
"applet/app/db"
"applet/app/e"
"applet/app/es/hdl"
md2 "applet/app/es/md"
"applet/app/md"
"applet/app/svc"
"applet/app/utils"
"applet/app/utils/qrcode"
"code.fnuoos.com/EggPlanet/egg_models.git/src/implement"
"code.fnuoos.com/EggPlanet/egg_models.git/src/model"
"code.fnuoos.com/EggPlanet/egg_system_rules.git/aliyun"
"code.fnuoos.com/EggPlanet/egg_system_rules.git/kuaizhan"
"code.fnuoos.com/go_rely_warehouse/zyos_go_es.git/es"
"context"
"github.com/gin-gonic/gin"
"github.com/olivere/elastic/v7"
"github.com/syyongx/php2go"
"github.com/tidwall/gjson"
"strings"
)

// UserInfo
@@ -172,3 +182,135 @@ func UserBindParent(c *gin.Context) {
e.OutSuc(c, "success", nil)
return
}

// UpdatePassword
// @Summary 修改密码-不要原密码 换成验证码
// @Tags 账号与安全
// @Description 修改密码
// @Accept json
// @Produce json
// @Param req body md.UpdatePasswordReq true "注册参数"
// @Success 200 string "登录成功返回"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/v1/memberCenter/updatePassword [post]
func UpdatePassword(c *gin.Context) {
var req md.UpdatePasswordReq
err := c.ShouldBindJSON(&req)
if err != nil {
err = svc.HandleValidateErr(err)
err1 := err.(e.E)
e.OutErr(c, err1.Code, err1.Error())
return
}
user := svc.GetUser(c)
data := svc.AliyunSmsBase(c, "")
//校验短信
err = aliyun.AliyunCheckSms(data["aliyun_sms_id"], data["aliyun_sms_secret"], user.Phone, req.Code)
if err != nil {
e.OutErr(c, 400, e.NewErr(400, "验证码错误,请重试"))
return
}
user.Password = utils.Md5(req.Password)
db.Db.Where("id=?", user.Id).Cols("password").Update(user)
e.OutSuc(c, "success", nil)
return
}

// UpdatePasscode
// @Summary 修改支付宝密码
// @Tags 账号与安全
// @Description 修改支付宝密码
// @Accept json
// @Produce json
// @Param req body md.UpdatePasscodeReq true "注册参数"
// @Success 200 string "登录成功返回"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/v1/memberCenter/updatePasscode [post]
func UpdatePasscode(c *gin.Context) {
var req md.UpdatePasscodeReq
err := c.ShouldBindJSON(&req)
if err != nil {
err = svc.HandleValidateErr(err)
err1 := err.(e.E)
e.OutErr(c, err1.Code, err1.Error())
return
}
user := svc.GetUser(c)
data := svc.AliyunSmsBase(c, "")
//校验短信
err = aliyun.AliyunCheckSms(data["aliyun_sms_id"], data["aliyun_sms_secret"], user.Phone, req.Code)
if err != nil {
e.OutErr(c, 400, e.NewErr(400, "验证码错误,请重试"))
return
}
user.Passcode = utils.Md5(req.PassCode)
db.Db.Where("id=?", user.Id).Cols("passcode").Update(user)
e.OutSuc(c, "success", nil)
return
}

// InviteUrl
// @Summary 邀请链接
// @Tags 邀请海报
// @Description 邀请链接
// @Accept json
// @Produce json
// @Success 200 {object} md.InviteUrl "登录成功返回"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/v1/memberCenter/inviteUrl [get]
func InviteUrl(c *gin.Context) {
user := svc.GetUser(c)

link := svc.GetSysCfgStr("kuaizhan_url")
res := md.InviteUrl{
Link: "",
InviteCode: user.SystemInviteCode,
}
if user.CustomInviteCode != "" {
res.InviteCode = user.CustomInviteCode
}
link += "?inviteCode=" + res.InviteCode
EggUserShortLink := md2.EggUserShortLink
boolQueryToItem := elastic.NewBoolQuery() // 创建bool查询
aggsMatch := elastic.NewMatchQuery("link", link) //设置查询条件
boolQueryToItem.Must(aggsMatch)
result, _ := hdl.EsSelectOne(context.Background(), EggUserShortLink, boolQueryToItem, false)
isHas := 0
if result != nil && len(result.Hits.Hits) > 0 {
for _, hit := range result.Hits.Hits {
if hit == nil {
continue
}
jsonByte, _ := hit.Source.MarshalJSON()
if gjson.Get(string(jsonByte), "short_link").String() != "" {
isHas = 1
link = gjson.Get(string(jsonByte), "short_link").String()
}
}
}
if isHas == 0 {
send, _ := kuaizhan.KuaizhanSend(svc.GetSysCfgStr("kuaizhan_app_key"), svc.GetSysCfgStr("kuaizhan_app_secret"), link)
if gjson.Get(send, "url").String() != "" {
var uniqueId = php2go.Md5(link)
oldLink := link
link = gjson.Get(send, "url").String()
tmp := map[string]interface{}{
"uid": user.Id,
"link": oldLink,
"short_link": link,
}
doc, _ := es.FirstDoc(EggUserShortLink, uniqueId)
if doc == nil {
es.CreateDoc(EggUserShortLink, uniqueId, tmp)
} else {
es.UpdateDoc(EggUserShortLink, uniqueId, tmp)
}
}
}
res.Link = link
QRcode := qrcode.GetPNGBase64(link)
QRcode = strings.ReplaceAll(QRcode, "\u0000", "")
res.Qrcode = QRcode
e.OutSuc(c, res, nil)
return
}

+ 6
- 6
app/md/md_add_friend.go View File

@@ -72,18 +72,18 @@ type MyFansUserListResp struct {

type SpaceListNode struct {
Name string `json:"name"` // 维度
MaxCount string `json:"max_count"` // 最大容纳人数
NowCount string `json:"now_count"` // 当前人数
MaxCount int `json:"max_count"` // 最大容纳人数
NowCount int `json:"now_count"` // 当前人数
}

type NineDimensionalSpaceResp struct {
Rows string `json:"rows"` // 行数
Times string `json:"times"` // 排数
SpaceTotalNums string `json:"space_total_nums"` // 空间总数
SpaceNums string `json:"space_nums"` // 空间人数
SpaceTotalNums int `json:"space_total_nums"` // 空间总数
SpaceNums int `json:"space_nums"` // 空间人数
SpaceList []SpaceListNode `json:"space_list"` // 数据列表
ALotOfNums string `json:"a_lot_of_nums"` // 全网至多用户数
DayNum string `json:"day_num"` // 连续x天不活跃
ALotOfNums int `json:"a_lot_of_nums"` // 全网至多用户数
DayNum int `json:"day_num"` // 连续x天不活跃
}

type BasalRateResp struct {


+ 3
- 0
app/md/md_advertising.go View File

@@ -27,6 +27,9 @@ type AdvertisingSpace struct {
type AdvertisingCheck struct {
IsCanVisit string `json:"is_can_visit"`
}
type AdvertisingState struct {
IsSuccess string `json:"is_success"`
}
type AdvertisingFunction struct {
Name string `json:"name" example:"名称"`
Type string `json:"type" example:"位置"`


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

@@ -19,7 +19,7 @@ type HomePageWatchAdRuleResp struct {
}

type RealTimePriceResp struct {
UserCount string `json:"user_count"` // 用户数
UserCount int64 `json:"user_count"` // 用户数
NowPrice string `json:"now_price"` // 当前价格
IsRises bool `json:"is_rises"` // 是否涨/跌价
Rises string `json:"rises"` // 涨价幅度(百分比)


+ 14
- 1
app/md/md_login.go View File

@@ -2,7 +2,7 @@ package md

type SmsSendReq struct {
Mobile string `json:"mobile" binding:"required"`
Type string `json:"type" example:"h5Register:h5注册页、wechatBindPhone:微信绑定手机、login:登陆、findPwd:找回密码、changePwd:修改密码"`
Type string `json:"type" example:"h5Register:h5注册页、wechatBindPhone:微信绑定手机、login:登陆、findPwd:找回密码、changePwd:修改密码、changePasscode:修改支付密码"`
LotNumber string `json:"lot_number" example:"阿里云图形验证码对应参数"`
GenTime string `json:"gen_time" example:"阿里云图形验证码对应参数"`
CaptchaOutput string `json:"captcha_output" example:"阿里云图形验证码对应参数"`
@@ -26,6 +26,14 @@ type FindPasswordReq struct {
Code string `json:"code" example:"验证码"`
Password string `json:"password" example:"密码 如 123"`
}
type UpdatePasswordReq struct {
Code string `json:"code" example:"验证码"`
Password string `json:"password" example:"密码 如 123"`
}
type UpdatePasscodeReq struct {
Code string `json:"code" example:"验证码"`
PassCode string `json:"passcode" example:"密码 如 123"`
}
type WechatLoginReq struct {
OpenID string `json:"open_id" example:"微信openId"`
UnionId string `json:"union_id" example:"微信UnionId"`
@@ -46,3 +54,8 @@ type LoginReq struct {
type LoginResponse struct {
Token string `json:"token"`
}
type InviteUrl struct {
Link string `json:"link"`
InviteCode string `json:"invite_code"`
Qrcode string `json:"qrcode"`
}

+ 11
- 3
app/router/router.go View File

@@ -57,6 +57,7 @@ func route(r *gin.RouterGroup) {
rCallback := r.Group("/callback")
{
rCallback.GET("/advertising/chuanshanjia", hdl.CallbackChuanshanjia) //穿山甲广告回调
rCallback.GET("/advertising/youlianghui", hdl.CallbackYoulianghui) //优量汇广告回调
}

r.Use(mw.CheckSign)
@@ -80,7 +81,11 @@ func route(r *gin.RouterGroup) {
r.GET("/getModuleSetting", hdl.GetModuleSetting) // 获取页面样式
r.Use(mw.Auth) // 以下接口需要JWT验证
rComm(r.Group("/comm"))
r.POST("/advertising/check", hdl.AdvertisingCheck) //广告位判断能不能看

{
r.POST("/advertising/check", hdl.AdvertisingCheck) //广告位判断能不能看
r.POST("/advertising/state", hdl.AdvertisingState) //广告位状态
}

rHomePage := r.Group("/homePage")
{
@@ -102,8 +107,11 @@ func route(r *gin.RouterGroup) {
}
rMemberCenter := r.Group("/memberCenter")
{
rMemberCenter.GET("/getBasic", hdl.MemberCenterGetBasic) // 会员中心-基础数据
rMemberCenter.POST("/bindParent", hdl.UserBindParent) //绑定上级
rMemberCenter.GET("/getBasic", hdl.MemberCenterGetBasic) // 会员中心-基础数据
rMemberCenter.POST("/bindParent", hdl.UserBindParent) //绑定上级
rMemberCenter.POST("/updatePassword", hdl.UpdatePassword) //修改密码
rMemberCenter.POST("/updatePasscode", hdl.UpdatePasscode) //修改支付密码
rMemberCenter.GET("/inviteUrl", hdl.InviteUrl) //邀请链接
}
rPointsCenter := r.Group("/pointsCenter") // 积分中心
{


+ 22
- 0
app/svc/svc_advertising.go View File

@@ -6,6 +6,7 @@ import (
"applet/app/md"
"applet/app/utils"
"code.fnuoos.com/EggPlanet/egg_models.git/src/implement"
"code.fnuoos.com/EggPlanet/egg_models.git/src/model"
"encoding/json"
"fmt"
"github.com/gin-gonic/gin"
@@ -115,6 +116,27 @@ func AdvertisingCheck(c *gin.Context) {
e.OutSuc(c, res, nil)
return
}
func AdvertisingState(c *gin.Context) {
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
}
isSuccess := "0"
var data model.AdvertisingCallback
db.Db.Where("oid=? ", req.Id).Get(&data)
if data.Id > 0 {
isSuccess = "1"
}
res := md.AdvertisingState{
IsSuccess: isSuccess,
}
e.OutSuc(c, res, nil)
return
}
func AdvertisingDetail(c *gin.Context) {
eg := db.Db
var req md.AdvertisingReq


+ 280
- 75
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"
@@ -454,6 +455,53 @@ const docTemplate = `{
}
}
},
"/api/v1/advertising/state": {
"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.AdvertisingState"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/v1/college/cate": {
"get": {
"description": "蛋蛋学院-分类",
@@ -1471,6 +1519,115 @@ const docTemplate = `{
}
}
},
"/api/v1/memberCenter/inviteUrl": {
"get": {
"description": "邀请链接",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"邀请海报"
],
"summary": "邀请链接",
"responses": {
"200": {
"description": "登录成功返回",
"schema": {
"$ref": "#/definitions/md.InviteUrl"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/v1/memberCenter/updatePasscode": {
"post": {
"description": "修改支付宝密码",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"账号与安全"
],
"summary": "修改支付宝密码",
"parameters": [
{
"description": "注册参数",
"name": "req",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.UpdatePasscodeReq"
}
}
],
"responses": {
"200": {
"description": "登录成功返回",
"schema": {
"type": "string"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/v1/memberCenter/updatePassword": {
"post": {
"description": "修改密码",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"账号与安全"
],
"summary": "修改密码-不要原密码 换成验证码",
"parameters": [
{
"description": "注册参数",
"name": "req",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.UpdatePasswordReq"
}
}
],
"responses": {
"200": {
"description": "登录成功返回",
"schema": {
"type": "string"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/v1/openApp/start": {
"get": {
"description": "打开app调用",
@@ -2063,7 +2220,9 @@ const docTemplate = `{
"name": "req",
"in": "body",
"required": true,
"schema": {}
"schema": {
"type": "object"
}
}
],
"responses": {
@@ -2552,6 +2711,68 @@ 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": {
@@ -2709,6 +2930,14 @@ const docTemplate = `{
}
}
},
"md.AdvertisingState": {
"type": "object",
"properties": {
"is_success": {
"type": "string"
}
}
},
"md.BasalRateResp": {
"type": "object",
"properties": {
@@ -3501,6 +3730,20 @@ const docTemplate = `{
}
}
},
"md.InviteUrl": {
"type": "object",
"properties": {
"invite_code": {
"type": "string"
},
"link": {
"type": "string"
},
"qrcode": {
"type": "string"
}
}
},
"md.IsCanGetRedPackageResp": {
"type": "object",
"properties": {
@@ -3642,11 +3885,11 @@ const docTemplate = `{
"properties": {
"a_lot_of_nums": {
"description": "全网至多用户数",
"type": "string"
"type": "integer"
},
"day_num": {
"description": "连续x天不活跃",
"type": "string"
"type": "integer"
},
"rows": {
"description": "行数",
@@ -3661,11 +3904,11 @@ const docTemplate = `{
},
"space_nums": {
"description": "空间人数",
"type": "string"
"type": "integer"
},
"space_total_nums": {
"description": "空间总数",
"type": "string"
"type": "integer"
},
"times": {
"description": "排数",
@@ -3745,7 +3988,7 @@ const docTemplate = `{
},
"user_count": {
"description": "用户数",
"type": "string"
"type": "integer"
}
}
},
@@ -3756,7 +3999,7 @@ const docTemplate = `{
"description": "红包详情信息",
"allOf": [
{
"$ref": "#/definitions/model.ImSendRedPackageOrd"
"$ref": "#/definitions/code_fnuoos_com_EggPlanet_egg_models_git_src_model.ImSendRedPackageOrd"
}
]
},
@@ -3986,7 +4229,7 @@ const docTemplate = `{
},
"type": {
"type": "string",
"example": "h5Register:h5注册页、wechatBindPhone:微信绑定手机、login:登陆、findPwd:找回密码、changePwd:修改密码"
"example": "h5Register:h5注册页、wechatBindPhone:微信绑定手机、login:登陆、findPwd:找回密码、changePwd:修改密码、changePasscode:修改支付密码"
}
}
},
@@ -3995,7 +4238,7 @@ const docTemplate = `{
"properties": {
"max_count": {
"description": "最大容纳人数",
"type": "string"
"type": "integer"
},
"name": {
"description": "维度",
@@ -4003,7 +4246,7 @@ const docTemplate = `{
},
"now_count": {
"description": "当前人数",
"type": "string"
"type": "integer"
}
}
},
@@ -4064,6 +4307,32 @@ const docTemplate = `{
}
}
},
"md.UpdatePasscodeReq": {
"type": "object",
"properties": {
"code": {
"type": "string",
"example": "验证码"
},
"passcode": {
"type": "string",
"example": "密码 如 123"
}
}
},
"md.UpdatePasswordReq": {
"type": "object",
"properties": {
"code": {
"type": "string",
"example": "验证码"
},
"password": {
"type": "string",
"example": "密码 如 123"
}
}
},
"md.UserFeedbackListReq": {
"type": "object",
"properties": {
@@ -4339,68 +4608,6 @@ 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": {
@@ -4423,8 +4630,6 @@ var SwaggerInfo = &swag.Spec{
Description: "APP客户端-Api接口",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}

func init() {


+ 278
- 72
docs/swagger.json View File

@@ -448,6 +448,53 @@
}
}
},
"/api/v1/advertising/state": {
"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.AdvertisingState"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/v1/college/cate": {
"get": {
"description": "蛋蛋学院-分类",
@@ -1465,6 +1512,115 @@
}
}
},
"/api/v1/memberCenter/inviteUrl": {
"get": {
"description": "邀请链接",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"邀请海报"
],
"summary": "邀请链接",
"responses": {
"200": {
"description": "登录成功返回",
"schema": {
"$ref": "#/definitions/md.InviteUrl"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/v1/memberCenter/updatePasscode": {
"post": {
"description": "修改支付宝密码",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"账号与安全"
],
"summary": "修改支付宝密码",
"parameters": [
{
"description": "注册参数",
"name": "req",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.UpdatePasscodeReq"
}
}
],
"responses": {
"200": {
"description": "登录成功返回",
"schema": {
"type": "string"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/v1/memberCenter/updatePassword": {
"post": {
"description": "修改密码",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"账号与安全"
],
"summary": "修改密码-不要原密码 换成验证码",
"parameters": [
{
"description": "注册参数",
"name": "req",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.UpdatePasswordReq"
}
}
],
"responses": {
"200": {
"description": "登录成功返回",
"schema": {
"type": "string"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/v1/openApp/start": {
"get": {
"description": "打开app调用",
@@ -2057,7 +2213,9 @@
"name": "req",
"in": "body",
"required": true,
"schema": {}
"schema": {
"type": "object"
}
}
],
"responses": {
@@ -2546,6 +2704,68 @@
}
}
},
"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": {
@@ -2703,6 +2923,14 @@
}
}
},
"md.AdvertisingState": {
"type": "object",
"properties": {
"is_success": {
"type": "string"
}
}
},
"md.BasalRateResp": {
"type": "object",
"properties": {
@@ -3495,6 +3723,20 @@
}
}
},
"md.InviteUrl": {
"type": "object",
"properties": {
"invite_code": {
"type": "string"
},
"link": {
"type": "string"
},
"qrcode": {
"type": "string"
}
}
},
"md.IsCanGetRedPackageResp": {
"type": "object",
"properties": {
@@ -3636,11 +3878,11 @@
"properties": {
"a_lot_of_nums": {
"description": "全网至多用户数",
"type": "string"
"type": "integer"
},
"day_num": {
"description": "连续x天不活跃",
"type": "string"
"type": "integer"
},
"rows": {
"description": "行数",
@@ -3655,11 +3897,11 @@
},
"space_nums": {
"description": "空间人数",
"type": "string"
"type": "integer"
},
"space_total_nums": {
"description": "空间总数",
"type": "string"
"type": "integer"
},
"times": {
"description": "排数",
@@ -3739,7 +3981,7 @@
},
"user_count": {
"description": "用户数",
"type": "string"
"type": "integer"
}
}
},
@@ -3750,7 +3992,7 @@
"description": "红包详情信息",
"allOf": [
{
"$ref": "#/definitions/model.ImSendRedPackageOrd"
"$ref": "#/definitions/code_fnuoos_com_EggPlanet_egg_models_git_src_model.ImSendRedPackageOrd"
}
]
},
@@ -3980,7 +4222,7 @@
},
"type": {
"type": "string",
"example": "h5Register:h5注册页、wechatBindPhone:微信绑定手机、login:登陆、findPwd:找回密码、changePwd:修改密码"
"example": "h5Register:h5注册页、wechatBindPhone:微信绑定手机、login:登陆、findPwd:找回密码、changePwd:修改密码、changePasscode:修改支付密码"
}
}
},
@@ -3989,7 +4231,7 @@
"properties": {
"max_count": {
"description": "最大容纳人数",
"type": "string"
"type": "integer"
},
"name": {
"description": "维度",
@@ -3997,7 +4239,7 @@
},
"now_count": {
"description": "当前人数",
"type": "string"
"type": "integer"
}
}
},
@@ -4058,6 +4300,32 @@
}
}
},
"md.UpdatePasscodeReq": {
"type": "object",
"properties": {
"code": {
"type": "string",
"example": "验证码"
},
"passcode": {
"type": "string",
"example": "密码 如 123"
}
}
},
"md.UpdatePasswordReq": {
"type": "object",
"properties": {
"code": {
"type": "string",
"example": "验证码"
},
"password": {
"type": "string",
"example": "密码 如 123"
}
}
},
"md.UserFeedbackListReq": {
"type": "object",
"properties": {
@@ -4333,68 +4601,6 @@
}
}
},
"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": {


+ 186
- 51
docs/swagger.yaml View File

@@ -12,6 +12,47 @@ 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:
@@ -121,6 +162,11 @@ definitions:
example: 名称
type: string
type: object
md.AdvertisingState:
properties:
is_success:
type: string
type: object
md.BasalRateResp:
properties:
basal_rate:
@@ -670,6 +716,15 @@ definitions:
nickname:
type: string
type: object
md.InviteUrl:
properties:
invite_code:
type: string
link:
type: string
qrcode:
type: string
type: object
md.IsCanGetRedPackageResp:
properties:
is_can_get_red_package:
@@ -769,10 +824,10 @@ definitions:
properties:
a_lot_of_nums:
description: 全网至多用户数
type: string
type: integer
day_num:
description: 连续x天不活跃
type: string
type: integer
rows:
description: 行数
type: string
@@ -783,10 +838,10 @@ definitions:
type: array
space_nums:
description: 空间人数
type: string
type: integer
space_total_nums:
description: 空间总数
type: string
type: integer
times:
description: 排数
type: string
@@ -842,13 +897,13 @@ definitions:
type: string
user_count:
description: 用户数
type: string
type: integer
type: object
md.RedPackageDetailResp:
properties:
detail:
allOf:
- $ref: '#/definitions/model.ImSendRedPackageOrd'
- $ref: '#/definitions/code_fnuoos_com_EggPlanet_egg_models_git_src_model.ImSendRedPackageOrd'
description: 红包详情信息
list:
description: 领取红包用户列表
@@ -1008,7 +1063,7 @@ definitions:
example: 阿里云图形验证码对应参数
type: string
type:
example: h5Register:h5注册页、wechatBindPhone:微信绑定手机、login:登陆、findPwd:找回密码、changePwd:修改密码
example: h5Register:h5注册页、wechatBindPhone:微信绑定手机、login:登陆、findPwd:找回密码、changePwd:修改密码、changePasscode:修改支付密码
type: string
required:
- mobile
@@ -1017,13 +1072,13 @@ definitions:
properties:
max_count:
description: 最大容纳人数
type: string
type: integer
name:
description: 维度
type: string
now_count:
description: 当前人数
type: string
type: integer
type: object
md.TotalRateResp:
properties:
@@ -1061,6 +1116,24 @@ definitions:
value:
type: string
type: object
md.UpdatePasscodeReq:
properties:
code:
example: 验证码
type: string
passcode:
example: 密码 如 123
type: string
type: object
md.UpdatePasswordReq:
properties:
code:
example: 验证码
type: string
password:
example: 密码 如 123
type: string
type: object
md.UserFeedbackListReq:
properties:
limit:
@@ -1249,47 +1322,6 @@ definitions:
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:
@@ -1594,6 +1626,37 @@ paths:
summary: 广告位详情
tags:
- 广告位
/api/v1/advertising/state:
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.AdvertisingState'
"400":
description: 具体错误
schema:
$ref: '#/definitions/md.Response'
summary: 广告状态 看完之后拿到广告唯一值
tags:
- 广告位
/api/v1/college/cate:
get:
consumes:
@@ -2264,6 +2327,77 @@ paths:
summary: 蛋蛋星球-会员中心-基础数据(获取)
tags:
- 会员中心
/api/v1/memberCenter/inviteUrl:
get:
consumes:
- application/json
description: 邀请链接
produces:
- application/json
responses:
"200":
description: 登录成功返回
schema:
$ref: '#/definitions/md.InviteUrl'
"400":
description: 具体错误
schema:
$ref: '#/definitions/md.Response'
summary: 邀请链接
tags:
- 邀请海报
/api/v1/memberCenter/updatePasscode:
post:
consumes:
- application/json
description: 修改支付宝密码
parameters:
- description: 注册参数
in: body
name: req
required: true
schema:
$ref: '#/definitions/md.UpdatePasscodeReq'
produces:
- application/json
responses:
"200":
description: 登录成功返回
schema:
type: string
"400":
description: 具体错误
schema:
$ref: '#/definitions/md.Response'
summary: 修改支付宝密码
tags:
- 账号与安全
/api/v1/memberCenter/updatePassword:
post:
consumes:
- application/json
description: 修改密码
parameters:
- description: 注册参数
in: body
name: req
required: true
schema:
$ref: '#/definitions/md.UpdatePasswordReq'
produces:
- application/json
responses:
"200":
description: 登录成功返回
schema:
type: string
"400":
description: 具体错误
schema:
$ref: '#/definitions/md.Response'
summary: 修改密码-不要原密码 换成验证码
tags:
- 账号与安全
/api/v1/openApp/start:
get:
consumes:
@@ -2653,7 +2787,8 @@ paths:
in: body
name: req
required: true
schema: {}
schema:
type: object
produces:
- application/json
responses:


Loading…
Cancel
Save