feat: integrate OA activation workflows and business migration
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/go-kratos/kratos/v3/errors"
|
||||
"kra/internal/service/dto"
|
||||
)
|
||||
|
||||
func (h *Activation) Pool(c *gin.Context) {
|
||||
var req dto.ActivationPoolQuery
|
||||
if c.ShouldBindQuery(&req) != nil {
|
||||
Fail(c, "申请绑定查询参数不正确")
|
||||
return
|
||||
}
|
||||
result, err := h.service.Pool(c.Request.Context(), &req)
|
||||
if err != nil {
|
||||
Fail(c, errors.FromError(err).Message)
|
||||
return
|
||||
}
|
||||
OKWithData(c, result)
|
||||
}
|
||||
func (h *Activation) Options(c *gin.Context) {
|
||||
result, err := h.service.Options(c.Request.Context())
|
||||
if err != nil {
|
||||
Fail(c, errors.FromError(err).Message)
|
||||
return
|
||||
}
|
||||
OKWithData(c, result)
|
||||
}
|
||||
func (h *Activation) Apply(c *gin.Context) {
|
||||
var req dto.ActivationApplyRequest
|
||||
if c.ShouldBindJSON(&req) != nil {
|
||||
Fail(c, "激活申请参数不正确")
|
||||
return
|
||||
}
|
||||
if err := h.service.Apply(c.Request.Context(), &req); err != nil {
|
||||
Fail(c, errors.FromError(err).Message)
|
||||
return
|
||||
}
|
||||
OKWithData(c, nil)
|
||||
}
|
||||
func (h *Activation) Churn(c *gin.Context) {
|
||||
var req dto.ActivationPoolQuery
|
||||
if c.ShouldBindQuery(&req) != nil {
|
||||
Fail(c, "流失记录查询参数不正确")
|
||||
return
|
||||
}
|
||||
result, err := h.service.Churn(c.Request.Context(), &req)
|
||||
if err != nil {
|
||||
Fail(c, errors.FromError(err).Message)
|
||||
return
|
||||
}
|
||||
OKWithData(c, result)
|
||||
}
|
||||
@@ -49,6 +49,10 @@ func (r *Routes) RegisterRoutes(public, private *gin.RouterGroup, engine *gin.En
|
||||
},
|
||||
func() { RegisterChannel(private, r.handlers.Channel) },
|
||||
func() {
|
||||
private.GET("/sw/promoteActivePool/pool", r.handlers.Activation.Pool)
|
||||
private.GET("/sw/promoteActivePool/options", r.handlers.Activation.Options)
|
||||
private.POST("/sw/promoteActivePool/apply", r.handlers.Activation.Apply)
|
||||
private.GET("/sw/promoteActivePool/churn", r.handlers.Activation.Churn)
|
||||
private.GET("/sw/promoteActivePool/bindList", r.handlers.Activation.List)
|
||||
private.GET("/sw/promoteActivePool/bindSpendDetail", r.handlers.Activation.SpendDetail)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user