2026-08-09 10:43:45 +08:00
|
|
|
|
// Package method 业务逻辑方法包,实现反馈相关的业务操作
|
|
|
|
|
|
package method
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
|
"context"
|
|
|
|
|
|
"time"
|
|
|
|
|
|
|
2026-08-09 12:41:08 +08:00
|
|
|
|
"bsm/full/module/base/feedback/internal/impl"
|
|
|
|
|
|
"bsm/full/module/base/feedback/internal/models"
|
|
|
|
|
|
pb "bsm/full/module/base/feedback/pb"
|
2026-08-09 10:43:45 +08:00
|
|
|
|
"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
|
|
|
|
|
|
}
|