First Assignment 832202201 Qinye Ding 丁钦烨

Neoooo0 Neoooo0 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

 

目录

1 Assignment

1.1 Basic Functions

1.3 Documentation and Submission

2 PSP Table

3 Presentation of the Finished Product

4 Design and Implementation Process

4.1 Requirements Analysis

4.2 Architectural Design:

4.3 Project Implementation Process

5 Code Description

5.1 Front-end code

5.1.1 System home page

5.1.2 TypeScript scripting section

5.1.3 Style

5.2 back-end code

6 Personal Journey and Learnings


Course for this AssignmentEE308
Where are the requirement for this assigmentFirst assignment-- front-end and back-end separation contacts programming
Name and student ID丁钦烨(Qinye Ding) 832202201
The objective of this assignment1. Front-end and Back-end Separation;2. Deployment and Functionality;3. Code Quality and Documentation
Front-end repository on GitHubhttps://github.com/A-Piao-ovo/-
Back-end repository on GitHubhttps://github.com/A-Piao-ovo/houduan
  •  
  • 1 Assignment

  • For this assignment, students are required to create a contact list using a front-end and back-end separation technology and meet the following basic requirements.

    1.1 Basic Functions

    1.1.1 Add:
    Users can add new contact information through certain interactions.
    1.1.2 Modify:
    Users can modify existing contact information through certain interactions.
    1.1.3 Delete:
    Users can delete existing contact information through certain interactions

  • 1.3 Documentation and Submission

    Students are required to document their coding standards, development process, and project structure. The assignment must be submitted via GitHub, with separate repositories for the front end and back end, and a blog post detailing the assignment, development journey, and code explanations.

  • 2 PSP Table

ActivityCommentsEstimated TimeActual Time
planningOverall plan of this project1h1h
Preparation(learning)download IDEA, Vue etc4h4h
Demand AnalysisDetermine the requirements of the project and the functions that can be achieved1h1.5h
Architecture DesignDesign a frontend-backend separated architecture with Vue for the frontend and Spring Boot for the backend1h1h
API DesignCreate excuses for the front and back ends, and correlate the front and back end designs10h11h
Database DesignCreate the required classes and bind the back end to the database15h20h
TestTest whether the project meets expectations1h1.5
ModifyCorrect errors and optimize code4h6h
Total 37h46h

3 Presentation of the Finished Product

 

4 Design and Implementation Process

4.1 Requirements Analysis

Functional Requirements: Implement the functions of adding, search, editing, and deleting contact information.
User Interface: The interface should be user-friendly, easy to operate, and compatible with mainstream browsers.
Tools Selection
Frontend: Use the Vue framework to build the user interface.
Backend: Utilize the Spring Boot and Maven framework.
Database: Choose MySQL to store contact data, use Navicat to visualize management data, ensuring data persistence and efficient querying.

4.2 Architectural Design:

Frontend Architecture: Develop using a component-based approach, leveraging the Element UI components to aid in development.
Backend Architecture: Study and implement backend code for CRUD (Create, Read, Update, Delete) operations.
Database Design: Design a reasonable table structure, including a contacts table (with fields such as ID, name, and phone number), and consider indexing to optimize search performance.

4.3 Project Implementation Process

·Environment setup and configuration:
Download Node.js  to set up the Vue front-end environment, and download npm to get the front-end up and running.
Download IDEA and build the Spring Boot framework into it.
Download Mysql and Navicat to prepare for the subsequent database setup

·Frontend Development:
Design and create user interfaces and design user interaction logic.
Set the callback function to the back end and display the back end data.

·Backend Development:
Receive front-end requirements, access database data and return data to the front-end

·Database Design and Implementation:
Design the database table structure based on requirements analysis, create and initialize the database.
Write code to handle cross-origin resource sharing (CORS) and implement CRUD operations for data.
Optimize database performance, such as by adding indexes and using transactions.

·Testing and Debugging:
Test that the code is running correctly, and optimize the code

5 Code Description

5.1 Front-end code

5.1.1 System home page

