第一次正式进入公司 实习 。接触到的并未在学校中学到的许多东西(软件、框架等)在下面列出。
工作软件:IDEA(之前使用的是eclipse)、Navicat(之前使用的是SQL Server Management)
框架:Spring Boot、Mybatis
软件项目管理工具:Maven
实现数据库的update功能
带我的师傅并不打算带着我做一次,也许他认为项目太简单,而且摸索的过程有利于我的发展吧!
但是对一个计算机专业但是从未接触过Spring框架的准大四生来说,很难完成,而且限定了2天时间完成(其实第一天下午15:00才布置任务)。
目标如下:
阵地介绍-编辑资料 @陈0敏 2019-7-9
服务队介绍-编辑资料 @陈0敏 2019-7-9
熟悉项目结构及开发规范 @陈0敏 2019-7-9
熟悉项目具体实施,且必须在规定时间内完成 @陈0敏 2019-7-9
参考文档如下:
mybatis-plus文档
Spring-Boot文档
Spring MVC文档
swagger(文档)
IDEA常用快捷键
java开发手册
使用的库:culture-center
使用的表:dept_detail
项目入口controller: DeptController
———————————————————分——界——线——————————————————
明确自己应该创建的java文件有哪些
main -->
- java -->
- Controller -->>
- ①DeptDetailController
- Service -->>
- ②IDeptDetailService
- impl -->>>
- ③DeptDetailServiceImpl
- DAO -->
- ④DeptDAO
api -->
- model -->
- entity -->>>
- ⑤DeptDetail
- param -->>>
- ⑥NoahDeptUpdateParam
/**
* @program: noah-task-unit
* @author: chenmin
* @create: 2019-07-09 15:10
* @desc: 服务队编辑详情
**/
@Api(tags = "服务队管理")
@RestController
@RequestMapping("/dept")
public class DeptDetailController {
@Autowired
private IDeptDetailService iDept_detailService;
@ApiOperation(value = "编辑部门资料")
@RequestMapping(value = "/data/edit", method = RequestMethod.POST)
@Transactional(rollbackFor = Exception.class)
public Boolean edit(@Valid @RequestBody NoahDeptDataUpdateParam param) {
Boolean result = deptDetailService.edit(param);
return result;
}
}
/**
* @program: noah-task-unit
* @author: chenmin
* @create: 2019-07-09 15:10
* @desc:
**/
@Service
public interface IDeptDetailService extends IService<DeptDetail> {
Long create(NoahDeptCreateParam param);
Boolean updateById(NoahDeptUpdateParam param);
}
@Service("IDeptDetailService")
public class DeptDetailServiceImpl extends AbstractNoahServiceImpl<IDeptDAO, DeptDetail> implements IDeptDetailService {
@Autowired
private IDeptDetailService iDept_detailService;
@Override
public Boolean updateById(NoahDeptUpdateParam param) {
DeptDetail deptDetailById = getById(param.getDeptId());
Assert.notNull(deptDetailById, "服务队不存在");
DeptDetail mapper = DozerUtil.mapper(param, DeptDetail.class);
boolean result = saveOrUpdate(mapper);
return result;
}
}
@TableName("dept_detail")
@Data
public class DeptDetail extends LogicDelEntity {
/**
*
*/
private Long deptId;
/**
*
*/
private Long memberCount;
/**
*
*/
private String abstracts;
/**
*
*/
private String pictureUrls;
}
/**
* @program: noah-culture-center
* @description: 更新
* @author: chenmin
* @create: 2019-07-09 15:10
**/
@Repository
public interface IDeptDAO extends BaseMapper<DeptDetail> {
}
public class NoahDeptUpdateParam {
/**
* 部门id
*/
@NotNull
@ApiModelProperty(value = "部门id")
private Long deptId;
/**
* appId
*/
@ApiModelProperty(value = "appId")
private Long appId;
/**
* 简介
*/
@ApiModelProperty(value = "简介")
private String abstracts;
/**
* 图片地址
*/
@ApiModelProperty(value = "图片地址")
private List<String> pictureUrls;
/**
* 人数
*/
@ApiModelProperty(value = "人数")
private Long memberCount;
@NotNull(message = "部门id不能为空")
@ApiModelProperty(value = "deptId")
private Long deptId;
}
第一个项目就逾期了,233。
其中碰到了很多不会的地方,也不能总是去麻烦别人,只能靠自己查看api文档(百度几乎不到答案),希望以后越来越好!