Remove FromJSON functions (Part 1) (#17961)

* Remove FromJSON functions (Part 1)

```release-note
Removed the following functions:
AccessDataFromJson
AccessResponseFromJson
AnalyticsRowFromJson
AnalyticsRowsFromJson
AuditFromJson
AuditsFromJson
AuthDataFromJson
AuthorizeRequestFromJson
BotFromJson
BotPatchFromJson
BotListFromJson
```

* fix tests

```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2021-07-21 14:17:08 +05:30
коммит произвёл Claudio Costa
родитель 7454680be5
Коммит e199eba313
17 изменённых файлов: 190 добавлений и 380 удалений

Просмотреть файл

@@ -4,6 +4,7 @@
package web
import (
"encoding/json"
"html"
"net/http"
"net/url"
@@ -44,8 +45,9 @@ func testHandler(c *Context, w http.ResponseWriter, r *http.Request) {
}
func authorizeOAuthApp(c *Context, w http.ResponseWriter, r *http.Request) {
authRequest := model.AuthorizeRequestFromJson(r.Body)
if authRequest == nil {
var authRequest *model.AuthorizeRequest
err := json.NewDecoder(r.Body).Decode(&authRequest)
if err != nil || authRequest == nil {
c.SetInvalidParam("authorize_request")
return
}
@@ -65,10 +67,9 @@ func authorizeOAuthApp(c *Context, w http.ResponseWriter, r *http.Request) {
defer c.LogAuditRec(auditRec)
c.LogAudit("attempt")
redirectUrl, err := c.App.AllowOAuthAppAccessToUser(c.AppContext.Session().UserId, authRequest)
if err != nil {
c.Err = err
redirectUrl, appErr := c.App.AllowOAuthAppAccessToUser(c.AppContext.Session().UserId, authRequest)
if appErr != nil {
c.Err = appErr
return
}