dev
This commit is contained in:
		
							parent
							
								
									06b9a5a15d
								
							
						
					
					
						commit
						1d8b4c9686
					
				|  | @ -28,7 +28,7 @@ export interface AddressAddRequest { | ||||||
| export interface FetchRequest { | export interface FetchRequest { | ||||||
|     page_no?: number;  //  页数 
 |     page_no?: number;  //  页数 
 | ||||||
|     page_size?: number;  //  每页记录数 
 |     page_size?: number;  //  每页记录数 
 | ||||||
|     params?: ParamsEntry[];  //  条件参数,key=val,eg key:category_id=?,vlaue=11  
 |     params?: { [key in string]: any};  //  条件参数,key=val,eg key:category_id=?,vlaue=11  
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | @ -52,5 +52,5 @@ export interface AddressListReply { | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| export interface AddressDelRequest { | export interface AddressDelRequest { | ||||||
|     id?: number;  //  ID 
 |     id?: number[];  //  ID 
 | ||||||
| } | } | ||||||
|  | @ -4,9 +4,7 @@ export interface Empty { | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  authorization_identity 用户识别identity 由上下文传递 |  //  authorization_identity 用户识别identity 由上下文传递   user_identity 用于鉴权 
 | ||||||
|   user_identity 用于鉴权 |  | ||||||
| 
 |  | ||||||
| export interface ListRequest { | export interface ListRequest { | ||||||
|     identity?: string;  //  文件夹唯一标识,获取顶级的不传 
 |     identity?: string;  //  文件夹唯一标识,获取顶级的不传 
 | ||||||
|     name?: string;  // 根据文件名称模糊查找,当该字段不为空时identity的限定失效 
 |     name?: string;  // 根据文件名称模糊查找,当该字段不为空时identity的限定失效 
 | ||||||
|  | @ -29,7 +27,7 @@ export interface DirTreeResponse { | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| export interface DownloadRequest { | export interface DownloadRequest { | ||||||
|     list?: string;  //  identity列表,必传 
 |     list?: string[];  //  identity列表,必传 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | @ -37,8 +35,8 @@ export interface UserFile { | ||||||
|     identity?: string;  // 唯一标识 
 |     identity?: string;  // 唯一标识 
 | ||||||
|     name?: string;  // 文件/文件夹名称 
 |     name?: string;  // 文件/文件夹名称 
 | ||||||
|     ext?: string;  // 后缀,文件夹时为空 
 |     ext?: string;  // 后缀,文件夹时为空 
 | ||||||
|     parent?: string;  //  父级文件夹序列,按文件名称查询时候生效 
 |     parent?: string[];  //  父级文件夹序列,按文件名称查询时候生效 
 | ||||||
|     file?: TYPE_MESSAGE;  // 文件信息 
 |     file?: File;  // 文件信息 
 | ||||||
|     created_at?: string;  |     created_at?: string;  | ||||||
|     updated_at?: string;  |     updated_at?: string;  | ||||||
|     children?: UserFile[];  // 子文件夹 
 |     children?: UserFile[];  // 子文件夹 
 | ||||||
|  | @ -66,8 +64,7 @@ export interface MakeResponse { | ||||||
|     identity?: string;  |     identity?: string;  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  同级下,名称必须唯一 |  //  同级下,名称必须唯一 
 | ||||||
| 
 |  | ||||||
| export interface RenameRequest { | export interface RenameRequest { | ||||||
|     identity?: string;  // 必传 
 |     identity?: string;  // 必传 
 | ||||||
|     name?: string;  // 文件/文件夹名称,必传 
 |     name?: string;  // 文件/文件夹名称,必传 
 | ||||||
|  | @ -76,24 +73,24 @@ export interface RenameRequest { | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| export interface RemoveRequest { | export interface RemoveRequest { | ||||||
|     list?: string;  //  identity列表 
 |     list?: string[];  //  identity列表 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| export interface MoveRequest { | export interface MoveRequest { | ||||||
|     list?: string;  //  identity列表 
 |     list?: string[];  //  identity列表 
 | ||||||
|     target_identity?: string;  //  目标文件夹标识,如果是顶级则不填 
 |     target_identity?: string;  //  目标文件夹标识,如果是顶级则不填 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| export interface CopyRequest { | export interface CopyRequest { | ||||||
|     list?: string;  //  identity列表 
 |     list?: string[];  //  identity列表 
 | ||||||
|     target_identity?: string;  //  目标文件夹标识,如果是顶级则不填 
 |     target_identity?: string;  //  目标文件夹标识,如果是顶级则不填 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| export interface ShareRequest { | export interface ShareRequest { | ||||||
|     list?: string;  //  identity列表 
 |     list?: string[];  //  identity列表 
 | ||||||
|     days?: number;  //  有效天数,默认永久 
 |     days?: number;  //  有效天数,默认永久 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -18,14 +18,14 @@ export interface CompanyListRequest { | ||||||
|     relation_genre?: number;  //  关联关系类型: 1 成员企业、2 分销企业、3 供货企业 
 |     relation_genre?: number;  //  关联关系类型: 1 成员企业、2 分销企业、3 供货企业 
 | ||||||
|     registered_start_at?: string;  //  注册时间-开始,格式:2006-01-02 15:04:05 
 |     registered_start_at?: string;  //  注册时间-开始,格式:2006-01-02 15:04:05 
 | ||||||
|     registered_end_at?: string;  //  注册时间-结束格式:2006-01-02 15:04:05 
 |     registered_end_at?: string;  //  注册时间-结束格式:2006-01-02 15:04:05 
 | ||||||
|     with_statistics?: TYPE_BOOL;  //  是否需要查询统计信息 
 |     with_statistics?: bool;  //  是否需要查询统计信息 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| export interface CompanyListReply { | export interface CompanyListReply { | ||||||
|     list?: CompanyItem[];  |     list?: CompanyItem[];  | ||||||
|     count?: number;  |     count?: number;  | ||||||
|     statistics?: TYPE_MESSAGE;  |     statistics?: CompanyStatisticsData;  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | @ -83,7 +83,7 @@ export interface DeliveryAddressItem { | ||||||
|     province_identity?: string;  // 省级identity 
 |     province_identity?: string;  // 省级identity 
 | ||||||
|     city_identity?: string;  //  市级identity 
 |     city_identity?: string;  //  市级identity 
 | ||||||
|     district_identity?: string;  //  区级identity 
 |     district_identity?: string;  //  区级identity 
 | ||||||
|     is_default?: TYPE_BOOL;  |     is_default?: bool;  | ||||||
|     created_at?: string;  |     created_at?: string;  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @ -100,12 +100,12 @@ export interface CollectionInformationItem { | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| export interface RoleRequest { | export interface RoleRequest { | ||||||
|     company_identity?: string;  //  企业identity,如果不传具体的identity就查询所有的 
 |     company_identity?: string[];  //  企业identity,如果不传具体的identity就查询所有的 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| export interface RoleReply { | export interface RoleReply { | ||||||
|     kv?: KvEntry[];  //  key:company_identity 
 |     kv?: { [key in string]: any};  //  key:company_identity 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | @ -131,7 +131,7 @@ export interface StaffListRequest { | ||||||
|     status?: number;  |     status?: number;  | ||||||
|     registered_start_at?: string;  //  注册时间-开始,格式:2006-01-02 15:04:05 
 |     registered_start_at?: string;  //  注册时间-开始,格式:2006-01-02 15:04:05 
 | ||||||
|     registered_end_at?: string;  //  注册时间-结束格式:2006-01-02 15:04:05 
 |     registered_end_at?: string;  //  注册时间-结束格式:2006-01-02 15:04:05 
 | ||||||
|     with_statistics?: TYPE_BOOL;  //  是否需要查询统计信息 
 |     with_statistics?: bool;  //  是否需要查询统计信息 
 | ||||||
|     staff_identity?: string;  |     staff_identity?: string;  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @ -139,7 +139,7 @@ export interface StaffListRequest { | ||||||
| export interface StaffListReply { | export interface StaffListReply { | ||||||
|     list?: StaffItem[];  |     list?: StaffItem[];  | ||||||
|     count?: number;  |     count?: number;  | ||||||
|     statistics?: TYPE_MESSAGE;  |     statistics?: StaffStatisticsData;  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -44,8 +44,8 @@ export interface GetRequest { | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| export interface GetReply { | export interface GetReply { | ||||||
|     record?: TYPE_MESSAGE;  |     record?: FeedbackItem;  | ||||||
|     exists?: TYPE_BOOL;  |     exists?: bool;  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -20,14 +20,12 @@ export interface StoreBasic { | ||||||
|     created_at?: string;  // 创建时间 
 |     created_at?: string;  // 创建时间 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  店铺唯一KEY |  //  店铺唯一KEY 
 | ||||||
| 
 |  | ||||||
| export interface UniqueIndex { | export interface UniqueIndex { | ||||||
|     store_key?: string;  // 店铺唯一KEY 
 |     store_key?: string;  // 店铺唯一KEY 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  产品分类数据列表 |  //  产品分类数据列表 
 | ||||||
| 
 |  | ||||||
| export interface CategoryReply { | export interface CategoryReply { | ||||||
|     data?: CategoryItem[];  |     data?: CategoryItem[];  | ||||||
| } | } | ||||||
|  | @ -114,7 +112,7 @@ export interface GetRequest { | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| export interface GetReply { | export interface GetReply { | ||||||
|     detail?: TYPE_MESSAGE;  // 商品详情数据 
 |     detail?: ProductItem;  // 商品详情数据 
 | ||||||
|     attr?: AttrItem[];  // 商品属性数据 
 |     attr?: AttrItem[];  // 商品属性数据 
 | ||||||
|     photos?: PhotosItem[];  // 商品相册数据 
 |     photos?: PhotosItem[];  // 商品相册数据 
 | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -1,6 +1,5 @@ | ||||||
| 
 | 
 | ||||||
|  sms module |  //  sms module 
 | ||||||
| 
 |  | ||||||
| export interface MailSendRequest { | export interface MailSendRequest { | ||||||
|     sign_name?: string;  //  必传项 
 |     sign_name?: string;  //  必传项 
 | ||||||
| } | } | ||||||
|  | @ -10,19 +9,18 @@ export interface MailSendResponse { | ||||||
|     request_id?: string;  |     request_id?: string;  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  sms module |  //  sms module 
 | ||||||
| 
 |  | ||||||
| export interface SmsSendRequest { | export interface SmsSendRequest { | ||||||
|     sign_name?: string;  //  必传项 
 |     sign_name?: string;  //  必传项 
 | ||||||
|     template_code?: string;  //  必传项 
 |     template_code?: string;  //  必传项 
 | ||||||
|     phone?: string;  //  必传项 
 |     phone?: string;  //  必传项 
 | ||||||
|     paramters?: ParamtersEntry[];  |     paramters?: { [key in string]: any};  | ||||||
|     generate_code?: TYPE_BOOL;  //  验证码相关 是否生成验证码 
 |     generate_code?: bool;  //  验证码相关 是否生成验证码 
 | ||||||
|     expire_interval?: number;  // 验证码缓存时间,单位:分钟,仅generate_code为true时会缓存,默认5分钟 
 |     expire_interval?: number;  // 验证码缓存时间,单位:分钟,仅generate_code为true时会缓存,默认5分钟 
 | ||||||
|     code_width?: number;  // 验证码长度,默认 4 
 |     code_width?: number;  // 验证码长度,默认 4 
 | ||||||
|     code_key?: string;  // template_code 模板中验证码的标识,默认code 
 |     code_key?: string;  // template_code 模板中验证码的标识,默认code 
 | ||||||
|     has_black_list_filter?: TYPE_BOOL;  //  是否黑单过滤,默认不过滤 
 |     has_black_list_filter?: bool;  //  是否黑单过滤,默认不过滤 
 | ||||||
|     wihout_limit?: TYPE_BOOL;  // 忽略每天短信条数上线限制,默认不忽略 
 |     wihout_limit?: bool;  // 忽略每天短信条数上线限制,默认不忽略 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | @ -38,5 +36,5 @@ export interface SmsVerifyRequest { | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| export interface PassResponse { | export interface PassResponse { | ||||||
|     pass?: TYPE_BOOL;  |     pass?: bool;  | ||||||
| } | } | ||||||
|  | @ -8,7 +8,7 @@ export interface Empty { | ||||||
| export interface FetchRequest { | export interface FetchRequest { | ||||||
|     page_no?: number;  //  页数 
 |     page_no?: number;  //  页数 
 | ||||||
|     page_size?: number;  //  每页记录数 
 |     page_size?: number;  //  每页记录数 
 | ||||||
|     params?: ParamsEntry[];  //  条件参数,key=val,eg key:category_id=?,vlaue=11  
 |     params?: { [key in string]: any};  //  条件参数,key=val,eg key:category_id=?,vlaue=11  
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | @ -67,7 +67,7 @@ export interface CartSetRequest { | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| export interface CartDelRequest { | export interface CartDelRequest { | ||||||
|     id?: number;  //  购物车ID 
 |     id?: number[];  //  购物车ID 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | @ -108,7 +108,7 @@ export interface FetchReply { | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| export interface CancelPlanRequest { | export interface CancelPlanRequest { | ||||||
|     id?: number;  |     id?: number[];  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | @ -132,14 +132,14 @@ export interface QuickCreateByTokenRequest { | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| export interface SubmitRequest { | export interface SubmitRequest { | ||||||
|     id?: string;  //  购物车的ID数据,以逗号分开 
 |     id?: string[];  //  购物车的ID数据,以逗号分开 
 | ||||||
|     partner_id?: number;  //  合伙人ID 
 |     partner_id?: number;  //  合伙人ID 
 | ||||||
|     address_id?: number;  //  地址ID 
 |     address_id?: number;  //  地址ID 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| export interface SummaryGetReply { | export interface SummaryGetReply { | ||||||
|     summary?: TYPE_MESSAGE;  //  订单概要详情 
 |     summary?: OrderSummary;  //  订单概要详情 
 | ||||||
|     details?: OrderDetails[];  //  订单商品详情 
 |     details?: OrderDetails[];  //  订单商品详情 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -3,7 +3,7 @@ | ||||||
| export interface FetchRequest { | export interface FetchRequest { | ||||||
|     page_no?: number;  //  页数 
 |     page_no?: number;  //  页数 
 | ||||||
|     page_size?: number;  //  每页记录数 
 |     page_size?: number;  //  每页记录数 
 | ||||||
|     params?: ParamsEntry[];  //  条件参数,key=val,eg key:category_id=?,vlaue=11  
 |     params?: { [key in string]: any};  //  条件参数,key=val,eg key:category_id=?,vlaue=11  
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | @ -52,7 +52,7 @@ export interface ForgetReply { | ||||||
|     identity?: string;  // 用户唯一码 
 |     identity?: string;  // 用户唯一码 
 | ||||||
|     data_bind?: string;  //  数据绑定的相关说明,PASS通过,NOPHONE没有绑定手机号,NOPWD没有设置密码,NOBIND没有手机号同时没有密码 
 |     data_bind?: string;  //  数据绑定的相关说明,PASS通过,NOPHONE没有绑定手机号,NOPWD没有设置密码,NOBIND没有手机号同时没有密码 
 | ||||||
|     token?: string;  // 用户凭证 
 |     token?: string;  // 用户凭证 
 | ||||||
|     extend?: ExtendEntry[];  // 扩展字段 
 |     extend?: { [key in string]: any};  // 扩展字段 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | @ -99,12 +99,12 @@ export interface SetPasswordRequest { | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| export interface StatisticsRequest { | export interface StatisticsRequest { | ||||||
|     field?: string;  // 要获取的统计数据字段。 
 |     field?: string[];  // 要获取的统计数据字段。 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| export interface StatisticsReply { | export interface StatisticsReply { | ||||||
|     Data?: DataEntry[];  // 数据以Map格式输出 
 |     Data?: { [key in string]: any};  // 数据以Map格式输出 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | @ -175,7 +175,7 @@ export interface LoginReply { | ||||||
|     identity?: string;  // 用户唯一码 
 |     identity?: string;  // 用户唯一码 
 | ||||||
|     data_bind?: string;  //  数据绑定的相关说明,PASS通过,NOPHONE没有绑定手机号,NOPWD没有设置密码,NOBIND没有手机号同时没有密码 
 |     data_bind?: string;  //  数据绑定的相关说明,PASS通过,NOPHONE没有绑定手机号,NOPWD没有设置密码,NOBIND没有手机号同时没有密码 
 | ||||||
|     token?: string;  // 用户凭证 
 |     token?: string;  // 用户凭证 
 | ||||||
|     extend?: ExtendEntry[];  // 扩展字段 
 |     extend?: { [key in string]: any};  // 扩展字段 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | @ -201,5 +201,5 @@ export interface RegisterReply { | ||||||
|     identity?: string;  // 用户唯一码 
 |     identity?: string;  // 用户唯一码 
 | ||||||
|     data_bind?: string;  //  数据绑定的相关说明,PASS通过,NOPHONE没有绑定手机号,NOPWD没有设置密码,NOBIND没有手机号同时没有密码 
 |     data_bind?: string;  //  数据绑定的相关说明,PASS通过,NOPHONE没有绑定手机号,NOPWD没有设置密码,NOBIND没有手机号同时没有密码 
 | ||||||
|     token?: string;  // 用户Header所需Token 
 |     token?: string;  // 用户Header所需Token 
 | ||||||
|     extend?: ExtendEntry[];  // 扩展字段 
 |     extend?: { [key in string]: any};  // 扩展字段 
 | ||||||
| } | } | ||||||
							
								
								
									
										60
									
								
								cli/main.go
								
								
								
								
							
							
						
						
									
										60
									
								
								cli/main.go
								
								
								
								
							|  | @ -180,7 +180,15 @@ export interface {{Name}} { | ||||||
| 			if msgItem.GetSourceInfo().GetLeadingComments() != "" { | 			if msgItem.GetSourceInfo().GetLeadingComments() != "" { | ||||||
| 				commit = msgItem.GetSourceInfo().GetLeadingComments() | 				commit = msgItem.GetSourceInfo().GetLeadingComments() | ||||||
| 			} | 			} | ||||||
| 			msgBody = strings.ReplaceAll(msgBody, "{{Commit}}", commit) | 			commit = strings.ReplaceAll(commit, "\r\n", " ") | ||||||
|  | 			commit = strings.ReplaceAll(commit, "\n", " ") | ||||||
|  | 
 | ||||||
|  | 			if commit == "" { | ||||||
|  | 				msgBody = strings.ReplaceAll(msgBody, "{{Commit}}", "") | ||||||
|  | 			} else { | ||||||
|  | 				msgBody = strings.ReplaceAll(msgBody, "{{Commit}}", " // "+commit) | ||||||
|  | 			} | ||||||
|  | 
 | ||||||
| 			msgBody = strings.ReplaceAll(msgBody, "{{Name}}", msgItem.GetName()) | 			msgBody = strings.ReplaceAll(msgBody, "{{Name}}", msgItem.GetName()) | ||||||
| 			msgBody = strings.ReplaceAll(msgBody, "{{Data}}", strings.Join(data, "\r\n")) | 			msgBody = strings.ReplaceAll(msgBody, "{{Data}}", strings.Join(data, "\r\n")) | ||||||
| 
 | 
 | ||||||
|  | @ -219,25 +227,41 @@ func dispFields(fd *desc.FieldDescriptor) string { | ||||||
| 		tpl = strings.ReplaceAll(tpl, "{{Commit}}", " // "+commit) | 		tpl = strings.ReplaceAll(tpl, "{{Commit}}", " // "+commit) | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	var fdType string = "" | 	tpl = strings.ReplaceAll(tpl, "{{Type}}", getFdType(fd)) | ||||||
| 	switch fd.GetType().String() { |  | ||||||
| 	case "TYPE_STRING": |  | ||||||
| 		fdType = "string" |  | ||||||
| 	case "TYPE_INT64", "TYPE_INT32", "TYPE_FLOAT32", "TYPE_FLOAT64": |  | ||||||
| 		fdType = "number" |  | ||||||
| 	case "bool": |  | ||||||
| 		fdType = "TYPE_BOOL" |  | ||||||
| 	default: |  | ||||||
| 		if fd.GetLabel().String() == "LABEL_REPEATED" { |  | ||||||
| 			fdType = fd.GetMessageType().GetName() + "[]" |  | ||||||
| 		} else { |  | ||||||
| 			fdType = fd.GetType().String() |  | ||||||
| 		} |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	tpl = strings.ReplaceAll(tpl, "{{Type}}", fdType) |  | ||||||
| 
 | 
 | ||||||
| 	tpl = strings.ReplaceAll(tpl, "\r\n", "") | 	tpl = strings.ReplaceAll(tpl, "\r\n", "") | ||||||
| 
 | 
 | ||||||
| 	return tpl | 	return tpl | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | func getFdType(fd *desc.FieldDescriptor) string { | ||||||
|  | 
 | ||||||
|  | 	if fd.IsMap() { | ||||||
|  | 		return "{ [key in string]: any}" | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	if fd.IsRepeated() { | ||||||
|  | 		switch fd.GetType().String() { | ||||||
|  | 		case "TYPE_STRING": | ||||||
|  | 			return "string[]" | ||||||
|  | 		case "TYPE_INT64", "TYPE_INT32", "TYPE_FLOAT32", "TYPE_FLOAT64": | ||||||
|  | 			return "number[]" | ||||||
|  | 		case "TYPE_MESSAGE": | ||||||
|  | 			return fd.GetMessageType().GetName() + "[]" | ||||||
|  | 		} | ||||||
|  | 
 | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	switch fd.GetType().String() { | ||||||
|  | 	case "TYPE_STRING": | ||||||
|  | 		return "string" | ||||||
|  | 	case "TYPE_INT64", "TYPE_INT32", "TYPE_FLOAT32", "TYPE_FLOAT64": | ||||||
|  | 		return "number" | ||||||
|  | 	case "TYPE_BOOL": | ||||||
|  | 		return "bool" | ||||||
|  | 	case "TYPE_MESSAGE": | ||||||
|  | 		return fd.GetMessageType().GetName() | ||||||
|  | 	default: | ||||||
|  | 		return fd.GetType().String() | ||||||
|  | 	} | ||||||
|  | } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue