import { message } from 'ant-design-vue'
import axios from '@/common/services/axios-instance'

class GuideService {
  getYwlxByModuleId(moduleId) {
    return axios({
      method: 'get',
      url: 'api/framework/v1/businesstype-manage/auth-businesstypes/moduleid',
      params: {
        appModuleId: moduleId,
      },
    }).then((res) => {
      return res.data
    })
  }

  getYwlx(urlCode) {
    return axios({
      method: 'get',
      url: 'api/framework/v1/businesstype-manage/businesstypes/list-auth',
      params: {
        categoryCode: urlCode, // 链接取code区分不同业务类型数据
      },
    }).then((res) => {
      if (res.status === 200) {
        return res.data
      } else {
        message.error(res.statusText)
      }
    })
  }
}

export default new GuideService()
