easychat项目复盘---管理端系统设置

1.保存系统设置

复制代码
@RequestMapping("/saveSysSetting")
@GlobalInterceptor(checkAdmin = true)
public ResponseVO saveSysSetting(SysSettingDto sysSettingDto,
                                 MultipartFile robotFile,
                                 MultipartFile robotCover) throws IOException {
    if (robotFile != null) {
        String baseFolder = appConfig.getProjectFolder() + Constants.FILE_FOLDER_FILE;
        File targetFileFolder = new File(baseFolder + Constants.FILE_FOLDER_AVATAR_NAME);
        if (!targetFileFolder.exists()) {
            targetFileFolder.mkdirs();
        }
        String filePath = targetFileFolder.getPath() + "/" + Constants.ROBOT_UID + Constants.IMAGE_SUFFIX;
        robotFile.transferTo(new File(filePath));
        robotCover.transferTo(new File(filePath + Constants.COVER_IMAGE_SUFFIX));
    }
    redisComponet.saveSysSetting(sysSettingDto);
    return getSuccessResponseVO(null);
}

robotFile为机器人的头像,robotCover为机器人封面

2.获取系统设置

代码:

复制代码
@RequestMapping("/getSysSetting")
@GlobalInterceptor(checkAdmin = true)
public ResponseVO getSysSetting() {
    SysSettingDto sysSettingDto = redisComponet.getSysSetting();
    return getSuccessResponseVO(sysSettingDto);
}

十分简单不再赘述

3.获取更新列表

代码:

复制代码
@RequestMapping("/loadUpdateList")
@GlobalInterceptor(checkAdmin = true)
public ResponseVO loadUpdateList(AppUpdateQuery query) {
    query.setOrderBy("id desc");
    return getSuccessResponseVO(appUpdateService.findListByPage(query));
}
相关推荐
灵感__idea10 分钟前
Hello 算法:贪心的世界
前端·javascript·算法
小成202303202651 小时前
Linux高级02
linux·开发语言
camellias_1 小时前
【无标题】
java·tomcat
知行合一。。。1 小时前
Python--04--数据容器(总结)
开发语言·python
咸鱼2.01 小时前
【java入门到放弃】需要背诵
java·开发语言
ZK_H1 小时前
嵌入式c语言——关键字其6
c语言·开发语言·计算机网络·面试·职场和发展
A.A呐1 小时前
【C++第二十九章】IO流
开发语言·c++
椰猫子1 小时前
Java:异常(exception)
java·开发语言
lifewange1 小时前
pytest-类中测试方法、多文件批量执行
开发语言·python·pytest
GreenTea2 小时前
一文搞懂Harness Engineering与Meta-Harness
前端·人工智能·后端