Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
4329f72a
Unverified
Commit
4329f72a
authored
Feb 02, 2026
by
Wesley Liddick
Committed by
GitHub
Feb 02, 2026
Browse files
Merge pull request #450 from bayma888/feature/show-admin-adjustment-notes
feat: 向用户显示管理员调整余额的备注
parents
016c3915
ae18397c
Changes
4
Show whitespace changes
Inline
Side-by-side
backend/internal/handler/dto/mappers.go
View file @
4329f72a
...
@@ -321,7 +321,7 @@ func RedeemCodeFromServiceAdmin(rc *service.RedeemCode) *AdminRedeemCode {
...
@@ -321,7 +321,7 @@ func RedeemCodeFromServiceAdmin(rc *service.RedeemCode) *AdminRedeemCode {
}
}
func
redeemCodeFromServiceBase
(
rc
*
service
.
RedeemCode
)
RedeemCode
{
func
redeemCodeFromServiceBase
(
rc
*
service
.
RedeemCode
)
RedeemCode
{
return
RedeemCode
{
out
:=
RedeemCode
{
ID
:
rc
.
ID
,
ID
:
rc
.
ID
,
Code
:
rc
.
Code
,
Code
:
rc
.
Code
,
Type
:
rc
.
Type
,
Type
:
rc
.
Type
,
...
@@ -335,6 +335,14 @@ func redeemCodeFromServiceBase(rc *service.RedeemCode) RedeemCode {
...
@@ -335,6 +335,14 @@ func redeemCodeFromServiceBase(rc *service.RedeemCode) RedeemCode {
User
:
UserFromServiceShallow
(
rc
.
User
),
User
:
UserFromServiceShallow
(
rc
.
User
),
Group
:
GroupFromServiceShallow
(
rc
.
Group
),
Group
:
GroupFromServiceShallow
(
rc
.
Group
),
}
}
// For admin_balance/admin_concurrency types, include notes so users can see
// why they were charged or credited by admin
if
(
rc
.
Type
==
"admin_balance"
||
rc
.
Type
==
"admin_concurrency"
)
&&
rc
.
Notes
!=
""
{
out
.
Notes
=
&
rc
.
Notes
}
return
out
}
}
// AccountSummaryFromService returns a minimal AccountSummary for usage log display.
// AccountSummaryFromService returns a minimal AccountSummary for usage log display.
...
...
backend/internal/handler/dto/types.go
View file @
4329f72a
...
@@ -198,6 +198,10 @@ type RedeemCode struct {
...
@@ -198,6 +198,10 @@ type RedeemCode struct {
GroupID
*
int64
`json:"group_id"`
GroupID
*
int64
`json:"group_id"`
ValidityDays
int
`json:"validity_days"`
ValidityDays
int
`json:"validity_days"`
// Notes is only populated for admin_balance/admin_concurrency types
// so users can see why they were charged or credited
Notes
*
string
`json:"notes,omitempty"`
User
*
User
`json:"user,omitempty"`
User
*
User
`json:"user,omitempty"`
Group
*
Group
`json:"group,omitempty"`
Group
*
Group
`json:"group,omitempty"`
}
}
...
...
frontend/src/api/redeem.ts
View file @
4329f72a
...
@@ -14,7 +14,9 @@ export interface RedeemHistoryItem {
...
@@ -14,7 +14,9 @@ export interface RedeemHistoryItem {
status
:
string
status
:
string
used_at
:
string
used_at
:
string
created_at
:
string
created_at
:
string
// 订阅类型专用字段
// Notes from admin for admin_balance/admin_concurrency types
notes
?:
string
// Subscription-specific fields
group_id
?:
number
group_id
?:
number
validity_days
?:
number
validity_days
?:
number
group
?:
{
group
?:
{
...
...
frontend/src/views/user/RedeemView.vue
View file @
4329f72a
...
@@ -312,6 +312,14 @@
...
@@ -312,6 +312,14 @@
<
p
v
-
else
class
=
"
text-xs text-gray-400 dark:text-dark-500
"
>
<
p
v
-
else
class
=
"
text-xs text-gray-400 dark:text-dark-500
"
>
{{
t
(
'
redeem.adminAdjustment
'
)
}}
{{
t
(
'
redeem.adminAdjustment
'
)
}}
<
/p
>
<
/p
>
<!--
Display
notes
for
admin
adjustments
-->
<
p
v
-
if
=
"
item.notes
"
class
=
"
mt-1 text-xs text-gray-500 dark:text-dark-400 italic max-w-[200px] truncate
"
:
title
=
"
item.notes
"
>
{{
item
.
notes
}}
<
/p
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment