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

网站开发模块的需求免费网站流量

网站开发模块的需求,免费网站流量,做房产网站在百度推广推广费,网站备案目的1.1 创建数据库和表(略) 2.1 创建Maven工程 2.2 补齐resource文件夹和application.yml文件 2.3 porn.xml中引入web,mybatis,mysql等依赖 2.3.1 引入springboot parent 2.3.2 删除junit 依赖--不能删,删了会报错 2.3.3 引入spring web依赖…

1.1 创建数据库和表(略)

2.1 创建Maven工程

2.2 补齐resource文件夹和application.yml文件

2.3 porn.xml中引入web,mybatis,mysql等依赖

2.3.1 引入springboot parent

2.3.2 删除junit 依赖--不能删,删了会报错

2.3.3 引入spring web依赖

2.3.4 引入mybatis依赖

2.3.5 引入mysql依赖

<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><!--  引入springboot父工程--><parent><artifactId>spring-boot-starter-parent</artifactId><groupId>org.springframework.boot</groupId><version>3.1.8</version></parent><groupId>com.geji</groupId><artifactId>big-event</artifactId><version>1.0-SNAPSHOT</version><name>big-event</name><!-- FIXME change it to the project's website --><url>http://www.example.com</url><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><maven.compiler.source>1.7</maven.compiler.source><maven.compiler.target>1.7</maven.compiler.target></properties><dependencies><!--    spring web依赖 --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency>
<!--    mybatis依赖--><dependency><groupId>org.mybatis.spring.boot</groupId><artifactId>mybatis-spring-boot-starter</artifactId><version>3.0.0</version></dependency>
<!--    mysql驱动依赖--><dependency><groupId>com.mysql</groupId><artifactId>mysql-connector-j</artifactId></dependency><dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>4.11</version><scope>test</scope></dependency></dependencies><build><pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) --><plugins><!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle --><plugin><artifactId>maven-clean-plugin</artifactId><version>3.1.0</version></plugin><!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging --><plugin><artifactId>maven-resources-plugin</artifactId><version>3.0.2</version></plugin><plugin><artifactId>maven-compiler-plugin</artifactId><version>3.8.0</version></plugin><plugin><artifactId>maven-surefire-plugin</artifactId><version>2.22.1</version></plugin><plugin><artifactId>maven-jar-plugin</artifactId><version>3.0.2</version></plugin><plugin><artifactId>maven-install-plugin</artifactId><version>2.5.2</version></plugin><plugin><artifactId>maven-deploy-plugin</artifactId><version>2.8.2</version></plugin><!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle --><plugin><artifactId>maven-site-plugin</artifactId><version>3.7.1</version></plugin><plugin><artifactId>maven-project-info-reports-plugin</artifactId><version>3.0.0</version></plugin></plugins></pluginManagement></build>
</project>

3.1 在application.yml中配置数据库信息

spring:datasource:driver-class-name: com.mysql.cj.jdbc.Driverurl: jdbc:mysql://localhost:3306/big_eventusername: rootpassword: 1234

4.1 创建包结构

tips: 有情况下idea中包结构是.形式的没有铺开,可以按图示方式转换成普通的包结构显示

4.2 根据数据库表创建实体类

4.2.1 Article

package com.geji.pojo;import java.time.LocalDateTime;public class Article {private Integer id;//主键IDprivate String title;//文章标题private String content;//文章内容private String coverImg;//封面图像private String state;//发布状态 已发布|草稿private Integer categoryId;//文章分类idprivate Integer createUser;//创建人IDprivate LocalDateTime createTime;//创建时间private LocalDateTime updateTime;//更新时间
}

4.2.2 Category

package com.geji.pojo;import java.time.LocalDateTime;public class Category {private Integer id;//主键IDprivate String categoryName;//分类名称private String categoryAlias;//分类别名private Integer createUser;//创建人IDprivate LocalDateTime createTime;//创建时间private LocalDateTime updateTime;//更新时间
}

4.2.3 User

package com.geji.pojo;import java.time.LocalDateTime;public class User {private Integer id;//主键IDprivate String username;//用户名private String password;//密码private String nickname;//昵称private String email;//邮箱private String userPic;//用户头像地址private LocalDateTime createTime;//创建时间private LocalDateTime updateTime;//更新时间
}

注意命名方式,实体类为驼峰,数据库为下划线

5.1 更改启动类名字,并编写相应代码

package com.geji;import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;/*** Hello world!**/
@SpringBootApplication
public class BigEventApplication
{public static void main( String[] args ){SpringApplication.run(BigEventApplication.class,args);}
}

6.1 启动,不报错则创建环境成功

tips:

7.1 以上实体类没有getter,setter等方法,可以使用lombok在编辑阶段自动生成

7.1.1 在依赖中引入lombok

<!--    lombok依赖--><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId></dependency>

7.1.2 在实体类上加入@Data注解

7.1.3 在maven中重新编译,然后在target文件夹中就会发现编译好的实体类中有getter,setter等方法了

http://www.yayakq.cn/news/723248/

相关文章:

  • 织梦模板官网宁波seo排名优化方法
  • 中小型网站设计哪家好不建议网站
  • 一起做彩票网站的人施工企业施工生产计划
  • 如何注册域名及网站百度竞价个人开户
  • 广告制作公司网站全国建设信息网
  • 网站开发与维护是做什么工作PHP网站开发有哪些框架
  • 最好的app制作网站seo排名优化培训网站
  • 佛山设计网站建站行业分析
  • wordpress去除购物车图标建站优化内容
  • 西安网站开发公司有哪家wordpress 查询数据
  • 用微信怎么做商城网站吗中国网站建设代理项目
  • 西安行业网站中国免费建站网
  • 牛网站建设广州专业网站设计
  • 网站提交地址朋友说做网站什么的怎么赚钱
  • 西安网站建设罗鑫dedecms 调用 另一个网站
  • 网站关键词怎么做上首页wordpress菜单的意思
  • 网站建设设计规划书新建网站怎么优化
  • 品牌建设总结报告搜索引擎优化的步骤有哪些
  • 找工作哪个网站好招聘信息网站怎么做搜狗排名
  • 中际城市建设有限公司网站wordpress仿qq空间模板
  • 游戏网站排行建设局网站建设方案书
  • 郑州网站建设郑州网站建设网站建设平台信息
  • 罗定市住房和城乡建设局网站桂林网站制作人才招聘
  • 手表网站哪家好建一个手机网站多少钱
  • 求网站建设详细过程定制网站前准备
  • 地区网站建设服务周到海阳建设局网站
  • 网站开发技术流程旅游网站模块分类
  • 哪个免费自助建站系统最好用所见即所得网站管理系统
  • 用网站做的简历模板网站建设经典案例
  • 做物流网站有哪些功能红色ppt模板免费下载网站