refactor: reorganize modules and add Linux build tooling
This commit is contained in:
35
module/base/feedback/internal/logic/method/delete.go
Normal file
35
module/base/feedback/internal/logic/method/delete.go
Normal file
@@ -0,0 +1,35 @@
|
||||
// Package method 业务逻辑方法包,实现反馈相关的业务操作
|
||||
package method
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"bsm/full/module/base/feedback/internal/impl"
|
||||
"bsm/full/module/base/feedback/internal/models"
|
||||
pb "bsm/full/module/base/feedback/pb"
|
||||
"git.apinb.com/bsm-sdk/core/vars"
|
||||
"git.apinb.com/bsm-sdk/engine/exception"
|
||||
)
|
||||
|
||||
// Delete 删除反馈记录
|
||||
// ctx: 上下文
|
||||
// in: 删除请求参数,包含记录ID
|
||||
// 返回: 删除操作结果
|
||||
func Delete(ctx context.Context, in *pb.DeleteRequest) (reply *pb.StatusReply, err error) {
|
||||
// 验证请求参数
|
||||
if in.GetIdentity() == "" {
|
||||
return nil, exception.ErrInvalidArgument
|
||||
}
|
||||
|
||||
// 删除记录(GORM会自动处理关联的图片和附件删除)
|
||||
err = impl.DBService.Where("identity = ?", in.GetIdentity()).Delete(new(models.FeedbackItem)).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &pb.StatusReply{
|
||||
Message: vars.OK,
|
||||
Timeseq: time.Now().UnixMilli(),
|
||||
}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user