Java private life 300 yuan, complete the JavaWeb volunteer management system (4)
need
Received an order requesting to complete a course design website, both front and back ends, and the fee is 300 yuan.
demand analysis
Technology stack used:
Front end: springboot + vue + layui + maven + mysql
Background: spring+jsp+tomcat8+mysql
1. Select the template that has been developed at the front end and change a few details directly
2. Create one and click to check various attributes in the background of the volunteer management system, and the code generator will check conditions such as additions, deletions, changes, and checks, and then automatically generate it.
part of the code
controller layer:
/**
* 新闻资讯
* 后端接口
* @author
* @email
* @date 2022-03-15 20:26:16
*/
@RestController
@RequestMapping("/news")
public class NewsController {
@Autowired
private NewsService newsService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,NewsEntity news,
HttpServletRequest request){
EntityWrapper<NewsEntity> ew = new EntityWrapper<NewsEntity>();
PageUtils page = newsService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, news), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,NewsEntity news, HttpServletRequest request){
EntityWrapper<NewsEntity> ew = new EntityWrapper<NewsEntity>();
PageUtils page = newsService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, news), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( NewsEntity news){
EntityWrapper<NewsEntity> ew = new EntityWrapper<NewsEntity>();
ew.allEq(MPUtil.allEQMapPre( news, "news"));
return R.ok().put("data", newsService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(NewsEntity news){
EntityWrapper< NewsEntity> ew = new EntityWrapper< NewsEntity>();
ew.allEq(MPUtil.allEQMapPre( news, "news"));
NewsView newsView = newsService.selectView(ew);
return R.ok("查询新闻资讯成功").put("data", newsView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
NewsEntity news = newsService.selectById(id);
return R.ok().put("data", news);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
NewsEntity news = newsService.selectById(id);
return R.ok().put("data", news);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody NewsEntity news, HttpServletRequest request){
news.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(news);
newsService.insert(news);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody NewsEntity news, HttpServletRequest request){
news.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(news);
newsService.insert(news);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody NewsEntity news, HttpServletRequest request){
//ValidatorUtils.validateEntity(news);
newsService.updateById(news);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
newsService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<NewsEntity> wrapper = new EntityWrapper<NewsEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = newsService.selectCount(wrapper);
return R.ok().put("count", count);
}
}
<!-- 首页 -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>首页</title>
<link rel="stylesheet" href="./layui/css/layui.css">
<!-- 样式 -->
<link rel="stylesheet" href="./css/style.css" />
<!-- 主题(主要颜色设置) -->
<link rel="stylesheet" href="./css/theme.css" />
<!-- 通用的css -->
<link rel="stylesheet" href="./css/common.css" />
</head>
<body scrolling="no" style="overflow-y: hidden;overflow-x: hidden;">
<!-- 顶部导航栏 -->
<header id="header">
<div class="top">
<div class="logo">
<a href="#">
{
{systemName}}
</a>
</div>
<div class="tel-container">
<img style="margin-right: 30px;" src="img/index_icon.png" >
<div class="tel">
<div>全国服务热线:</div>
<div>9999-888-999</div>
</div>
</div>
</div>
<ul class="layui-nav nav">
<li class="layui-nav-item"><a href="javascript:navPage('./pages/home/home.html')">首页</a></li>
<li v-for="(item,index) in indexNav" v-bind:key="index" class="layui-nav-item"><a :href="'javascript:navPage(\''+item.url+'\')'">{
{item.name}}</a></li>
<li class="layui-nav-item">
<a href="javascript:centerPage();">我的</a
Effect
Video demo
Volunteer management website front-end + back-end
Respond to questions:
In the first article I mentioned 200 yuan for a private job of an HDFS file manager. In the article, it was said that I had done something similar before and just took it and delivered it. 200 yuan is considered a waste of money. Of course, this also takes time. After accumulating so many orders, there are always a few orders that sell the finished product directly at a customized price. This is also a small skill for receiving orders. Below is the link to the original text:
https://blog.csdn.net/xianyu120/article/details/125508845
Follow me to learn more ways to get private life!
Summarize
The above is to use the code generator to generate the sharing of the background of the volunteer management system. Use the code generator to automate the typing of codes that you don't need to know. Or, that sentence can't make you rich and rich, and it is still very easy to earn some pocket money. Yes, friends who want to take private work or have ideas about code generators can click the card below to contact me.