feat: 重构内容和订单列表接口,使用过滤器结构体简化参数传递;更新相关服务和测试用例
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package dto
|
||||
|
||||
import "quyun/v2/app/requests"
|
||||
|
||||
type ApplyForm struct {
|
||||
Name string `json:"name"`
|
||||
Bio string `json:"bio"`
|
||||
@@ -37,6 +39,19 @@ type ContentUpdateForm struct {
|
||||
MediaIDs []string `json:"media_ids"`
|
||||
}
|
||||
|
||||
type CreatorContentListFilter struct {
|
||||
requests.Pagination
|
||||
Status *string `query:"status"`
|
||||
Genre *string `query:"genre"`
|
||||
Keyword *string `query:"keyword"`
|
||||
}
|
||||
|
||||
type CreatorOrderListFilter struct {
|
||||
requests.Pagination
|
||||
Status *string `query:"status"`
|
||||
Keyword *string `query:"keyword"`
|
||||
}
|
||||
|
||||
type RefundForm struct {
|
||||
Action string `json:"action"` // accept, reject
|
||||
Reason string `json:"reason"`
|
||||
@@ -63,15 +78,3 @@ type WithdrawForm struct {
|
||||
Method string `json:"method"` // wallet, external
|
||||
AccountID string `json:"account_id"`
|
||||
}
|
||||
|
||||
// Re-export or Wrap
|
||||
// Since ContentItem and Order are in the same package 'dto',
|
||||
// we don't need type aliases unless we want to rename them.
|
||||
// If creator.go uses them, it can use dto.ContentItem directly.
|
||||
// But creator.go is in `v1` (package v1) and imports `dto`.
|
||||
// So it uses `dto.ContentItem`.
|
||||
// So we don't need aliases here if the original types are in this package.
|
||||
|
||||
// However, if the originals were in `content/dto` and `user/dto` and we moved them to `v1/dto` (this package),
|
||||
// then we just have them defined in `content.go` (dto) and `user.go` (dto).
|
||||
// So aliases are not needed if they are in the same package.
|
||||
|
||||
Reference in New Issue
Block a user