<template>
  <div class="container">
    <h1>联系人管理</h1>
    <div class="button-container">
      <button @click="showAddModal">添加联系人</button>
    </div>
    <table>
      <thead>
      <tr>
        <th>姓名</th>
        <th>电话</th>
        <th>年龄</th>
        <th>性别</th>
        <th>地址</th>
        <th>操作</th>
      </tr>
      </thead>
      <tbody>
      <tr v-for="contact in contacts" :key="contact.id">
        <td>{{ contact.name }}</td>
        <td>{{ contact.phone }}</td>
        <td>{{ contact.age }}</td>
        <td>{{ contact.gender }}</td>
        <td>{{ contact.address }}</td>
        <td>
          <button @click="editContact(contact)">修改</button>
          <button @click="deleteContact(contact.id)">删除</button>
        </td>
      </tr>
      </tbody>
    </table>
    <modal v-if="showModal" @close="closeModal">
      <template #header>
        <h2>{{ editMode ? '修改联系人' : '添加联系人' }}</h2>
      </template>
      <template #body>
        <div>
          <label>姓名:</label>
          <input v-model="currentContact.name" />
          <label>电话:</label>
          <input v-model="currentContact.phone" />
          <label>年龄:</label>
          <input type="number" v-model="currentContact.age" />
          <label>性别:</label>
          <input v-model="currentContact.gender" />
          <label>地址:</label>
          <input v-model="currentContact.address" />
        </div>
      </template>
      <template #footer>
        <div class="button-group">
          <button @click="saveContact">确认</button>
          <button @click="closeModal">取消</button>
        </div>
      </template>
    </modal>
  </div>
</template>

5.1.2 TypeScript scripting section

<script>
import axios from 'axios';
import Modal from './AppModal.vue';

export default {
  components: { Modal },
  data() {
    return {
      contacts: [],
      currentContact: { name: '', phone: '', age: null, gender: '', address: '' },
      showModal: false,
      editMode: false,
    };
  },
  methods: {
    fetchContacts() {
      axios.get('/api/contacts').then(response => {
        this.contacts = response.data;
      });
    },
    showAddModal() {
      this.currentContact = { name: '', phone: '', age: null, gender: '', address: '' };
      this.editMode = false;
      this.showModal = true;
    },
    editContact(contact) {
      this.currentContact = { ...contact };
      this.editMode = true;
      this.showModal = true;
    },
    deleteContact(id) {
      axios.delete(`/api/contacts/${id}`).then(() => {
        this.fetchContacts();
      });
    },
    saveContact() {
      const method = this.editMode ? 'put' : 'post';
      const url = this.editMode ? '/api/contacts' : '/api/contacts';

      axios[method](url, this.currentContact).then(() => {
        this.closeModal();
        this.fetchContacts();
      });
    },
    closeModal() {
      this.showModal = false;
    }
  },
  mounted() {
    this.fetchContacts();
  }
};
</script>

5.1.3 Style

<style scoped>
/* 页面主样式 */
h1 {
  text-align: center;
  font-size: 2rem;
  margin: 20px 0;
  color: #333;
}

/* 表格容器 */
.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

/* 表格样式 */
table {
  width: 50vw; /* 设置表格宽度为视口宽度的一半 */
  margin: 20px auto; /* 表格水平居中 */
  border-collapse: collapse;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

th, td {
  padding: 12px;
  border: 1px solid #ccc;
  text-align: center;
  word-wrap: break-word;
  white-space: nowrap; /* 防止内容换行 */
  overflow: hidden; /* 隐藏溢出文本 */
  text-overflow: ellipsis; /* 使用省略号表示溢出文本 */
}

th {
  background-color: #f2f2f2;
  font-weight: bold;
}

tbody tr:hover {
  background-color: #f5f5f5;
}

/* 媒体查询 */
@media (max-width: 768px) {
  table {
    display: block; /* 在小屏幕上使用块布局 */
    overflow-x: auto; /* 超出部分水平滚动 */
    white-space: nowrap; /* 避免单元格内容换行 */
  }

  th, td {
    display: block; /* 每个单元格为块元素 */
    text-align: right; /* 文字右对齐 */
  }

  th {
    text-align: left; /* 表头文字左对齐 */
  }

  tbody tr {
    margin-bottom: 10px; /* 行间距 */
    border: none; /* 移除行的边框 */
  }
}


/* 按钮容器样式 */
.button-container {
  display: flex; /* 使用 Flexbox 排列按钮 */
  justify-content: center; /* 水平居中 */
  margin-bottom: 20px; /* 下方外边距 */
}

/* 按钮组样式 */
.button-group {
  display: flex; /* 使用 Flexbox 布局 */
  justify-content: center; /* 水平居中 */
  gap: 10px; /* 按钮之间的间距 */
  flex-wrap: nowrap; /* 防止换行 */
  max-width: 100%; /* 最大宽度限制 */
}

/* 按钮样式 */
button {
  padding: 10px 15px; /* 内边距 */
  background-color: #007bff; /* 按钮背景颜色 */
  color: white; /* 按钮字体颜色 */
  border: none; /* 去掉边框 */
  border-radius: 5px; /* 圆角 */
  cursor: pointer; /* 鼠标悬停时的指针样式 */
  transition: background-color 0.3s; /* 背景颜色过渡 */
  margin: 0 5px; /* 按钮间距 */
  font-size: 1rem; /* 字体大小 */
}

button:hover {
  background-color: #0056b3; /* 鼠标悬停时背景颜色变化 */
}



/* 输入框样式 */
input {
  width: 100%; /* 输入框宽度 */
  padding: 10px; /* 内边距 */
  margin: 10px 0; /* 上下外边距 */
  border: 1px solid #ccc; /* 边框 */
  border-radius: 5px; /* 圆角 */
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1); /* 内部阴影 */
}

input:focus {
  border-color: #007bff; /* 聚焦时边框颜色 */
  outline: none; /* 去掉默认聚焦轮廓 */
}

.button-group {
  display: flex; /* 使用 flexbox 布局 */
  justify-content: center; /* 水平居中 */
  gap: 10px; /* 按钮之间的间距 */
}

button {
  padding: 10px 20px; /* 增加按钮内边距 */
  border: none; /* 去掉边框 */
  border-radius: 5px; /* 圆角 */
  background-color: #007bff; /* 按钮背景色 */
  color: white; /* 文字颜色 */
  cursor: pointer; /* 鼠标指针效果 */
  transition: background-color 0.3s; /* 背景色过渡效果 */
}

button:hover {
  background-color: #0056b3; /* 鼠标悬停时背景色 */
}

</style>

5.2 back-end code

import com.example.demo.entity.Contact;
import com.example.demo.service.ContactService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/api/contacts")
public class ContactController {

    @Resource
    private ContactService contactService;

    @GetMapping
    public List<Contact> getAllContacts() {
        return contactService.getAllContacts();
    }

    @GetMapping("/{id}")
    public Contact getContact(@PathVariable Integer id) {
        return contactService.getContactById(id);
    }

    @PostMapping
    public void addContact(@RequestBody Contact contact) {
        contact.setId(null); // 确保不传入 id
        contactService.addContact(contact);
    }

    @PutMapping
    public void updateContact(@RequestBody Contact contact) {
        contactService.updateContact(contact);
    }

    @DeleteMapping("/{id}")
    public void deleteContact(@PathVariable Integer id) {
        contactService.deleteContact(id);
    }
}

 

 

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

@Data
@TableName("contacts")
public class Contact {
    @TableId(type = IdType.AUTO)
    private Integer id;
    private String name;
    private String phone;
    private Integer age; 
    private String gender;
    private String address;
}

6 Personal Journey and Learnings

Through this project of separating the front and back ends, I have a deep understanding of the operation law of the front and back ends of the web page, can make some web pages, and know the underlying law of the back end. 

...全文
YOLO26算法户外仓储场地管道凹痕目标检测+训练好的模型+260张数据集+pyqt可视化界面.zip 附训练好的 YOLO 权重与 PyQt 可视化检测界面,页面底部含可视化效果预览,毕设/课设开箱即用。 【数据集概况】 · 检测类别(中文):[凹痕(Dents)] · 训练集:228 张 · 验证集:20 张 · 测试集:12 张 · 总计:260 张 该数据集聚焦于大型工业管道在户外仓储或中转场地的表面质量检测,通过高精度标注管道表面的凹痕缺陷,为工业品控与资产维护提供可靠的数据支撑。其核心价值在于将视觉检测能力下沉至现场作业环节,有效提升对关键基础设施的损伤识别效率,保障后续运输与安装的安全性。... 【训练曲线与评估图】 【模型训练配置】 参数 | 值 模型 | yolo26n 训练轮数 | 100 epochs 输入尺寸 | 640x640 批次大小 | 24 优化器 | auto 初始学习率 | 0.01 训练设备 【关键指标汇总】 训练了 37 个 epoch,最终轮指标: 指标 | 数值 mAP50 | **0.0407** mAP50-95 | 0.0103 Precision | 0.1843 Recall | 0.1482 train/box_loss | 1.9046 train/cls_loss | 2.8888 val/box_loss | 2.7624 val/cls_loss | 5.1260 【训练过程分析】 37 轮训练后 mAP50 仅 0.0407,模型收敛不充分。Loss 曲线前期下降后进入平台期,mAP 提升缓慢。mAP50-95 为 0.0103,整体性能需要进一步优化。 【模型性能评估】 Precision 0.1843、Recall 0.1482,精度高于召回,存在一定漏检。 【预测效果展示】 验证集预测效果偏弱,漏检和误检较多,小目标和边缘场景的检出能力... 使用场景:毕业设计、课程设计、深度学习入门、工业场景落地验证。 立即下载

相关推荐

技术转移机构如何基于数据提升项目撮合精准度?.docx

技术转移机构如何基于数据提升项目撮合精准度?

BIZKEEN

超扭滑模与快速终端滑模的永磁同步电机无感控制:理论、离散化实现与仿真研究(Simulink仿真实现)

内容概要:本文系统研究了超扭滑模控制(STSMC)与快速终端滑模控制(FTSMC)在永磁同步电机(PMSM)无感控制中的应用,重点涵盖其理论基础、离散化实现方法及Simulink仿真验证。文章深入阐述了两种高阶滑模控制策略的设计原理,利用磁链无感观测技术实现转子位置与速度的精确估计,从而省去物理传感器,有效提升了系统的可靠性与鲁棒性。同时,提供了完整的Simulink仿真模型构建方案,包括控制器设计、关键参数整定及动态响应性能分析,充分验证了所提出的方法在零速与低速工况下的卓越控制性能和有效性。; 适合人群:具备电机控制、现代控制理论基础知识及熟练掌握MATLAB/Simulink仿真技能的研究生、科研人员与工程技术人员。; 使用场景及目标:①深入理解高阶滑模控制在电机驱动系统中的设计思想与具体实现;②掌握基于滑模观测器的无感控制核心技术;③开展永磁同步电机高性能控制算法的理论研究、仿真验证与工程化探索。; 阅读建议:建议将文中详尽的理论推导与Simulink仿真模型相结合进行学习,重点关注滑模面的构建、抖振抑制策略的实施以及离散化处理的细节,有条件的研究者可进一步将算法移植到DSP等硬件平台进行实验验证,以深化对理论的理解并检验其实际应用效果。

长安程序猿

多源动态最优潮流的分布鲁棒优化方法(IEEE118节点)(Matlab代码实现)

内容概要:本文系统阐述了基于Matlab的多源动态最优潮流分布鲁棒优化方法,聚焦于IEEE118节点电力系统,旨在应对高比例可再生能源接入背景下源荷双重不确定性所带来的调度挑战。该方法深度融合分布鲁棒优化理论,通过构建能够抵御最坏情况概率分布的决策模型,有效提升了电力系统在复杂不确定性环境下的运行安全性、经济性与可靠性。研究不仅提供了完整的Matlab代码实现,便于结果复现与算法验证,还特别关注了含风电等新能源的现代电网低碳调度问题,为解决实际工程中的优化调度难题提供了强有力的理论支撑和技术工具。; 适合人群:具备电力系统分析基础和Matlab编程能力的研究生、科研人员及从事智能电网优化运行、能源系统规划等相关领域的工程技术人员。; 使用场景及目标:①研究含高比例可再生能源接入的电力系统动态最优潮流问题;②掌握分布鲁棒优化在电力系统经济调度、低碳调度中的建模思想与求解方法;③利用IEEE118标准测试系统进行算法有效性验证与性能对比分析;④基于所提供的Matlab代码进行二次开发,探索新型不确定性优化理论在电力系统中的创新应用。; 阅读建议:建议读者结合电力系统最优潮流、不确定性优化理论(特别是分布鲁棒优化)的背景知识进行学习,重点关注模型的构建逻辑、目标函数与约束条件的设计原理,以及Matlab代码的具体实现细节。在学习过程中,应动手调试代码,尝试修改系统参数(如新能源出力波动范围、负荷水平等),以观察不同场景下优化结果的变化,从而深刻理解该方法的适应性、优势及其潜在的局限性。

天天程序猿

车间调度基于GA、PSO、SA、ACO、TS优化算法的车间调度比较研究(Matlab代码实现)

内容概要:本文系统性地比较了遗传算法(GA)、粒子群优化(PSO)、模拟退火(SA)、蚁群优化(ACO)和禁忌搜索(TS)五种智能优化算法在车间调度问题中的性能表现,并提供了基于Matlab的完整代码实现。研究聚焦于调度优化的核心目标——最小化完工时间(makespan),通过标准测试案例对各算法的收敛速度、求解精度和稳定性进行了深入对比分析,旨在为实际生产调度中算法的选择与改进提供科学依据。文中不仅详述了每种算法的设计思路与关键参数设置,还展示了其实现逻辑,便于读者理解、复现与拓展。; 适合人群:从事智能制造、工业工程、运筹优化等相关领域的研究人员,以及具备Matlab编程基础、希望将智能优化算法应用于实际调度问题的研究生和工程师。; 使用场景及目标:① 掌握主流智能优化算法在解决NP-hard车间调度问题上的具体应用与差异;② 学习如何利用Matlab实现并对比不同优化算法的性能;③ 为解决生产制造、物流配送等领域中的资源调度难题提供算法选型和技术参考。; 阅读建议:建议读者在阅读时重点关注各算法的Matlab实现代码和实验结果对比部分,动手运行代码以直观感受不同算法的寻优过程和效果差异。同时,可结合具体调度约束条件,尝试调整算法参数或融合多种算法思想,以深化对优化机理的理解。

天天程序猿

3D人物伍子胥智能对话及反应动作报告

3D人物伍子胥智能对话及反应动作报告

atye115
评论
收藏 已收藏
分享
返回顶部
Neoooo0
2401_MU_SE_FZU 174 成员 461 内容