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

113 lines
2.8 KiB
TypeScript
Raw Normal View History

2022-08-29 11:06:52 +00:00
import request from '@/utils/request'
2022-09-30 06:05:38 +00:00
import { firstToUpperCase } from '@/utils/util'
2022-08-29 11:06:52 +00:00
// 微信公众号配置保存
2022-08-29 11:06:52 +00:00
export function setOaConfig(params: any) {
return request.post({ url: '/channel/oa/save', params })
}
// 微信公众号配置详情
2022-08-29 11:06:52 +00:00
export function getOaConfig() {
return request.get({ url: '/channel/oa/detail' })
}
export interface Menu {
2022-09-16 08:31:24 +00:00
name: string
menuType?: number
visitType?: string
url?: string
appId?: string
2022-09-16 08:31:24 +00:00
pagePath?: string
subButtons: 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/oaMenu/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/oaMenu/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/oaMenu/publish', params })
}
/**
2022-09-30 06:05:38 +00:00
* @description
*/
2022-09-30 06:05:38 +00:00
export function getOaReplyList(params: any) {
const type = firstToUpperCase(params.type)
return request.get({ url: `/channel/oaReply${type}/list`, params })
}
/**
2022-09-16 08:31:24 +00:00
* @return { Promise }
* @param { number } id
* @description
*/
2022-09-30 06:05:38 +00:00
export function oaReplyDel(params: any) {
const type = firstToUpperCase(params.type)
return request.post({ url: `/channel/oaReply${type}/del`, params })
}
/**
2022-09-16 08:31:24 +00:00
* @return { Promise }
* @param { number } id
* @description
*/
2022-09-30 06:05:38 +00:00
export function changeOaReplyStatus(params: any) {
const type = firstToUpperCase(params.type)
return request.post({ url: `/channel/oaReply${type}/status`, params })
}
export interface Reply {
2022-09-16 08:31:24 +00:00
content: string // 内容
contentType: number // 内容类型: 1=文本
keyword?: string // 关键词
matchingType?: number // 匹配方式: [1=全匹配, 2=模糊匹配]
name: string // 规则名称
status: number // 状态: 1=开启, 0=关闭
type: string // 类型: follow=关注, keyword=关键词, default=默认
sort: number // 排序
}
/**
2022-09-16 08:31:24 +00:00
* @return { Promise }
2022-09-30 06:05:38 +00:00
* @description
*/
2022-09-16 08:31:24 +00:00
export function oaReplyAdd(params: Reply) {
2022-09-30 06:05:38 +00:00
const type = firstToUpperCase(params.type)
return request.post({ url: `/channel/oaReply${type}/add`, params })
}
/**
2022-09-16 08:31:24 +00:00
* @return { Promise }
2022-09-30 06:05:38 +00:00
* @description
*/
2022-09-16 08:31:24 +00:00
export function oaReplyEdit(params: Reply) {
2022-09-30 06:05:38 +00:00
const type = firstToUpperCase(params.type)
return request.post({ url: `/channel/oaReply${type}/edit`, params })
}
/**
2022-09-30 06:05:38 +00:00
* @description
*/
2022-09-30 06:05:38 +00:00
export function getOaReplyDetail(params: any) {
const type = firstToUpperCase(params.type)
return request.get({ url: `/channel/oaReply${type}/detail`, params })
2022-09-16 08:31:24 +00:00
}