First Assigment -- Front-end and Back-end Separation Contact -- 832201315 XinyangChen

qq_39660711 qq_39660711 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
Course for This Assignment2401_MU_SE_FZU
Assignment RequirementsFirst assignment-- front-end and back-end separation contacts programming-CSDN社区
Objectives of This AssignmentDesign a contact with separated front and back ends
Other References黑马程序员SpringBoot3+Vue3
Github Front-end Repository2401_MU_SE_FZU_1stAssigment_Front_end: 832201315XinyangChen's First Assigment
Github Back-end Repository2401_MU_SE_FZU_1stAssigment_Back_end: 832201315XinyangChen's First assignment

Catalogue:

1.Project Description

2.PSP Table

3.Presentation of the Finished Product

4.Design and Implementation Proces

5.Code Explanation


1.Project Description

  • The contact management system project implements several functions. Users can add contacts, enter information such as names and phone numbers, and store this information in a back-end database. The system allows you to modify and delete contacts. Click Modify or Delete to modify or delete a specified contact in the address book.
  • The front-end of this program uses html, css, JavaScript, node.js, vue and other technologies, the back-end uses Springboot and other technologies, and uses mysql as the database.

2.PSP Table

Personal Software Process StagesEstimated Time(h)Actual Time(h)
Develop project plans11
Front-end interface and interaction design, back-end design, database design45.5
Front-end development68
Back-end development1012
MySQL Database setup11
Integration testing23
Project review and reflection11
Sum2531.5

3.Presentation of the Finished Product

3.1 User interface

You can add, delete, modify, and view your contacts on this page. 

3.2 Backend Functionality Implementation

servers:

mysql:

Add:

In the Add form, you can enter the name and phone number of the new contact, and then choose whether to save it or not.

Edit:

After clicking Edit on the right, you can modify the information of the selected contact.

Delete:

 After clicking Delete on the right of the contact, the software will ask you to confirm whether to delete the contact. After clicking Confirm, the contact will be deleted, and vice versa.

4.Design and Implementation Process

4.1 System Architecture:

  • The system adopts a separate architecture of front end and back end, which communicate through Axios module.
  • The back end is built using SpringBoot, by setting up a server-side api to receive front-end data, process and interact with the MySQL database.
  • The front end is developed using Vue.js and is responsible for page display, receiving user information and interacting with the user.

4.2 System implementation process:

  • The front end uses vue technology and elements plus library to accept requests initiated by users. Users can create, edit and delete contacts by calling out forms by controlling buttons. The table on the main interface displays contacts saved in the database by applying data from the back end through programs.
  • The front end uses the Axios module to initiate a data interaction request from the back end, which receives the front end request through the UserRepository.java file and sends it to the server for processing.
  • The back-end uses UserController.java to handle front-end requests, and reads the database definition in the User.java file to modify the data in the database, and returns the data to the front-end.

4.3 Functional Structure Diagram:

5. Code Explanation

5.1 User interface

<template>
  <div class="common-layout">
    <el-container>
      <el-header style="background-color:#77BBDD; position: relative; font-size: 35px; height: 40px;">
        Address Book
      </el-header>
      <el-main>

      <el-dialog
        v-model="dialogVisible"
        title="Add a new contact"
        width="30%"
        :before-close="handleClose"
      >
        <span>
          <el-form
            :label-position="labelPosition"
            label-width="120px"
            :model="form"
            style="max-width: 500px"
          >
            <el-form-item label="Name">
              <el-input v-model="form.name" />
            </el-form-item>
            <el-form-item label="TelephoneNumber">
              <el-input v-model="form.telephone_number" />
            </el-form-item>
          </el-form>
        </span>
        <template #footer>
          <span class="dialog-footer">
            <el-button @click="dialogVisible = false">Cancel</el-button>
            <el-button type="primary" @click="save">
              Save
            </el-button>
          </span>
        </template>
      </el-dialog>

      <el-table :data="tableData" stripe style="width: 100%">
        <el-table-column prop="name" label="Name"/>
        <el-table-column prop="telephone_number" label="TelephoneNumber" />
        <el-table-column fixed="right" label="Operations" width="120">
          <template #default="scope">
            <el-button link type="primary" size="small" @click="Edit(scope.row)">Edit</el-button>
            <el-popconfirm title="Are you sure you want to delete this contact?" @confirm="Delete(scope.row.id)">
              <template #reference>
              <el-button link type="primary" size="small">Delete</el-button>
              </template>
            </el-popconfirm>
          </template>
        </el-table-column>
      </el-table>
    </el-main>
    
    <el-footer>
      <div>
        <el-button @click="add" type="primary">
          Add a new contact 
        </el-button>
      </div>
    </el-footer>
    </el-container>
  </div>
