重构资源创建逻辑,整合支付宝,优化套餐生成与交易处理
This commit is contained in:
@@ -99,13 +99,13 @@ func RemoveChannels(c *fiber.Ctx) error {
|
||||
}
|
||||
|
||||
// 获取用户信息
|
||||
auth, ok := c.Locals("auth").(*services.AuthContext)
|
||||
authCtx, ok := c.Locals("auth").(*services.AuthContext)
|
||||
if !ok {
|
||||
return errors.New("user not found")
|
||||
}
|
||||
|
||||
// 删除通道
|
||||
err := services.Channel.RemoveChannels(c.Context(), auth, req.ByIds...)
|
||||
err := services.Channel.RemoveChannels(c.Context(), authCtx, req.ByIds...)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -166,7 +166,7 @@ func CreateChannelGet(c *fiber.Ctx) error {
|
||||
return err
|
||||
}
|
||||
|
||||
auth := &services.AuthContext{
|
||||
authCtx := &services.AuthContext{
|
||||
Payload: services.Payload{
|
||||
Id: user.ID,
|
||||
Type: services.PayloadUser,
|
||||
@@ -188,7 +188,7 @@ func CreateChannelGet(c *fiber.Ctx) error {
|
||||
// 建立连接通道
|
||||
result, err := services.Channel.CreateChannel(
|
||||
c.Context(),
|
||||
auth,
|
||||
authCtx,
|
||||
req.ResourceId,
|
||||
req.Protocol,
|
||||
req.AuthType,
|
||||
|
||||
Reference in New Issue
Block a user