From bbd96593da3be823e2fab66dd4632fd8d44a2035 Mon Sep 17 00:00:00 2001 From: chenweijian <820961417@qq.com> Date: Thu, 29 Jun 2023 11:55:03 +0800 Subject: [PATCH] =?UTF-8?q?=E9=82=80=E8=AF=B7=E6=B4=BE=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- domain/model/invite_m/invite_apply.go | 5 +++-- ...\272\346\264\276\345\257\271\347\224\263\350\257\267.sql" | 3 ++- route/invite_r/party_invite.go | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/domain/model/invite_m/invite_apply.go b/domain/model/invite_m/invite_apply.go index 311fe44..c68500e 100644 --- a/domain/model/invite_m/invite_apply.go +++ b/domain/model/invite_m/invite_apply.go @@ -12,6 +12,7 @@ type InviteApply struct { UserId uint64 `json:"user_id"` NewUserId uint64 `json:"new_user_id"` Platform string `json:"platform"` + PlatformId string `json:"platform_id"` RechargeInfo string `json:"recharge_info"` Status uint8 `json:"status"` // 状态0.未审核1.已通过2.已拒绝 VideoUrl string `json:"video_url"` @@ -19,9 +20,9 @@ type InviteApply struct { CreatedTime time.Time `json:"created_time"` } -func CreateInviteApply(model *domain.Model, userId, newUserId uint64, platform, recharge, videoUrl string) error { +func CreateInviteApply(model *domain.Model, userId, newUserId uint64, platform, platformId, recharge, videoUrl string) error { err := model.DB().Create(&InviteApply{ - UserId: userId, NewUserId: newUserId, Platform: platform, RechargeInfo: recharge, VideoUrl: videoUrl, + UserId: userId, NewUserId: newUserId, Platform: platform, PlatformId: platformId, RechargeInfo: recharge, VideoUrl: videoUrl, CreatedTime: time.Now()}).Error if err != nil { model.Log.Errorf("CreateInviteApply err:%v", err) diff --git "a/mysql/\346\226\260\344\272\272\346\264\276\345\257\271\347\224\263\350\257\267.sql" "b/mysql/\346\226\260\344\272\272\346\264\276\345\257\271\347\224\263\350\257\267.sql" index 6b35356..aaf5c12 100644 --- "a/mysql/\346\226\260\344\272\272\346\264\276\345\257\271\347\224\263\350\257\267.sql" +++ "b/mysql/\346\226\260\344\272\272\346\264\276\345\257\271\347\224\263\350\257\267.sql" @@ -2,7 +2,8 @@ CREATE TABLE `invite_apply` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', `user_id` bigint NOT NULL COMMENT '发起申请者', `new_user_id` bigint NOT NULL COMMENT '被邀请的人', - `platform` varchar(20) NOT NULL COMMENT '从那个平台过来', + `platform` varchar(20) NOT NULL COMMENT '来自平台', + `platform_id` varchar(150) NOT NULL COMMENT '平台id', `recharge_info` varchar(50) NOT NULL COMMENT '新用户在其它平台充值的标志', `status` tinyint unsigned NOT NULL COMMENT '状态0.未审核1.已通过2.已拒绝', `level` varchar(5) NOT NULL DEFAULT '' COMMENT '申请等级(S,A,B,C)', diff --git a/route/invite_r/party_invite.go b/route/invite_r/party_invite.go index d76ad34..27fa0de 100644 --- a/route/invite_r/party_invite.go +++ b/route/invite_r/party_invite.go @@ -21,6 +21,7 @@ import ( // @Summary 提交申请 // @Param newUserCode formData string true "被邀请人id" // @Param platform formData string true "平台" +// @Param platformId formData string true "平台Id" // @Param recharge formData string true "充值金额" // @Param userCode formData string true "邀请人id" // @Param videoUrl formData string true "充值金额" @@ -32,6 +33,7 @@ func InviteApply(c *gin.Context) (*mycontext.MyContext, error) { type paramStr struct { NewUserCode string `form:"newUserCode" binding:"required"` Platform string `form:"platform" binding:"required"` + PlatformId string `form:"platformId" binding:"required"` Recharge string `form:"recharge" binding:"required"` UserCode string `form:"userCode" binding:"required"` VideoUrl string `form:"videoUrl" binding:"required"` @@ -104,7 +106,7 @@ func InviteApply(c *gin.Context) (*mycontext.MyContext, error) { return myCtx, bizerr.InviteApplyAlreadyInvited } // 插入邀请表 - err = invite_m.CreateInviteApply(model, user.ID, newUser.ID, param.Platform, param.Recharge, param.VideoUrl) + err = invite_m.CreateInviteApply(model, user.ID, newUser.ID, param.Platform, param.PlatformId, param.Recharge, param.VideoUrl) if err != nil { model.Log.Errorf("InviteApply param:%v", param) return myCtx, err -- 2.22.0