diff --git a/routers/commentsRouter_controllers.go b/routers/commentsRouter_controllers.go index 4bc06c9..db5f1d0 100644 --- a/routers/commentsRouter_controllers.go +++ b/routers/commentsRouter_controllers.go @@ -7,38 +7,6 @@ import ( func init() { - beego.GlobalControllerRouter["multitenantStack/controllers:AuthController"] = append(beego.GlobalControllerRouter["multitenantStack/controllers:AuthController"], - beego.ControllerComments{ - Method: "GetAll", - Router: `/`, - AllowHTTPMethods: []string{"get"}, - MethodParams: param.Make(), - Params: nil}) - - beego.GlobalControllerRouter["multitenantStack/controllers:AuthController"] = append(beego.GlobalControllerRouter["multitenantStack/controllers:AuthController"], - beego.ControllerComments{ - Method: "GetOne", - Router: `/:id`, - AllowHTTPMethods: []string{"get"}, - MethodParams: param.Make(), - Params: nil}) - - beego.GlobalControllerRouter["multitenantStack/controllers:AuthController"] = append(beego.GlobalControllerRouter["multitenantStack/controllers:AuthController"], - beego.ControllerComments{ - Method: "Put", - Router: `/:id`, - AllowHTTPMethods: []string{"put"}, - MethodParams: param.Make(), - Params: nil}) - - beego.GlobalControllerRouter["multitenantStack/controllers:AuthController"] = append(beego.GlobalControllerRouter["multitenantStack/controllers:AuthController"], - beego.ControllerComments{ - Method: "Delete", - Router: `/:id`, - AllowHTTPMethods: []string{"delete"}, - MethodParams: param.Make(), - Params: nil}) - beego.GlobalControllerRouter["multitenantStack/controllers:AuthController"] = append(beego.GlobalControllerRouter["multitenantStack/controllers:AuthController"], beego.ControllerComments{ Method: "Login", @@ -47,6 +15,14 @@ func init() { MethodParams: param.Make(), Params: nil}) + beego.GlobalControllerRouter["multitenantStack/controllers:AuthController"] = append(beego.GlobalControllerRouter["multitenantStack/controllers:AuthController"], + beego.ControllerComments{ + Method: "Register", + Router: `/register`, + AllowHTTPMethods: []string{"post"}, + MethodParams: param.Make(), + Params: nil}) + beego.GlobalControllerRouter["multitenantStack/controllers:CompanyDataController"] = append(beego.GlobalControllerRouter["multitenantStack/controllers:CompanyDataController"], beego.ControllerComments{ Method: "Post", diff --git a/swagger/swagger.json b/swagger/swagger.json index 4ac5b6e..197b919 100644 --- a/swagger/swagger.json +++ b/swagger/swagger.json @@ -15,64 +15,6 @@ }, "basePath": "/v1", "paths": { - "/auth/": { - "get": { - "tags": [ - "auth" - ], - "description": "get Auth", - "operationId": "AuthController.GetAll", - "parameters": [ - { - "in": "query", - "name": "query", - "description": "Filter. e.g. col1:v1,col2:v2 ...", - "type": "string" - }, - { - "in": "query", - "name": "fields", - "description": "Fields returned. e.g. col1,col2 ...", - "type": "string" - }, - { - "in": "query", - "name": "sortby", - "description": "Sorted-by fields. e.g. col1,col2 ...", - "type": "string" - }, - { - "in": "query", - "name": "order", - "description": "Order corresponding to each sortby field, if single value, apply to all sortby fields. e.g. desc,asc ...", - "type": "string" - }, - { - "in": "query", - "name": "limit", - "description": "Limit the size of result set. Must be an integer", - "type": "string" - }, - { - "in": "query", - "name": "offset", - "description": "Start position of result set. Must be an integer", - "type": "string" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/.Auth" - } - }, - "403": { - "description": "" - } - } - } - }, "/auth/login": { "post": { "tags": [ @@ -87,7 +29,7 @@ "description": "body for Auth content", "required": true, "schema": { - "$ref": "#/definitions/.Auth" + "$ref": "#/definitions/models.Auth" } } ], @@ -95,7 +37,7 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/.Auth" + "$ref": "#/definitions/models.Auth" } }, "403": { @@ -104,91 +46,33 @@ } } }, - "/auth/{id}": { - "get": { + "/auth/register": { + "post": { "tags": [ "auth" ], - "description": "get Auth by id", - "operationId": "AuthController.GetOne", + "description": "create Auth", + "operationId": "AuthController.Create", "parameters": [ - { - "in": "path", - "name": "id", - "description": "The key for staticblock", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/.Auth" - } - }, - "403": { - "description": ":id is empty" - } - } - }, - "put": { - "tags": [ - "auth" - ], - "description": "update the Auth", - "operationId": "AuthController.Put", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "The id you want to update", - "required": true, - "type": "string" - }, { "in": "body", "name": "body", "description": "body for Auth content", "required": true, "schema": { - "$ref": "#/definitions/.Auth" + "$ref": "#/definitions/models.Auth" } } ], "responses": { - "200": { + "201": { "description": "", "schema": { - "$ref": "#/definitions/.Auth" + "$ref": "#/definitions/models.Auth" } }, "403": { - "description": ":id is not int" - } - } - }, - "delete": { - "tags": [ - "auth" - ], - "description": "delete the Auth", - "operationId": "AuthController.Delete", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "The id you want to delete", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "{string} delete success!" - }, - "403": { - "description": "id is empty" + "description": "body is empty" } } } @@ -887,7 +771,8 @@ } }, "definitions": { - ".Auth": { + "models.Auth": { + "title": "Auth", "type": "object" }, "models.CompanyData": { diff --git a/swagger/swagger.yml b/swagger/swagger.yml index 346606e..72eb997 100644 --- a/swagger/swagger.yml +++ b/swagger/swagger.yml @@ -11,104 +11,6 @@ info: url: http://www.apache.org/licenses/LICENSE-2.0.html basePath: /v1 paths: - /auth/: - get: - tags: - - auth - description: get Auth - operationId: AuthController.GetAll - parameters: - - in: query - name: query - description: Filter. e.g. col1:v1,col2:v2 ... - type: string - - in: query - name: fields - description: Fields returned. e.g. col1,col2 ... - type: string - - in: query - name: sortby - description: Sorted-by fields. e.g. col1,col2 ... - type: string - - in: query - name: order - description: Order corresponding to each sortby field, if single value, apply - to all sortby fields. e.g. desc,asc ... - type: string - - in: query - name: limit - description: Limit the size of result set. Must be an integer - type: string - - in: query - name: offset - description: Start position of result set. Must be an integer - type: string - responses: - "200": - description: "" - schema: - $ref: '#/definitions/.Auth' - "403": - description: "" - /auth/{id}: - get: - tags: - - auth - description: get Auth by id - operationId: AuthController.GetOne - parameters: - - in: path - name: id - description: The key for staticblock - required: true - type: string - responses: - "200": - description: "" - schema: - $ref: '#/definitions/.Auth' - "403": - description: :id is empty - put: - tags: - - auth - description: update the Auth - operationId: AuthController.Put - parameters: - - in: path - name: id - description: The id you want to update - required: true - type: string - - in: body - name: body - description: body for Auth content - required: true - schema: - $ref: '#/definitions/.Auth' - responses: - "200": - description: "" - schema: - $ref: '#/definitions/.Auth' - "403": - description: :id is not int - delete: - tags: - - auth - description: delete the Auth - operationId: AuthController.Delete - parameters: - - in: path - name: id - description: The id you want to delete - required: true - type: string - responses: - "200": - description: '{string} delete success!' - "403": - description: id is empty /auth/login: post: tags: @@ -121,12 +23,32 @@ paths: description: body for Auth content required: true schema: - $ref: '#/definitions/.Auth' + $ref: '#/definitions/models.Auth' responses: "201": description: "" schema: - $ref: '#/definitions/.Auth' + $ref: '#/definitions/models.Auth' + "403": + description: body is empty + /auth/register: + post: + tags: + - auth + description: create Auth + operationId: AuthController.Create + parameters: + - in: body + name: body + description: body for Auth content + required: true + schema: + $ref: '#/definitions/models.Auth' + responses: + "201": + description: "" + schema: + $ref: '#/definitions/models.Auth' "403": description: body is empty /companydata/: @@ -590,7 +512,8 @@ paths: "403": description: id is empty definitions: - .Auth: + models.Auth: + title: Auth type: object models.CompanyData: title: CompanyData