edu/admin/src/api/channel/wx_oa.ts

111 lines
2.9 KiB
TypeScript
Raw Normal View History

2022-08-29 11:06:52 +00:00
import request from '@/utils/request'
// 微信公众号配置保存
2022-08-29 11:06:52 +00:00
export function setOaConfig(params: any) {
return request.post({ url: '/channel.official_account_setting/setConfig', params })
2022-08-29 11:06:52 +00:00
}
// 微信公众号配置详情
2022-08-29 11:06:52 +00:00
export function getOaConfig() {
return request.get({ url: '/channel.official_account_setting/getConfig' })
2022-08-29 11:06:52 +00:00
}
export interface Menu {
2022-09-16 08:31:24 +00:00
name: string
has_menu?: boolean
type?: string
2022-09-16 08:31:24 +00:00
url?: string
appid?: string
pagepath?: string
sub_button: Menu[] | any
}
/**
2022-09-16 08:31:24 +00:00
* @return { Promise }
* @description
*/
2022-09-16 08:31:24 +00:00
export function getOaMenu() {
return request.get({ url: '/channel.official_account_menu/detail' })
}
/**
2022-09-16 08:31:24 +00:00
* @return { Promise }
* @param { Menu } Menu
* @description
*/
2022-09-16 08:31:24 +00:00
export function setOaMenuSave(params: Menu | any) {
return request.post({ url: '/channel.official_account_menu/save', params })
}
/**
2022-09-16 08:31:24 +00:00
* @return { Promise }
* @param { Menu } Menu
* @description
*/
export function setOaMenuPublish(params: Menu | any) {
return request.post({ url: '/channel.official_account_menu/saveAndPublish', params })
}
/**
* @return { Promise }
* @param { string } reply_type
* @description
*/
export function getOaReplyList(params: { reply_type: string }) {
return request.get({ url: '/channel.official_account_reply/lists', params })
}
/**
2022-09-16 08:31:24 +00:00
* @return { Promise }
* @param { number } id
* @description
*/
export function oaReplyDel(params: { id: number }) {
return request.post({ url: '/channel.official_account_reply/delete', params })
}
/**
2022-09-16 08:31:24 +00:00
* @return { Promise }
* @param { number } id
* @description
*/
export function changeOaReplyStatus(params: { id: number }) {
return request.post({ url: '/channel.official_account_reply/status', params })
}
export interface Reply {
2022-09-16 08:31:24 +00:00
content: string // 内容
content_type: number // 内容类型: 1=文本
2022-09-16 08:31:24 +00:00
keyword?: string // 关键词
matching_type?: number // 匹配方式: [1=全匹配, 2=模糊匹配]
2022-09-16 08:31:24 +00:00
name: string // 规则名称
status: number // 状态: 1=开启, 0=关闭
reply_type: number // 类型: 回复类型 1-关注回复 2-关键词回复 3-默认回复
reply_num: number // 回复数量`
2022-09-16 08:31:24 +00:00
sort: number // 排序
}
/**
2022-09-16 08:31:24 +00:00
* @return { Promise }
* @description
*/
2022-09-16 08:31:24 +00:00
export function oaReplyAdd(params: Reply) {
return request.post({ url: '/channel.official_account_reply/add', params })
}
/**
2022-09-16 08:31:24 +00:00
* @return { Promise }
* @description
*/
2022-09-16 08:31:24 +00:00
export function oaReplyEdit(params: Reply) {
return request.post({ url: '/channel.official_account_reply/edit', params })
}
/**
* @return { Promise }
* @param { string } type
* @description
*/
export function getOaReplyDetail(params: { id: number }) {
return request.get({ url: '/channel.official_account_reply/detail', params })
2022-09-16 08:31:24 +00:00
}