# recipe_recommendation_system
**Repository Path**: yang_tao_code/recipe_recommendation_system
## Basic Information
- **Project Name**: recipe_recommendation_system
- **Description**: 基于内容,协同过滤的食谱推荐系统,目前正在开发中,会逐步完善此项目
- **Primary Language**: Java
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 7
- **Forks**: 2
- **Created**: 2021-03-03
- **Last Updated**: 2023-04-07
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# 基于mybatis-plus的springboot代码生成器
[](https://github.com/misterchaos/springboot-mybatis-plus-generator)
[](https://github.com/misterchaos/springboot-mybatis-plus-generator/releases)
[](https://github.com/misterchaos/springboot-mybatis-plus-generator/releases)

## :star:Features
- 实现controller restful风格CURD接口
- service层CURD对IService的方法再次封装,方便添加业务逻辑
- serviceImpl中方法实现执行日志打印
- mapper模板在官方模板基础上加入@mapper注解
- 各模板方法添加Javadoc注释
- 实现分页查询,关键词模糊查询(需自定义字段)
## :point_right:Quick Start
**动画演示**:

**使用步骤:**
- 修改application.properties配置文件,设置数据库信息
```
#DataSource Config
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/flower?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT
spring.datasource.username=root
spring.datasource.password=
```
- 运行CodeGenerator类,输入Author,输入数据库表名
- 运行SpringbootMybatisPlusGeneratorApplication,测试接口
> 注意:数据库表必须符合以下规范
> 每张表的主键命名为 表名_id 如: user_id
## :bulb:Examples
### 1.Controller模板代码示例
```java
package cn.hellochaos.generator.controller2;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import cn.hellochaos.generator.entity.dto.ResultBean;
import cn.hellochaos.generator.service.UserService;
import cn.hellochaos.generator.entity.User;
import org.springframework.web.bind.annotation.RestController;
/**
*
* 用户 前端控制器 *
* * @author chaos * @since 2020-05-02 * @version v1.0 */ @RestController @RequestMapping("/generator/api/v1/user") public class UserController { @Autowired private UserService userService; /** * 查询分页数据 */ @RequestMapping(method = RequestMethod.GET) public ResultBean> listByPage(@RequestParam(name = "page", defaultValue = "1") int page, @RequestParam(name = "pageSize", defaultValue = "10") int pageSize, @RequestParam String keyword) { return new ResultBean<>(userService.listUsersByPage(page, pageSize, keyword)); } /** * 根据id查询 */ @RequestMapping(method = RequestMethod.GET, value = "/{id}") public ResultBean> getById(@PathVariable("id") Integer id) { return new ResultBean<>(userService.getUserById(id)); } /** * 新增 */ @RequestMapping(method = RequestMethod.POST) public ResultBean> insert(@RequestBody User user) { return new ResultBean<>(userService.insertUser(user)); } /** * 删除 */ @RequestMapping(method = RequestMethod.DELETE, value = "/{id}") public ResultBean> deleteById(@PathVariable("id") Integer id) { return new ResultBean<>(userService.deleteUserById(id)); } /** * 修改 */ @RequestMapping(method = RequestMethod.PUT) public ResultBean> updateById(@RequestBody User user) { return new ResultBean<>(userService.updateUser(user)); } } ``` ### 2.Service模板代码示例 ```java package cn.hellochaos.generator.service; import cn.hellochaos.generator.entity.User; import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; /** ** 用户 服务类 *
* * @author chaos * @since 2020-05-02 */ public interface UserService { /** * 分页查询User * * @param page 当前页数 * @param pageSize 页的大小 * @param keyword 搜索关键词 * @return 返回mybatis-plus的Page对象,其中records字段为符合条件的查询结果 * @author chaos * @since 2020-05-02 */ Page* 用户 服务实现类 *
* * @author chaos * @since 2020-05-02 */ @Slf4j @Service public class UserServiceImpl extends ServiceImpl