501 lines
		
	
	
		
			11 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			501 lines
		
	
	
		
			11 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
swagger: "2.0"
 | 
						|
info:
 | 
						|
  title: SqlDB WS API
 | 
						|
  description: |
 | 
						|
    Generic database access API
 | 
						|
  version: 1.0.0
 | 
						|
  termsOfService: https://www.irt-saintexupery.com/
 | 
						|
  contact:
 | 
						|
    email: yves.cerezal@irt-saintexupery.com
 | 
						|
  license:
 | 
						|
    name: Apache 2.0
 | 
						|
    url: http://www.apache.org/licenses/LICENSE-2.0.html
 | 
						|
basePath: /v1
 | 
						|
paths:
 | 
						|
  /helper/create:
 | 
						|
    post:
 | 
						|
      tags:
 | 
						|
      - helper
 | 
						|
      description: |-
 | 
						|
        Post raw header
 | 
						|
        <br>
 | 
						|
      operationId: HelperController.CreateTable
 | 
						|
      parameters:
 | 
						|
      - in: body
 | 
						|
        name: body
 | 
						|
        description: body of jsonform data
 | 
						|
        schema:
 | 
						|
          $ref: '#/definitions/form'
 | 
						|
      responses:
 | 
						|
        "200":
 | 
						|
          description: '{string} success !'
 | 
						|
        "500":
 | 
						|
          description: query error
 | 
						|
  /helper/header:
 | 
						|
    post:
 | 
						|
      tags:
 | 
						|
      - helper
 | 
						|
      description: |-
 | 
						|
        Post raw header
 | 
						|
        <br>
 | 
						|
      operationId: HelperController.ParseHeader
 | 
						|
      parameters:
 | 
						|
      - in: body
 | 
						|
        name: body
 | 
						|
        description: body of jsonform data
 | 
						|
        schema:
 | 
						|
          $ref: '#/definitions/form'
 | 
						|
      responses:
 | 
						|
        "200":
 | 
						|
          description: '{string} success !'
 | 
						|
        "500":
 | 
						|
          description: query error
 | 
						|
  /helper/import/{table}:
 | 
						|
    post:
 | 
						|
      tags:
 | 
						|
      - helper
 | 
						|
      description: |-
 | 
						|
        Post raw header
 | 
						|
        <br>
 | 
						|
      operationId: HelperController.Import
 | 
						|
      parameters:
 | 
						|
      - in: body
 | 
						|
        name: body
 | 
						|
        description: body of jsonform data
 | 
						|
        schema:
 | 
						|
          $ref: '#/definitions/form'
 | 
						|
      responses:
 | 
						|
        "200":
 | 
						|
          description: '{string} success !'
 | 
						|
        "500":
 | 
						|
          description: query error
 | 
						|
  /l/adduser:
 | 
						|
    post:
 | 
						|
      tags:
 | 
						|
      - l
 | 
						|
      description: |-
 | 
						|
        Add user
 | 
						|
        <br>
 | 
						|
      operationId: LoginController.AddUser
 | 
						|
      parameters:
 | 
						|
      - in: query
 | 
						|
        name: username
 | 
						|
        description: The username for register format
 | 
						|
        required: true
 | 
						|
        type: string
 | 
						|
      - in: query
 | 
						|
        name: password
 | 
						|
        description: The password for register
 | 
						|
        required: true
 | 
						|
        type: string
 | 
						|
      responses:
 | 
						|
        "200":
 | 
						|
          description: ""
 | 
						|
        "403":
 | 
						|
          description: user already exist
 | 
						|
  /l/login:
 | 
						|
    post:
 | 
						|
      tags:
 | 
						|
      - l
 | 
						|
      description: |-
 | 
						|
        User login
 | 
						|
        <br>
 | 
						|
      operationId: LoginController.Login
 | 
						|
      parameters:
 | 
						|
      - in: body
 | 
						|
        name: body
 | 
						|
        description: Credentials
 | 
						|
        required: true
 | 
						|
        schema:
 | 
						|
          $ref: '#/definitions/Credential'
 | 
						|
      responses:
 | 
						|
        "200":
 | 
						|
          description: '{string} success !'
 | 
						|
        "402":
 | 
						|
          description: user already connected
 | 
						|
        "403":
 | 
						|
          description: user does not exist
 | 
						|
  /l/logout:
 | 
						|
    post:
 | 
						|
      tags:
 | 
						|
      - l
 | 
						|
      description: |-
 | 
						|
        Logs user
 | 
						|
        <br>
 | 
						|
      operationId: LoginController.Logout
 | 
						|
      responses:
 | 
						|
        "200":
 | 
						|
          description: ""
 | 
						|
        "403":
 | 
						|
          description: user not exist
 | 
						|
  /s/:
 | 
						|
    get:
 | 
						|
      tags:
 | 
						|
      - s
 | 
						|
      description: |-
 | 
						|
        Get database tables list
 | 
						|
        <br>
 | 
						|
      operationId: SchemaController.GetTablesList
 | 
						|
      responses:
 | 
						|
        "200":
 | 
						|
          description: '{string} success !'
 | 
						|
        "500":
 | 
						|
          description: query error
 | 
						|
  /s/{table}:
 | 
						|
    get:
 | 
						|
      tags:
 | 
						|
      - s
 | 
						|
      description: |-
 | 
						|
        Get table schema
 | 
						|
        <br>
 | 
						|
      operationId: SchemaController.GetSchema
 | 
						|
      parameters:
 | 
						|
      - in: path
 | 
						|
        name: table
 | 
						|
        description: Name of the table
 | 
						|
        required: true
 | 
						|
        type: string
 | 
						|
      responses:
 | 
						|
        "200":
 | 
						|
          description: success !
 | 
						|
        "204":
 | 
						|
          description: no table
 | 
						|
  /t/{table}:
 | 
						|
    get:
 | 
						|
      tags:
 | 
						|
      - t
 | 
						|
      description: |-
 | 
						|
        get all Datas
 | 
						|
        <br>
 | 
						|
      operationId: TableController.GetAllTable
 | 
						|
      parameters:
 | 
						|
      - in: path
 | 
						|
        name: table
 | 
						|
        description: Name of the table
 | 
						|
        required: true
 | 
						|
        type: string
 | 
						|
      responses:
 | 
						|
        "200":
 | 
						|
          description: '{string} success !'
 | 
						|
        "403":
 | 
						|
          description: no table
 | 
						|
    put:
 | 
						|
      tags:
 | 
						|
      - t
 | 
						|
      description: |-
 | 
						|
        put data in table
 | 
						|
        <br>
 | 
						|
      operationId: TableController.Put data in table
 | 
						|
      parameters:
 | 
						|
      - in: path
 | 
						|
        name: table
 | 
						|
        description: Name of the table
 | 
						|
        required: true
 | 
						|
        type: string
 | 
						|
      - in: body
 | 
						|
        name: data
 | 
						|
        description: body for data content (Json format)
 | 
						|
        required: true
 | 
						|
        schema:
 | 
						|
          $ref: '#/definitions/json'
 | 
						|
      responses:
 | 
						|
        "200":
 | 
						|
          description: '{string} success'
 | 
						|
        "403":
 | 
						|
          description: :table put issue
 | 
						|
    post:
 | 
						|
      tags:
 | 
						|
      - t
 | 
						|
      description: |-
 | 
						|
        get all Datas
 | 
						|
        <br>
 | 
						|
      operationId: TableController.TablePost
 | 
						|
      parameters:
 | 
						|
      - in: path
 | 
						|
        name: table
 | 
						|
        description: Name of the table
 | 
						|
        required: true
 | 
						|
        type: string
 | 
						|
      - in: body
 | 
						|
        name: body
 | 
						|
        description: TableQuery
 | 
						|
        required: true
 | 
						|
        schema:
 | 
						|
          $ref: '#/definitions/TableQuery'
 | 
						|
      responses:
 | 
						|
        "200":
 | 
						|
          description: '{string} success !'
 | 
						|
        "403":
 | 
						|
          description: no table
 | 
						|
    delete:
 | 
						|
      tags:
 | 
						|
      - t
 | 
						|
      description: |-
 | 
						|
        delete the data in table
 | 
						|
        <br>
 | 
						|
      operationId: TableController.Delete
 | 
						|
      parameters:
 | 
						|
      - in: path
 | 
						|
        name: table
 | 
						|
        description: Name of the table
 | 
						|
        required: true
 | 
						|
        type: string
 | 
						|
      - in: body
 | 
						|
        name: body
 | 
						|
        description: body for data content (Json format)
 | 
						|
        schema:
 | 
						|
          $ref: '#/definitions/true'
 | 
						|
      responses:
 | 
						|
        "200":
 | 
						|
          description: '{string} delete success!'
 | 
						|
        "403":
 | 
						|
          description: delete issue
 | 
						|
  /t/{table}/{columns}:
 | 
						|
    get:
 | 
						|
      tags:
 | 
						|
      - t
 | 
						|
      description: |-
 | 
						|
        get all Datas
 | 
						|
        <br>
 | 
						|
      operationId: TableController.GetAllTableColumn
 | 
						|
      parameters:
 | 
						|
      - in: path
 | 
						|
        name: table
 | 
						|
        description: Name of the table
 | 
						|
        required: true
 | 
						|
        type: string
 | 
						|
      - in: path
 | 
						|
        name: columns
 | 
						|
        description: Name of the columns (separate with a comma)
 | 
						|
        required: true
 | 
						|
        type: string
 | 
						|
      responses:
 | 
						|
        "200":
 | 
						|
          description: '{string} success !'
 | 
						|
        "403":
 | 
						|
          description: no table
 | 
						|
  /t/{table}/{columns}/{restriction}:
 | 
						|
    get:
 | 
						|
      tags:
 | 
						|
      - t
 | 
						|
      description: |-
 | 
						|
        get all Datas
 | 
						|
        <br>
 | 
						|
      operationId: TableController.GetAllTableColumnRestriction
 | 
						|
      parameters:
 | 
						|
      - in: path
 | 
						|
        name: table
 | 
						|
        description: Name of the table
 | 
						|
        required: true
 | 
						|
        type: string
 | 
						|
      - in: path
 | 
						|
        name: columns
 | 
						|
        description: Name of the columns (separate with a comma)
 | 
						|
        required: true
 | 
						|
        type: string
 | 
						|
      - in: path
 | 
						|
        name: restriction
 | 
						|
        description: SQL restriction
 | 
						|
        required: true
 | 
						|
        type: string
 | 
						|
      responses:
 | 
						|
        "200":
 | 
						|
          description: '{string} success !'
 | 
						|
        "403":
 | 
						|
          description: no table
 | 
						|
  /t/{table}/{columns}/{restriction}/{sortkeys}:
 | 
						|
    get:
 | 
						|
      tags:
 | 
						|
      - t
 | 
						|
      description: |-
 | 
						|
        get all Datas
 | 
						|
        <br>
 | 
						|
      operationId: TableController.GetAllTableColumnRestrictionSortkeys
 | 
						|
      parameters:
 | 
						|
      - in: path
 | 
						|
        name: table
 | 
						|
        description: Name of the table
 | 
						|
        required: true
 | 
						|
        type: string
 | 
						|
      - in: path
 | 
						|
        name: columns
 | 
						|
        description: Name of the columns (separate with a comma)
 | 
						|
        required: true
 | 
						|
        type: string
 | 
						|
      - in: path
 | 
						|
        name: restriction
 | 
						|
        description: SQL restriction
 | 
						|
        required: true
 | 
						|
        type: string
 | 
						|
      - in: path
 | 
						|
        name: sortkeys
 | 
						|
        description: 'Order by: columns names (separate with a comma)'
 | 
						|
        required: true
 | 
						|
        type: string
 | 
						|
      responses:
 | 
						|
        "200":
 | 
						|
          description: '{string} success !'
 | 
						|
        "403":
 | 
						|
          description: no table
 | 
						|
  /t/{table}/{columns}/{restriction}/{sortkeys}/{dir}:
 | 
						|
    get:
 | 
						|
      tags:
 | 
						|
      - t
 | 
						|
      description: |-
 | 
						|
        get all Datas
 | 
						|
        <br>
 | 
						|
      operationId: TableController.GetAllTableColumnRestrictionSortkeysDir
 | 
						|
      parameters:
 | 
						|
      - in: path
 | 
						|
        name: table
 | 
						|
        description: Name of the table
 | 
						|
        required: true
 | 
						|
        type: string
 | 
						|
      - in: path
 | 
						|
        name: columns
 | 
						|
        description: Name of the columns (separate with a comma)
 | 
						|
        required: true
 | 
						|
        type: string
 | 
						|
      - in: path
 | 
						|
        name: restriction
 | 
						|
        description: SQL restriction
 | 
						|
        required: true
 | 
						|
        type: string
 | 
						|
      - in: path
 | 
						|
        name: sortkeys
 | 
						|
        description: 'Order by: columns names (separate with a comma)'
 | 
						|
        required: true
 | 
						|
        type: string
 | 
						|
      - in: path
 | 
						|
        name: dir
 | 
						|
        description: asc or desc
 | 
						|
        required: true
 | 
						|
        type: string
 | 
						|
      responses:
 | 
						|
        "200":
 | 
						|
          description: '{string} success !'
 | 
						|
        "403":
 | 
						|
          description: no table
 | 
						|
  /ui/form/{fid}:
 | 
						|
    get:
 | 
						|
      tags:
 | 
						|
      - ui
 | 
						|
      description: |-
 | 
						|
        create access form
 | 
						|
        <br>
 | 
						|
      operationId: UiController.form
 | 
						|
      parameters:
 | 
						|
      - in: path
 | 
						|
        name: fid
 | 
						|
        description: The fid of the form
 | 
						|
        required: true
 | 
						|
        type: string
 | 
						|
      responses:
 | 
						|
        "200":
 | 
						|
          description: json form
 | 
						|
        "403":
 | 
						|
          description: body is empty
 | 
						|
  /ui/form/{fid}/{uid}:
 | 
						|
    get:
 | 
						|
      tags:
 | 
						|
      - ui
 | 
						|
      description: |-
 | 
						|
        create access form
 | 
						|
        <br>
 | 
						|
      operationId: UiController.form
 | 
						|
      parameters:
 | 
						|
      - in: path
 | 
						|
        name: fid
 | 
						|
        description: The fid of the form
 | 
						|
        required: true
 | 
						|
        type: string
 | 
						|
      - in: path
 | 
						|
        name: uid
 | 
						|
        description: The uid you want to edit
 | 
						|
        required: true
 | 
						|
        type: string
 | 
						|
      responses:
 | 
						|
        "200":
 | 
						|
          description: json form
 | 
						|
        "403":
 | 
						|
          description: body is empty
 | 
						|
    post:
 | 
						|
      tags:
 | 
						|
      - ui
 | 
						|
      description: |-
 | 
						|
        insert access
 | 
						|
        <br>
 | 
						|
      operationId: UiController.Access form data post
 | 
						|
      parameters:
 | 
						|
      - in: path
 | 
						|
        name: fid
 | 
						|
        description: The fid of the form
 | 
						|
        required: true
 | 
						|
        type: string
 | 
						|
      - in: path
 | 
						|
        name: uid
 | 
						|
        description: The uid you want to edit
 | 
						|
        required: true
 | 
						|
        type: string
 | 
						|
      - in: body
 | 
						|
        name: body
 | 
						|
        description: body of jsonform data
 | 
						|
        schema:
 | 
						|
          $ref: '#/definitions/form'
 | 
						|
      responses:
 | 
						|
        "200":
 | 
						|
          description: json
 | 
						|
        "403":
 | 
						|
          description: body is empty
 | 
						|
  /ui/tableview/{tvid}:
 | 
						|
    get:
 | 
						|
      tags:
 | 
						|
      - ui
 | 
						|
      description: |-
 | 
						|
        Get table view
 | 
						|
        <br>
 | 
						|
      operationId: UiController.Tableview
 | 
						|
      parameters:
 | 
						|
      - in: path
 | 
						|
        name: tvid
 | 
						|
        description: The id of the tableview
 | 
						|
        required: true
 | 
						|
        type: string
 | 
						|
      responses:
 | 
						|
        "200":
 | 
						|
          description: json form
 | 
						|
        "403":
 | 
						|
          description: body is empty
 | 
						|
definitions:
 | 
						|
  Credential:
 | 
						|
    title: Credential
 | 
						|
    type: object
 | 
						|
  TableQuery:
 | 
						|
    title: TableQuery
 | 
						|
    type: object
 | 
						|
  form:
 | 
						|
    title: form
 | 
						|
    type: object
 | 
						|
  json:
 | 
						|
    title: json
 | 
						|
    type: object
 | 
						|
  "true":
 | 
						|
    title: "true"
 | 
						|
    type: object
 | 
						|
tags:
 | 
						|
- name: t
 | 
						|
  description: |
 | 
						|
    Operations about table
 | 
						|
- name: s
 | 
						|
  description: |
 | 
						|
    Operations about schema
 | 
						|
- name: l
 | 
						|
  description: |
 | 
						|
    Operations about login
 | 
						|
- name: ui
 | 
						|
  description: |
 | 
						|
    Operations about table
 | 
						|
- name: helper
 | 
						|
  description: |
 | 
						|
    Operations about schema
 |