fangyuan
2022-11-22 b1516fedd7deedb61641321158fce862f77b4b4d
ycl-platform/src/main/java/com/ycl/controller/NewsAdminController.java
@@ -50,6 +50,7 @@
        } else {
            if (admin.getPassword().equals(MD5Util.md5Encrypt32Lower(loginParam.getPassword()))) {
                JwtTokenUtil jwtTokenUtil = new JwtTokenUtil();
                return CommonResult.success(jwtTokenUtil.generateToken(admin.getId(), admin.getUsername()));
            } else {
                return CommonResult.failed("密码错误");
@@ -64,6 +65,7 @@
     * @return 所有数据
     */
    @GetMapping
    @ApiOperation(value = "查询所有数据")
    public R selectAll(Page<NewsAdmin> page, NewsAdmin newsAdmin) {
        return success(this.newsAdminService.page(page, new QueryWrapper<>(newsAdmin)));
    }
@@ -75,6 +77,7 @@
     * @return 单条数据
     */
    @GetMapping("{id}")
    @ApiOperation(value = "按id查询数据")
    public R selectOne(@PathVariable Serializable id) {
        return success(this.newsAdminService.getById(id));
    }
@@ -86,6 +89,7 @@
     * @return 新增结果
     */
    @PostMapping
    @ApiOperation(value = "新增数据")
    public R insert(@RequestBody NewsAdmin newsAdmin) {
        return success(this.newsAdminService.save(newsAdmin));
    }
@@ -97,6 +101,7 @@
     * @return 修改结果
     */
    @PutMapping
    @ApiOperation(value = "修改数据")
    public R update(@RequestBody NewsAdmin newsAdmin) {
        return success(this.newsAdminService.updateById(newsAdmin));
    }
@@ -108,6 +113,7 @@
     * @return 删除结果
     */
    @DeleteMapping
    @ApiOperation(value = "删除数据")
    public R delete(@RequestParam("idList") List<Long> idList) {
        return success(this.newsAdminService.removeByIds(idList));
    }