</template>

<script>
import request from '@/utils/request'

export default {
  name: 'HomeView',
  data(){
    return{
      form:{},
      dialogVisible:false,
      tableData:[]
    }
  },
  created(){
    this.load()
  },
  methods:{
    add(){
      this.dialogVisible=true
    },
    load(){
      request.get("http://localhost:9090/user").then(
        res=>{
          this.tableData=res
        }
      )
    },
    save(){
      request.post("http://localhost:9090/user",this.form).then(
        res=>{
          this.load()
        }
      )
      this.dialogVisible=false
    },
    Edit(row){
      this.form=JSON.parse(JSON.stringify(row))
      this.dialogVisible=true
    },
    Delete(id){
      request.delete("http://localhost:9090/user/"+id).then(
        res=>{
          this.load()
        }
      )
    }
  }

}
</script>

The header, main interface, and tail are defined in <el-container>. <el-header> represents the name of the program, <el-main> defines a form and a table, the form can be called and closed by the button, for accepting user input; Tables are used to display the user information stored in the current database. Finally, <el-footer> defines a button at the bottom of the screen for adding contacts. The <script> section defines the actions performed by the program when each button is pressed, including calling out and closing the form, uploading user input data or performing operations on the data to the back-end server, and accepting the server to display the result after processing to the user.

5.2 Back-end server

5.2.1 User.Java:

package com.example.demo.entity;

import jakarta.persistence.*;
import lombok.Data;

@Entity
@Data
@Table(name="user")
public class User {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;

    private String name;

    private String telephone_number;
}

 

This Java code defines an entity class named User that represents the user table in the database. Specific functions are as follows:

  • Mark the User class as a JPA entity using the @Entity annotation.
  • Use the @Data annotation to automatically generate getters, setters, tostrings, and so on.
  • Use the @Table annotation to specify the database table name user.
  • The id field is the primary key, which is generated using the @Id and @GeneratedValue annotations.
  • The name and telephone_number fields represent the user's name and phone number, respectively.

5.2.2 UserRepository:

package com.example.demo.repository;

import com.example.demo.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface UserRepository extends JpaRepository<User,Integer> {
}

 This Java code defines an interface called UserRepository, which inherits the JpaRepository interface. UserRepository is used to manage database operations for User entities. By inheriting JpaRepository, UserRepository automatically acquires basic CRUD (Create, read, update, delete) functionality.

5.2.3 UserController:

package com.example.demo.controller;

import com.example.demo.entity.User;
import com.example.demo.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/user")
@CrossOrigin(origins = "*",maxAge = 3600)
public class UserController {

    @Autowired
    UserRepository repo;

    @PostMapping
    void save(@RequestBody User user){
        repo.save(user);
    }

    @GetMapping
    List<User>userList(){
        return repo.findAll();
    }

    @DeleteMapping("/{id}")
    void delete(@PathVariable int id){
        repo.deleteById(id);
    }
}

 

This Java code defines a Spring Boot controller, UserController, to handle user-specific HTTP requests. Specific functions are as follows:

  • Save user: The user object is saved to the database through a POST request.
  • GET a list of users: Return a list of all users via a GET request.
  • Deleting a user: Deletes a specified user based on the user ID through a DELETE request.

 

 

 

 

...全文

相关推荐

【雷达信号处理】数字下变频(DDC)(Matlab代码实现)

内容概要:本文围绕雷达信号处理中的数字下变频(DDC)技术,详细阐述了其在Matlab环境下的实现方法与工作原理。DDC作为雷达接收机中的核心技术,主要用于将高频中频信号高效转换为低频基带信号,以便于后续的数字信号处理。文章系统介绍了DDC的三大核心步骤:混频实现频谱搬移、低通滤波抑制带外噪声与干扰、以及抽取降低采样率以减轻数据处理负担。文中提供了完整的Matlab代码实例,并通过仿真结果直观展示了信号在时域和频域的变化过程,有效验证了DDC设计的正确性与有效性。该资源对于理解现代雷达与通信系统前端处理机制具有重要价值。; 适合人群:具备一定Matlab编程基础和数字信号处理理论知识的研究生、科研人员及工程技术人员。; 使用场景及目标:①深入学习和掌握数字下变频(DDC)的基本原理、数学模型及其实现流程;②利用Matlab对雷达或通信系统中的中频信号进行仿真处理与性能验证;③为信号检测、参数估计等后续高级处理算法提供高质量的基带信号预处理支持。; 阅读建议:在学习过程中,应结合提供的Matlab代码进行逐行调试与运行,重点观察混频、滤波和抽取每一环节对信号时域波形和频谱分布的影响。建议主动修改信号参数(如载频、带宽)和DDC系统参数(如滤波器截止频率、抽取因子),探究不同参数配置对信号保真度和处理效率的影响,从而深化对DDC技术细节的理解。

