feat: 初次启动
This commit is contained in:
@@ -1,17 +1,11 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.10.1
|
||||
|
||||
package client
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
"sundynix-micro-go/app/system/api/internal/svc"
|
||||
"sundynix-micro-go/app/system/api/internal/types"
|
||||
sysModel "sundynix-micro-go/app/system/model"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
"sundynix-micro-go/app/system/rpc/system"
|
||||
)
|
||||
|
||||
type DeleteClientLogic struct {
|
||||
@@ -21,17 +15,10 @@ type DeleteClientLogic struct {
|
||||
}
|
||||
|
||||
func NewDeleteClientLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteClientLogic {
|
||||
return &DeleteClientLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
return &DeleteClientLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx}
|
||||
}
|
||||
|
||||
func (l *DeleteClientLogic) DeleteClient(req *types.IdsReq) error {
|
||||
if err := l.svcCtx.DB.Where("id IN ?", req.Ids).Delete(&sysModel.SundynixClient{}).Error; err != nil {
|
||||
l.Errorf("删除客户端失败: %v", err)
|
||||
return fmt.Errorf("删除客户端失败")
|
||||
}
|
||||
return nil
|
||||
_, err := l.svcCtx.SystemRpc.DeleteClient(l.ctx, &system.IdsReq{Ids: req.Ids})
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user