(c *gin.Context, key constant.ContextKey)
| 79 | } |
| 80 | |
| 81 | func GetContextKeyType[T any](c *gin.Context, key constant.ContextKey) (T, bool) { |
| 82 | if value, ok := c.Get(string(key)); ok { |
| 83 | if v, ok := value.(T); ok { |
| 84 | return v, true |
| 85 | } |
| 86 | } |
| 87 | var t T |
| 88 | return t, false |
| 89 | } |
| 90 | |
| 91 | func ApiError(c *gin.Context, err error) { |
| 92 | c.JSON(http.StatusOK, gin.H{ |