优化code reason定义
This commit is contained in:
		
							
								
								
									
										10
									
								
								define.go
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								define.go
									
									
									
									
									
								
							| @ -13,9 +13,9 @@ package exception | |||||||
| // | // | ||||||
| // Date : 15:55 2023/6/9 | // Date : 15:55 2023/6/9 | ||||||
| type Code struct { | type Code struct { | ||||||
| 	Value   interface{}              `json:"value"`   // 状态码的值 | 	Value   interface{}       `json:"value"`   // 状态码的值 | ||||||
| 	Message map[string]string        `json:"message"` // 状态码对应的文案(key -> 语言 , value -> 对应语言的描述) | 	Message map[string]string `json:"message"` // 状态码对应的文案(key -> 语言 , value -> 对应语言的描述) | ||||||
| 	Reason  map[string][]*CodeReason `json:"reason"`  // 产生此错误码的原因描述(key -> 语言 , value -> 对应语言的原因列表) | 	Reason  []*CodeReason     `json:"reason"`  // 产生此错误码的原因描述(key -> 语言 , value -> 对应语言的原因列表) | ||||||
| } | } | ||||||
|  |  | ||||||
| // CodeReason 错误码的原因 | // CodeReason 错误码的原因 | ||||||
| @ -24,6 +24,6 @@ type Code struct { | |||||||
| // | // | ||||||
| // Date : 00:31 2023/11/5 | // Date : 00:31 2023/11/5 | ||||||
| type CodeReason struct { | type CodeReason struct { | ||||||
| 	Reason   string   `json:"reason"`   // 错误原因: 语言 => 原因 | 	Reason   map[string]string `json:"reason"`   // 错误原因: 语言 => 原因 | ||||||
| 	Solution []string `json:"solution"` // 解决步骤. 语言 => 解决步骤 | 	Solution map[string]string `json:"solution"` // 解决步骤. 语言 => 解决步骤 | ||||||
| } | } | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user