diff --git a/customer/customer.go b/customer/customer.go index 2ce164f..aef31de 100644 --- a/customer/customer.go +++ b/customer/customer.go @@ -1,5 +1,8 @@ package customer +import "git.oa00.com/supply-chain/service/customer/service" + type Customer struct { - User user + User user + Service service.Service } diff --git a/customer/service.go b/customer/service.go index dee26e8..1712f31 100644 --- a/customer/service.go +++ b/customer/service.go @@ -1,7 +1,5 @@ package customer -import "git.oa00.com/supply-chain/service/customer/service" - type serviceId uint const ( @@ -12,7 +10,3 @@ const ( UserServiceStatusAdopt = 2 // 审核通过 UserServiceStatusReject = 3 // 审核驳回 ) - -type Service struct { - Audit service.Audit -} diff --git a/customer/service/audit.go b/customer/service/audit.go index 6af040e..553b5b1 100644 --- a/customer/service/audit.go +++ b/customer/service/audit.go @@ -3,14 +3,13 @@ package service import ( "context" "git.oa00.com/supply-chain/service/client" - "git.oa00.com/supply-chain/service/customer/service/audit" + audit2 "git.oa00.com/supply-chain/service/customer/service/audit" "git.oa00.com/supply-chain/service/lib/bean" ) -type Audit struct { - Supply audit.Supply +type audit struct { + audit2.Audit } - type AuditSearch struct { Status uint // 审核状态 1=未审核 2=通过 3=驳回 Name string // 用户名称 @@ -36,7 +35,7 @@ type ReplyAuditLists struct { } // Lists @Title 服务审核列表 -func (a *Audit) Lists(ctx context.Context, args ArgsAuditLists) (reply ReplyAuditLists, err error) { +func (a *audit) Lists(ctx context.Context, args ArgsAuditLists) (reply ReplyAuditLists, err error) { xClient, err := client.GetClient(a) if err != nil { return diff --git a/customer/service/audit/audit.go b/customer/service/audit/audit.go new file mode 100644 index 0000000..ccbd49d --- /dev/null +++ b/customer/service/audit/audit.go @@ -0,0 +1,5 @@ +package audit + +type Audit struct { + Supply supply +} diff --git a/customer/service/audit/supply.go b/customer/service/audit/supply.go index 4ed02fc..368109e 100644 --- a/customer/service/audit/supply.go +++ b/customer/service/audit/supply.go @@ -5,11 +5,11 @@ import ( "git.oa00.com/supply-chain/service/client" ) -type Supply struct { +type supply struct { } type ArgsSupplyApply struct { - ApplyId uint // 申请人id + ApplyUserId uint // 申请人id CustomerId uint // 客户id RateId uint // 费率id ExpirationAt int64 // 到期时间 @@ -17,7 +17,7 @@ type ArgsSupplyApply struct { } // Apply @Title 申请 -func (s *Supply) Apply(ctx context.Context, args ArgsSupplyApply) error { +func (s *supply) Apply(ctx context.Context, args ArgsSupplyApply) error { reply := 0 xClient, err := client.GetClient(s) if err != nil { @@ -27,12 +27,12 @@ func (s *Supply) Apply(ctx context.Context, args ArgsSupplyApply) error { } type ArgsSupplyAdopt struct { - AuditId uint // 审核人id + AuditUserId uint // 审核人id UserServiceId uint // 客户服务id } // Adopt @Title 审核通过 -func (s *Supply) Adopt(ctx context.Context, args ArgsSupplyAdopt) error { +func (s *supply) Adopt(ctx context.Context, args ArgsSupplyAdopt) error { reply := 0 xClient, err := client.GetClient(s) if err != nil { @@ -42,13 +42,13 @@ func (s *Supply) Adopt(ctx context.Context, args ArgsSupplyAdopt) error { } type ArgsSupplyReject struct { - AuditId uint // 审核人id + AuditUserId uint // 审核人id UserServiceId uint // 客户服务id Reason string // 驳回原因 } // Reject @Title 驳回 -func (s *Supply) Reject(ctx context.Context, args ArgsSupplyReject) error { +func (s *supply) Reject(ctx context.Context, args ArgsSupplyReject) error { reply := 0 xClient, err := client.GetClient(s) if err != nil { @@ -74,7 +74,7 @@ type ReplySupplyInfo struct { } // Info @Title 详情 -func (s *Supply) Info(ctx context.Context, userServiceId uint) (reply ReplySupplyInfo, err error) { +func (s *supply) Info(ctx context.Context, userServiceId uint) (reply ReplySupplyInfo, err error) { xClient, err := client.GetClient(s) if err != nil { return diff --git a/customer/service/service.go b/customer/service/service.go new file mode 100644 index 0000000..6a8ec8c --- /dev/null +++ b/customer/service/service.go @@ -0,0 +1,5 @@ +package service + +type Service struct { + Audit audit +} diff --git a/jd/category.go b/jd/category.go index 2aad24d..54cf054 100644 --- a/jd/category.go +++ b/jd/category.go @@ -63,3 +63,21 @@ func (c *category) Select(ctx context.Context) (reply []CategoryItem, err error) err = xClient.Call(ctx, "Select", args, &reply) return } + +type ArgsCategoryImport struct { + First string + Second string + Third string + SupplyCategoryId uint +} + +// Import @Title 导入 +func (*category) Import(ctx context.Context, args []ArgsCategoryImport) (err error) { + reply := 0 + xClient, err := client.GetClient(ctx) + if err != nil { + return + } + err = xClient.Call(ctx, "Import", args, &reply) + return +}