<template>
    <ap-container>
        <ap-main margin="1111">
            <el-divider content-position="left">缓存：组织/用户</el-divider>
            <div>
                <el-button type="primary" @click="refreshOrgGroup">组织分组</el-button>
                <el-button type="primary" @click="refreshToken">永久token</el-button>
            </div>
            <br>
            <br>
            <el-divider content-position="left">缓存：业务配置</el-divider>
            <div>
                <el-button type="primary" @click="refreshDictionary">数据字典</el-button>
                <el-button type="primary" @click="refreshMedium">消息推送配置</el-button>
            </div>
            <br>
            <br>
            <el-divider content-position="left">缓存：参数配置</el-divider>
            <div>
                <el-button type="primary" @click="refreshQywxConfig">企业微信配置</el-button>
                <el-button type="primary" @click="refreshDifyConfig">企业Dify配置</el-button>
            </div>
        </ap-main>
    </ap-container>
</template>

<script>
export default {
    name: "SysCache",
    methods: {
        refreshDictionary() {
            this.$request({
                url: '/apm/sys/dictionary/refreshCache',
                method: 'post'
            }).then(response => {
                this.$message.success(`数据字典缓存，刷新成功！`)
            })
        },
        refreshOrgGroup() {
            this.$request({
                url: '/apm/sys/TSysOrgGroup/refreshOrgGroupCache',
                method: 'post',
            }).then(response => {
                this.$message.success(`组织分组缓存，刷新成功！`)
            })
        },
        refreshQywxConfig() {
            this.$request({
                url: '/apm/sys/TSysConfigQywx/refreshQywxConfigCache',
                method: 'post',
            }).then(response => {
                this.$message.success(`企业微信配置缓存，刷新成功！`)
            })
        },
        refreshDifyConfig(){
            this.$request({
                url: '/apm/sys/TSysConfigDify/refreshDifyConfigCache',
                method: 'post',
            }).then(response => {
                this.$message.success(`缓存刷新成功！`)
            })
        },
        refreshMedium() {
            this.$request({
                url: '/apm/sys/TSysMedium/refreshCache',
                method: 'post'
            }).then(response => {
                this.$message.success(`消息推送配置缓存，刷新成功！`)
            })
        },
        refreshToken() {
            // 加载数据
            this.$request({
                url: '/apm/sys/TSysUser/refreshToken',
                method: 'post'
            }).then(response => {
                this.$message.success('永久token缓存，刷新成功！');
            })
        },
    }
}
</script>

<style scoped>

</style>
