Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hilo-user
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenweijian
hilo-user
Commits
bbd96593
Commit
bbd96593
authored
Jun 29, 2023
by
chenweijian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
邀请派对
parent
b16be92c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
4 deletions
+8
-4
invite_apply.go
domain/model/invite_m/invite_apply.go
+3
-2
新人派对申请.sql
mysql/新人派对申请.sql
+2
-1
party_invite.go
route/invite_r/party_invite.go
+3
-1
No files found.
domain/model/invite_m/invite_apply.go
View file @
bbd96593
...
...
@@ -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
)
...
...
mysql/新人派对申请.sql
View file @
bbd96593
...
...
@@ -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)'
,
...
...
route/invite_r/party_invite.go
View file @
bbd96593
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment