(logger g.LoggerType, c echo.Context, reqParam interface{})
| 125 | } |
| 126 | |
| 127 | func BindAndValidate(logger g.LoggerType, c echo.Context, reqParam interface{}) error { |
| 128 | logger.Info("validate params") |
| 129 | if err := c.Bind(reqParam); nil != err { |
| 130 | return fmt.Errorf("bind reqParam param failed, error: %v", err) |
| 131 | } |
| 132 | if err := c.Validate(reqParam); nil != err { |
| 133 | return fmt.Errorf("invalid params:\n%v", err) |
| 134 | } |
| 135 | return nil |
| 136 | } |
| 137 | |
| 138 | func rsaDecrypt(ciphertext []byte, privateKey string) ([]byte, error) { |
| 139 | block, _ := pem.Decode([]byte(privateKey)) |
no test coverage detected