import {
  PageInputFeedingConfigGetPageInput,
  FeedingConfigGetPageOutput,
  FeedingConfigUpdateInput,
  FeedingConfigAddInput,
  FeedingConfigGetOutput,
  ResultOutputFeedingConfigGetOutput,
  ResultOutputPageOutputFeedingConfigGetPageOutput,
  ResultOutputInt64
} from './data-contracts'
import { HttpClient, ContentType, RequestParams } from './http-client'
import { AxiosResponse } from 'axios'

export class UspFeedingConfigApi<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
  /**
   * 查询
   * @request GET:/api/admin/usp-feeding-config/get
   */
  get = (
    query?: { id?: number },
    params: RequestParams = {}
  ) =>
    this.request<ResultOutputFeedingConfigGetOutput, any>({
      path: '/api/admin/usp-feeding-config/get',
      method: 'GET',
      query,
      secure: true,
      format: 'json',
      ...params,
    })

  /**
   * 查询分页
   * @request POST:/api/admin/usp-feeding-config/get-page
   */
  getPage = (data: PageInputFeedingConfigGetPageInput, params: RequestParams = {}) =>
    this.request<ResultOutputPageOutputFeedingConfigGetPageOutput, any>({
      path: '/api/admin/usp-feeding-config/get-page',
      method: 'POST',
      body: data,
      secure: true,
      type: ContentType.Json,
      format: 'json',
      ...params,
    })

  /**
   * 新增
   * @request POST:/api/admin/usp-feeding-config/add
   */
  add = (data: FeedingConfigAddInput, params: RequestParams = {}) =>
    this.request<ResultOutputInt64, any>({
      path: '/api/admin/usp-feeding-config/add',
      method: 'POST',
      body: data,
      secure: true,
      type: ContentType.Json,
      format: 'json',
      ...params,
    })

  /**
   * 修改
   * @request PUT:/api/admin/usp-feeding-config/update
   */
  update = (data: FeedingConfigUpdateInput, params: RequestParams = {}) =>
    this.request<AxiosResponse, any>({
      path: '/api/admin/usp-feeding-config/update',
      method: 'PUT',
      body: data,
      secure: true,
      type: ContentType.Json,
      ...params,
    })

  /**
   * 彻底删除
   * @request DELETE:/api/admin/usp-feeding-config/delete
   */
  delete = (
    query?: { id?: number },
    params: RequestParams = {}
  ) =>
    this.request<AxiosResponse, any>({
      path: '/api/admin/usp-feeding-config/delete',
      method: 'DELETE',
      query,
      secure: true,
      ...params,
    })

  /**
   * 删除（软删除）
   * @request DELETE:/api/admin/usp-feeding-config/soft-delete
   */
  softDelete = (
    query?: { id?: number },
    params: RequestParams = {}
  ) =>
    this.request<AxiosResponse, any>({
      path: '/api/admin/usp-feeding-config/soft-delete',
      method: 'DELETE',
      query,
      secure: true,
      ...params,
    })
}
