import http from '@/utils/request'

// 获取微信配置
export function getWeixinConfig () {
  return http.get('/config/weixin/')
}

/**
 *
 * 设置微信配置信息
 * @export
 * @param {*}
 * params:
 * { "wx_app_secret": "string", "wx_appid": "string", "wx_mchid": "string", "wx_name": "string"}
 * @returns
 */
export function setWeixinConfig (params) {
  return http.post('/config/weixin/', params)
}
export function getAliConfig () {
  return http.get('/config/ali/')
}
export function setAliConfig (params) {
  return http.post('/config/ali/', params)
}
export function getUmsConfig () {
  return http.get('/config/ums/')
}
export function setUmsConfig (params) {
  return http.post('/config/ums/', params)
}

// 获取微信主题配置
export function getWeixinTheme () {
  return http.get('/config/weixintheme/')
}

/**
 *
 *
 * @export
 * @param {*}
 * params:
 * {"wx_color": "string","wx_style": "string"}
 * @returns
 */
export function setWeixinTheme (params) {
  return http.post('/config/weixintheme/', params)
}

// 获取风格列表
export function getWeixinStyle (pageNum = 1, pageSize = 10) {
  return http.get(`/weixinstyle/?pageNum=${pageNum}&pageSize=${pageSize}`)
}

// 获取单个风格信息
export function getSingleWeixinStyle (id) {
  return http.get(`/weixinstyle/${id}`)
}

// 设置单个风格列表
export function setSingleWeixinStyle (id) {
  return http.put(`/weixinstyle/${id}`)
}

export function getWeixinColor (pageNum = 1, pageSize = 10) {
  return http.get(`weixincolor/?pageNum=${pageNum}&pageSize=${pageSize}`)
}
