Browse Source

feat: 删除无用接口

weijianghai 2 năm trước cách đây
mục cha
commit
9ea5f15d0f

+ 2 - 74
src/main/java/com/nokia/controller/RoleController.java

@@ -1,81 +1,9 @@
 package com.nokia.controller;
 
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.nokia.common.R;
-import com.nokia.dao.RoleDao;
-import com.nokia.pojo.Role;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 @RequestMapping("rest/api/role")
 @RestController
 public class RoleController {
-
-    public final RoleDao roleDao;
-
-    @Autowired
-    public RoleController(RoleDao roleDao){
-        this.roleDao=roleDao;
-    }
-
-    @PostMapping("/list")
-    public R list() {
-        return R.ok().data(roleDao.selectList(null));
-    }
-
-    @PostMapping("/add")
-    public R RoleAdd(@RequestBody Role roleEntity){
-        if (roleEntity==null){
-            return R.error().message("空");
-        }
-        QueryWrapper<Role> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("role_name",roleEntity.getRoleName());
-        Role roleEntity1 = roleDao.selectOne(queryWrapper);
-        if (roleEntity1!=null){
-            return R.error().message("角色已经存在");
-        }
-        int insert = roleDao.insert(roleEntity);
-        if (insert>0){
-            return R.ok().message("添加成功");
-        }else {
-            return R.error().message("添加失败");
-        }
-    }
-
-    @PostMapping("/delete/id/{roleId}")
-    public R RoleDelete(@PathVariable Integer roleId){
-        if (roleId==null){
-            return R.error().message("roleId 为空");
-        }
-        int ResurnRole = roleDao.deleteById(roleId);
-        if (ResurnRole>0){
-            return R.ok().message("删除成功");
-        }else {
-            return R.error().message("删除失败");
-        }
-    }
-
-    @PostMapping("/update/id/{roleId}")
-    public R RoleUpdate(@PathVariable Integer roleId, @RequestBody Role roleEntity){
-        if (roleEntity==null){
-            return R.error().message("roleEntity 为空");
-        }
-        Role roleEntity1 = roleDao.selectById(roleId);
-        roleEntity1.setRoleName(roleEntity.getRoleName());
-        int i = roleDao.updateById(roleEntity1);
-        if (i>0){
-            return R.ok().message("修改成功");
-        }else {
-            return R.ok().message("修改失败");
-        }
-    }
-
-    @PostMapping("/select/id/{roleId}")
-    public R RoleSelect(@PathVariable Integer roleId){
-        if (roleId==null){
-            return R.error().message("roleId 为空");
-        }
-        Role roleEntity = roleDao.selectById(roleId);
-        return  roleEntity==null ? R.error().message("role不存在") :R.ok().data(roleEntity);
-    }
 }

+ 4 - 23
src/main/java/com/nokia/controller/UserController.java

@@ -1,11 +1,13 @@
 package com.nokia.controller;
 
 import com.nokia.common.R;
-import com.nokia.pojo.User;
 import com.nokia.service.UserService;
 import com.nokia.vo.UserVo;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
 
 import java.util.List;
 
@@ -19,27 +21,6 @@ public class UserController {
         this.userServiceImpl = userServiceImpl;
     }
 
-    @PostMapping("list")
-    @ResponseBody
-    public R list() {
-        List<User> userEntities = userServiceImpl.list();
-        return R.ok().data(userEntities);
-    }
-
-    @PostMapping("add")
-    @ResponseBody
-    public R add(@RequestBody User user) {
-        if (user.getLoginName() == null || user.getLoginName().equals("")) {
-            return R.error().message("LoginName不能为空");
-        }
-        String msg = userServiceImpl.add(user);
-        if (msg.equals("ok")) {
-            return R.ok().message("添加成功");
-        } else {
-            return R.error().message(msg);
-        }
-    }
-
     @PostMapping("baselist")
     @ResponseBody
     public R baseList() {

+ 0 - 1
src/main/java/com/nokia/controller/VerificationController.java

@@ -5,7 +5,6 @@ import com.nokia.service.AclService;
 import com.nokia.vo.TokenVo;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;