优化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{
 | 
			
		||||
			Value:    code,
 | 
			
		||||
			Message:  message,
 | 
			
		||||
			Reason:   "",
 | 
			
		||||
			Reason:   message,
 | 
			
		||||
			Solution: map[string]interface{}{},
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@ -15,6 +15,6 @@ package exception
 | 
			
		||||
type Code struct {
 | 
			
		||||
	Value    interface{}            `json:"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"` // 解决方案
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user