feat: rbac完善,file接入完成
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
"sundynix-micro-go/app/file/model"
|
||||
"sundynix-micro-go/app/file/rpc/file"
|
||||
"sundynix-micro-go/app/file/rpc/internal/svc"
|
||||
)
|
||||
|
||||
type DeleteStorageConfigLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewDeleteStorageConfigLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteStorageConfigLogic {
|
||||
return &DeleteStorageConfigLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *DeleteStorageConfigLogic) DeleteStorageConfig(in *file.DeleteFilesReq) (*file.CommonResp, error) {
|
||||
if len(in.Ids) == 0 {
|
||||
return &file.CommonResp{Code: 400, Msg: "ids不能为空"}, nil
|
||||
}
|
||||
err := l.svcCtx.DB.Where("id IN ?", in.Ids).Delete(&model.StorageConfig{}).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &file.CommonResp{Code: 0, Msg: "删除成功"}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user