add go lint
This commit is contained in:
parent
8b0aa7a0db
commit
a14747bbd7
|
@ -7,10 +7,11 @@
|
|||
package product
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -8,6 +8,7 @@ package product
|
|||
|
||||
import (
|
||||
context "context"
|
||||
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
package config
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/cache"
|
||||
"github.com/zeromicro/go-zero/zrpc"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
package categoryservicelogic
|
||||
|
||||
import (
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/entity"
|
||||
"context"
|
||||
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/entity"
|
||||
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/gen_result/pb/product"
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/internal/svc"
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
package categoryservicelogic
|
||||
|
||||
import (
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/usecase"
|
||||
"context"
|
||||
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/usecase"
|
||||
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/gen_result/pb/product"
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/internal/svc"
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
package categoryservicelogic
|
||||
|
||||
import (
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/entity"
|
||||
"context"
|
||||
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/entity"
|
||||
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/gen_result/pb/product"
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/internal/svc"
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
package kycservicelogic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/entity"
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/kyc"
|
||||
"context"
|
||||
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/gen_result/pb/product"
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/internal/svc"
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
package kycservicelogic
|
||||
|
||||
import (
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/usecase"
|
||||
"context"
|
||||
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/usecase"
|
||||
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/gen_result/pb/product"
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/internal/svc"
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
package kycservicelogic
|
||||
|
||||
import (
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/usecase"
|
||||
"context"
|
||||
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/usecase"
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/gen_result/pb/product"
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
package productitemservicelogic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/internal/utils"
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/product"
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/usecase"
|
||||
"code.30cm.net/digimon/library-go/errs"
|
||||
"context"
|
||||
|
||||
PB "code.30cm.net/digimon/app-cloudep-product-service/gen_result/pb/product"
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/internal/svc"
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
package productitemservicelogic
|
||||
|
||||
import (
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/internal/utils"
|
||||
"context"
|
||||
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/internal/utils"
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/gen_result/pb/product"
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
package productitemservicelogic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/internal/utils"
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/product"
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/usecase"
|
||||
"code.30cm.net/digimon/library-go/errs"
|
||||
"context"
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
PB "code.30cm.net/digimon/app-cloudep-product-service/gen_result/pb/product"
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
package productitemservicelogic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/gen_result/pb/product"
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/internal/svc"
|
||||
domain "code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/product"
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/usecase"
|
||||
"code.30cm.net/digimon/library-go/errs"
|
||||
"context"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
package productitemservicelogic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/product"
|
||||
"code.30cm.net/digimon/library-go/errs"
|
||||
"context"
|
||||
|
||||
PB "code.30cm.net/digimon/app-cloudep-product-service/gen_result/pb/product"
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/internal/svc"
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
package tagservicelogic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/gen_result/pb/product"
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/internal/svc"
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/entity"
|
||||
domainProduct "code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/product"
|
||||
"code.30cm.net/digimon/library-go/errs"
|
||||
"context"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
package tagservicelogic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/gen_result/pb/product"
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/internal/svc"
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/entity"
|
||||
domain "code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/product"
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/usecase"
|
||||
"code.30cm.net/digimon/library-go/errs"
|
||||
"context"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
package tagservicelogic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
domain "code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/product"
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/usecase"
|
||||
"code.30cm.net/digimon/library-go/errs"
|
||||
"context"
|
||||
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/gen_result/pb/product"
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/internal/svc"
|
||||
|
|
|
@ -8,7 +8,7 @@ import (
|
|||
"context"
|
||||
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/gen_result/pb/product"
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/internal/logic/category_service"
|
||||
categoryservicelogic "code.30cm.net/digimon/app-cloudep-product-service/internal/logic/category_service"
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/internal/svc"
|
||||
)
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import (
|
|||
"context"
|
||||
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/gen_result/pb/product"
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/internal/logic/kyc_service"
|
||||
kycservicelogic "code.30cm.net/digimon/app-cloudep-product-service/internal/logic/kyc_service"
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/internal/svc"
|
||||
)
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import (
|
|||
"context"
|
||||
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/gen_result/pb/product"
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/internal/logic/product_item_service"
|
||||
productitemservicelogic "code.30cm.net/digimon/app-cloudep-product-service/internal/logic/product_item_service"
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/internal/svc"
|
||||
)
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import (
|
|||
"context"
|
||||
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/gen_result/pb/product"
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/internal/logic/tag_service"
|
||||
tagservicelogic "code.30cm.net/digimon/app-cloudep-product-service/internal/logic/tag_service"
|
||||
"code.30cm.net/digimon/app-cloudep-product-service/internal/svc"
|
||||
)
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ const (
|
|||
|
||||
func (t *ItemType) ToString() string {
|
||||
s, _ := ItemTypeToString(*t)
|
||||
|
||||
return s
|
||||
}
|
||||
|
||||
|
@ -38,11 +39,13 @@ var stringToItemTypeMap = map[string]ItemType{
|
|||
// ItemTypeToString 將 ItemType 轉換為字串
|
||||
func ItemTypeToString(it ItemType) (string, bool) {
|
||||
str, ok := itemTypeToStringMap[it]
|
||||
|
||||
return str, ok
|
||||
}
|
||||
|
||||
// StringToItemType 將字串轉換為 ItemType
|
||||
func StringToItemType(str string) (ItemType, bool) {
|
||||
it, ok := stringToItemTypeMap[str]
|
||||
|
||||
return it, ok
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ const (
|
|||
|
||||
func (s *ShowType) ToString() string {
|
||||
str, _ := ShowTypeToString(*s)
|
||||
|
||||
return str
|
||||
}
|
||||
|
||||
|
@ -26,11 +27,13 @@ var stringToShowTypeMap = map[string]ShowType{
|
|||
// ShowTypeToString 將 ShowType 轉換為字串
|
||||
func ShowTypeToString(st ShowType) (string, bool) {
|
||||
str, ok := showTypeToStringMap[st]
|
||||
|
||||
return str, ok
|
||||
}
|
||||
|
||||
// StringToShowType 將字串轉換為 ShowType
|
||||
func StringToShowType(str string) (ShowType, bool) {
|
||||
st, ok := stringToShowTypeMap[str]
|
||||
|
||||
return st, ok
|
||||
}
|
||||
|
|
|
@ -104,11 +104,11 @@ func (repo *KYCRepository) List(ctx context.Context, params repository.KYCQueryP
|
|||
|
||||
// 設置排序選項
|
||||
opts := options.Find().SetSkip((params.PageIndex - 1) * params.PageSize).SetLimit(params.PageSize)
|
||||
//if params.SortByDate {
|
||||
// if params.SortByDate {
|
||||
// opts.SetSort(bson.E{Key: "created_at", Value: -1})
|
||||
//} else {
|
||||
// } else {
|
||||
// opts.SetSort(bson.D{{Key: "updated_at", Value: -1}})
|
||||
//}
|
||||
// }
|
||||
// 查詢符合條件的總數
|
||||
total, err := repo.DB.GetClient().CountDocuments(ctx, filter)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue