[17:25:31.185][DEBUG][org.mybatis.spring.SqlSessionUtils][http-nio-8088-exec-8] Creating a new SqlSession
[17:25:31.185][DEBUG][org.mybatis.spring.SqlSessionUtils][http-nio-8088-exec-8] SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@3fa855e0] was not registered for synchronization because synchronization is not active
[17:25:31.186][DEBUG][o.m.s.t.SpringManagedTransaction][http-nio-8088-exec-8] JDBC Connection [jdbc:mysql://localhost:3306/mmall?characterEncoding=utf-8, UserName=root@localhost, MySQL-AB JDBC Driver] will not be managed by Spring
[17:25:31.187][DEBUG][com.mmall.dao.CategoryMapper.insert][http-nio-8088-exec-8] ==> Preparing: insert into mmall_category (id, parent_id, name, status, sort_order, create_time, update_time) values (?, ?, ?, ?, ?, now(), now()})
[17:25:31.187][DEBUG][com.mmall.dao.CategoryMapper.insert][http-nio-8088-exec-8] ==> Parameters: null, 0(Integer), 新产品2(String), true(Boolean), null
[17:25:31.188][DEBUG][org.mybatis.spring.SqlSessionUtils][http-nio-8088-exec-8] Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@3fa855e0]
一直500报错
public ServerResponse addCategory(String categoryName,Integer parentId){
if(parentId == null || StringUtils.isBlank(categoryName)){
return ServerResponse.createByErrorMessage("添加品类参数错误");
}
Category category = new Category();
category.setName(categoryName);
category.setParentId(parentId);
category.setStatus(true);//这个分类是可用的
int rowCount = categoryMapper.insert(category);
if(rowCount > 0){
return ServerResponse.createBySuccess("添加品类成功");
}
return ServerResponse.createByErrorMessage("添加品类失败");
}
但我把这里面的