Created
November 7, 2018 12:06
-
-
Save gavinzhou/71c182ee5f12216b5ac105f3dee361e4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package e | |
| var MsgFlags = map[int]string{ | |
| SUCCESS: "ok", | |
| ERROR: "fail", | |
| INVALID_PARAMS: "invalid params", | |
| ERROR_EXIST_TAG: "tag is exist", | |
| ERROR_NOT_EXIST_TAG: "tag is not exist", | |
| ERROR_NOT_EXIST_ARTICLE: "article is not exist", | |
| ERROR_AUTH_CHECK_TOKEN_FAIL: "token check is fail", | |
| ERROR_AUTH_CHECK_TOKEN_TIMEOUT: "token is expired", | |
| ERROR_AUTH_TOKEN: "can not create token", | |
| ERROR_AUTH: "Token error", | |
| } | |
| func GetMsg(code int) string { | |
| msg, ok := MsgFlags[code] | |
| if ok { | |
| return msg | |
| } | |
| return MsgFlags[ERROR] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment