优化结构

This commit is contained in:
Yvan
2026-08-28 09:44:11 +08:00
parent 279692375b
commit e997d9718e
26 changed files with 106 additions and 129 deletions
+2 -3
View File
@@ -1,9 +1,8 @@
package dto
type GetAuthorityButtonsRequest struct {
MenuID uint `json:"menuID"`
AuthorityID uint `json:"authorityId"`
Selected []uint `json:"selected"`
MenuID uint `json:"menuID"`
AuthorityID uint `json:"authorityId"`
}
type SetAuthorityButtonsRequest struct {
+1 -15
View File
@@ -16,21 +16,7 @@ func (s *PaymentService) Order(ctx context.Context, provider, tradeNo string) (*
if err != nil {
return nil, err
}
return &dto.PaymentOrderResponse{
ID: order.ID,
Provider: order.Provider, TradeNo: order.TradeNo, ProviderTradeNo: order.ProviderTradeNo,
BusinessType: order.BusinessType, BusinessID: order.BusinessID, Subject: order.Subject,
PaymentMode: order.PaymentMode, OriginalAmount: order.OriginalAmount,
Amount: order.Amount, PaidAmount: order.PaidAmount, PayerPaidAmount: order.PayerPaidAmount,
CashPaidAmount: order.CashPaidAmount, PointPaidAmount: order.PointPaidAmount,
DiscountAmount: order.DiscountAmount, ProviderDiscountAmount: order.ProviderDiscountAmount,
MerchantDiscountAmount: order.MerchantDiscountAmount, SettlementAmount: order.SettlementAmount,
Currency: order.Currency, PayerCurrency: order.PayerCurrency, AmountBreakdownKnown: order.AmountBreakdownKnown,
PaymentStatus: order.PaymentStatus, ProviderStatus: order.ProviderStatus, FulfillmentStatus: order.FulfillmentStatus,
RefundStatus: order.RefundStatus, RefundedAmount: order.RefundedAmount, RefundRequestedAmount: order.RefundRequestedAmount, RefundNo: order.RefundNo, LastError: order.LastError,
CreatedAt: order.CreatedAt, UpdatedAt: order.UpdatedAt, PaidAt: order.PaidAt,
FulfilledAt: order.FulfilledAt, RefundedAt: order.RefundedAt,
}, nil
return paymentOrderResponse(order)
}
func (s *PaymentService) Orders(ctx context.Context, req *dto.PaymentOrderListRequest) ([]*dto.PaymentOrderResponse, int64, int, int, error) {
@@ -14,34 +14,10 @@ func NewSecurityService(uc *system.SecurityUsecase) *SecurityService {
return &SecurityService{uc: uc}
}
func (s *SecurityService) ActiveToken(ctx context.Context, username string) (string, error) {
return s.uc.ActiveToken(ctx, username)
}
func (s *SecurityService) LoginLocked(ctx context.Context, username string) (bool, error) {
return s.uc.LoginLocked(ctx, username)
}
func (s *SecurityService) IncrementLoginFailure(ctx context.Context, username string, expiration time.Duration) (int64, error) {
return s.uc.IncrementLoginFailure(ctx, username, expiration)
}
func (s *SecurityService) LockLogin(ctx context.Context, username string, expiration time.Duration) error {
return s.uc.LockLogin(ctx, username, expiration)
}
func (s *SecurityService) ClearLoginState(ctx context.Context, username string) {
s.uc.ClearLoginState(ctx, username)
}
func (s *SecurityService) EnsureLoginIPCounter(ctx context.Context, ip string, expiration time.Duration) (int, error) {
return s.uc.EnsureLoginIPCounter(ctx, ip, expiration)
}
func (s *SecurityService) IncrementLoginIP(ctx context.Context, ip string, expiration time.Duration) (int64, error) {
return s.uc.IncrementLoginIP(ctx, ip, expiration)
}
func (s *SecurityService) IncrementRateLimit(ctx context.Context, key string, expiration time.Duration) (int64, error) {
return s.uc.IncrementRateLimit(ctx, key, expiration)
}
@@ -58,12 +34,6 @@ func (s *SecurityService) DeleteCaptcha(ctx context.Context, id string) error {
return s.uc.DeleteCaptcha(ctx, id)
}
func (s *SecurityService) UseMultipoint() bool { return s.uc.UseMultipoint() }
func (s *SecurityService) CaptchaSettings() system.CaptchaSettings {
return s.uc.CaptchaRuntimeSettings()
}
func (s *SecurityService) RotateActiveToken(ctx context.Context, username, oldToken, newToken string, expiration time.Duration) error {
return s.uc.RotateActiveToken(ctx, username, oldToken, newToken, expiration)
}