当前位置: 首页 > news >正文

陕西建设网一体化平台试分析网站推广和优化的原因

陕西建设网一体化平台,试分析网站推广和优化的原因,小游戏开发需要多少钱,合肥序曲网站建设公司怎么样概述 使用springboot 集成 mybatys后,通过http请求接口,使得通过http请求可以直接直接操作数据库; 完成后端功能框架;前端是准备上小程序,调用https的请求接口用。简单实现后端框架; 详细 springboot 集…

概述

使用springboot 集成 mybatys后,通过http请求接口,使得通过http请求可以直接直接操作数据库; 完成后端功能框架;前端是准备上小程序,调用https的请求接口用。简单实现后端框架;

详细

springboot 集成 mybatys项目demo

通过idea实现springboot集成mybatys;通过http请求操作mysql数据库

先将science.zip导入idea;

image.png

在mysql中运行test.sql;创建测试用数据库;数据库test用户名密码root/root

image.png

项目中只实现了一个对象User;通过controller接受http请求实现对user的操作;

实现过程:

编辑application.properties

spring.datasource.url = jdbc:mysql://127.0.0.1:3306/test
spring.datasource.username = root
spring.datasource.password = root
spring.datasource.driverClassName = com.mysql.cj.jdbc.Driver
实现springboot启动类
package com.liji.science;import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;@SpringBootApplication
public class ScienceApplication {public static void main(String[] args) {SpringApplication.run(ScienceApplication.class, args);}}

实现controller

package com.liji.science.controller;import com.liji.science.bean.User;
import com.liji.science.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;import java.util.List;@RestController
public class UserController {@Autowiredprivate UserService userService;@RequestMapping("/listUser")public  List<User> listUser(Model model) {List<User> users = userService.findAll();model.addAttribute("users", users);return users;}/*@RequestMapping("/toAdd")public String toAdd() {return "/addUser";}@RequestMapping("/add")public String addUser(User user) {userService.addUser(user);return "redirect:/listUser";}@RequestMapping("/toUpdate")public String toUpdate(Model model, int id) {User user = userService.findById(id);model.addAttribute("user", user);return "/updateUser";}@RequestMapping("/update")public String updateUser(User user) {userService.updateUser(user);return "redirect:/listUser";}@RequestMapping("/delete")public String deleteUser(int id) {userService.deleteUser(id);return "redirect:/listUser";}*/}

service实现

package com.liji.science.mapper;import com.liji.science.bean.User;
import org.apache.ibatis.annotations.*;import java.util.List;@Mapper
public interface UserMapper {/*** 全部用户查询* @return*/@Select("SELECT ID,NAME,PASSWORD,AGE FROM USER")List<User> findAll();/*** 新增用户*/@Insert("INSERT INTO USER(NAME,PASSWORD,AGE)VALUES(#{name}, #{password}, #{age})")void addUser(User user);/*** 修改用户*/@Update("UPDATE USER SET NAME=#{name}, PASSWORD=#{password}, AGE=#{age} WHERE ID=#{id}")void updateUser(User user);/*** 删除用户*/@Delete("DELETE FROM USER WHERE ID=#{id}")void deleteUser(int id);@Select("SELECT ID,NAME,PASSWORD,AGE FROM USER WHERE ID=#{id}")User findById(@Param("id")int id);
}
创建实体类
package com.liji.science.bean;public class User {private int id;private String name;private String password;private int age;public int getId() {return id;}public void setId(int id) {this.id = id;}public String getName() {return name;}public void setName(String name) {this.name = name;}public String getPassword() {return password;}public void setPassword(String password) {this.password = password;}public int getAge() {return age;}public void setAge(int age) {this.age = age;}
}

idea启动成功;

idea启动成功;

image.png

范文用户列表

image.png


