refactor: centralize protobuf and remove go-zero

This commit is contained in:
2026-08-09 15:10:19 +08:00
parent 5cc5fd92ed
commit 4bbed3156c
357 changed files with 14208 additions and 19903 deletions

View File

@@ -8,8 +8,8 @@ import (
"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/errcode"
"git.apinb.com/bsm-sdk/core/vars"
"git.apinb.com/bsm-sdk/engine/exception"
)
// Delete 删除反馈记录
@@ -19,7 +19,7 @@ import (
func Delete(ctx context.Context, in *pb.DeleteRequest) (reply *pb.StatusReply, err error) {
// 验证请求参数
if in.GetIdentity() == "" {
return nil, exception.ErrInvalidArgument
return nil, errcode.ErrInvalidArgument
}
// 删除记录GORM会自动处理关联的图片和附件删除

View File

@@ -8,7 +8,7 @@ import (
"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/engine/exception"
"git.apinb.com/bsm-sdk/core/errcode"
"gorm.io/gorm"
)
@@ -19,7 +19,7 @@ import (
func Get(ctx context.Context, in *pb.GetRequest) (reply *pb.GetReply, err error) {
// 验证请求参数
if in.GetIdentity() == "" {
return nil, exception.ErrInvalidArgument
return nil, errcode.ErrInvalidArgument
}
out := new(pb.GetReply)
@@ -29,7 +29,7 @@ func Get(ctx context.Context, in *pb.GetRequest) (reply *pb.GetReply, err error)
err = impl.DBService.Preload("Images").Where("identity = ?", in.GetIdentity()).First(record).Error
if err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
return nil, exception.ErrNotFound
return nil, errcode.ErrRecordNotFound
}
return nil, err
}

View File

@@ -8,11 +8,11 @@ import (
"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/errcode"
"git.apinb.com/bsm-sdk/core/service"
"git.apinb.com/bsm-sdk/core/types"
"git.apinb.com/bsm-sdk/core/utils"
"git.apinb.com/bsm-sdk/core/vars"
"git.apinb.com/bsm-sdk/engine/exception"
)
// Modify 修改反馈记录
@@ -28,7 +28,7 @@ func Modify(ctx context.Context, in *pb.ModifyRequest) (reply *pb.StatusReply, e
// 验证请求参数
if in.GetIdentity() == "" {
return nil, exception.ErrInvalidArgument
return nil, errcode.ErrInvalidArgument
}
// 构建更新记录

View File

@@ -8,8 +8,8 @@ import (
"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/errcode"
"git.apinb.com/bsm-sdk/core/vars"
"git.apinb.com/bsm-sdk/engine/exception"
)
// Remark 添加或更新反馈记录的备注和状态
@@ -19,7 +19,7 @@ import (
func Remark(ctx context.Context, in *pb.RemarkRequest) (reply *pb.StatusReply, err error) {
// 验证请求参数
if in.GetIdentity() == "" {
return nil, exception.ErrInvalidArgument
return nil, errcode.ErrInvalidArgument
}
// 构建更新记录

View File

@@ -2,9 +2,9 @@
package server
import (
"context"
"bsm/full/module/base/feedback/internal/logic/method"
pb "bsm/full/module/base/feedback/pb"
"context"
)
type MethodServer struct {

View File

@@ -2,8 +2,8 @@
package server
import (
"context"
pb "bsm/full/module/base/feedback/pb"
"context"
"git.apinb.com/bsm-sdk/core/vars"
gwRuntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"google.golang.org/grpc"