首页 > 编程语言 >3.1日javaweb

3.1日javaweb

时间:2024-03-05 10:24:09浏览次数:27  
标签:String example application 3.1 import com public javaweb

  今天继续进行项目的编写

package com.example.service;

import com.example.mapper.UserMapper;
import com.example.pojo.Application;
import com.example.pojo.Plan;
import com.example.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;

    public User getByUser(String username, String password) {
        return userMapper.getByUser(username,password);
    }

    public void add(Plan plan) {
         String name=plan.getName();
         int num=plan.getNumber();
         String sum=plan.getSum();
        String idea=plan.getIdea();
        String english=plan.getEnglish();
         String math=plan.getMath();
         LocalDateTime time=plan.getTime();
         userMapper.add(name,num,sum,idea,english,math,time);
    }

    public Plan decline(String type) {
        return userMapper.decline(type);
    }

    public List<Application> zizhi() {
        return userMapper.zizhi();
    }
}
package com.example.service;

import com.example.mapper.StudentMapper;
import com.example.pojo.Application;
import com.example.pojo.Plan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Random;

@Service
public class StudentService {
    @Autowired
    private StudentMapper studentMapper;

    public void addStudent(Application application) {
        String name = application.getName();
        String nameId = application.getNameId();
        String type = application.getType();
        int sum = application.getSum();
        int idea = application.getIdea();
        int english = application.getEnglish();
        int math = application.getMath();
        int major = application.getMajor();
        int status =application.getStatus();
        String username=application.getUsername();
        studentMapper.addStudent(name, nameId, type, sum, idea, english, math, major,status,username);
    }

    public Application select(String username) {
        return  studentMapper.select(username);
    }

    public List<Plan> getAll() {
        return  studentMapper.getAll();
    }
}

 

标签:String,example,application,3.1,import,com,public,javaweb
From: https://www.cnblogs.com/dmx-03/p/18053385

相关文章

  • JavaWeb
    JavaWebJavaWeb组件首先献上Tomcat架构神图:ServletServlet容器:运行在Web服务器上的程序,作为来自HTTP客户端的请求和HTTP服务器上的数据库或应用程序之间的中间层,它负责处理用户的请求,并根据请求生成相应的返回信息提供给用户。​ 大体原理图如下:Servlet请求的处理......
  • 黑马程序员JavaWeb学习笔记-过滤器
    过滤器--Filter过滤器Filter快速入门Filter拦截路径过滤器链Filter——流程importcom.alibaba.fastjson.JSONObject;importcom.itheima.pojo.Result;importlombok.extern.slf4j.Slf4j;importorg.springframework.util.StringUtils;importjavax.servlet.*;im......
  • 黑马程序员JavaWeb学习笔记-拦截器
    拦截器--Interceptor--快速入门@Component注解交给ioc容器管理--注册配置拦截器@Configuration注解用来标识当前是Spring当中的一个配置类//Interceptor拦截所有("/**")//Filter拦截所有("/*")//WebConfig需要在包下新建一个config包与controller同级//.excl......
  • 黑马程序员JavaWeb学习笔记-文件上传
    文件上传https://www.bilibili.com/video/BV1m84y1w7Tb/?p=150&spm_id_from=pageDriver&vd_source=62f4901d4d947272c439194b87ec6698当报错500时,服务端出现错误,因为默认最大为1M在application.properties里面修改文件上传的几个函数本地存储Controller层的代码import......
  • 黑马程序员JavaWeb学习笔记-登陆login
    登陆loginlogin是登陆业务方法,mapper接口是持久层,用来操作数据库的,用业务方法名不合适三层架构PostMan测试登陆校验http协议是无状态的,下次请求不会携带上次请求的数据,两次请求是独立的Cookie前后端分离项目中前端页面和后段接口部署在不同的服务器上,所以他们的协议......
  • 黑马程序员JavaWeb学习笔记-JavaScript
    JavaScript--JavaScript引入方式--书写语法--输出语句window可以省略--变量var特点1:作用域比较大,全局变量特点2:可以重复定义--数据类型原始数据类型相当于java中基础数据类型alert(parseInt("12"));//12alert(parseInt("12A45"));//12alert(parseInt("A4......
  • 黑马程序员JavaWeb学习笔记-HTML
    HTML-新浪新闻HTML格式化代码mac:sheft+option+Fwin:ctrl+alt+L--标题排版<!--文档类型为HTML--><!DOCTYPEhtml><htmllang="en"><head><!--字符集为UTF-8--><metacharset="UTF-8"><!--设置浏览器兼容性-->......
  • JavaWeb_mac_env
    maven安装brew安装wgetbrewinstallwgetbrewcleanup--prune=all //删除所有安装缓存下载mavenwgethttps://dlcdn.apache.org/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.tar.gz或者curl-Ohttps://dlcdn.apache.org/maven/maven-3/3.9.6/binaries/apache......
  • 3.1~3.10解题报告
    [cf1525E]AssimilationIV依据题面,可以知道每个点只会被计算一次,所以可以从点出发,求每个点被覆盖的概率,正着计算会有很多重复,所以考虑先算出不可能的情况,在与1作差,很明显,若所有城市到点A的距离都小于n,则一定成立,如果有一个不满足,则若此城市第一个放置,就要分两种情况,若其余距离均......
  • faster-fifo:C++实现的python多进程通信队列 —— 强化学习ppo算法库sample-factory的C
    项目地址:https://github.com/alex-petrenko/faster-fifo需要注意,该项目给出了两种安装方法,一种是pip从pypi官网安装,一种是从GitHub上的源码安装;经过测试发现这个项目维护程度较差,因此pypi官网上的项目比较落后,因此不建议使用pypi上的安装,而是进行源码编译安装。给出源码编......