import http from '../../utils/http'

export default class SwapPath {
  static async findBySumValueAndLevel(sumValue: String, level: String) {
    let url = '/swappath/findBySumValueAndLevel'
    const rst = await http.post(url, {
      sum_value: sumValue,
      level: level
    })
    return rst.data
  }

  static async appendOrUpdate(sumValue: String, level: String, data: any) {
    let url = '/swappath/appendOrUpdate'
    const rst = await http.post(url, {
      sum_value: sumValue,
      level: level,
      data: JSON.stringify(data)
    })
    return rst.data
  }
}
