Skip to content

Feat/thread subscription#2719

Draft
aruaru624 wants to merge 13 commits intofeat/threadfrom
feat/thread-subscription
Draft

Feat/thread subscription#2719
aruaru624 wants to merge 13 commits intofeat/threadfrom
feat/thread-subscription

Conversation

@aruaru624
Copy link
Copy Markdown
Contributor

close #2706
編集は未実装です。

@Takeno-hito Takeno-hito self-requested a review July 5, 2025 05:32
Copy link
Copy Markdown
Member

@Takeno-hito Takeno-hito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

遅くなりましたがレビュー返したので確認お願いします…!

Comment thread migration/v40.go
)

// v40 スレッド通知を管理するテーブルを追加
func v40() *gormigrate.Migration {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

めっちゃ申し訳ないんだけどここ threadV1 とかに名前変えたりってできます?
というのも、スレッド系はマージする際にまとめて1マイグレーションにしちゃいたいと思ってて、今は開発用で管理するために名前を分けたいです!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

threadV1に変更しました!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ファイル名も threadv1 に変えてほしいです!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

変更しました

Comment thread model/channels.go Outdated
IsForced bool `gorm:"type:boolean;not null;default:false;index:idx_channel_channels_id_is_public_is_forced,priority:3"`
IsPublic bool `gorm:"type:boolean;not null;default:false;index:idx_channel_channels_id_is_public_is_forced,priority:2"`
IsVisible bool `gorm:"type:boolean;not null;default:false"`
IsThread bool `gorm:"type:boolean;not null;default:false"`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lint 落ちてるので直してほしいです!間がハードタブになってるかな

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修正しました

Comment thread model/channels.go Outdated
ChannelSubscribeLevelMark
// ChannelSubscribeLevelMarkAndNotify レベル:未読管理+通知
ChannelSubscribeLevelMarkAndNotify
// ChannelSubscribeLevelMarkAndNotify
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不要な行かも!消してほしいです

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

削除しました_

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

消えてない気がする!

Copy link
Copy Markdown
Contributor Author

@aruaru624 aruaru624 Aug 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

すみません削除しました

Comment thread repository/channel.go Outdated
type ChannelSubscriptionQuery struct {
UserID optional.Of[uuid.UUID]
ChannelID optional.Of[uuid.UUID]
ThreadParentID optional.Of[uuid.UUID]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[q] これってどこで使われてるかって分かりますか?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

現段階では使われていなくて、あるチャンネル以下で通知を有効にしているスレッドを取れるようする意図で書いていました
一旦削除しました

Comment thread repository/user_group.go Outdated
}

// UserGroupRepository ユーザーグループリポジトリ
//test
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不要な行なので消してほしいです!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

削除しました

Comment thread repository/gorm/user.go
}
if query.IsSubscriberAtMarkLevelOf.Valid {
tx = tx.Joins("INNER JOIN users_subscribe_channels ON users_subscribe_channels.user_id = users.id AND users_subscribe_channels.channel_id = ? AND users_subscribe_channels.mark = true", query.IsSubscriberAtMarkLevelOf.V)
tx = tx.Where("users.id IN (SELECT user_id FROM users_subscribe_threads WHERE channel_id = ? AND mark = true UNION SELECT user_id FROM users_subscribe_channels WHERE channel_id = ? AND mark = true)", query.IsSubscriberAtMarkLevelOf.V, query.IsSubscriberAtMarkLevelOf.V)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここの explain 結果が欲しいかも ( Adminer で explain [sql文] ででた結果を貼ってほしいです

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

// GetThreadSubscriptions implements ChannelRepository interface.
func (repo *Repository) GetThreadSubscriptions(query repository.ChannelSubscriptionQuery) ([]*model.UserSubscribeThread, error) {

subQuery := repo.db.Table("channels").
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここも explain 結果が欲しいかも ( Adminer で explain [sql文] ででた結果を貼ってほしいです

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@Takeno-hito Takeno-hito marked this pull request as draft January 22, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants