| | |
| | | import com.baomidou.mybatisplus.extension.api.ApiController;
|
| | | import com.baomidou.mybatisplus.extension.api.R;
|
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
| | | import com.github.pagehelper.PageHelper;
|
| | | import com.ycl.api.CommonResult;
|
| | | import com.ycl.entity.NewsAdmin;
|
| | | import com.ycl.pojo.dto.LoginParam;
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | @PostMapping("/login/reception")
|
| | | @ApiOperation(value = "前台登录")
|
| | | @SneakyThrows
|
| | | public CommonResult Reception(@RequestBody LoginParam loginParam) {
|
| | | NewsAdmin admin = newsAdminService.getOne(new LambdaQueryWrapper<NewsAdmin>().eq(NewsAdmin::getUsername, loginParam.getUsername()));
|
| | | if (admin == null) {
|
| | | return CommonResult.failed("用户不存在");
|
| | | } else {
|
| | | if (admin.getPassword().equals(MD5Util.md5Encrypt32Lower(loginParam.getPassword()))) {
|
| | |
|
| | |
|
| | | return CommonResult.success(admin.getNewsPoliceId());
|
| | | } else {
|
| | | return CommonResult.failed("密码错误");
|
| | | }
|
| | | }
|
| | | }
|
| | | /**
|
| | | * 分页查询所有数据
|
| | | *
|
| | |
| | | @GetMapping
|
| | | @ApiOperation(value = "查询所有数据")
|
| | | public R selectAll(Page<NewsAdmin> page, NewsAdmin newsAdmin) {
|
| | | page.setTotal(newsAdminService.count());
|
| | | PageHelper.startPage(new Long(page.getCurrent()).intValue(),new Long(page.getSize()).intValue());
|
| | | return success(this.newsAdminService.page(page, new QueryWrapper<>(newsAdmin)));
|
| | | }
|
| | |
|