From 650179833c074c284c20afb6892c9bc39291956c Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Thu, 14 Nov 2024 17:59:47 +0800 Subject: [PATCH] update --- .../egg_energy/hdl_basic.go | 14 +++++++------- .../public_platoon/hdl_basic.go | 15 ++++++++++++++- app/router/router.go | 10 +++++----- 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/app/hdl/institutional_management/egg_energy/hdl_basic.go b/app/hdl/institutional_management/egg_energy/hdl_basic.go index 255684f..7c48a47 100644 --- a/app/hdl/institutional_management/egg_energy/hdl_basic.go +++ b/app/hdl/institutional_management/egg_energy/hdl_basic.go @@ -72,25 +72,25 @@ func GetEggEnergyBasic(c *gin.Context) { } var videoRewardSystem md2.VideoRewardSystemStruct - utils.Unserialize([]byte(basicSettings.VideoRewardSystem), videoRewardSystem) + utils.Unserialize([]byte(basicSettings.VideoRewardSystem), &videoRewardSystem) var destructionSetting md2.DestructionSettingStruct - utils.Unserialize([]byte(basicSettings.DestructionSetting), destructionSetting) + utils.Unserialize([]byte(basicSettings.DestructionSetting), &destructionSetting) var priceSetting md2.PriceSettingStruct - utils.Unserialize([]byte(basicSettings.PriceSetting), priceSetting) + utils.Unserialize([]byte(basicSettings.PriceSetting), &priceSetting) var exchangeRules md2.ExchangeRulesStruct - utils.Unserialize([]byte(basicSettings.ExchangeRules), exchangeRules) + utils.Unserialize([]byte(basicSettings.ExchangeRules), &exchangeRules) var rewardSystem md2.RewardSystemStruct - utils.Unserialize([]byte(basicSettings.RewardSystem), rewardSystem) + utils.Unserialize([]byte(basicSettings.RewardSystem), &rewardSystem) var newUserRewardRules md2.NewUserRewardRules - utils.Unserialize([]byte(basicSettings.NewUserIncentiveRules), newUserRewardRules) + utils.Unserialize([]byte(basicSettings.NewUserIncentiveRules), &newUserRewardRules) var directPushReward md2.TeamRewardSettingStruct - utils.Unserialize([]byte(basicSettings.DirectPushReward), directPushReward) + utils.Unserialize([]byte(basicSettings.DirectPushReward), &directPushReward) resp := md.GetEggEnergyBasicResp{ BasicSetting: md.BasicSetting{ diff --git a/app/hdl/institutional_management/public_platoon/hdl_basic.go b/app/hdl/institutional_management/public_platoon/hdl_basic.go index 87bbc47..3b300e8 100644 --- a/app/hdl/institutional_management/public_platoon/hdl_basic.go +++ b/app/hdl/institutional_management/public_platoon/hdl_basic.go @@ -445,6 +445,20 @@ func AddFreePublishUser(c *gin.Context) { return } + freePunishWithUserDb := implement.NewPublicPlatoonFreePunishWithUserDb(db.Db) + userExist, err := freePunishWithUserDb.PublicPlatoonFreePunishWithUserGetOneByParams(map[string]interface{}{ + "key": "uid", + "value": req.Uid, + }) + if err != nil { + e.OutErr(c, e.ERR_DB_ORM, err.Error()) + return + } + if userExist != nil { + e.OutErr(c, e.ERR_DB_ORM, "用户已在名单,无需重复添加") + return + } + userDb := implement.NewUserDb(db.Db) user, err2 := userDb.UserGetOneByParams(map[string]interface{}{ "key": "id", @@ -458,7 +472,6 @@ func AddFreePublishUser(c *gin.Context) { e.OutErr(c, e.ERR_DB_ORM, errors.New("该用户不存在")) } - freePunishWithUserDb := implement.NewPublicPlatoonFreePunishWithUserDb(db.Db) var m model.PublicPlatoonFreePunishWithUser m = model.PublicPlatoonFreePunishWithUser{ Uid: req.Uid, diff --git a/app/router/router.go b/app/router/router.go index c5ca784..06e929b 100644 --- a/app/router/router.go +++ b/app/router/router.go @@ -52,9 +52,9 @@ func Init() *gin.Engine { func route(r *gin.RouterGroup) { r.GET("/test", hdl.Demo) r.POST("/login", hdl.Login) - r.Use(mw.Auth) // 以下接口需要JWT验证 + //r.Use(mw.Auth) // 以下接口需要JWT验证 rComm(r.Group("/comm")) - r.Use(mw.CheckPermission) // 检测权限 + //r.Use(mw.CheckPermission) // 检测权限 rInstitutionalManagement(r.Group("/institutionalManagement")) rSettCenter(r.Group("/settCenter")) } @@ -123,9 +123,9 @@ func rInstitutionalManagement(r *gin.RouterGroup) { //制度管理 } rPlatformRevenue := rEggEnergy.Group("/platformRevenue") { - rPlatformRevenue.POST("/SetVideoReward", egg_energy.SetVideoReward) - rPlatformRevenue.POST("/PlatformRevenueList", egg_energy.ListPlatformRevenue) - rPlatformRevenue.POST("/PlatformRevenueAdd", egg_energy.AddPlatformRevenue) + rPlatformRevenue.POST("/setVideoReward", egg_energy.SetVideoReward) + rPlatformRevenue.POST("/platformRevenueList", egg_energy.ListPlatformRevenue) + rPlatformRevenue.POST("/platformRevenueAdd", egg_energy.AddPlatformRevenue) } } }