优化reason
This commit is contained in:
		
							
								
								
									
										2
									
								
								code.go
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								code.go
									
									
									
									
									
								
							@ -36,7 +36,7 @@ func InitCodeTableWithMessage(table map[interface{}]map[string]string, convertDe
 | 
				
			|||||||
		codeTable[code] = Code{
 | 
							codeTable[code] = Code{
 | 
				
			||||||
			Value:    code,
 | 
								Value:    code,
 | 
				
			||||||
			Message:  message,
 | 
								Message:  message,
 | 
				
			||||||
			Reason:   "",
 | 
								Reason:   message,
 | 
				
			||||||
			Solution: map[string]interface{}{},
 | 
								Solution: map[string]interface{}{},
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
				
			|||||||
@ -15,6 +15,6 @@ package exception
 | 
				
			|||||||
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   string                 `json:"reason"`   // 产生此错误码的原因描述
 | 
						Reason   map[string]string      `json:"reason"`   // 产生此错误码的原因描述(key -> 语言 , value -> 对应语言的描述)
 | 
				
			||||||
	Solution map[string]interface{} `json:"solution"` // 解决方案
 | 
						Solution map[string]interface{} `json:"solution"` // 解决方案
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user