技术栈
SpringCloud |微服务| 注册中心使用的Nacos | Dism配置DNS映射 | SpringBoot |Mybatis-Plus | vue3 | Avue | element-ui | token | redis | MySQL | 构建工具Maven | Wangeditor | 测试工具Apifox
印象深刻的问题
Vue3 和 Vue2 的区别 Vue3实现父子传参
一些 debug的经验:不会debug的程序员不是好程序员
动态路由的第二种配置方式
通过远端数据去对接前台接口,url以网关配置的路由起始,如 /drp 如 /admin
客户前台与后端间一层接口 前端与后端 间一层接口(api)
借助框架工具进行开发时,仔细阅读原文档十分甚至九分重要,因为你不知道作者用了什么奇奇怪怪的封装
利用mapper.xml 完成 数据库字段 到 后端实体类字段名 的 映射
DTO(Data Transfer Object)和VO(Value Object)是在软件开发中常用的设计模式或概念,用于处理数据传输和封装数据。
DTO是一种用于数据传输的对象,用于在不同的层或模块之间传递数据。它的主要作用是将数据从一个地方传输到另一个地方,可以在不同的系统组件或服务之间传递数据,通常用于在客户端和服务器之间传输数据。DTO对象通常是无状态的,只包含数据字段和对应的getter和setter方法,不包含业务逻辑。
VO(Value Object)是一种用于封装数据的对象,通常用于表示一个不可变的值或领域对象。VO的主要作用是将一组相关的数据封装在一个对象中,并提供相应的操作方法。VO对象通常包含多个属性,并提供访问这些属性的方法,但不提供修改属性的方法,以保持对象的不可变性。
DTO和VO之间的区别在于它们的使用场景和目的。DTO主要用于数据传输,用于在不同层或模块之间传递数据,而VO主要用于封装数据和行为,用于表示一个不可变的值或领域对象。DTO通常是为了方便数据传输和解耦而设计的,而VO则更注重数据的封装和语义表示。
因为是通过网关9999统一转发的,所以用9999和8080都可以
一、实验任务:
完成内容管理系统后台部分的基本功能操作。要求jdbc连接数据库,数据库自行设计。具体功能如下:
1、文章分类的管理,包括文章分类的列表显示(含删除、修改、查询的功能)、添加。
2、文章的管理,包括文章的列表显示(含删除、修改、查询的功能)、添加。
3、用户的管理,包括用户的列表显示(含删除、修改、查询的功能)、添加。
用户登录及退出、修改个人信息功能。
二、数据库设计:
article
type
type_article_middle
menu
user_role
user
三、程序界面截图:
四、程序代码(主要的后台代码):
ArticleController
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pig.article.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pig4cloud.pig.article.dto.ArticleDTO;
import com.pig4cloud.pig.article.entity.TypeArticleMiddle;
import com.pig4cloud.pig.article.service.TypeArticleMiddleService;
import com.pig4cloud.pig.common.core.constant.CommonConstants;
import com.pig4cloud.pig.common.core.util.R;
import com.pig4cloud.pig.common.log.annotation.SysLog;
import com.pig4cloud.pig.article.service.ArticleService;
import org.springframework.beans.BeanUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
/**
* @author pig code generator
* @date 2023-05-28 18:08:52
*/