论坛凯发k8国际首页 java企业应用论坛

springboot vue3 项目实战,打造企业级在线办公系统【升级版16章】 -凯发k8国际

浏览 302 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2023-12-25  
springboot vue3 项目实战,打造企业级在线办公系统【升级版16章】
网盘地址:https://pan.baidu.com/s/1wgunjytp9mnaznk9dajfdq 提取码: y37w
腾讯微云下载地址:https://share.weiyun.com/shux3sm7 密码:976qth


视频课程分享——springboot vue3 项目实战,打造企业级在线办公系统,最新升级版16章,附源码 电子书下载。


 在线办公系统的开发主要包括前端开发和后端开发,应根据系统需求分配相应的工作量和任务。
  1. 前端开发。 在线办公系统采用的是前后端分离模式。前端应用层使用react、vue或angular等框架开发,实现交互设计和页面开发。
  2. 后端开发。采用spring boot、spring cloud、docker等技术,实现应用逻辑和数据操作。
  3. 代码开发规范。代码开发规范非常重要,可采用团队组建的方法,提高团队的协作效率及代码的质量。

在开发项目的过程中,很多人都喜欢自定义异常,处理异常的时候可以根据异常的类型,判断出哪些是java语言异常,哪些是业务异常。在本项目中,我们也是需要自定义异常类的。
package com.example.hospital.api.exception;

import lombok.data;

@data
public class hospitalexception extends runtimeexception {
    private string msg;
    private int code = 500;

    public hospitalexception(exception e) {
        super(e);
        this.msg = "执行异常";
        this.code = 500;
    }

    public hospitalexception(string msg) {
        super(msg);
        this.msg = msg;
    }

    public hospitalexception(string msg, throwable e) {
        super(msg, e);
        this.msg = msg;
    }

    public hospitalexception(string msg, int code) {
        super(msg);
        this.msg = msg;
        this.code = code;
    }

    public hospitalexception(string msg, int code, throwable e) {
        super(msg, e);
        this.msg = msg;
        this.code = code;
    }

}

因为springboot data中默认的redistemplate因为序列化机制的问题,往redis里面保存hash类型数据通常是乱码的,为了解决这个问题,我们需要定义配置类,修改redistemplate使用的序列化机制。
package com.example.hospital.api.config;

import org.springframework.context.annotation.bean;
import org.springframework.context.annotation.configuration;
import org.springframework.data.redis.connection.redisconnectionfactory;
import org.springframework.data.redis.core.redistemplate;
import org.springframework.data.redis.serializer.genericjackson2jsonredisserializer;
import org.springframework.data.redis.serializer.stringredisserializer;

@configuration
public class redistemplateconfig {
    @bean
    public redistemplate redistemplate(redisconnectionfactory factory) {
        redistemplate template = new redistemplate<>();
        template.setkeyserializer(new stringredisserializer());
        template.sethashkeyserializer(new stringredisserializer());
        template.sethashvalueserializer(new genericjackson2jsonredisserializer());
        template.setconnectionfactory(factory);
        return template;
    }
}

查询分页数据需要用到两条sql语句,一个查询记录总数的,另一个是查询某页记录的。在doctordao.xml文件中,声明这两条sql语句。






 
global site tag (gtag.js) - google analytics
网站地图