|
|
@@ -1,98 +0,0 @@
|
|
|
-package com.template.controller;
|
|
|
-
|
|
|
-
|
|
|
-import com.template.api.SmartAuthorGroupControllerAPI;
|
|
|
-import com.template.common.utils.paramUtils;
|
|
|
-import com.template.model.pojo.SmartAuthorGroup;
|
|
|
-import com.template.model.pojo.SmartAuthorGroup;
|
|
|
-import com.template.model.result.CommonResult;
|
|
|
-import com.template.model.result.PageUtils;
|
|
|
-import com.template.model.vo.ApplyVo;
|
|
|
-import com.template.services.SmartAuthorGroupService;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.validation.BindingResult;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
-
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
-/**
|
|
|
- * <p>
|
|
|
- * 前端控制器
|
|
|
- * </p>
|
|
|
- *
|
|
|
- * @author ceshi
|
|
|
- * @since 2023-12-04
|
|
|
- */
|
|
|
-@RestController
|
|
|
-public class SmartAuthorGroupController implements SmartAuthorGroupControllerAPI {
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private SmartAuthorGroupService smartAuthorGroupService;
|
|
|
-
|
|
|
- /**
|
|
|
- * 新增权限组
|
|
|
- * @param smartApply 权限组数据
|
|
|
- * @param bindingResult
|
|
|
- * @return
|
|
|
- */
|
|
|
- @Override
|
|
|
- public CommonResult insertSmartAuthorGroup(SmartAuthorGroup smartApply, BindingResult bindingResult) {
|
|
|
- if (bindingResult.hasErrors()) {
|
|
|
- String st = paramUtils.getParamError(bindingResult);
|
|
|
- return CommonResult.fail(st);
|
|
|
- }
|
|
|
-
|
|
|
- int result = smartAuthorGroupService.insertSmartAuthorGroup(smartApply);
|
|
|
-
|
|
|
- return result > 0 ? CommonResult.ok("添加成功") : CommonResult.fail("添加失败");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 更新权限组
|
|
|
- * @param sa 权限组数据
|
|
|
- * @param bindingResult
|
|
|
- * @return
|
|
|
- */
|
|
|
- @Override
|
|
|
- public CommonResult updateSmartAuthorGroupById(SmartAuthorGroup sa, BindingResult bindingResult) {
|
|
|
- if (bindingResult.hasErrors()) {
|
|
|
- String st = paramUtils.getParamError(bindingResult);
|
|
|
- return CommonResult.fail(st);
|
|
|
- }
|
|
|
-
|
|
|
- int result = smartAuthorGroupService.updateSmartAuthorGroup(sa);
|
|
|
- return result > 0 ? CommonResult.ok("修改成功") : CommonResult.fail("修改失败");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 权限组分页数据查询
|
|
|
- * @param currentPage 当前页数
|
|
|
- * @param pageCount 一页数据条数
|
|
|
- * @param name 查询名称
|
|
|
- * @return
|
|
|
- */
|
|
|
- @Override
|
|
|
- public CommonResult queryPageSmartAuthorGroups(int currentPage, int pageCount, String name) {
|
|
|
- PageUtils<SmartAuthorGroup> result = smartAuthorGroupService.queryPageSmartAuthorGroups(currentPage, pageCount, name);
|
|
|
-
|
|
|
- return CommonResult.ok(result);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- @Override
|
|
|
- public CommonResult deleteSmartAuthorGroupById(int id) {
|
|
|
-
|
|
|
- SmartAuthorGroup data = smartAuthorGroupService.getSmartById(id);
|
|
|
-
|
|
|
- if(data == null){
|
|
|
- return CommonResult.fail("当前数据不存在,删除失败!");
|
|
|
- }
|
|
|
-
|
|
|
- int result = smartAuthorGroupService.deleteSmartAuthorGroupById(id);
|
|
|
-
|
|
|
- return result > 0 ? CommonResult.ok("删除成功") : CommonResult.fail("删除失败");
|
|
|
- }
|
|
|
-}
|
|
|
-
|