From 913c0d33a28decfb50f29af7412baca5d6c3d3e2 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Tue, 26 Nov 2024 17:16:45 +0800 Subject: [PATCH] update pic url --- app/hdl/ModuleSetting.go | 5 +++++ app/hdl/hdl_add_friend.go | 7 ++++++- app/md/md_home_page.go | 12 ++++++------ app/router/router.go | 2 +- docs/docs.go | 15 ++++++++++----- docs/swagger.json | 10 +++++++--- docs/swagger.yaml | 9 +++++++-- go.mod | 2 +- 8 files changed, 43 insertions(+), 19 deletions(-) diff --git a/app/hdl/ModuleSetting.go b/app/hdl/ModuleSetting.go index 48bbe9b..6540394 100644 --- a/app/hdl/ModuleSetting.go +++ b/app/hdl/ModuleSetting.go @@ -5,7 +5,9 @@ import ( "applet/app/e" "applet/app/md" "applet/app/utils" + "applet/app/utils/cache" "code.fnuoos.com/EggPlanet/egg_models.git/src/implement" + "code.fnuoos.com/EggPlanet/egg_system_rules.git/svc" "github.com/gin-gonic/gin" ) @@ -44,6 +46,9 @@ func GetModuleSetting(c *gin.Context) { return } var dataMap map[string]interface{} + redisConn := cache.GetPool().Get() + scheme, domain := svc.ImageBucket(db.Db, redisConn) + moduleStyle.Data = svc.ImageFormatWithBucketNew(scheme, domain, moduleStyle.Data) utils.Unserialize([]byte(moduleStyle.Data), &dataMap) resp := md.GetModuleSettingResp{ ModName: moduleStyle.ModName, diff --git a/app/hdl/hdl_add_friend.go b/app/hdl/hdl_add_friend.go index 121ae29..8c23ce4 100644 --- a/app/hdl/hdl_add_friend.go +++ b/app/hdl/hdl_add_friend.go @@ -5,10 +5,12 @@ import ( "applet/app/e" "applet/app/md" "applet/app/utils" + "applet/app/utils/cache" "code.fnuoos.com/EggPlanet/egg_models.git/src/implement" "code.fnuoos.com/EggPlanet/egg_models.git/src/model" enum "code.fnuoos.com/EggPlanet/egg_system_rules.git/enum" md2 "code.fnuoos.com/EggPlanet/egg_system_rules.git/rule/egg_energy/md" + "code.fnuoos.com/EggPlanet/egg_system_rules.git/svc" "encoding/json" "fmt" "github.com/gin-gonic/gin" @@ -659,15 +661,18 @@ func MyFansUserList(c *gin.Context) { } } + redisConn := cache.GetPool().Get() + scheme, domain := svc.ImageBucket(db.Db, redisConn) var data []md.OneLineUserNode for _, v := range results { isOnline := false if userSignInMap[utils.AnyToInt64(v["uid"])] != nil { isOnline = true } + tempUrl := svc.ImageFormatWithBucket(scheme, domain, v["avatar_url"]) data = append(data, md.OneLineUserNode{ IsOnline: isOnline, - AvatarURL: v["avatar_url"], + AvatarURL: tempUrl, Nickname: v["nickname"], InviteTime: v["invite_time"], }) diff --git a/app/md/md_home_page.go b/app/md/md_home_page.go index 24da3f4..054ca92 100644 --- a/app/md/md_home_page.go +++ b/app/md/md_home_page.go @@ -23,16 +23,16 @@ type HomePageWatchAdRuleResp struct { } type RealTimePriceResp struct { - UserCount string `json:"user_count"` - NowPrice string `json:"now_price"` - IsRises bool `json:"is_rises"` - Rises string `json:"rises"` + UserCount string `json:"user_count"` // 用户数 + NowPrice string `json:"now_price"` // 当前价格 + IsRises bool `json:"is_rises"` // 是否涨/跌价 + Rises string `json:"rises"` // 涨价幅度 } type IsCanSignInResp struct { - IsCan bool `json:"is_can_sign_in"` + IsCan bool `json:"is_can_sign_in"` // 能否签到 } type IsCanGetRedPackageResp struct { - IsCan bool `json:"is_can_get_red_package"` + IsCan bool `json:"is_can_get_red_package"` // 能否获取红包 } diff --git a/app/router/router.go b/app/router/router.go index 0347c71..44dab7d 100644 --- a/app/router/router.go +++ b/app/router/router.go @@ -65,7 +65,7 @@ func route(r *gin.RouterGroup) { r.POST("/register", hdl.Register) //注册 r.POST("/login", hdl.Login) //登录 r.POST("/findPassword", hdl.FindPassword) //找回密码 - r.GET("/getModuleSetting", hdl.GetModuleSetting) // 获取 + r.GET("/getModuleSetting", hdl.GetModuleSetting) // 获取页面样式 r.Use(mw.Auth) // 以下接口需要JWT验证 rComm(r.Group("/comm")) r.GET("/userInfo", hdl.UserInfo) //用户基础信息 diff --git a/docs/docs.go b/docs/docs.go index ad73067..c84c1cc 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -1,5 +1,4 @@ -// Code generated by swaggo/swag. DO NOT EDIT. - +// Package docs Code generated by swaggo/swag. DO NOT EDIT package docs import "github.com/swaggo/swag" @@ -1890,9 +1889,7 @@ const docTemplate = `{ "name": "req", "in": "body", "required": true, - "schema": { - "type": "object" - } + "schema": {} } ], "responses": { @@ -3241,6 +3238,7 @@ const docTemplate = `{ "type": "object", "properties": { "is_can_get_red_package": { + "description": "能否获取红包", "type": "boolean" } } @@ -3249,6 +3247,7 @@ const docTemplate = `{ "type": "object", "properties": { "is_can_sign_in": { + "description": "能否签到", "type": "boolean" } } @@ -3450,15 +3449,19 @@ const docTemplate = `{ "type": "object", "properties": { "is_rises": { + "description": "是否涨/跌价", "type": "boolean" }, "now_price": { + "description": "当前价格", "type": "string" }, "rises": { + "description": "涨价幅度", "type": "string" }, "user_count": { + "description": "用户数", "type": "string" } } @@ -4022,6 +4025,8 @@ var SwaggerInfo = &swag.Spec{ Description: "APP客户端-Api接口", InfoInstanceName: "swagger", SwaggerTemplate: docTemplate, + LeftDelim: "{{", + RightDelim: "}}", } func init() { diff --git a/docs/swagger.json b/docs/swagger.json index 457f9ac..70edbd6 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -1883,9 +1883,7 @@ "name": "req", "in": "body", "required": true, - "schema": { - "type": "object" - } + "schema": {} } ], "responses": { @@ -3234,6 +3232,7 @@ "type": "object", "properties": { "is_can_get_red_package": { + "description": "能否获取红包", "type": "boolean" } } @@ -3242,6 +3241,7 @@ "type": "object", "properties": { "is_can_sign_in": { + "description": "能否签到", "type": "boolean" } } @@ -3443,15 +3443,19 @@ "type": "object", "properties": { "is_rises": { + "description": "是否涨/跌价", "type": "boolean" }, "now_price": { + "description": "当前价格", "type": "string" }, "rises": { + "description": "涨价幅度", "type": "string" }, "user_count": { + "description": "用户数", "type": "string" } } diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 83aa295..da39dbe 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -638,11 +638,13 @@ definitions: md.IsCanGetRedPackageResp: properties: is_can_get_red_package: + description: 能否获取红包 type: boolean type: object md.IsCanSignInResp: properties: is_can_sign_in: + description: 能否签到 type: boolean type: object md.LoginReq: @@ -784,12 +786,16 @@ definitions: md.RealTimePriceResp: properties: is_rises: + description: 是否涨/跌价 type: boolean now_price: + description: 当前价格 type: string rises: + description: 涨价幅度 type: string user_count: + description: 用户数 type: string type: object md.RedPackageDetailResp: @@ -2407,8 +2413,7 @@ paths: in: body name: req required: true - schema: - type: object + schema: {} produces: - application/json responses: diff --git a/go.mod b/go.mod index fdf7634..2bea63c 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,7 @@ require ( require ( code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241126080048-3c72cf5fa2e9 - code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241125081706-0915be3f4144 + code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241126083327-1b1d0a2602a0 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 github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible