feat: 迁移渠道激活列表和绑定期间流水

This commit is contained in:
Yvan
2026-11-03 20:53:25 +08:00
parent 838c2c496f
commit 8908430a89
28 changed files with 1180 additions and 9 deletions
+42
View File
@@ -0,0 +1,42 @@
package handler
import (
"strconv"
"github.com/gin-gonic/gin"
"github.com/go-kratos/kratos/v3/errors"
"kra/internal/service/business"
"kra/internal/service/dto"
)
type Activation struct{ service *business.ActivationService }
func NewActivation(service *business.ActivationService) *Activation {
return &Activation{service: service}
}
func (h *Activation) List(c *gin.Context) {
var req dto.ActivationQuery
if c.ShouldBindQuery(&req) != nil {
Fail(c, "渠道激活查询参数不正确")
return
}
result, err := h.service.List(c.Request.Context(), &req)
if err != nil {
Fail(c, errors.FromError(err).Message)
return
}
OKWithData(c, result)
}
func (h *Activation) SpendDetail(c *gin.Context) {
id, err := strconv.ParseUint(c.Query("id"), 10, 64)
if err != nil {
Fail(c, "绑定记录不存在")
return
}
result, err := h.service.SpendDetail(c.Request.Context(), id)
if err != nil {
Fail(c, errors.FromError(err).Message)
return
}
OKWithData(c, result)
}
+1
View File
@@ -10,6 +10,7 @@ var ProviderSet = wire.NewSet(
NewBusinessPromote,
NewAlertRule,
NewAlertRecord,
NewActivation,
NewAuthority, NewMenu, NewAPI, NewPermission, NewOrganization,
NewAnnouncement, NewEmail, NewPayment, NewTask, NewMedia, NewAudit,
NewExport, NewVersion, NewDictionary, NewParameter, NewAPIToken,
+1
View File
@@ -1,6 +1,7 @@
package handler
type Set struct {
Activation *Activation
AlertRecord *AlertRecord
AlertRule *AlertRule
BusinessPromote *BusinessPromote