parent
8fb6dc9d3e
commit
25b6781d27
@ -1,21 +0,0 @@
|
||||
package com;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||
|
||||
@SpringBootApplication
|
||||
@MapperScan(basePackages = {"com.dao"})
|
||||
public class SpringbootSchemaApplication extends SpringBootServletInitializer{
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(SpringbootSchemaApplication.class, args);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder applicationBuilder) {
|
||||
return applicationBuilder.sources(SpringbootSchemaApplication.class);
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
package com.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 登录用户信息
|
||||
*/
|
||||
@Target(ElementType.PARAMETER)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface APPLoginUser {
|
||||
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
package com.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* 忽略Token验证
|
||||
*/
|
||||
@Target(ElementType.METHOD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface IgnoreAuth {
|
||||
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
package com.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 登录用户信息
|
||||
*/
|
||||
@Target(ElementType.PARAMETER)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface LoginUser {
|
||||
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
|
||||
package com.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.MetaObjectHandler;
|
||||
import com.baomidou.mybatisplus.plugins.PaginationInterceptor;
|
||||
|
||||
/**
|
||||
* mybatis-plus配置
|
||||
*/
|
||||
@Configuration
|
||||
public class MybatisPlusConfig {
|
||||
|
||||
/**
|
||||
* 分页插件
|
||||
*/
|
||||
@Bean
|
||||
public PaginationInterceptor paginationInterceptor() {
|
||||
return new PaginationInterceptor();
|
||||
}
|
||||
|
||||
}
|
@ -1,274 +0,0 @@
|
||||
package com.controller;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.utils.ValidatorUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.annotation.IgnoreAuth;
|
||||
|
||||
import com.entity.BozhuwenzhangEntity;
|
||||
import com.entity.view.BozhuwenzhangView;
|
||||
|
||||
import com.service.BozhuwenzhangService;
|
||||
import com.service.TokenService;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.R;
|
||||
import com.utils.MD5Util;
|
||||
import com.utils.MPUtil;
|
||||
import com.utils.CommonUtil;
|
||||
import java.io.IOException;
|
||||
import com.service.StoreupService;
|
||||
import com.entity.StoreupEntity;
|
||||
|
||||
/**
|
||||
* 博主文章
|
||||
* 后端接口
|
||||
* @author
|
||||
* @email
|
||||
* @date 2022-03-29 01:13:41
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/bozhuwenzhang")
|
||||
public class BozhuwenzhangController {
|
||||
@Autowired
|
||||
private BozhuwenzhangService bozhuwenzhangService;
|
||||
|
||||
@Autowired
|
||||
private StoreupService storeupService;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 后端列表
|
||||
*/
|
||||
@RequestMapping("/page")
|
||||
public R page(@RequestParam Map<String, Object> params,BozhuwenzhangEntity bozhuwenzhang,
|
||||
HttpServletRequest request){
|
||||
String tableName = request.getSession().getAttribute("tableName").toString();
|
||||
if(tableName.equals("bozhu")) {
|
||||
bozhuwenzhang.setBozhuhao((String)request.getSession().getAttribute("username"));
|
||||
}
|
||||
EntityWrapper<BozhuwenzhangEntity> ew = new EntityWrapper<BozhuwenzhangEntity>();
|
||||
PageUtils page = bozhuwenzhangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, bozhuwenzhang), params), params));
|
||||
|
||||
return R.ok().put("data", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端列表
|
||||
*/
|
||||
@IgnoreAuth
|
||||
@RequestMapping("/list")
|
||||
public R list(@RequestParam Map<String, Object> params,BozhuwenzhangEntity bozhuwenzhang,
|
||||
HttpServletRequest request){
|
||||
EntityWrapper<BozhuwenzhangEntity> ew = new EntityWrapper<BozhuwenzhangEntity>();
|
||||
PageUtils page = bozhuwenzhangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, bozhuwenzhang), params), params));
|
||||
return R.ok().put("data", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/lists")
|
||||
public R list( BozhuwenzhangEntity bozhuwenzhang){
|
||||
EntityWrapper<BozhuwenzhangEntity> ew = new EntityWrapper<BozhuwenzhangEntity>();
|
||||
ew.allEq(MPUtil.allEQMapPre( bozhuwenzhang, "bozhuwenzhang"));
|
||||
return R.ok().put("data", bozhuwenzhangService.selectListView(ew));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
@RequestMapping("/query")
|
||||
public R query(BozhuwenzhangEntity bozhuwenzhang){
|
||||
EntityWrapper< BozhuwenzhangEntity> ew = new EntityWrapper< BozhuwenzhangEntity>();
|
||||
ew.allEq(MPUtil.allEQMapPre( bozhuwenzhang, "bozhuwenzhang"));
|
||||
BozhuwenzhangView bozhuwenzhangView = bozhuwenzhangService.selectView(ew);
|
||||
return R.ok("查询博主文章成功").put("data", bozhuwenzhangView);
|
||||
}
|
||||
|
||||
/**
|
||||
* 后端详情
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
public R info(@PathVariable("id") Long id){
|
||||
BozhuwenzhangEntity bozhuwenzhang = bozhuwenzhangService.selectById(id);
|
||||
bozhuwenzhang.setClicknum(bozhuwenzhang.getClicknum()+1);
|
||||
bozhuwenzhang.setClicktime(new Date());
|
||||
bozhuwenzhangService.updateById(bozhuwenzhang);
|
||||
return R.ok().put("data", bozhuwenzhang);
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端详情
|
||||
*/
|
||||
@IgnoreAuth
|
||||
@RequestMapping("/detail/{id}")
|
||||
public R detail(@PathVariable("id") Long id){
|
||||
BozhuwenzhangEntity bozhuwenzhang = bozhuwenzhangService.selectById(id);
|
||||
bozhuwenzhang.setClicknum(bozhuwenzhang.getClicknum()+1);
|
||||
bozhuwenzhang.setClicktime(new Date());
|
||||
bozhuwenzhangService.updateById(bozhuwenzhang);
|
||||
return R.ok().put("data", bozhuwenzhang);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 赞或踩
|
||||
*/
|
||||
@RequestMapping("/thumbsup/{id}")
|
||||
public R vote(@PathVariable("id") String id,String type){
|
||||
BozhuwenzhangEntity bozhuwenzhang = bozhuwenzhangService.selectById(id);
|
||||
if(type.equals("1")) {
|
||||
bozhuwenzhang.setThumbsupnum(bozhuwenzhang.getThumbsupnum()+1);
|
||||
} else {
|
||||
bozhuwenzhang.setCrazilynum(bozhuwenzhang.getCrazilynum()+1);
|
||||
}
|
||||
bozhuwenzhangService.updateById(bozhuwenzhang);
|
||||
return R.ok("投票成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 后端保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
public R save(@RequestBody BozhuwenzhangEntity bozhuwenzhang, HttpServletRequest request){
|
||||
bozhuwenzhang.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
|
||||
//ValidatorUtils.validateEntity(bozhuwenzhang);
|
||||
bozhuwenzhangService.insert(bozhuwenzhang);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端保存
|
||||
*/
|
||||
@RequestMapping("/add")
|
||||
public R add(@RequestBody BozhuwenzhangEntity bozhuwenzhang, HttpServletRequest request){
|
||||
bozhuwenzhang.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
|
||||
//ValidatorUtils.validateEntity(bozhuwenzhang);
|
||||
bozhuwenzhangService.insert(bozhuwenzhang);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
public R update(@RequestBody BozhuwenzhangEntity bozhuwenzhang, HttpServletRequest request){
|
||||
//ValidatorUtils.validateEntity(bozhuwenzhang);
|
||||
bozhuwenzhangService.updateById(bozhuwenzhang);//全部更新
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
public R delete(@RequestBody Long[] ids){
|
||||
bozhuwenzhangService.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<BozhuwenzhangEntity> wrapper = new EntityWrapper<BozhuwenzhangEntity>();
|
||||
if(map.get("remindstart")!=null) {
|
||||
wrapper.ge(columnName, map.get("remindstart"));
|
||||
}
|
||||
if(map.get("remindend")!=null) {
|
||||
wrapper.le(columnName, map.get("remindend"));
|
||||
}
|
||||
|
||||
String tableName = request.getSession().getAttribute("tableName").toString();
|
||||
if(tableName.equals("bozhu")) {
|
||||
wrapper.eq("bozhuhao", (String)request.getSession().getAttribute("username"));
|
||||
}
|
||||
|
||||
int count = bozhuwenzhangService.selectCount(wrapper);
|
||||
return R.ok().put("count", count);
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端智能排序
|
||||
*/
|
||||
@IgnoreAuth
|
||||
@RequestMapping("/autoSort")
|
||||
public R autoSort(@RequestParam Map<String, Object> params,BozhuwenzhangEntity bozhuwenzhang, HttpServletRequest request,String pre){
|
||||
EntityWrapper<BozhuwenzhangEntity> ew = new EntityWrapper<BozhuwenzhangEntity>();
|
||||
Map<String, Object> newMap = new HashMap<String, Object>();
|
||||
Map<String, Object> param = new HashMap<String, Object>();
|
||||
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
Map.Entry<String, Object> entry = it.next();
|
||||
String key = entry.getKey();
|
||||
String newKey = entry.getKey();
|
||||
if (pre.endsWith(".")) {
|
||||
newMap.put(pre + newKey, entry.getValue());
|
||||
} else if (StringUtils.isEmpty(pre)) {
|
||||
newMap.put(newKey, entry.getValue());
|
||||
} else {
|
||||
newMap.put(pre + "." + newKey, entry.getValue());
|
||||
}
|
||||
}
|
||||
params.put("sort", "clicknum");
|
||||
params.put("order", "desc");
|
||||
PageUtils page = bozhuwenzhangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, bozhuwenzhang), params), params));
|
||||
return R.ok().put("data", page);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,112 +0,0 @@
|
||||
|
||||
package com.controller;
|
||||
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.annotation.IgnoreAuth;
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.entity.ConfigEntity;
|
||||
import com.service.ConfigService;
|
||||
import com.utils.MPUtil;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.R;
|
||||
import com.utils.ValidatorUtils;
|
||||
|
||||
/**
|
||||
* 登录相关
|
||||
*/
|
||||
@RequestMapping("config")
|
||||
@RestController
|
||||
public class ConfigController{
|
||||
|
||||
@Autowired
|
||||
private ConfigService configService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/page")
|
||||
public R page(@RequestParam Map<String, Object> params,ConfigEntity config){
|
||||
EntityWrapper<ConfigEntity> ew = new EntityWrapper<ConfigEntity>();
|
||||
PageUtils page = configService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, config), params), params));
|
||||
return R.ok().put("data", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@IgnoreAuth
|
||||
@RequestMapping("/list")
|
||||
public R list(@RequestParam Map<String, Object> params,ConfigEntity config){
|
||||
EntityWrapper<ConfigEntity> ew = new EntityWrapper<ConfigEntity>();
|
||||
PageUtils page = configService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, config), params), params));
|
||||
return R.ok().put("data", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
public R info(@PathVariable("id") String id){
|
||||
ConfigEntity config = configService.selectById(id);
|
||||
return R.ok().put("data", config);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
@IgnoreAuth
|
||||
@RequestMapping("/detail/{id}")
|
||||
public R detail(@PathVariable("id") String id){
|
||||
ConfigEntity config = configService.selectById(id);
|
||||
return R.ok().put("data", config);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据name获取信息
|
||||
*/
|
||||
@RequestMapping("/info")
|
||||
public R infoByName(@RequestParam String name){
|
||||
ConfigEntity config = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
|
||||
return R.ok().put("data", config);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
public R save(@RequestBody ConfigEntity config){
|
||||
// ValidatorUtils.validateEntity(config);
|
||||
configService.insert(config);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
public R update(@RequestBody ConfigEntity config){
|
||||
// ValidatorUtils.validateEntity(config);
|
||||
configService.updateById(config);//全部更新
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
public R delete(@RequestBody Long[] ids){
|
||||
configService.deleteBatchIds(Arrays.asList(ids));
|
||||
return R.ok();
|
||||
}
|
||||
}
|
@ -1,215 +0,0 @@
|
||||
package com.controller;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.utils.ValidatorUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.annotation.IgnoreAuth;
|
||||
|
||||
import com.entity.DiscussbozhuwenzhangEntity;
|
||||
import com.entity.view.DiscussbozhuwenzhangView;
|
||||
|
||||
import com.service.DiscussbozhuwenzhangService;
|
||||
import com.service.TokenService;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.R;
|
||||
import com.utils.MD5Util;
|
||||
import com.utils.MPUtil;
|
||||
import com.utils.CommonUtil;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* 博主文章评论表
|
||||
* 后端接口
|
||||
* @author
|
||||
* @email
|
||||
* @date 2022-03-29 01:13:41
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/discussbozhuwenzhang")
|
||||
public class DiscussbozhuwenzhangController {
|
||||
@Autowired
|
||||
private DiscussbozhuwenzhangService discussbozhuwenzhangService;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 后端列表
|
||||
*/
|
||||
@RequestMapping("/page")
|
||||
public R page(@RequestParam Map<String, Object> params,DiscussbozhuwenzhangEntity discussbozhuwenzhang,
|
||||
HttpServletRequest request){
|
||||
EntityWrapper<DiscussbozhuwenzhangEntity> ew = new EntityWrapper<DiscussbozhuwenzhangEntity>();
|
||||
PageUtils page = discussbozhuwenzhangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, discussbozhuwenzhang), params), params));
|
||||
|
||||
return R.ok().put("data", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端列表
|
||||
*/
|
||||
@IgnoreAuth
|
||||
@RequestMapping("/list")
|
||||
public R list(@RequestParam Map<String, Object> params,DiscussbozhuwenzhangEntity discussbozhuwenzhang,
|
||||
HttpServletRequest request){
|
||||
EntityWrapper<DiscussbozhuwenzhangEntity> ew = new EntityWrapper<DiscussbozhuwenzhangEntity>();
|
||||
PageUtils page = discussbozhuwenzhangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, discussbozhuwenzhang), params), params));
|
||||
return R.ok().put("data", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/lists")
|
||||
public R list( DiscussbozhuwenzhangEntity discussbozhuwenzhang){
|
||||
EntityWrapper<DiscussbozhuwenzhangEntity> ew = new EntityWrapper<DiscussbozhuwenzhangEntity>();
|
||||
ew.allEq(MPUtil.allEQMapPre( discussbozhuwenzhang, "discussbozhuwenzhang"));
|
||||
return R.ok().put("data", discussbozhuwenzhangService.selectListView(ew));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
@RequestMapping("/query")
|
||||
public R query(DiscussbozhuwenzhangEntity discussbozhuwenzhang){
|
||||
EntityWrapper< DiscussbozhuwenzhangEntity> ew = new EntityWrapper< DiscussbozhuwenzhangEntity>();
|
||||
ew.allEq(MPUtil.allEQMapPre( discussbozhuwenzhang, "discussbozhuwenzhang"));
|
||||
DiscussbozhuwenzhangView discussbozhuwenzhangView = discussbozhuwenzhangService.selectView(ew);
|
||||
return R.ok("查询博主文章评论表成功").put("data", discussbozhuwenzhangView);
|
||||
}
|
||||
|
||||
/**
|
||||
* 后端详情
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
public R info(@PathVariable("id") Long id){
|
||||
DiscussbozhuwenzhangEntity discussbozhuwenzhang = discussbozhuwenzhangService.selectById(id);
|
||||
return R.ok().put("data", discussbozhuwenzhang);
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端详情
|
||||
*/
|
||||
@IgnoreAuth
|
||||
@RequestMapping("/detail/{id}")
|
||||
public R detail(@PathVariable("id") Long id){
|
||||
DiscussbozhuwenzhangEntity discussbozhuwenzhang = discussbozhuwenzhangService.selectById(id);
|
||||
return R.ok().put("data", discussbozhuwenzhang);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 后端保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
public R save(@RequestBody DiscussbozhuwenzhangEntity discussbozhuwenzhang, HttpServletRequest request){
|
||||
discussbozhuwenzhang.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
|
||||
//ValidatorUtils.validateEntity(discussbozhuwenzhang);
|
||||
discussbozhuwenzhangService.insert(discussbozhuwenzhang);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端保存
|
||||
*/
|
||||
@RequestMapping("/add")
|
||||
public R add(@RequestBody DiscussbozhuwenzhangEntity discussbozhuwenzhang, HttpServletRequest request){
|
||||
discussbozhuwenzhang.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
|
||||
//ValidatorUtils.validateEntity(discussbozhuwenzhang);
|
||||
discussbozhuwenzhangService.insert(discussbozhuwenzhang);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
public R update(@RequestBody DiscussbozhuwenzhangEntity discussbozhuwenzhang, HttpServletRequest request){
|
||||
//ValidatorUtils.validateEntity(discussbozhuwenzhang);
|
||||
discussbozhuwenzhangService.updateById(discussbozhuwenzhang);//全部更新
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
public R delete(@RequestBody Long[] ids){
|
||||
discussbozhuwenzhangService.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<DiscussbozhuwenzhangEntity> wrapper = new EntityWrapper<DiscussbozhuwenzhangEntity>();
|
||||
if(map.get("remindstart")!=null) {
|
||||
wrapper.ge(columnName, map.get("remindstart"));
|
||||
}
|
||||
if(map.get("remindend")!=null) {
|
||||
wrapper.le(columnName, map.get("remindend"));
|
||||
}
|
||||
|
||||
|
||||
int count = discussbozhuwenzhangService.selectCount(wrapper);
|
||||
return R.ok().put("count", count);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,215 +0,0 @@
|
||||
package com.controller;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.utils.ValidatorUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.annotation.IgnoreAuth;
|
||||
|
||||
import com.entity.NewsEntity;
|
||||
import com.entity.view.NewsView;
|
||||
|
||||
import com.service.NewsService;
|
||||
import com.service.TokenService;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.R;
|
||||
import com.utils.MD5Util;
|
||||
import com.utils.MPUtil;
|
||||
import com.utils.CommonUtil;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* 系统公告
|
||||
* 后端接口
|
||||
* @author
|
||||
* @email
|
||||
* @date 2022-03-29 01:13:41
|
||||
*/
|
||||
@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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,225 +0,0 @@
|
||||
package com.controller;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.utils.ValidatorUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.annotation.IgnoreAuth;
|
||||
|
||||
import com.entity.StoreupEntity;
|
||||
import com.entity.view.StoreupView;
|
||||
|
||||
import com.service.StoreupService;
|
||||
import com.service.TokenService;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.R;
|
||||
import com.utils.MD5Util;
|
||||
import com.utils.MPUtil;
|
||||
import com.utils.CommonUtil;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* 收藏表
|
||||
* 后端接口
|
||||
* @author
|
||||
* @email
|
||||
* @date 2022-03-29 01:13:41
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/storeup")
|
||||
public class StoreupController {
|
||||
@Autowired
|
||||
private StoreupService storeupService;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 后端列表
|
||||
*/
|
||||
@RequestMapping("/page")
|
||||
public R page(@RequestParam Map<String, Object> params,StoreupEntity storeup,
|
||||
HttpServletRequest request){
|
||||
if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
|
||||
storeup.setUserid((Long)request.getSession().getAttribute("userId"));
|
||||
}
|
||||
EntityWrapper<StoreupEntity> ew = new EntityWrapper<StoreupEntity>();
|
||||
PageUtils page = storeupService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, storeup), params), params));
|
||||
|
||||
return R.ok().put("data", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
public R list(@RequestParam Map<String, Object> params,StoreupEntity storeup,
|
||||
HttpServletRequest request){
|
||||
if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
|
||||
storeup.setUserid((Long)request.getSession().getAttribute("userId"));
|
||||
}
|
||||
EntityWrapper<StoreupEntity> ew = new EntityWrapper<StoreupEntity>();
|
||||
PageUtils page = storeupService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, storeup), params), params));
|
||||
return R.ok().put("data", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/lists")
|
||||
public R list( StoreupEntity storeup){
|
||||
EntityWrapper<StoreupEntity> ew = new EntityWrapper<StoreupEntity>();
|
||||
ew.allEq(MPUtil.allEQMapPre( storeup, "storeup"));
|
||||
return R.ok().put("data", storeupService.selectListView(ew));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
@RequestMapping("/query")
|
||||
public R query(StoreupEntity storeup){
|
||||
EntityWrapper< StoreupEntity> ew = new EntityWrapper< StoreupEntity>();
|
||||
ew.allEq(MPUtil.allEQMapPre( storeup, "storeup"));
|
||||
StoreupView storeupView = storeupService.selectView(ew);
|
||||
return R.ok("查询收藏表成功").put("data", storeupView);
|
||||
}
|
||||
|
||||
/**
|
||||
* 后端详情
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
public R info(@PathVariable("id") Long id){
|
||||
StoreupEntity storeup = storeupService.selectById(id);
|
||||
return R.ok().put("data", storeup);
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端详情
|
||||
*/
|
||||
@IgnoreAuth
|
||||
@RequestMapping("/detail/{id}")
|
||||
public R detail(@PathVariable("id") Long id){
|
||||
StoreupEntity storeup = storeupService.selectById(id);
|
||||
return R.ok().put("data", storeup);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 后端保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
public R save(@RequestBody StoreupEntity storeup, HttpServletRequest request){
|
||||
storeup.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
|
||||
//ValidatorUtils.validateEntity(storeup);
|
||||
storeup.setUserid((Long)request.getSession().getAttribute("userId"));
|
||||
storeupService.insert(storeup);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端保存
|
||||
*/
|
||||
@RequestMapping("/add")
|
||||
public R add(@RequestBody StoreupEntity storeup, HttpServletRequest request){
|
||||
storeup.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
|
||||
//ValidatorUtils.validateEntity(storeup);
|
||||
storeup.setUserid((Long)request.getSession().getAttribute("userId"));
|
||||
storeupService.insert(storeup);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
public R update(@RequestBody StoreupEntity storeup, HttpServletRequest request){
|
||||
//ValidatorUtils.validateEntity(storeup);
|
||||
storeupService.updateById(storeup);//全部更新
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
public R delete(@RequestBody Long[] ids){
|
||||
storeupService.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<StoreupEntity> wrapper = new EntityWrapper<StoreupEntity>();
|
||||
if(map.get("remindstart")!=null) {
|
||||
wrapper.ge(columnName, map.get("remindstart"));
|
||||
}
|
||||
if(map.get("remindend")!=null) {
|
||||
wrapper.le(columnName, map.get("remindend"));
|
||||
}
|
||||
if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
|
||||
wrapper.eq("userid", (Long)request.getSession().getAttribute("userId"));
|
||||
}
|
||||
|
||||
|
||||
int count = storeupService.selectCount(wrapper);
|
||||
return R.ok().put("count", count);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,215 +0,0 @@
|
||||
package com.controller;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.utils.ValidatorUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.annotation.IgnoreAuth;
|
||||
|
||||
import com.entity.WenzhangfenleiEntity;
|
||||
import com.entity.view.WenzhangfenleiView;
|
||||
|
||||
import com.service.WenzhangfenleiService;
|
||||
import com.service.TokenService;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.R;
|
||||
import com.utils.MD5Util;
|
||||
import com.utils.MPUtil;
|
||||
import com.utils.CommonUtil;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* 文章分类
|
||||
* 后端接口
|
||||
* @author
|
||||
* @email
|
||||
* @date 2022-03-29 01:13:41
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/wenzhangfenlei")
|
||||
public class WenzhangfenleiController {
|
||||
@Autowired
|
||||
private WenzhangfenleiService wenzhangfenleiService;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 后端列表
|
||||
*/
|
||||
@RequestMapping("/page")
|
||||
public R page(@RequestParam Map<String, Object> params,WenzhangfenleiEntity wenzhangfenlei,
|
||||
HttpServletRequest request){
|
||||
EntityWrapper<WenzhangfenleiEntity> ew = new EntityWrapper<WenzhangfenleiEntity>();
|
||||
PageUtils page = wenzhangfenleiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, wenzhangfenlei), params), params));
|
||||
|
||||
return R.ok().put("data", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端列表
|
||||
*/
|
||||
@IgnoreAuth
|
||||
@RequestMapping("/list")
|
||||
public R list(@RequestParam Map<String, Object> params,WenzhangfenleiEntity wenzhangfenlei,
|
||||
HttpServletRequest request){
|
||||
EntityWrapper<WenzhangfenleiEntity> ew = new EntityWrapper<WenzhangfenleiEntity>();
|
||||
PageUtils page = wenzhangfenleiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, wenzhangfenlei), params), params));
|
||||
return R.ok().put("data", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/lists")
|
||||
public R list( WenzhangfenleiEntity wenzhangfenlei){
|
||||
EntityWrapper<WenzhangfenleiEntity> ew = new EntityWrapper<WenzhangfenleiEntity>();
|
||||
ew.allEq(MPUtil.allEQMapPre( wenzhangfenlei, "wenzhangfenlei"));
|
||||
return R.ok().put("data", wenzhangfenleiService.selectListView(ew));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
@RequestMapping("/query")
|
||||
public R query(WenzhangfenleiEntity wenzhangfenlei){
|
||||
EntityWrapper< WenzhangfenleiEntity> ew = new EntityWrapper< WenzhangfenleiEntity>();
|
||||
ew.allEq(MPUtil.allEQMapPre( wenzhangfenlei, "wenzhangfenlei"));
|
||||
WenzhangfenleiView wenzhangfenleiView = wenzhangfenleiService.selectView(ew);
|
||||
return R.ok("查询文章分类成功").put("data", wenzhangfenleiView);
|
||||
}
|
||||
|
||||
/**
|
||||
* 后端详情
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
public R info(@PathVariable("id") Long id){
|
||||
WenzhangfenleiEntity wenzhangfenlei = wenzhangfenleiService.selectById(id);
|
||||
return R.ok().put("data", wenzhangfenlei);
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端详情
|
||||
*/
|
||||
@IgnoreAuth
|
||||
@RequestMapping("/detail/{id}")
|
||||
public R detail(@PathVariable("id") Long id){
|
||||
WenzhangfenleiEntity wenzhangfenlei = wenzhangfenleiService.selectById(id);
|
||||
return R.ok().put("data", wenzhangfenlei);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 后端保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
public R save(@RequestBody WenzhangfenleiEntity wenzhangfenlei, HttpServletRequest request){
|
||||
wenzhangfenlei.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
|
||||
//ValidatorUtils.validateEntity(wenzhangfenlei);
|
||||
wenzhangfenleiService.insert(wenzhangfenlei);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端保存
|
||||
*/
|
||||
@RequestMapping("/add")
|
||||
public R add(@RequestBody WenzhangfenleiEntity wenzhangfenlei, HttpServletRequest request){
|
||||
wenzhangfenlei.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
|
||||
//ValidatorUtils.validateEntity(wenzhangfenlei);
|
||||
wenzhangfenleiService.insert(wenzhangfenlei);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
public R update(@RequestBody WenzhangfenleiEntity wenzhangfenlei, HttpServletRequest request){
|
||||
//ValidatorUtils.validateEntity(wenzhangfenlei);
|
||||
wenzhangfenleiService.updateById(wenzhangfenlei);//全部更新
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
public R delete(@RequestBody Long[] ids){
|
||||
wenzhangfenleiService.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<WenzhangfenleiEntity> wrapper = new EntityWrapper<WenzhangfenleiEntity>();
|
||||
if(map.get("remindstart")!=null) {
|
||||
wrapper.ge(columnName, map.get("remindstart"));
|
||||
}
|
||||
if(map.get("remindend")!=null) {
|
||||
wrapper.le(columnName, map.get("remindend"));
|
||||
}
|
||||
|
||||
|
||||
int count = wenzhangfenleiService.selectCount(wrapper);
|
||||
return R.ok().put("count", count);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
package com.dao;
|
||||
|
||||
import com.entity.BozhuEntity;
|
||||
import com.baomidou.mybatisplus.mapper.BaseMapper;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.vo.BozhuVO;
|
||||
import com.entity.view.BozhuView;
|
||||
|
||||
|
||||
/**
|
||||
* 博主
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2022-03-29 01:13:41
|
||||
*/
|
||||
public interface BozhuDao extends BaseMapper<BozhuEntity> {
|
||||
|
||||
List<BozhuVO> selectListVO(@Param("ew") Wrapper<BozhuEntity> wrapper);
|
||||
|
||||
BozhuVO selectVO(@Param("ew") Wrapper<BozhuEntity> wrapper);
|
||||
|
||||
List<BozhuView> selectListView(@Param("ew") Wrapper<BozhuEntity> wrapper);
|
||||
|
||||
List<BozhuView> selectListView(Pagination page,@Param("ew") Wrapper<BozhuEntity> wrapper);
|
||||
|
||||
BozhuView selectView(@Param("ew") Wrapper<BozhuEntity> wrapper);
|
||||
|
||||
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
package com.dao;
|
||||
|
||||
import com.entity.BozhuwenzhangEntity;
|
||||
import com.baomidou.mybatisplus.mapper.BaseMapper;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.vo.BozhuwenzhangVO;
|
||||
import com.entity.view.BozhuwenzhangView;
|
||||
|
||||
|
||||
/**
|
||||
* 博主文章
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2022-03-29 01:13:41
|
||||
*/
|
||||
public interface BozhuwenzhangDao extends BaseMapper<BozhuwenzhangEntity> {
|
||||
|
||||
List<BozhuwenzhangVO> selectListVO(@Param("ew") Wrapper<BozhuwenzhangEntity> wrapper);
|
||||
|
||||
BozhuwenzhangVO selectVO(@Param("ew") Wrapper<BozhuwenzhangEntity> wrapper);
|
||||
|
||||
List<BozhuwenzhangView> selectListView(@Param("ew") Wrapper<BozhuwenzhangEntity> wrapper);
|
||||
|
||||
List<BozhuwenzhangView> selectListView(Pagination page,@Param("ew") Wrapper<BozhuwenzhangEntity> wrapper);
|
||||
|
||||
BozhuwenzhangView selectView(@Param("ew") Wrapper<BozhuwenzhangEntity> wrapper);
|
||||
|
||||
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
|
||||
package com.dao;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 通用接口
|
||||
*/
|
||||
public interface CommonDao{
|
||||
List<String> getOption(Map<String, Object> params);
|
||||
|
||||
Map<String, Object> getFollowByOption(Map<String, Object> params);
|
||||
|
||||
List<String> getFollowByOption2(Map<String, Object> params);
|
||||
|
||||
void sh(Map<String, Object> params);
|
||||
|
||||
int remindCount(Map<String, Object> params);
|
||||
|
||||
Map<String, Object> selectCal(Map<String, Object> params);
|
||||
|
||||
List<Map<String, Object>> selectGroup(Map<String, Object> params);
|
||||
|
||||
List<Map<String, Object>> selectValue(Map<String, Object> params);
|
||||
|
||||
List<Map<String, Object>> selectTimeStatValue(Map<String, Object> params);
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
|
||||
package com.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.BaseMapper;
|
||||
import com.entity.ConfigEntity;
|
||||
|
||||
/**
|
||||
* 配置
|
||||
*/
|
||||
public interface ConfigDao extends BaseMapper<ConfigEntity> {
|
||||
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
package com.dao;
|
||||
|
||||
import com.entity.DiscussbozhuwenzhangEntity;
|
||||
import com.baomidou.mybatisplus.mapper.BaseMapper;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.vo.DiscussbozhuwenzhangVO;
|
||||
import com.entity.view.DiscussbozhuwenzhangView;
|
||||
|
||||
|
||||
/**
|
||||
* 博主文章评论表
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2022-03-29 01:13:41
|
||||
*/
|
||||
public interface DiscussbozhuwenzhangDao extends BaseMapper<DiscussbozhuwenzhangEntity> {
|
||||
|
||||
List<DiscussbozhuwenzhangVO> selectListVO(@Param("ew") Wrapper<DiscussbozhuwenzhangEntity> wrapper);
|
||||
|
||||
DiscussbozhuwenzhangVO selectVO(@Param("ew") Wrapper<DiscussbozhuwenzhangEntity> wrapper);
|
||||
|
||||
List<DiscussbozhuwenzhangView> selectListView(@Param("ew") Wrapper<DiscussbozhuwenzhangEntity> wrapper);
|
||||
|
||||
List<DiscussbozhuwenzhangView> selectListView(Pagination page,@Param("ew") Wrapper<DiscussbozhuwenzhangEntity> wrapper);
|
||||
|
||||
DiscussbozhuwenzhangView selectView(@Param("ew") Wrapper<DiscussbozhuwenzhangEntity> wrapper);
|
||||
|
||||
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
package com.dao;
|
||||
|
||||
import com.entity.NewsEntity;
|
||||
import com.baomidou.mybatisplus.mapper.BaseMapper;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.vo.NewsVO;
|
||||
import com.entity.view.NewsView;
|
||||
|
||||
|
||||
/**
|
||||
* 系统公告
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2022-03-29 01:13:41
|
||||
*/
|
||||
public interface NewsDao extends BaseMapper<NewsEntity> {
|
||||
|
||||
List<NewsVO> selectListVO(@Param("ew") Wrapper<NewsEntity> wrapper);
|
||||
|
||||
NewsVO selectVO(@Param("ew") Wrapper<NewsEntity> wrapper);
|
||||
|
||||
List<NewsView> selectListView(@Param("ew") Wrapper<NewsEntity> wrapper);
|
||||
|
||||
List<NewsView> selectListView(Pagination page,@Param("ew") Wrapper<NewsEntity> wrapper);
|
||||
|
||||
NewsView selectView(@Param("ew") Wrapper<NewsEntity> wrapper);
|
||||
|
||||
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
package com.dao;
|
||||
|
||||
import com.entity.StoreupEntity;
|
||||
import com.baomidou.mybatisplus.mapper.BaseMapper;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.vo.StoreupVO;
|
||||
import com.entity.view.StoreupView;
|
||||
|
||||
|
||||
/**
|
||||
* 收藏表
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2022-03-29 01:13:41
|
||||
*/
|
||||
public interface StoreupDao extends BaseMapper<StoreupEntity> {
|
||||
|
||||
List<StoreupVO> selectListVO(@Param("ew") Wrapper<StoreupEntity> wrapper);
|
||||
|
||||
StoreupVO selectVO(@Param("ew") Wrapper<StoreupEntity> wrapper);
|
||||
|
||||
List<StoreupView> selectListView(@Param("ew") Wrapper<StoreupEntity> wrapper);
|
||||
|
||||
List<StoreupView> selectListView(Pagination page,@Param("ew") Wrapper<StoreupEntity> wrapper);
|
||||
|
||||
StoreupView selectView(@Param("ew") Wrapper<StoreupEntity> wrapper);
|
||||
|
||||
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
|
||||
package com.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
|
||||
import com.entity.TokenEntity;
|
||||
|
||||
/**
|
||||
* token
|
||||
*/
|
||||
public interface TokenDao extends BaseMapper<TokenEntity> {
|
||||
|
||||
List<TokenEntity> selectListView(@Param("ew") Wrapper<TokenEntity> wrapper);
|
||||
|
||||
List<TokenEntity> selectListView(Pagination page,@Param("ew") Wrapper<TokenEntity> wrapper);
|
||||
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
|
||||
package com.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
|
||||
import com.entity.UserEntity;
|
||||
|
||||
/**
|
||||
* 用户
|
||||
*/
|
||||
public interface UserDao extends BaseMapper<UserEntity> {
|
||||
|
||||
List<UserEntity> selectListView(@Param("ew") Wrapper<UserEntity> wrapper);
|
||||
|
||||
List<UserEntity> selectListView(Pagination page,@Param("ew") Wrapper<UserEntity> wrapper);
|
||||
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
package com.dao;
|
||||
|
||||
import com.entity.WenzhangfenleiEntity;
|
||||
import com.baomidou.mybatisplus.mapper.BaseMapper;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.vo.WenzhangfenleiVO;
|
||||
import com.entity.view.WenzhangfenleiView;
|
||||
|
||||
|
||||
/**
|
||||
* 文章分类
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2022-03-29 01:13:41
|
||||
*/
|
||||
public interface WenzhangfenleiDao extends BaseMapper<WenzhangfenleiEntity> {
|
||||
|
||||
List<WenzhangfenleiVO> selectListVO(@Param("ew") Wrapper<WenzhangfenleiEntity> wrapper);
|
||||
|
||||
WenzhangfenleiVO selectVO(@Param("ew") Wrapper<WenzhangfenleiEntity> wrapper);
|
||||
|
||||
List<WenzhangfenleiView> selectListView(@Param("ew") Wrapper<WenzhangfenleiEntity> wrapper);
|
||||
|
||||
List<WenzhangfenleiView> selectListView(Pagination page,@Param("ew") Wrapper<WenzhangfenleiEntity> wrapper);
|
||||
|
||||
WenzhangfenleiView selectView(@Param("ew") Wrapper<WenzhangfenleiEntity> wrapper);
|
||||
|
||||
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
package com.dao;
|
||||
|
||||
import com.entity.YonghuEntity;
|
||||
import com.baomidou.mybatisplus.mapper.BaseMapper;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.vo.YonghuVO;
|
||||
import com.entity.view.YonghuView;
|
||||
|
||||
|
||||
/**
|
||||
* 用户
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2022-03-29 01:13:41
|
||||
*/
|
||||
public interface YonghuDao extends BaseMapper<YonghuEntity> {
|
||||
|
||||
List<YonghuVO> selectListVO(@Param("ew") Wrapper<YonghuEntity> wrapper);
|
||||
|
||||
YonghuVO selectVO(@Param("ew") Wrapper<YonghuEntity> wrapper);
|
||||
|
||||
List<YonghuView> selectListView(@Param("ew") Wrapper<YonghuEntity> wrapper);
|
||||
|
||||
List<YonghuView> selectListView(Pagination page,@Param("ew") Wrapper<YonghuEntity> wrapper);
|
||||
|
||||
YonghuView selectView(@Param("ew") Wrapper<YonghuEntity> wrapper);
|
||||
|
||||
|
||||
}
|
@ -1,53 +0,0 @@
|
||||
package com.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotations.TableId;
|
||||
import com.baomidou.mybatisplus.annotations.TableName;
|
||||
import com.baomidou.mybatisplus.enums.IdType;
|
||||
|
||||
/**
|
||||
* 类说明 :
|
||||
*/
|
||||
@TableName("config")
|
||||
public class ConfigEntity implements Serializable{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* key
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* value
|
||||
*/
|
||||
private String value;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
|
||||
package com.entity;
|
||||
|
||||
/**
|
||||
* 自定义异常
|
||||
*/
|
||||
public class EIException extends RuntimeException {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String msg;
|
||||
private int code = 500;
|
||||
|
||||
public EIException(String msg) {
|
||||
super(msg);
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public EIException(String msg, Throwable e) {
|
||||
super(msg, e);
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public EIException(String msg, int code) {
|
||||
super(msg);
|
||||
this.msg = msg;
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public EIException(String msg, int code, Throwable e) {
|
||||
super(msg, e);
|
||||
this.msg = msg;
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,132 +0,0 @@
|
||||
package com.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotations.TableId;
|
||||
import com.baomidou.mybatisplus.annotations.TableName;
|
||||
import com.baomidou.mybatisplus.enums.IdType;
|
||||
|
||||
/**
|
||||
* token表
|
||||
*/
|
||||
@TableName("token")
|
||||
public class TokenEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userid;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 表名
|
||||
*/
|
||||
private String tablename;
|
||||
|
||||
/**
|
||||
* 角色
|
||||
*/
|
||||
private String role;
|
||||
|
||||
/**
|
||||
* token
|
||||
*/
|
||||
private String token;
|
||||
|
||||
/**
|
||||
* 过期时间
|
||||
*/
|
||||
private Date expiratedtime;
|
||||
|
||||
/**
|
||||
* 新增时间
|
||||
*/
|
||||
private Date addtime;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getUserid() {
|
||||
return userid;
|
||||
}
|
||||
|
||||
public void setUserid(Long userid) {
|
||||
this.userid = userid;
|
||||
}
|
||||
|
||||
public String getRole() {
|
||||
return role;
|
||||
}
|
||||
|
||||
public void setRole(String role) {
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
public String getToken() {
|
||||
return token;
|
||||
}
|
||||
|
||||
public String getTablename() {
|
||||
return tablename;
|
||||
}
|
||||
|
||||
public void setTablename(String tablename) {
|
||||
this.tablename = tablename;
|
||||
}
|
||||
|
||||
public void setToken(String token) {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
public Date getExpiratedtime() {
|
||||
return expiratedtime;
|
||||
}
|
||||
|
||||
public void setExpiratedtime(Date expiratedtime) {
|
||||
this.expiratedtime = expiratedtime;
|
||||
}
|
||||
|
||||
public Date getAddtime() {
|
||||
return addtime;
|
||||
}
|
||||
|
||||
public void setAddtime(Date addtime) {
|
||||
this.addtime = addtime;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public TokenEntity(Long userid, String username, String tablename,String role, String token, Date expiratedtime) {
|
||||
super();
|
||||
this.userid = userid;
|
||||
this.username = username;
|
||||
this.tablename = tablename;
|
||||
this.role = role;
|
||||
this.token = token;
|
||||
this.expiratedtime = expiratedtime;
|
||||
}
|
||||
|
||||
public TokenEntity() {
|
||||
}
|
||||
|
||||
}
|
@ -1,77 +0,0 @@
|
||||
package com.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotations.TableId;
|
||||
import com.baomidou.mybatisplus.annotations.TableName;
|
||||
import com.baomidou.mybatisplus.enums.IdType;
|
||||
|
||||
/**
|
||||
* 用户
|
||||
*/
|
||||
@TableName("users")
|
||||
public class UserEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户账号
|
||||
*/
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
private String role;
|
||||
|
||||
private Date addtime;
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getRole() {
|
||||
return role;
|
||||
}
|
||||
|
||||
public void setRole(String role) {
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
public Date getAddtime() {
|
||||
return addtime;
|
||||
}
|
||||
|
||||
public void setAddtime(Date addtime) {
|
||||
this.addtime = addtime;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
package com.service;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.service.IService;
|
||||
import com.utils.PageUtils;
|
||||
import com.entity.BozhuEntity;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.entity.vo.BozhuVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.view.BozhuView;
|
||||
|
||||
|
||||
/**
|
||||
* 博主
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2022-03-29 01:13:41
|
||||
*/
|
||||
public interface BozhuService extends IService<BozhuEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
|
||||
List<BozhuVO> selectListVO(Wrapper<BozhuEntity> wrapper);
|
||||
|
||||
BozhuVO selectVO(@Param("ew") Wrapper<BozhuEntity> wrapper);
|
||||
|
||||
List<BozhuView> selectListView(Wrapper<BozhuEntity> wrapper);
|
||||
|
||||
BozhuView selectView(@Param("ew") Wrapper<BozhuEntity> wrapper);
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params,Wrapper<BozhuEntity> wrapper);
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,37 +0,0 @@
|
||||
package com.service;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.service.IService;
|
||||
import com.utils.PageUtils;
|
||||
import com.entity.BozhuwenzhangEntity;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.entity.vo.BozhuwenzhangVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.view.BozhuwenzhangView;
|
||||
|
||||
|
||||
/**
|
||||
* 博主文章
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2022-03-29 01:13:41
|
||||
*/
|
||||
public interface BozhuwenzhangService extends IService<BozhuwenzhangEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
|
||||
List<BozhuwenzhangVO> selectListVO(Wrapper<BozhuwenzhangEntity> wrapper);
|
||||
|
||||
BozhuwenzhangVO selectVO(@Param("ew") Wrapper<BozhuwenzhangEntity> wrapper);
|
||||
|
||||
List<BozhuwenzhangView> selectListView(Wrapper<BozhuwenzhangEntity> wrapper);
|
||||
|
||||
BozhuwenzhangView selectView(@Param("ew") Wrapper<BozhuwenzhangEntity> wrapper);
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params,Wrapper<BozhuwenzhangEntity> wrapper);
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,22 +0,0 @@
|
||||
package com.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface CommonService {
|
||||
List<String> getOption(Map<String, Object> params);
|
||||
|
||||
Map<String, Object> getFollowByOption(Map<String, Object> params);
|
||||
|
||||
void sh(Map<String, Object> params);
|
||||
|
||||
int remindCount(Map<String, Object> params);
|
||||
|
||||
Map<String, Object> selectCal(Map<String, Object> params);
|
||||
|
||||
List<Map<String, Object>> selectGroup(Map<String, Object> params);
|
||||
|
||||
List<Map<String, Object>> selectValue(Map<String, Object> params);
|
||||
|
||||
List<Map<String, Object>> selectTimeStatValue(Map<String, Object> params);
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
|
||||
package com.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.service.IService;
|
||||
import com.entity.ConfigEntity;
|
||||
import com.utils.PageUtils;
|
||||
|
||||
|
||||
/**
|
||||
* 系统用户
|
||||
*/
|
||||
public interface ConfigService extends IService<ConfigEntity> {
|
||||
PageUtils queryPage(Map<String, Object> params,Wrapper<ConfigEntity> wrapper);
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
package com.service;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.service.IService;
|
||||
import com.utils.PageUtils;
|
||||
import com.entity.DiscussbozhuwenzhangEntity;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.entity.vo.DiscussbozhuwenzhangVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.view.DiscussbozhuwenzhangView;
|
||||
|
||||
|
||||
/**
|
||||
* 博主文章评论表
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2022-03-29 01:13:41
|
||||
*/
|
||||
public interface DiscussbozhuwenzhangService extends IService<DiscussbozhuwenzhangEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
|
||||
List<DiscussbozhuwenzhangVO> selectListVO(Wrapper<DiscussbozhuwenzhangEntity> wrapper);
|
||||
|
||||
DiscussbozhuwenzhangVO selectVO(@Param("ew") Wrapper<DiscussbozhuwenzhangEntity> wrapper);
|
||||
|
||||
List<DiscussbozhuwenzhangView> selectListView(Wrapper<DiscussbozhuwenzhangEntity> wrapper);
|
||||
|
||||
DiscussbozhuwenzhangView selectView(@Param("ew") Wrapper<DiscussbozhuwenzhangEntity> wrapper);
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params,Wrapper<DiscussbozhuwenzhangEntity> wrapper);
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,37 +0,0 @@
|
||||
package com.service;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.service.IService;
|
||||
import com.utils.PageUtils;
|
||||
import com.entity.NewsEntity;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.entity.vo.NewsVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.view.NewsView;
|
||||
|
||||
|
||||
/**
|
||||
* 系统公告
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2022-03-29 01:13:41
|
||||
*/
|
||||
public interface NewsService extends IService<NewsEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
|
||||
List<NewsVO> selectListVO(Wrapper<NewsEntity> wrapper);
|
||||
|
||||
NewsVO selectVO(@Param("ew") Wrapper<NewsEntity> wrapper);
|
||||
|
||||
List<NewsView> selectListView(Wrapper<NewsEntity> wrapper);
|
||||
|
||||
NewsView selectView(@Param("ew") Wrapper<NewsEntity> wrapper);
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params,Wrapper<NewsEntity> wrapper);
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,37 +0,0 @@
|
||||
package com.service;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.service.IService;
|
||||
import com.utils.PageUtils;
|
||||
import com.entity.StoreupEntity;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.entity.vo.StoreupVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.view.StoreupView;
|
||||
|
||||
|
||||
/**
|
||||
* 收藏表
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2022-03-29 01:13:41
|
||||
*/
|
||||
public interface StoreupService extends IService<StoreupEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
|
||||
List<StoreupVO> selectListVO(Wrapper<StoreupEntity> wrapper);
|
||||
|
||||
StoreupVO selectVO(@Param("ew") Wrapper<StoreupEntity> wrapper);
|
||||
|
||||
List<StoreupView> selectListView(Wrapper<StoreupEntity> wrapper);
|
||||
|
||||
StoreupView selectView(@Param("ew") Wrapper<StoreupEntity> wrapper);
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params,Wrapper<StoreupEntity> wrapper);
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,26 +0,0 @@
|
||||
|
||||
package com.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.service.IService;
|
||||
import com.entity.TokenEntity;
|
||||
import com.utils.PageUtils;
|
||||
|
||||
|
||||
/**
|
||||
* token
|
||||
*/
|
||||
public interface TokenService extends IService<TokenEntity> {
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
|
||||
List<TokenEntity> selectListView(Wrapper<TokenEntity> wrapper);
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params,Wrapper<TokenEntity> wrapper);
|
||||
|
||||
String generateToken(Long userid,String username,String tableName, String role);
|
||||
|
||||
TokenEntity getTokenEntity(String token);
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
|
||||
package com.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.service.IService;
|
||||
import com.entity.UserEntity;
|
||||
import com.utils.PageUtils;
|
||||
|
||||
|
||||
/**
|
||||
* 系统用户
|
||||
*/
|
||||
public interface UserService extends IService<UserEntity> {
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
|
||||
List<UserEntity> selectListView(Wrapper<UserEntity> wrapper);
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params,Wrapper<UserEntity> wrapper);
|
||||
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
package com.service;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.service.IService;
|
||||
import com.utils.PageUtils;
|
||||
import com.entity.WenzhangfenleiEntity;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.entity.vo.WenzhangfenleiVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.view.WenzhangfenleiView;
|
||||
|
||||
|
||||
/**
|
||||
* 文章分类
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2022-03-29 01:13:41
|
||||
*/
|
||||
public interface WenzhangfenleiService extends IService<WenzhangfenleiEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
|
||||
List<WenzhangfenleiVO> selectListVO(Wrapper<WenzhangfenleiEntity> wrapper);
|
||||
|
||||
WenzhangfenleiVO selectVO(@Param("ew") Wrapper<WenzhangfenleiEntity> wrapper);
|
||||
|
||||
List<WenzhangfenleiView> selectListView(Wrapper<WenzhangfenleiEntity> wrapper);
|
||||
|
||||
WenzhangfenleiView selectView(@Param("ew") Wrapper<WenzhangfenleiEntity> wrapper);
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params,Wrapper<WenzhangfenleiEntity> wrapper);
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,37 +0,0 @@
|
||||
package com.service;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.service.IService;
|
||||
import com.utils.PageUtils;
|
||||
import com.entity.YonghuEntity;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.entity.vo.YonghuVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.view.YonghuView;
|
||||
|
||||
|
||||
/**
|
||||
* 用户
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2022-03-29 01:13:41
|
||||
*/
|
||||
public interface YonghuService extends IService<YonghuEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
|
||||
List<YonghuVO> selectListVO(Wrapper<YonghuEntity> wrapper);
|
||||
|
||||
YonghuVO selectVO(@Param("ew") Wrapper<YonghuEntity> wrapper);
|
||||
|
||||
List<YonghuView> selectListView(Wrapper<YonghuEntity> wrapper);
|
||||
|
||||
YonghuView selectView(@Param("ew") Wrapper<YonghuEntity> wrapper);
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params,Wrapper<YonghuEntity> wrapper);
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,63 +0,0 @@
|
||||
package com.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.Query;
|
||||
|
||||
|
||||
import com.dao.BozhuDao;
|
||||
import com.entity.BozhuEntity;
|
||||
import com.service.BozhuService;
|
||||
import com.entity.vo.BozhuVO;
|
||||
import com.entity.view.BozhuView;
|
||||
|
||||
@Service("bozhuService")
|
||||
public class BozhuServiceImpl extends ServiceImpl<BozhuDao, BozhuEntity> implements BozhuService {
|
||||
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
Page<BozhuEntity> page = this.selectPage(
|
||||
new Query<BozhuEntity>(params).getPage(),
|
||||
new EntityWrapper<BozhuEntity>()
|
||||
);
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params, Wrapper<BozhuEntity> wrapper) {
|
||||
Page<BozhuView> page =new Query<BozhuView>(params).getPage();
|
||||
page.setRecords(baseMapper.selectListView(page,wrapper));
|
||||
PageUtils pageUtil = new PageUtils(page);
|
||||
return pageUtil;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BozhuVO> selectListVO(Wrapper<BozhuEntity> wrapper) {
|
||||
return baseMapper.selectListVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BozhuVO selectVO(Wrapper<BozhuEntity> wrapper) {
|
||||
return baseMapper.selectVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BozhuView> selectListView(Wrapper<BozhuEntity> wrapper) {
|
||||
return baseMapper.selectListView(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BozhuView selectView(Wrapper<BozhuEntity> wrapper) {
|
||||
return baseMapper.selectView(wrapper);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
package com.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.Query;
|
||||
|
||||
|
||||
import com.dao.BozhuwenzhangDao;
|
||||
import com.entity.BozhuwenzhangEntity;
|
||||
import com.service.BozhuwenzhangService;
|
||||
import com.entity.vo.BozhuwenzhangVO;
|
||||
import com.entity.view.BozhuwenzhangView;
|
||||
|
||||
@Service("bozhuwenzhangService")
|
||||
public class BozhuwenzhangServiceImpl extends ServiceImpl<BozhuwenzhangDao, BozhuwenzhangEntity> implements BozhuwenzhangService {
|
||||
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
Page<BozhuwenzhangEntity> page = this.selectPage(
|
||||
new Query<BozhuwenzhangEntity>(params).getPage(),
|
||||
new EntityWrapper<BozhuwenzhangEntity>()
|
||||
);
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params, Wrapper<BozhuwenzhangEntity> wrapper) {
|
||||
Page<BozhuwenzhangView> page =new Query<BozhuwenzhangView>(params).getPage();
|
||||
page.setRecords(baseMapper.selectListView(page,wrapper));
|
||||
PageUtils pageUtil = new PageUtils(page);
|
||||
return pageUtil;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BozhuwenzhangVO> selectListVO(Wrapper<BozhuwenzhangEntity> wrapper) {
|
||||
return baseMapper.selectListVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BozhuwenzhangVO selectVO(Wrapper<BozhuwenzhangEntity> wrapper) {
|
||||
return baseMapper.selectVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BozhuwenzhangView> selectListView(Wrapper<BozhuwenzhangEntity> wrapper) {
|
||||
return baseMapper.selectListView(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BozhuwenzhangView selectView(Wrapper<BozhuwenzhangEntity> wrapper) {
|
||||
return baseMapper.selectView(wrapper);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,64 +0,0 @@
|
||||
|
||||
package com.service.impl;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.dao.CommonDao;
|
||||
import com.service.CommonService;
|
||||
|
||||
|
||||
/**
|
||||
* 系统用户
|
||||
*/
|
||||
@Service("commonService")
|
||||
public class CommonServiceImpl implements CommonService {
|
||||
|
||||
@Autowired
|
||||
private CommonDao commonDao;
|
||||
|
||||
@Override
|
||||
public List<String> getOption(Map<String, Object> params) {
|
||||
return commonDao.getOption(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getFollowByOption(Map<String, Object> params) {
|
||||
return commonDao.getFollowByOption(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sh(Map<String, Object> params) {
|
||||
commonDao.sh(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int remindCount(Map<String, Object> params) {
|
||||
return commonDao.remindCount(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> selectCal(Map<String, Object> params) {
|
||||
return commonDao.selectCal(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> selectGroup(Map<String, Object> params) {
|
||||
return commonDao.selectGroup(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> selectValue(Map<String, Object> params) {
|
||||
return commonDao.selectValue(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> selectTimeStatValue(Map<String, Object> params) {
|
||||
return commonDao.selectTimeStatValue(params);
|
||||
}
|
||||
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
|
||||
package com.service.impl;
|
||||
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
||||
import com.dao.ConfigDao;
|
||||
import com.entity.ConfigEntity;
|
||||
import com.service.ConfigService;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.Query;
|
||||
|
||||
|
||||
/**
|
||||
* 系统用户
|
||||
*/
|
||||
@Service("configService")
|
||||
public class ConfigServiceImpl extends ServiceImpl<ConfigDao, ConfigEntity> implements ConfigService {
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params, Wrapper<ConfigEntity> wrapper) {
|
||||
Page<ConfigEntity> page = this.selectPage(
|
||||
new Query<ConfigEntity>(params).getPage(),
|
||||
wrapper
|
||||
);
|
||||
return new PageUtils(page);
|
||||
}
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
package com.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.Query;
|
||||
|
||||
|
||||
import com.dao.DiscussbozhuwenzhangDao;
|
||||
import com.entity.DiscussbozhuwenzhangEntity;
|
||||
import com.service.DiscussbozhuwenzhangService;
|
||||
import com.entity.vo.DiscussbozhuwenzhangVO;
|
||||
import com.entity.view.DiscussbozhuwenzhangView;
|
||||
|
||||
@Service("discussbozhuwenzhangService")
|
||||
public class DiscussbozhuwenzhangServiceImpl extends ServiceImpl<DiscussbozhuwenzhangDao, DiscussbozhuwenzhangEntity> implements DiscussbozhuwenzhangService {
|
||||
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
Page<DiscussbozhuwenzhangEntity> page = this.selectPage(
|
||||
new Query<DiscussbozhuwenzhangEntity>(params).getPage(),
|
||||
new EntityWrapper<DiscussbozhuwenzhangEntity>()
|
||||
);
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params, Wrapper<DiscussbozhuwenzhangEntity> wrapper) {
|
||||
Page<DiscussbozhuwenzhangView> page =new Query<DiscussbozhuwenzhangView>(params).getPage();
|
||||
page.setRecords(baseMapper.selectListView(page,wrapper));
|
||||
PageUtils pageUtil = new PageUtils(page);
|
||||
return pageUtil;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DiscussbozhuwenzhangVO> selectListVO(Wrapper<DiscussbozhuwenzhangEntity> wrapper) {
|
||||
return baseMapper.selectListVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DiscussbozhuwenzhangVO selectVO(Wrapper<DiscussbozhuwenzhangEntity> wrapper) {
|
||||
return baseMapper.selectVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DiscussbozhuwenzhangView> selectListView(Wrapper<DiscussbozhuwenzhangEntity> wrapper) {
|
||||
return baseMapper.selectListView(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DiscussbozhuwenzhangView selectView(Wrapper<DiscussbozhuwenzhangEntity> wrapper) {
|
||||
return baseMapper.selectView(wrapper);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
package com.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.Query;
|
||||
|
||||
|
||||
import com.dao.NewsDao;
|
||||
import com.entity.NewsEntity;
|
||||
import com.service.NewsService;
|
||||
import com.entity.vo.NewsVO;
|
||||
import com.entity.view.NewsView;
|
||||
|
||||
@Service("newsService")
|
||||
public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements NewsService {
|
||||
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
Page<NewsEntity> page = this.selectPage(
|
||||
new Query<NewsEntity>(params).getPage(),
|
||||
new EntityWrapper<NewsEntity>()
|
||||
);
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params, Wrapper<NewsEntity> wrapper) {
|
||||
Page<NewsView> page =new Query<NewsView>(params).getPage();
|
||||
page.setRecords(baseMapper.selectListView(page,wrapper));
|
||||
PageUtils pageUtil = new PageUtils(page);
|
||||
return pageUtil;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NewsVO> selectListVO(Wrapper<NewsEntity> wrapper) {
|
||||
return baseMapper.selectListVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NewsVO selectVO(Wrapper<NewsEntity> wrapper) {
|
||||
return baseMapper.selectVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NewsView> selectListView(Wrapper<NewsEntity> wrapper) {
|
||||
return baseMapper.selectListView(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NewsView selectView(Wrapper<NewsEntity> wrapper) {
|
||||
return baseMapper.selectView(wrapper);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
package com.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.Query;
|
||||
|
||||
|
||||
import com.dao.StoreupDao;
|
||||
import com.entity.StoreupEntity;
|
||||
import com.service.StoreupService;
|
||||
import com.entity.vo.StoreupVO;
|
||||
import com.entity.view.StoreupView;
|
||||
|
||||
@Service("storeupService")
|
||||
public class StoreupServiceImpl extends ServiceImpl<StoreupDao, StoreupEntity> implements StoreupService {
|
||||
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
Page<StoreupEntity> page = this.selectPage(
|
||||
new Query<StoreupEntity>(params).getPage(),
|
||||
new EntityWrapper<StoreupEntity>()
|
||||
);
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params, Wrapper<StoreupEntity> wrapper) {
|
||||
Page<StoreupView> page =new Query<StoreupView>(params).getPage();
|
||||
page.setRecords(baseMapper.selectListView(page,wrapper));
|
||||
PageUtils pageUtil = new PageUtils(page);
|
||||
return pageUtil;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StoreupVO> selectListVO(Wrapper<StoreupEntity> wrapper) {
|
||||
return baseMapper.selectListVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StoreupVO selectVO(Wrapper<StoreupEntity> wrapper) {
|
||||
return baseMapper.selectVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StoreupView> selectListView(Wrapper<StoreupEntity> wrapper) {
|
||||
return baseMapper.selectListView(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StoreupView selectView(Wrapper<StoreupEntity> wrapper) {
|
||||
return baseMapper.selectView(wrapper);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,79 +0,0 @@
|
||||
|
||||
package com.service.impl;
|
||||
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
||||
import com.dao.TokenDao;
|
||||
import com.entity.TokenEntity;
|
||||
import com.entity.TokenEntity;
|
||||
import com.service.TokenService;
|
||||
import com.utils.CommonUtil;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.Query;
|
||||
|
||||
|
||||
/**
|
||||
* token
|
||||
*/
|
||||
@Service("tokenService")
|
||||
public class TokenServiceImpl extends ServiceImpl<TokenDao, TokenEntity> implements TokenService {
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
Page<TokenEntity> page = this.selectPage(
|
||||
new Query<TokenEntity>(params).getPage(),
|
||||
new EntityWrapper<TokenEntity>()
|
||||
);
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TokenEntity> selectListView(Wrapper<TokenEntity> wrapper) {
|
||||
return baseMapper.selectListView(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params,
|
||||
Wrapper<TokenEntity> wrapper) {
|
||||
Page<TokenEntity> page =new Query<TokenEntity>(params).getPage();
|
||||
page.setRecords(baseMapper.selectListView(page,wrapper));
|
||||
PageUtils pageUtil = new PageUtils(page);
|
||||
return pageUtil;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String generateToken(Long userid,String username, String tableName, String role) {
|
||||
TokenEntity tokenEntity = this.selectOne(new EntityWrapper<TokenEntity>().eq("userid", userid).eq("role", role));
|
||||
String token = CommonUtil.getRandomString(32);
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(new Date());
|
||||
cal.add(Calendar.HOUR_OF_DAY, 1);
|
||||
if(tokenEntity!=null) {
|
||||
tokenEntity.setToken(token);
|
||||
tokenEntity.setExpiratedtime(cal.getTime());
|
||||
this.updateById(tokenEntity);
|
||||
} else {
|
||||
this.insert(new TokenEntity(userid,username, tableName, role, token, cal.getTime()));
|
||||
}
|
||||
return token;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TokenEntity getTokenEntity(String token) {
|
||||
TokenEntity tokenEntity = this.selectOne(new EntityWrapper<TokenEntity>().eq("token", token));
|
||||
if(tokenEntity == null || tokenEntity.getExpiratedtime().getTime()<new Date().getTime()) {
|
||||
return null;
|
||||
}
|
||||
return tokenEntity;
|
||||
}
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
|
||||
package com.service.impl;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
||||
import com.dao.UserDao;
|
||||
import com.entity.UserEntity;
|
||||
import com.service.UserService;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.Query;
|
||||
|
||||
|
||||
/**
|
||||
* 系统用户
|
||||
*/
|
||||
@Service("userService")
|
||||
public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements UserService {
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
Page<UserEntity> page = this.selectPage(
|
||||
new Query<UserEntity>(params).getPage(),
|
||||
new EntityWrapper<UserEntity>()
|
||||
);
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserEntity> selectListView(Wrapper<UserEntity> wrapper) {
|
||||
return baseMapper.selectListView(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params,
|
||||
Wrapper<UserEntity> wrapper) {
|
||||
Page<UserEntity> page =new Query<UserEntity>(params).getPage();
|
||||
page.setRecords(baseMapper.selectListView(page,wrapper));
|
||||
PageUtils pageUtil = new PageUtils(page);
|
||||
return pageUtil;
|
||||
}
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
package com.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.Query;
|
||||
|
||||
|
||||
import com.dao.WenzhangfenleiDao;
|
||||
import com.entity.WenzhangfenleiEntity;
|
||||
import com.service.WenzhangfenleiService;
|
||||
import com.entity.vo.WenzhangfenleiVO;
|
||||
import com.entity.view.WenzhangfenleiView;
|
||||
|
||||
@Service("wenzhangfenleiService")
|
||||
public class WenzhangfenleiServiceImpl extends ServiceImpl<WenzhangfenleiDao, WenzhangfenleiEntity> implements WenzhangfenleiService {
|
||||
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
Page<WenzhangfenleiEntity> page = this.selectPage(
|
||||
new Query<WenzhangfenleiEntity>(params).getPage(),
|
||||
new EntityWrapper<WenzhangfenleiEntity>()
|
||||
);
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params, Wrapper<WenzhangfenleiEntity> wrapper) {
|
||||
Page<WenzhangfenleiView> page =new Query<WenzhangfenleiView>(params).getPage();
|
||||
page.setRecords(baseMapper.selectListView(page,wrapper));
|
||||
PageUtils pageUtil = new PageUtils(page);
|
||||
return pageUtil;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WenzhangfenleiVO> selectListVO(Wrapper<WenzhangfenleiEntity> wrapper) {
|
||||
return baseMapper.selectListVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WenzhangfenleiVO selectVO(Wrapper<WenzhangfenleiEntity> wrapper) {
|
||||
return baseMapper.selectVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WenzhangfenleiView> selectListView(Wrapper<WenzhangfenleiEntity> wrapper) {
|
||||
return baseMapper.selectListView(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WenzhangfenleiView selectView(Wrapper<WenzhangfenleiEntity> wrapper) {
|
||||
return baseMapper.selectView(wrapper);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
package com.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.Query;
|
||||
|
||||
|
||||
import com.dao.YonghuDao;
|
||||
import com.entity.YonghuEntity;
|
||||
import com.service.YonghuService;
|
||||
import com.entity.vo.YonghuVO;
|
||||
import com.entity.view.YonghuView;
|
||||
|
||||
@Service("yonghuService")
|
||||
public class YonghuServiceImpl extends ServiceImpl<YonghuDao, YonghuEntity> implements YonghuService {
|
||||
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
Page<YonghuEntity> page = this.selectPage(
|
||||
new Query<YonghuEntity>(params).getPage(),
|
||||
new EntityWrapper<YonghuEntity>()
|
||||
);
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params, Wrapper<YonghuEntity> wrapper) {
|
||||
Page<YonghuView> page =new Query<YonghuView>(params).getPage();
|
||||
page.setRecords(baseMapper.selectListView(page,wrapper));
|
||||
PageUtils pageUtil = new PageUtils(page);
|
||||
return pageUtil;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<YonghuVO> selectListVO(Wrapper<YonghuEntity> wrapper) {
|
||||
return baseMapper.selectListVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public YonghuVO selectVO(Wrapper<YonghuEntity> wrapper) {
|
||||
return baseMapper.selectVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<YonghuView> selectListView(Wrapper<YonghuEntity> wrapper) {
|
||||
return baseMapper.selectListView(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public YonghuView selectView(Wrapper<YonghuEntity> wrapper) {
|
||||
return baseMapper.selectView(wrapper);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,75 +0,0 @@
|
||||
package com.utils;
|
||||
|
||||
import java.util.Random;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.Objects;
|
||||
|
||||
@Component
|
||||
public class CommonUtil {
|
||||
/**
|
||||
* 获取随机字符串
|
||||
*
|
||||
* @param num
|
||||
* @return
|
||||
*/
|
||||
public static String getRandomString(Integer num) {
|
||||
String base = "abcdefghijklmnopqrstuvwxyz0123456789";
|
||||
Random random = new Random();
|
||||
StringBuffer sb = new StringBuffer();
|
||||
for (int i = 0; i < num; i++) {
|
||||
int number = random.nextInt(base.length());
|
||||
sb.append(base.charAt(number));
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取随机验证码
|
||||
*
|
||||
* @param num
|
||||
* @return
|
||||
*/
|
||||
public static String getRandomNumber(Integer num) {
|
||||
String base = "0123456789";
|
||||
Random random = new Random();
|
||||
StringBuffer sb = new StringBuffer();
|
||||
for (int i = 0; i < num; i++) {
|
||||
int number = random.nextInt(base.length());
|
||||
sb.append(base.charAt(number));
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public static String getCellValue(Cell cell) {
|
||||
String resultValue = "";
|
||||
// 判空
|
||||
if (Objects.isNull(cell)) {
|
||||
return resultValue;
|
||||
}
|
||||
|
||||
// 拿到单元格类型
|
||||
int cellType = cell.getCellType();
|
||||
switch (cellType) {
|
||||
// 字符串类型
|
||||
case Cell.CELL_TYPE_STRING:
|
||||
resultValue = StringUtils.isEmpty(cell.getStringCellValue()) ? "" : cell.getStringCellValue().trim();
|
||||
break;
|
||||
// 布尔类型
|
||||
case Cell.CELL_TYPE_BOOLEAN:
|
||||
resultValue = String.valueOf(cell.getBooleanCellValue());
|
||||
break;
|
||||
// 数值类型
|
||||
case Cell.CELL_TYPE_NUMERIC:
|
||||
resultValue = new DecimalFormat("#.######").format(cell.getNumericCellValue());
|
||||
break;
|
||||
// 取空串
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return resultValue;
|
||||
}
|
||||
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
package com.utils;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
/**
|
||||
* 类说明 :
|
||||
*/
|
||||
|
||||
public class FileUtil {
|
||||
public static byte[] FileToByte(File file) throws IOException {
|
||||
// 将数据转为流
|
||||
@SuppressWarnings("resource")
|
||||
InputStream content = new FileInputStream(file);
|
||||
ByteArrayOutputStream swapStream = new ByteArrayOutputStream();
|
||||
byte[] buff = new byte[100];
|
||||
int rc = 0;
|
||||
while ((rc = content.read(buff, 0, 100)) > 0) {
|
||||
swapStream.write(buff, 0, rc);
|
||||
}
|
||||
// 获得二进制数组
|
||||
return swapStream.toByteArray();
|
||||
}
|
||||
}
|
@ -1,42 +0,0 @@
|
||||
package com.utils;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
|
||||
|
||||
/**
|
||||
* HttpClient工具类
|
||||
*/
|
||||
public class HttpClientUtils {
|
||||
|
||||
/**
|
||||
* @param uri
|
||||
* @return String
|
||||
* @description get请求方式
|
||||
* @author: long.he01
|
||||
*/
|
||||
public static String doGet(String uri) {
|
||||
|
||||
StringBuilder result = new StringBuilder();
|
||||
try {
|
||||
String res = "";
|
||||
URL url = new URL(uri);
|
||||
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||
BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"));
|
||||
String line;
|
||||
while ((line = in.readLine()) != null) {
|
||||
res += line+"\n";
|
||||
}
|
||||
in.close();
|
||||
return res;
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,54 +0,0 @@
|
||||
package com.utils;
|
||||
|
||||
public class JQPageInfo{
|
||||
private Integer page;
|
||||
|
||||
private Integer limit;
|
||||
|
||||
private String sidx;
|
||||
|
||||
private String order;
|
||||
|
||||
private Integer offset;
|
||||
|
||||
public Integer getPage() {
|
||||
return page;
|
||||
}
|
||||
|
||||
public void setPage(Integer page) {
|
||||
this.page = page;
|
||||
}
|
||||
|
||||
public Integer getLimit() {
|
||||
return limit;
|
||||
}
|
||||
|
||||
public void setLimit(Integer limit) {
|
||||
this.limit = limit;
|
||||
}
|
||||
|
||||
public String getSidx() {
|
||||
return sidx;
|
||||
}
|
||||
|
||||
public void setSidx(String sidx) {
|
||||
this.sidx = sidx;
|
||||
}
|
||||
|
||||
public String getOrder() {
|
||||
return order;
|
||||
}
|
||||
|
||||
public void setOrder(String order) {
|
||||
this.order = order;
|
||||
}
|
||||
|
||||
public Integer getOffset() {
|
||||
return offset;
|
||||
}
|
||||
|
||||
public void setOffset(Integer offset) {
|
||||
this.offset = offset;
|
||||
}
|
||||
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
package com.utils;
|
||||
|
||||
import cn.hutool.crypto.digest.DigestUtil;
|
||||
|
||||
public class MD5Util {
|
||||
|
||||
/**
|
||||
* @param text明文
|
||||
* @param key密钥
|
||||
* @return 密文
|
||||
*/
|
||||
// 带秘钥加密
|
||||
public static String md5(String text) {
|
||||
// 加密后的字符串
|
||||
String md5str = DigestUtil.md5Hex(text);
|
||||
return md5str;
|
||||
}
|
||||
|
||||
}
|
@ -1,184 +0,0 @@
|
||||
package com.utils;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
|
||||
/**
|
||||
* Mybatis-Plus工具类
|
||||
*/
|
||||
public class MPUtil {
|
||||
public static final char UNDERLINE = '_';
|
||||
|
||||
|
||||
//mybatis plus allEQ 表达式转换
|
||||
public static Map allEQMapPre(Object bean,String pre) {
|
||||
Map<String, Object> map =BeanUtil.beanToMap(bean);
|
||||
return camelToUnderlineMap(map,pre);
|
||||
}
|
||||
|
||||
//mybatis plus allEQ 表达式转换
|
||||
public static Map allEQMap(Object bean) {
|
||||
Map<String, Object> map =BeanUtil.beanToMap(bean);
|
||||
return camelToUnderlineMap(map,"");
|
||||
}
|
||||
|
||||
public static Wrapper allLikePre(Wrapper wrapper,Object bean,String pre) {
|
||||
Map<String, Object> map =BeanUtil.beanToMap(bean);
|
||||
Map result = camelToUnderlineMap(map,pre);
|
||||
|
||||
return genLike(wrapper,result);
|
||||
}
|
||||
|
||||
public static Wrapper allLike(Wrapper wrapper,Object bean) {
|
||||
Map result = BeanUtil.beanToMap(bean, true, true);
|
||||
return genLike(wrapper,result);
|
||||
}
|
||||
|
||||
|
||||
public static Wrapper genLike( Wrapper wrapper,Map param) {
|
||||
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
|
||||
int i=0;
|
||||
while (it.hasNext()) {
|
||||
if(i>0) wrapper.and();
|
||||
Map.Entry<String, Object> entry = it.next();
|
||||
String key = entry.getKey();
|
||||
String value = (String) entry.getValue();
|
||||
wrapper.like(key, value);
|
||||
i++;
|
||||
}
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
public static Wrapper likeOrEq(Wrapper wrapper,Object bean) {
|
||||
Map result = BeanUtil.beanToMap(bean, true, true);
|
||||
return genLikeOrEq(wrapper,result);
|
||||
}
|
||||
|
||||
public static Wrapper genLikeOrEq( Wrapper wrapper,Map param) {
|
||||
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
|
||||
int i=0;
|
||||
while (it.hasNext()) {
|
||||
if(i>0) wrapper.and();
|
||||
Map.Entry<String, Object> entry = it.next();
|
||||
String key = entry.getKey();
|
||||
if(entry.getValue().toString().contains("%")) {
|
||||
wrapper.like(key, entry.getValue().toString().replace("%", ""));
|
||||
} else {
|
||||
wrapper.eq(key, entry.getValue());
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
public static Wrapper allEq(Wrapper wrapper,Object bean) {
|
||||
Map result = BeanUtil.beanToMap(bean, true, true);
|
||||
return genEq(wrapper,result);
|
||||
}
|
||||
|
||||
|
||||
public static Wrapper genEq( Wrapper wrapper,Map param) {
|
||||
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
|
||||
int i=0;
|
||||
while (it.hasNext()) {
|
||||
if(i>0) wrapper.and();
|
||||
Map.Entry<String, Object> entry = it.next();
|
||||
String key = entry.getKey();
|
||||
wrapper.eq(key, entry.getValue());
|
||||
i++;
|
||||
}
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
|
||||
public static Wrapper between(Wrapper wrapper,Map<String, Object> params) {
|
||||
for(String key : params.keySet()) {
|
||||
String columnName = "";
|
||||
if(key.endsWith("_start")) {
|
||||
columnName = key.substring(0, key.indexOf("_start"));
|
||||
if(StringUtils.isNotBlank(params.get(key).toString())) {
|
||||
wrapper.ge(columnName, params.get(key));
|
||||
}
|
||||
}
|
||||
if(key.endsWith("_end")) {
|
||||
columnName = key.substring(0, key.indexOf("_end"));
|
||||
if(StringUtils.isNotBlank(params.get(key).toString())) {
|
||||
wrapper.le(columnName, params.get(key));
|
||||
}
|
||||
}
|
||||
}
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
public static Wrapper sort(Wrapper wrapper,Map<String, Object> params) {
|
||||
String order = "";
|
||||
if(params.get("order") != null && StringUtils.isNotBlank(params.get("order").toString())) {
|
||||
order = params.get("order").toString();
|
||||
}
|
||||
if(params.get("sort") != null && StringUtils.isNotBlank(params.get("sort").toString())) {
|
||||
if(order.equalsIgnoreCase("desc")) {
|
||||
wrapper.orderDesc(Arrays.asList(params.get("sort")));
|
||||
} else {
|
||||
wrapper.orderAsc(Arrays.asList(params.get("sort")));
|
||||
}
|
||||
}
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 驼峰格式字符串转换为下划线格式字符串
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
public static String camelToUnderline(String param) {
|
||||
if (param == null || "".equals(param.trim())) {
|
||||
return "";
|
||||
}
|
||||
int len = param.length();
|
||||
StringBuilder sb = new StringBuilder(len);
|
||||
for (int i = 0; i < len; i++) {
|
||||
char c = param.charAt(i);
|
||||
if (Character.isUpperCase(c)) {
|
||||
sb.append(UNDERLINE);
|
||||
sb.append(Character.toLowerCase(c));
|
||||
} else {
|
||||
sb.append(c);
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public static void main(String[] ages) {
|
||||
System.out.println(camelToUnderline("ABCddfANM"));
|
||||
}
|
||||
|
||||
public static Map camelToUnderlineMap(Map param, String pre) {
|
||||
|
||||
Map<String, Object> newMap = new HashMap<String, Object>();
|
||||
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
Map.Entry<String, Object> entry = it.next();
|
||||
String key = entry.getKey();
|
||||
String newKey = camelToUnderline(key);
|
||||
if (pre.endsWith(".")) {
|
||||
newMap.put(pre + newKey, entry.getValue());
|
||||
} else if (StringUtils.isEmpty(pre)) {
|
||||
newMap.put(newKey, entry.getValue());
|
||||
} else {
|
||||
|
||||
newMap.put(pre + "." + newKey, entry.getValue());
|
||||
}
|
||||
}
|
||||
return newMap;
|
||||
}
|
||||
}
|
@ -1,101 +0,0 @@
|
||||
|
||||
package com.utils;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
|
||||
/**
|
||||
* 分页工具类
|
||||
*/
|
||||
public class PageUtils implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
//总记录数
|
||||
private long total;
|
||||
//每页记录数
|
||||
private int pageSize;
|
||||
//总页数
|
||||
private long totalPage;
|
||||
//当前页数
|
||||
private int currPage;
|
||||
//列表数据
|
||||
private List<?> list;
|
||||
|
||||
/**
|
||||
* 分页
|
||||
* @param list 列表数据
|
||||
* @param totalCount 总记录数
|
||||
* @param pageSize 每页记录数
|
||||
* @param currPage 当前页数
|
||||
*/
|
||||
public PageUtils(List<?> list, int totalCount, int pageSize, int currPage) {
|
||||
this.list = list;
|
||||
this.total = totalCount;
|
||||
this.pageSize = pageSize;
|
||||
this.currPage = currPage;
|
||||
this.totalPage = (int)Math.ceil((double)totalCount/pageSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*/
|
||||
public PageUtils(Page<?> page) {
|
||||
this.list = page.getRecords();
|
||||
this.total = page.getTotal();
|
||||
this.pageSize = page.getSize();
|
||||
this.currPage = page.getCurrent();
|
||||
this.totalPage = page.getPages();
|
||||
}
|
||||
|
||||
/*
|
||||
* 空数据的分页
|
||||
*/
|
||||
public PageUtils(Map<String, Object> params) {
|
||||
Page page =new Query(params).getPage();
|
||||
new PageUtils(page);
|
||||
}
|
||||
|
||||
|
||||
public int getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(int pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public int getCurrPage() {
|
||||
return currPage;
|
||||
}
|
||||
|
||||
public void setCurrPage(int currPage) {
|
||||
this.currPage = currPage;
|
||||
}
|
||||
|
||||
public List<?> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<?> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
public long getTotalPage() {
|
||||
return totalPage;
|
||||
}
|
||||
|
||||
public void setTotalPage(long totalPage) {
|
||||
this.totalPage = totalPage;
|
||||
}
|
||||
|
||||
public long getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(long total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
}
|
@ -1,51 +0,0 @@
|
||||
package com.utils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 返回数据
|
||||
*/
|
||||
public class R extends HashMap<String, Object> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public R() {
|
||||
put("code", 0);
|
||||
}
|
||||
|
||||
public static R error() {
|
||||
return error(500, "未知异常,请联系管理员");
|
||||
}
|
||||
|
||||
public static R error(String msg) {
|
||||
return error(500, msg);
|
||||
}
|
||||
|
||||
public static R error(int code, String msg) {
|
||||
R r = new R();
|
||||
r.put("code", code);
|
||||
r.put("msg", msg);
|
||||
return r;
|
||||
}
|
||||
|
||||
public static R ok(String msg) {
|
||||
R r = new R();
|
||||
r.put("msg", msg);
|
||||
return r;
|
||||
}
|
||||
|
||||
public static R ok(Map<String, Object> map) {
|
||||
R r = new R();
|
||||
r.putAll(map);
|
||||
return r;
|
||||
}
|
||||
|
||||
public static R ok() {
|
||||
return new R();
|
||||
}
|
||||
|
||||
public R put(String key, Object value) {
|
||||
super.put(key, value);
|
||||
return this;
|
||||
}
|
||||
}
|
@ -1,42 +0,0 @@
|
||||
|
||||
package com.utils;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.entity.EIException;
|
||||
|
||||
/**
|
||||
* SQL过滤
|
||||
*/
|
||||
public class SQLFilter {
|
||||
|
||||
/**
|
||||
* SQL注入过滤
|
||||
* @param str 待验证的字符串
|
||||
*/
|
||||
public static String sqlInject(String str){
|
||||
if(StringUtils.isBlank(str)){
|
||||
return null;
|
||||
}
|
||||
//去掉'|"|;|\字符
|
||||
str = StringUtils.replace(str, "'", "");
|
||||
str = StringUtils.replace(str, "\"", "");
|
||||
str = StringUtils.replace(str, ";", "");
|
||||
str = StringUtils.replace(str, "\\", "");
|
||||
|
||||
//转换成小写
|
||||
str = str.toLowerCase();
|
||||
|
||||
//非法字符
|
||||
String[] keywords = {"master", "truncate", "insert", "select", "delete", "update", "declare", "alter", "drop"};
|
||||
|
||||
//判断是否包含非法字符
|
||||
for(String keyword : keywords){
|
||||
if(str.indexOf(keyword) != -1){
|
||||
throw new EIException("包含非法字符");
|
||||
}
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
|
||||
package com.utils;
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
||||
/**
|
||||
* Spring Context 工具类
|
||||
*/
|
||||
@Component
|
||||
public class SpringContextUtils implements ApplicationContextAware {
|
||||
public static ApplicationContext applicationContext;
|
||||
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext)
|
||||
throws BeansException {
|
||||
SpringContextUtils.applicationContext = applicationContext;
|
||||
}
|
||||
|
||||
public static Object getBean(String name) {
|
||||
return applicationContext.getBean(name);
|
||||
}
|
||||
|
||||
public static <T> T getBean(String name, Class<T> requiredType) {
|
||||
return applicationContext.getBean(name, requiredType);
|
||||
}
|
||||
|
||||
public static boolean containsBean(String name) {
|
||||
return applicationContext.containsBean(name);
|
||||
}
|
||||
|
||||
public static boolean isSingleton(String name) {
|
||||
return applicationContext.isSingleton(name);
|
||||
}
|
||||
|
||||
public static Class<? extends Object> getType(String name) {
|
||||
return applicationContext.getType(name);
|
||||
}
|
||||
|
||||
}
|
@ -1 +0,0 @@
|
||||
cnpm install
|
@ -1 +0,0 @@
|
||||
cnpm run serve
|
@ -1 +0,0 @@
|
||||
cnpm run build
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue