This commit is contained in:
2026-05-09 19:08:02 +08:00
parent 45b0ddcf9f
commit 04a683273c
4 changed files with 11 additions and 6 deletions

View File

@@ -12,7 +12,7 @@ type SubPortalRegisterCommand struct {
// CreateInvitationCommand 主账号创建邀请
type CreateInvitationCommand struct {
ParentUserID string
// ExpiresInHours 可选0 用默认 168 小时
// ExpiresInHours 可选0 或不传为永久有效100年
ExpiresInHours int `json:"expires_in_hours"`
}

View File

@@ -127,7 +127,8 @@ func (s *SubordinateApplicationServiceImpl) RegisterSubPortal(ctx context.Contex
func (s *SubordinateApplicationServiceImpl) CreateInvitation(ctx context.Context, cmd *commands.CreateInvitationCommand) (*responses.CreateInvitationResponse, error) {
hours := cmd.ExpiresInHours
if hours <= 0 {
hours = 24 * 7
// 永久有效设置100年后过期
hours = 24 * 365 * 100
}
raw, hash, err := GenerateInviteToken()
if err != nil {