feat(explorer): save user's view setting to server / optionally share view setting via share link (#2232)

This commit is contained in:
Aaron Liu
2025-06-05 10:00:37 +08:00
parent c13b7365b0
commit 522fcca6af
31 changed files with 704 additions and 158 deletions

View File

@@ -31,6 +31,8 @@ const (
FieldExpires = "expires"
// FieldRemainDownloads holds the string denoting the remain_downloads field in the database.
FieldRemainDownloads = "remain_downloads"
// FieldProps holds the string denoting the props field in the database.
FieldProps = "props"
// EdgeUser holds the string denoting the user edge name in mutations.
EdgeUser = "user"
// EdgeFile holds the string denoting the file edge name in mutations.
@@ -64,6 +66,7 @@ var Columns = []string{
FieldDownloads,
FieldExpires,
FieldRemainDownloads,
FieldProps,
}
// ForeignKeys holds the SQL foreign-keys that are owned by the "shares"

View File

@@ -480,6 +480,16 @@ func RemainDownloadsNotNil() predicate.Share {
return predicate.Share(sql.FieldNotNull(FieldRemainDownloads))
}
// PropsIsNil applies the IsNil predicate on the "props" field.
func PropsIsNil() predicate.Share {
return predicate.Share(sql.FieldIsNull(FieldProps))
}
// PropsNotNil applies the NotNil predicate on the "props" field.
func PropsNotNil() predicate.Share {
return predicate.Share(sql.FieldNotNull(FieldProps))
}
// HasUser applies the HasEdge predicate on the "user" edge.
func HasUser() predicate.Share {
return predicate.Share(func(s *sql.Selector) {