|
@@ -59,42 +59,31 @@ public class WebController extends BaseController {
|
|
|
private FodderService fodderService;
|
|
|
|
|
|
|
|
|
- @ApiOperation("留言")
|
|
|
- @PostMapping("comment")
|
|
|
- public Result comment(@Valid @RequestBody CommentRequest param) {
|
|
|
|
|
|
- CommentEntity entity = new CommentEntity();
|
|
|
- BeanUtils.copyProperties(param, entity);
|
|
|
- // 默认不显示
|
|
|
- entity.setDisplay(0);
|
|
|
- commentService.save(entity);
|
|
|
|
|
|
- return Result.success();
|
|
|
- }
|
|
|
|
|
|
+// @ApiOperation("搜索")
|
|
|
+// @PostMapping("search")
|
|
|
+// public Result<NewsVo> search(@RequestBody PageDto param) {
|
|
|
+// startPage(param);
|
|
|
+// PageInfo<NewsVo> page = new PageInfo<>(newsService.webSearch(param));
|
|
|
+// return Result.success(page);
|
|
|
+// }
|
|
|
|
|
|
- @ApiOperation("搜索")
|
|
|
- @PostMapping("search")
|
|
|
- public Result<NewsVo> search(@RequestBody PageDto param) {
|
|
|
- startPage(param);
|
|
|
- PageInfo<NewsVo> page = new PageInfo<>(newsService.webSearch(param));
|
|
|
- return Result.success(page);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- @ApiOperation("获取访问量")
|
|
|
- @GetMapping("count")
|
|
|
- public Result count() {
|
|
|
|
|
|
- ViewEntity entity = new ViewEntity();
|
|
|
- entity.setIp(request.getRemoteAddr());
|
|
|
- entity.setPath(request.getRequestURI());
|
|
|
- viewService.save(entity);
|
|
|
|
|
|
- long count = viewService.count();
|
|
|
- return Result.success(count);
|
|
|
- }
|
|
|
+// @ApiOperation("获取访问量")
|
|
|
+// @GetMapping("count")
|
|
|
+// public Result count() {
|
|
|
+//
|
|
|
+// ViewEntity entity = new ViewEntity();
|
|
|
+// entity.setIp(request.getRemoteAddr());
|
|
|
+// entity.setPath(request.getRequestURI());
|
|
|
+// viewService.save(entity);
|
|
|
+//
|
|
|
+// long count = viewService.count();
|
|
|
+// return Result.success(count);
|
|
|
+// }
|
|
|
|
|
|
|
|
|
|
|
@@ -103,7 +92,7 @@ public class WebController extends BaseController {
|
|
|
public Result<FodderEntity> list(@RequestBody FodderPageDto param) {
|
|
|
|
|
|
startPage(param);
|
|
|
- PageInfo<FodderEntity> page = new PageInfo<>(fodderService.search(param));
|
|
|
+ PageInfo<FodderEntity> page = new PageInfo<>(fodderService.search(param, 1));
|
|
|
return Result.success(page);
|
|
|
}
|
|
|
|
|
@@ -118,26 +107,26 @@ public class WebController extends BaseController {
|
|
|
}
|
|
|
|
|
|
|
|
|
- @ApiOperation(value = "数字史馆-场景")
|
|
|
- @GetMapping("scene")
|
|
|
- public Result scene() {
|
|
|
- Condition condition = new Condition(SceneEntity.class);
|
|
|
- condition.and().andEqualTo("display", 1);
|
|
|
- List<SceneEntity> all = sceneService.findAll(condition);
|
|
|
- return Result.success(all);
|
|
|
- }
|
|
|
-
|
|
|
+// @ApiOperation(value = "数字史馆-场景")
|
|
|
+// @GetMapping("scene")
|
|
|
+// public Result scene() {
|
|
|
+// Condition condition = new Condition(SceneEntity.class);
|
|
|
+// condition.and().andEqualTo("display", 1);
|
|
|
+// List<SceneEntity> all = sceneService.findAll(condition);
|
|
|
+// return Result.success(all);
|
|
|
+// }
|
|
|
|
|
|
- @ApiOperation(value = "数字史馆-视频")
|
|
|
- @GetMapping("video")
|
|
|
- public Result video() {
|
|
|
|
|
|
- Condition condition = new Condition(VideoEntity.class);
|
|
|
- condition.and().andEqualTo("display", 1);
|
|
|
- List<VideoEntity> all = videoService.findAll(condition);
|
|
|
-
|
|
|
- return Result.success(all);
|
|
|
- }
|
|
|
+// @ApiOperation(value = "数字史馆-视频")
|
|
|
+// @GetMapping("video")
|
|
|
+// public Result video() {
|
|
|
+//
|
|
|
+// Condition condition = new Condition(VideoEntity.class);
|
|
|
+// condition.and().andEqualTo("display", 1);
|
|
|
+// List<VideoEntity> all = videoService.findAll(condition);
|
|
|
+//
|
|
|
+// return Result.success(all);
|
|
|
+// }
|
|
|
|
|
|
|
|
|
@ApiOperation("留言列表")
|
|
@@ -153,38 +142,51 @@ public class WebController extends BaseController {
|
|
|
return Result.success(page);
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation("留言")
|
|
|
+ @PostMapping("comment")
|
|
|
+ public Result comment(@Valid @RequestBody CommentRequest param) {
|
|
|
|
|
|
-
|
|
|
- @ApiOperation("用户注册")
|
|
|
- @PostMapping("register")
|
|
|
- public Result register(@Valid @RequestBody RegisterDto param) {
|
|
|
-
|
|
|
- if (!param.getPassword().equals(param.getVerifyPassword())) {
|
|
|
- log.error("确认密码不一致");
|
|
|
- return Result.failure("确认密码不一致");
|
|
|
- }
|
|
|
-
|
|
|
- SysUserEntity entity = sysUserService.findByUserName(param.getUserName());
|
|
|
- if (entity != null) {
|
|
|
- log.error("该身份证号已注册: {}", param.getUserName());
|
|
|
- return Result.failure("该身份证号已注册");
|
|
|
- }
|
|
|
-
|
|
|
- entity = new SysUserEntity();
|
|
|
+ CommentEntity entity = new CommentEntity();
|
|
|
BeanUtils.copyProperties(param, entity);
|
|
|
+ // 默认不显示
|
|
|
+ entity.setDisplay(0);
|
|
|
+ commentService.save(entity);
|
|
|
|
|
|
- entity.setPassword(PasswordUtils.encrypt(param.getUserName(), param.getPassword(), PasswordUtils.getStaticSalt()));
|
|
|
- entity.setStatus(1);
|
|
|
- entity.setRole("sys_visitor");
|
|
|
- sysUserService.save(entity);
|
|
|
-
|
|
|
- // 保存操作日志
|
|
|
- saveLog(new LogEntity(entity.getId(),"用户注册","新增用户"));
|
|
|
+ return Result.success();
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
- return Result.success();
|
|
|
- }
|
|
|
+// @ApiOperation("用户注册")
|
|
|
+// @PostMapping("register")
|
|
|
+// public Result register(@Valid @RequestBody RegisterDto param) {
|
|
|
+//
|
|
|
+// if (!param.getPassword().equals(param.getVerifyPassword())) {
|
|
|
+// log.error("确认密码不一致");
|
|
|
+// return Result.failure("确认密码不一致");
|
|
|
+// }
|
|
|
+//
|
|
|
+// SysUserEntity entity = sysUserService.findByUserName(param.getUserName());
|
|
|
+// if (entity != null) {
|
|
|
+// log.error("该身份证号已注册: {}", param.getUserName());
|
|
|
+// return Result.failure("该身份证号已注册");
|
|
|
+// }
|
|
|
+//
|
|
|
+// entity = new SysUserEntity();
|
|
|
+// BeanUtils.copyProperties(param, entity);
|
|
|
+//
|
|
|
+// entity.setPassword(PasswordUtils.encrypt(param.getUserName(), param.getPassword(), PasswordUtils.getStaticSalt()));
|
|
|
+// entity.setStatus(1);
|
|
|
+// entity.setRole("sys_visitor");
|
|
|
+// sysUserService.save(entity);
|
|
|
+//
|
|
|
+// // 保存操作日志
|
|
|
+// saveLog(new LogEntity(entity.getId(),"用户注册","新增用户"));
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+// return Result.success();
|
|
|
+// }
|
|
|
|
|
|
|
|
|
@ApiOperation("找回密码")
|