java项目实战Day1

技术选型

前端:三件套+React+组件库Ant Degsin+Umi+Ant Desgin Pro
后端:java+springboot+spring+springmvc+mybatis+mysql+mybatis-plus

Day1

一.初始化项目

1.前端初始化

1.1初始化项目
1.2引入组件

1.node.js
2.ANT DESIGN PRO
YARN 是一个包项目管理器 比npm好在并行下载
遇到的问题
[Error: EPERM: operation not permitted, rmdir ‘E:\Node.js\node_cache\node_modules\yarnpkg\node_modules\agent-base\node_modules’]错误代码4048
*更改了nodejs.exe的权限

最后根据官方解决https://classic.yarnpkg.com/en/docs/install/#windows-stable*
yran怎么知道项目依赖那些包?
package.json

react是对js的封装,umi是对react的封装

2.后端初始化

mysql
修改application.yml文件加入mapper文件夹,创建接口,创建测试类
还有个问题就是如果导入了mybaitsplus,不要再次导入mybaits以及mybaits-spring-boot-starter和MyBits-Spring

package org.dxw.usercenter;

import com.baomidou.mybatisplus.core.toolkit.Assert;
import org.dxw.usercenter.mapper.UserMapper;
import org.dxw.usercenter.model.User;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;

@SpringBootTest
@RunWith(SpringRunner.class)
public class SampleTest {

    @Autowired
    private UserMapper userMapper;

    @Test
    public void testSelect() {
        System.out.println(("----- selectAll method test ------"));
        List<User> userList = userMapper.selectList(null);
        Assert.isTrue(5 == userList.size(), "");
        userList.forEach(System.out::println);
    }

}

要加@RunWith(SpringRunner.class)

  • 7
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值