You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
560 B
Go
27 lines
560 B
Go
package campaignnotice
|
|
|
|
import (
|
|
"joybuywork/internal/app"
|
|
"joybuywork/internal/consts/ckey"
|
|
"joybuywork/internal/service/provider/projectuser"
|
|
"joybuywork/internal/service/queue/types"
|
|
"joybuywork/internal/utils/logic"
|
|
)
|
|
|
|
type ProjectUser struct {
|
|
logic.Logic
|
|
|
|
Req *types.ProjectUser
|
|
}
|
|
|
|
func (s *ProjectUser) Exec() (err error) {
|
|
|
|
if !app.NewRedisLock(s.Ctx, ckey.FissionProjectUserUniq(s.Req.ProjectId, s.Req.UserId)).SoftLock() {
|
|
return
|
|
}
|
|
|
|
_, _ = projectuser.NewProjectUser(s.Ctx, projectuser.WithInit(s.Req.ProjectId, s.Req.UserId))
|
|
|
|
return
|
|
}
|