refactor: migrate wechat to user attributes and enhance users list
Migrate the hardcoded wechat field to the new extensible user attributes system and improve the users management UI. Migration: - Add migration 019 to move wechat data to user_attribute_values - Remove wechat field from User entity, DTOs, and API contracts - Clean up wechat-related code from backend and frontend UsersView enhancements: - Add text labels to action buttons (Filter Settings, Column Settings, Attributes Config) for better UX - Change status column to show colored dot + Chinese text instead of English text - Add dynamic attribute columns support with batch loading - Add column visibility settings with localStorage persistence - Add filter settings modal for search and filter preferences - Update i18n translations 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -105,11 +105,6 @@ func Username(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldUsername, v))
|
||||
}
|
||||
|
||||
// Wechat applies equality check predicate on the "wechat" field. It's identical to WechatEQ.
|
||||
func Wechat(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldWechat, v))
|
||||
}
|
||||
|
||||
// Notes applies equality check predicate on the "notes" field. It's identical to NotesEQ.
|
||||
func Notes(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldNotes, v))
|
||||
@@ -650,71 +645,6 @@ func UsernameContainsFold(v string) predicate.User {
|
||||
return predicate.User(sql.FieldContainsFold(FieldUsername, v))
|
||||
}
|
||||
|
||||
// WechatEQ applies the EQ predicate on the "wechat" field.
|
||||
func WechatEQ(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldWechat, v))
|
||||
}
|
||||
|
||||
// WechatNEQ applies the NEQ predicate on the "wechat" field.
|
||||
func WechatNEQ(v string) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldWechat, v))
|
||||
}
|
||||
|
||||
// WechatIn applies the In predicate on the "wechat" field.
|
||||
func WechatIn(vs ...string) predicate.User {
|
||||
return predicate.User(sql.FieldIn(FieldWechat, vs...))
|
||||
}
|
||||
|
||||
// WechatNotIn applies the NotIn predicate on the "wechat" field.
|
||||
func WechatNotIn(vs ...string) predicate.User {
|
||||
return predicate.User(sql.FieldNotIn(FieldWechat, vs...))
|
||||
}
|
||||
|
||||
// WechatGT applies the GT predicate on the "wechat" field.
|
||||
func WechatGT(v string) predicate.User {
|
||||
return predicate.User(sql.FieldGT(FieldWechat, v))
|
||||
}
|
||||
|
||||
// WechatGTE applies the GTE predicate on the "wechat" field.
|
||||
func WechatGTE(v string) predicate.User {
|
||||
return predicate.User(sql.FieldGTE(FieldWechat, v))
|
||||
}
|
||||
|
||||
// WechatLT applies the LT predicate on the "wechat" field.
|
||||
func WechatLT(v string) predicate.User {
|
||||
return predicate.User(sql.FieldLT(FieldWechat, v))
|
||||
}
|
||||
|
||||
// WechatLTE applies the LTE predicate on the "wechat" field.
|
||||
func WechatLTE(v string) predicate.User {
|
||||
return predicate.User(sql.FieldLTE(FieldWechat, v))
|
||||
}
|
||||
|
||||
// WechatContains applies the Contains predicate on the "wechat" field.
|
||||
func WechatContains(v string) predicate.User {
|
||||
return predicate.User(sql.FieldContains(FieldWechat, v))
|
||||
}
|
||||
|
||||
// WechatHasPrefix applies the HasPrefix predicate on the "wechat" field.
|
||||
func WechatHasPrefix(v string) predicate.User {
|
||||
return predicate.User(sql.FieldHasPrefix(FieldWechat, v))
|
||||
}
|
||||
|
||||
// WechatHasSuffix applies the HasSuffix predicate on the "wechat" field.
|
||||
func WechatHasSuffix(v string) predicate.User {
|
||||
return predicate.User(sql.FieldHasSuffix(FieldWechat, v))
|
||||
}
|
||||
|
||||
// WechatEqualFold applies the EqualFold predicate on the "wechat" field.
|
||||
func WechatEqualFold(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEqualFold(FieldWechat, v))
|
||||
}
|
||||
|
||||
// WechatContainsFold applies the ContainsFold predicate on the "wechat" field.
|
||||
func WechatContainsFold(v string) predicate.User {
|
||||
return predicate.User(sql.FieldContainsFold(FieldWechat, v))
|
||||
}
|
||||
|
||||
// NotesEQ applies the EQ predicate on the "notes" field.
|
||||
func NotesEQ(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldNotes, v))
|
||||
@@ -918,6 +848,29 @@ func HasUsageLogsWith(preds ...predicate.UsageLog) predicate.User {
|
||||
})
|
||||
}
|
||||
|
||||
// HasAttributeValues applies the HasEdge predicate on the "attribute_values" edge.
|
||||
func HasAttributeValues() predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.O2M, false, AttributeValuesTable, AttributeValuesColumn),
|
||||
)
|
||||
sqlgraph.HasNeighbors(s, step)
|
||||
})
|
||||
}
|
||||
|
||||
// HasAttributeValuesWith applies the HasEdge predicate on the "attribute_values" edge with a given conditions (other predicates).
|
||||
func HasAttributeValuesWith(preds ...predicate.UserAttributeValue) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
step := newAttributeValuesStep()
|
||||
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
|
||||
for _, p := range preds {
|
||||
p(s)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// HasUserAllowedGroups applies the HasEdge predicate on the "user_allowed_groups" edge.
|
||||
func HasUserAllowedGroups() predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
|
||||
Reference in New Issue
Block a user