科研_研学社

基于数据挖掘的京东商城商品推荐系统设计与实现(代码+数据库+LW)

摘 要 随着电商行业竞争加剧,京东商城商品品类激增,用户“信息过载”问题突出——传统货架式展示难以匹配个性化需求,致使用户购物效率低、平台转化率与粘性下滑。在此背景下,依托SpringBoot框架的快速开发特性与MySQL数据库的稳定存储能力,设计实现商品推荐系统,成为解决京东用户体验痛点、提升核心竞争力的关键。研究意义在于以“SpringBoot+MySQL”技术组合打破“人找货”传统模式,转向“货找人”精准服务;核心问题聚焦于借该技术架构整合用户与商品信息,实现个性化推荐功能与系统高效管理的协同落地。 研究以京东用户核心行为与商品关键属性为对象,采用“SpringBoot开发+MySQL存储+模块化开发”综合方法。具体步骤为:先搭建技术架构,基于SpringBoot设计分层开发结构,依托MySQL实现用户与商品信息的稳定存储及交互;再划分功能模块,用户模块涵盖注册登录、个人中心、禅选商品、订单管理等,满足个性化操作需求;管理员模块包含数据看板分析、预测信息管理、禅选商品管理等,支撑推荐效果监控与运营决策;最后构建推荐逻辑,结合用户行为特征与商品属性关联关系,实现商品精准匹配与需求趋势预判。 系统落地应用后核心成果显著:个性化推荐精准度大幅提升,有效减少用户筛选商品的时间成本;系统管理效率升级,管理员借MySQL实现信息高效交互,通过数据看板实时掌握用户偏好与推荐转化动态,预测功能可提前辅助运营决策;用户全流程体验改善,地址同步、客服聊天、收藏管理等功能形成服务闭环,增强用户平台粘性。综上,该系统依托技术优势解决京东“信息过载”与推荐低效问题,实现“个性化推荐+高效管理”双重目标,为商品运营优化提供支撑。模块化设计具备可扩展性,后续可基于现有架构迭代功能,适配更多电商场景。 关键词:个性化推荐,推荐系统,Spring Boot,MySQL

小码学长计算机程序设计

wxhook_产物_20261009

包含 wxhook_产物_20261009.zip 的资源包

鱿鱼助手

海上水面目标检测数据集VOC+YOLO格式12316张10类别.md

亲爱的CSDN用户: 首先感谢你点进这个资源页面。我需要提前说明一个重要情况: **本资源原本已设置为“0积分下载”**,即作者希望完全免费共享。但CSDN平台有时会根据文件的下载热度、文件大小、用户权限等因素,**自动将部分资源的积分调整为非0数值**(如1积分、2积分、5积分等)。这是平台系统的自动行为,而非作者本人的设定。 **因此,如果你当前看到该资源的下载所需积分不是0(例如显示为1、2、3……),请谨慎决定是否下载。** 如果你按照非0积分支付并下载后发现资源内容不符合预期、链接失效,或者实际上该资源本应是免费的,作者无法为此承担积分损失或退还操作。**强烈建议:仅在页面显示为0积分时进行下载。** 另外,本资源描述中**并未直接提供具体的下载地址或外部链接**,因为它本身是一个通过CSDN官方上传通道提交的文件/内容包。如果你看到描述中没有外部网盘地址,这是正常的——资源文件应通过CSDN内置的“下载”按钮获取。若因平台积分显示异常导致你支付了积分,请优先联系CSDN客服咨询积分退还政策,作者没有权限修改平台自动设定的积分值。 感谢你的理解与支持。技术分享本应开放,但受限于平台规则,特此提醒如上。祝学习进步!

fl176831

毕业设计含文档和代码vb+access工资管理系统(系统+答辩PPT+论文+开题报告+外文翻译)

毕业设计含文档和代码vb+access工资管理系统(系统+答辩PPT+论文+开题报告+外文翻译)

zz_ll9023
评论
收藏 已收藏
分享
返回顶部