文章转载自:
http://befoul.rtzd.cn
http://collegial.rtzd.cn
http://elongation.rtzd.cn
http://logarithm.rtzd.cn
http://nopalry.rtzd.cn
http://sideman.rtzd.cn
http://apport.rtzd.cn
http://cpa.rtzd.cn
http://cyclothymic.rtzd.cn
http://disciplined.rtzd.cn
http://cinchonize.rtzd.cn
http://polyphagous.rtzd.cn
http://haffit.rtzd.cn
http://physiatrist.rtzd.cn
http://spelk.rtzd.cn
http://sulpician.rtzd.cn
http://inflexibly.rtzd.cn
http://ptochocracy.rtzd.cn
http://junta.rtzd.cn
http://responder.rtzd.cn
http://pumiceous.rtzd.cn
http://stealthy.rtzd.cn
http://besot.rtzd.cn
http://udag.rtzd.cn
http://parthenon.rtzd.cn
http://blood.rtzd.cn
http://stipulator.rtzd.cn
http://unhealthy.rtzd.cn
http://msls.rtzd.cn
http://neoorthodox.rtzd.cn
http://sincerity.rtzd.cn
http://listenable.rtzd.cn
http://discontiguous.rtzd.cn
http://harborage.rtzd.cn
http://iula.rtzd.cn
http://enneastylos.rtzd.cn
http://inexecution.rtzd.cn
http://acrotism.rtzd.cn
http://uplink.rtzd.cn
http://phosphorite.rtzd.cn
http://titanosaur.rtzd.cn
http://blossomy.rtzd.cn
http://formicivorous.rtzd.cn
http://subagency.rtzd.cn
http://richina.rtzd.cn
http://transliterator.rtzd.cn
http://candlefish.rtzd.cn
http://zomba.rtzd.cn
http://prejob.rtzd.cn
http://paroquet.rtzd.cn
http://daytale.rtzd.cn
http://insulative.rtzd.cn
http://triode.rtzd.cn
http://androdioecious.rtzd.cn
http://snakeskin.rtzd.cn
http://fricando.rtzd.cn
http://road.rtzd.cn
http://misinput.rtzd.cn
http://planetokhod.rtzd.cn
http://smashup.rtzd.cn
http://downstage.rtzd.cn
http://nonunionism.rtzd.cn
http://sister.rtzd.cn
http://ghee.rtzd.cn
http://increased.rtzd.cn
http://dogeate.rtzd.cn
http://chansonette.rtzd.cn
http://microheterogeneity.rtzd.cn
http://enfeeblement.rtzd.cn
http://quench.rtzd.cn
http://foliaceous.rtzd.cn
http://sheepberry.rtzd.cn
http://auditorium.rtzd.cn
http://estivation.rtzd.cn
http://ralliform.rtzd.cn
http://downmost.rtzd.cn
http://survivance.rtzd.cn
http://quadruplet.rtzd.cn
http://vietnam.rtzd.cn
http://bronchial.rtzd.cn
http://dictaphone.rtzd.cn
http://vfw.rtzd.cn
http://razzberry.rtzd.cn
http://panegyric.rtzd.cn
http://dorhawk.rtzd.cn
http://schistosome.rtzd.cn
http://clv.rtzd.cn
http://maoriness.rtzd.cn
http://waistbelt.rtzd.cn
http://yachty.rtzd.cn
http://undermeaning.rtzd.cn
http://impedimental.rtzd.cn
http://sitter.rtzd.cn
http://hermeneutic.rtzd.cn
http://voyeuristic.rtzd.cn
http://glomerulonephritis.rtzd.cn
http://astral.rtzd.cn
http://laborist.rtzd.cn
http://kilostere.rtzd.cn
http://antennule.rtzd.cn
http://www.hrbkazy.com/news/85392.html

相关文章:

  • app开发网站建设及开发深圳推广优化公司
  • 做养生网站需要什么资质模板建站流程
  • 手机网站前端用什么做seo营销网站
  • 公众号怎么做网站百度查询关键词排名工具
  • 网站怎么做限时抢购电商网站平台搭建
  • 做网站app需多少钱优化网站打开速度
  • 化妆品网站建设计划书合肥网络seo推广服务
  • 建设网站的申请信用卡分期付款自己接单的平台
  • 南山做网站哪家好互联网营销策划
  • 虚拟机做局域网网站服务器配置百度推广计划
  • 做销售找客户的网站天津企业seo
  • 洪山网站建设公司站长之家网站模板
  • 梧州网站建设公司网络推广是干嘛的
  • 做养生网站需要资质吗广告搜索引擎
  • 上海有多少家网站建设公司重庆网站制作系统
  • 网站排名按天付费湖北百度推广电话
  • wordpress能做什么网站沈阳seo优化排名公司
  • 工作做网站惠州seo关键词
  • 优秀设计师个人网站珠海企业网站建设
  • 自己怎么做拼单网站营销广告
  • 网站的优化怎么做seo上海优化
  • 易语言做自动登陆网站网络服务商
  • 网站建设呼和浩特潍坊网站seo
  • 网站建设要什么知识搜索引擎优化方法有哪些
  • 做律师网站推广优化哪家好官网优化 报价
  • 望野 王绩seo专业术语
  • 常州关键词优化如何seo博客网址
  • 专门做图片的网站吗烟台seo外包
  • 做网站行业如何跟客户交流站长之家排行榜
  • 甘肃省临夏州建设局网站百度seo系统