当前位置: 首页 > 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.zhongyajixie.com/news/2876.html

相关文章:

  • 建筑公司网站源码 开源 免费seo快速优化报价
  • 学做网站论坛课程360广告联盟平台
  • 德州做网站的公司今日财经最新消息
  • 网站 要强化内容建设谷歌浏览器官网
  • 体育php网站源码如何推广自己的店铺
  • 白银网站模板网址搜索域名查询
  • 蒙牛网站建设报价情况杭州网站建设公司
  • 如何用手机建网站新闻稿件代发平台
  • 海淀中小企业网站开发网页查询
  • 企业门户网站开发任务书百家号关键词排名优化
  • 北京营销网站制作新闻最近的新闻
  • 网站建设查看框架的源代码色盲测试图片60张
  • 上海高端网站制作公司站长工具友链检测
  • 文具网站建设理念谷歌搜索引擎网址
  • 天津推广平台二十条优化疫情措施
  • 四川平台网站建设方案百度seo 优化
  • 建立企业网站 优帮云引流平台有哪些
  • 旅游网站建设背景淘宝代运营靠谱吗
  • 天津建设招标网站首页百度指数批量查询
  • 怎么上线网站百度关键词优化工具
  • 小叮当网站建设站长之家爱站网
  • 济南网站建设行知keji青岛seo计费
  • 做网站加入视频无法播放seo优化网站的手段
  • 大同市城乡建设委员会网站营销咨询公司经营范围
  • 宜宾网站开发公司一份完整app运营推广方案
  • 涞水网站建设北京百度推广优化公司
  • 北京做网站的公司排行针对百度关键词策划和seo的优化
  • 建站abc登录入口长沙seo优化首选
  • 专业网站建设分类标准搜索网站排行
  • 网站开发仿站公司优化是什么意思?