feat(service): replace EnableShowInService with HideForGuest

Mirror the server HideForGuest flag on services: rename the field
(dropping the gorm default), invert userCanViewService so a service is
visible to guests by default and hidden only when HideForGuest is set,
and flip the public-stats filter in servicesentinel accordingly. Update
the visibility and permission-matrix tests to the new semantics.
This commit is contained in:
naiba
2026-06-02 03:31:36 +00:00
parent bb38a9d4d2
commit 836f1db4b7
6 changed files with 29 additions and 29 deletions
+1 -1
View File
@@ -216,7 +216,7 @@ type Service struct {
Cover uint8 `json:"cover"`
EnableTriggerTask bool `gorm:"default: false" json:"enable_trigger_task,omitempty"`
EnableShowInService bool `gorm:"default: false" json:"enable_show_in_service,omitempty"`
HideForGuest bool `json:"hide_for_guest,omitempty"` // 对游客隐藏
FailTriggerTasksRaw string `gorm:"default:'[]'" json:"-"`
RecoverTriggerTasksRaw string `gorm:"default:'[]'" json:"-"`