refactor: 移除客户等级和企业规模的枚举限制,更新相关文档和请求结构以简化字段定义
This commit is contained in:
1 parent
1d62dc4e95
commit
ac8066e0a5
3 files changed
+10
-30
No files matched your search
@@ -433,11 +433,6 @@ definitions:
|
||||
type: string
|
||||
company_size:
|
||||
description: 企业规模,可选
|
||||
enum:
|
||||
- small
|
||||
- medium
|
||||
- large
|
||||
- enterprise
|
||||
type: string
|
||||
contact_person:
|
||||
description: 联系人姓名,必填
|
||||
@@ -449,11 +444,6 @@ definitions:
|
||||
type: string
|
||||
customer_level:
|
||||
description: 客户等级,必填
|
||||
enum:
|
||||
- basic
|
||||
- active
|
||||
- vip
|
||||
- strategic
|
||||
type: string
|
||||
customer_name:
|
||||
description: 客户名称,必填
|
||||
@@ -580,11 +570,6 @@ definitions:
|
||||
type: string
|
||||
company_size:
|
||||
description: 企业规模,可选
|
||||
enum:
|
||||
- small
|
||||
- medium
|
||||
- large
|
||||
- enterprise
|
||||
type: string
|
||||
contact_person:
|
||||
description: 联系人姓名,可选
|
||||
@@ -596,11 +581,6 @@ definitions:
|
||||
type: string
|
||||
customer_level:
|
||||
description: 客户等级,可选
|
||||
enum:
|
||||
- basic
|
||||
- active
|
||||
- vip
|
||||
- strategic
|
||||
type: string
|
||||
customer_name:
|
||||
description: 客户名称,可选
|
||||
|
||||
@@ -81,7 +81,7 @@ type CustomerListRequest struct {
|
||||
PageSize int `form:"page_size" binding:"omitempty,min=1,max=100"` // 每页条数,默认20,最大100
|
||||
Search string `form:"search" binding:"omitempty,max=100"` // 搜索关键词(支持客户编码、名称、联系人、邮箱)
|
||||
CustomerType string `form:"customer_type" binding:"omitempty,oneof=individual enterprise government education"` // 客户类型筛选
|
||||
CustomerLevel string `form:"customer_level" binding:"omitempty,oneof=basic active vip strategic"` // 客户等级筛选
|
||||
CustomerLevel string `form:"customer_level" binding:"omitempty"` // 客户等级筛选
|
||||
Status string `form:"status" binding:"omitempty,oneof=active disabled"` // 状态筛选
|
||||
Sort string `form:"sort" binding:"omitempty,oneof=created_at updated_at customer_name customer_code"` // 排序字段,默认created_at
|
||||
Order string `form:"order" binding:"omitempty,oneof=asc desc"` // 排序方向,默认desc
|
||||
@@ -121,8 +121,8 @@ type CustomerCreateRequest struct {
|
||||
Email *string `json:"email" binding:"omitempty,email,max=255"` // 邮箱,可选
|
||||
Phone *string `json:"phone" binding:"omitempty,max=20"` // 电话,可选
|
||||
Address *string `json:"address" binding:"omitempty,max=500"` // 地址,可选
|
||||
CompanySize *string `json:"company_size" binding:"omitempty,oneof=small medium large enterprise"` // 企业规模,可选
|
||||
CustomerLevel string `json:"customer_level" binding:"required,oneof=basic active vip strategic"` // 客户等级,必填
|
||||
CompanySize *string `json:"company_size" binding:"omitempty"` // 企业规模,可选
|
||||
CustomerLevel string `json:"customer_level" binding:"required"` // 客户等级,必填
|
||||
Status string `json:"status" binding:"required,oneof=active disabled"` // 状态,必填
|
||||
Description *string `json:"description" binding:"omitempty,max=1000"` // 描述,可选
|
||||
}
|
||||
@@ -136,8 +136,8 @@ type CustomerUpdateRequest struct {
|
||||
Email *string `json:"email" binding:"omitempty,email,max=255"` // 邮箱,可选
|
||||
Phone *string `json:"phone" binding:"omitempty,max=20"` // 电话,可选
|
||||
Address *string `json:"address" binding:"omitempty,max=500"` // 地址,可选
|
||||
CompanySize *string `json:"company_size" binding:"omitempty,oneof=small medium large enterprise"` // 企业规模,可选
|
||||
CustomerLevel *string `json:"customer_level" binding:"omitempty,oneof=basic active vip strategic"` // 客户等级,可选
|
||||
CompanySize *string `json:"company_size" binding:"omitempty"` // 企业规模,可选
|
||||
CustomerLevel *string `json:"customer_level" binding:"omitempty"` // 客户等级,可选
|
||||
Status *string `json:"status" binding:"omitempty,oneof=active disabled"` // 状态,可选
|
||||
Description *string `json:"description" binding:"omitempty,max=1000"` // 描述,可选
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ export interface CustomerQueryRequest {
|
||||
search?: string;
|
||||
customer_name?: string;
|
||||
customer_type?: 'individual' | 'enterprise' | 'government' | 'education';
|
||||
customer_level?: 'basic' | 'active' | 'vip' | 'strategic';
|
||||
customer_level?: string;
|
||||
status?: 'active' | 'disabled';
|
||||
sort?: 'created_at' | 'updated_at' | 'customer_name' | 'customer_code';
|
||||
order?: 'asc' | 'desc';
|
||||
@@ -47,9 +47,9 @@ export interface CustomerCreateRequest {
|
||||
email?: string;
|
||||
phone?: string;
|
||||
address?: string;
|
||||
customer_level: 'basic' | 'active' | 'vip' | 'strategic';
|
||||
customer_level: string;
|
||||
status: 'active' | 'disabled';
|
||||
company_size?: 'small' | 'medium' | 'large' | 'enterprise';
|
||||
company_size?: string;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
@@ -62,9 +62,9 @@ export interface CustomerUpdateRequest {
|
||||
email?: string;
|
||||
phone?: string;
|
||||
address?: string;
|
||||
customer_level?: 'basic' | 'active' | 'vip' | 'strategic';
|
||||
customer_level?: string;
|
||||
status?: 'active' | 'disabled';
|
||||
company_size?: 'small' | 'medium' | 'large' | 'enterprise';
|
||||
company_size?: string;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user