|
@@ -7,10 +7,10 @@ import com.gz.dto.system.AdminDTO;
|
|
|
import com.gz.rvo.system.AdminRVO;
|
|
import com.gz.rvo.system.AdminRVO;
|
|
|
import com.gz.service.system.AdminService;
|
|
import com.gz.service.system.AdminService;
|
|
|
import com.gz.vo.system.AdminVO;
|
|
import com.gz.vo.system.AdminVO;
|
|
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
-import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
|
@@ -25,23 +25,33 @@ public class AdminController {
|
|
|
@Resource
|
|
@Resource
|
|
|
private AdminService adminService;
|
|
private AdminService adminService;
|
|
|
|
|
|
|
|
- @PostMapping("insert")
|
|
|
|
|
|
|
+ @PostMapping("addOrUpdate")
|
|
|
@TraceLog(module = "管理员管理",business = "新增管理员")
|
|
@TraceLog(module = "管理员管理",business = "新增管理员")
|
|
|
- public Integer insert(@RequestBody AdminDTO adminDTO){
|
|
|
|
|
- return adminService.insert(adminDTO);
|
|
|
|
|
|
|
+ public Integer addOrUpdate(@RequestBody AdminDTO adminDTO){
|
|
|
|
|
+ if(StringUtils.isNotBlank(adminDTO.getId())){
|
|
|
|
|
+ return adminService.update(adminDTO);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ return adminService.insert(adminDTO);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// @PostMapping("insert")
|
|
|
|
|
+// @TraceLog(module = "管理员管理",business = "新增管理员")
|
|
|
|
|
+// public Integer insert(@RequestBody AdminDTO adminDTO){
|
|
|
|
|
+// return adminService.insert(adminDTO);
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
@DeleteMapping("delete")
|
|
@DeleteMapping("delete")
|
|
|
@TraceLog(module = "管理员管理",business = "删除管理员")
|
|
@TraceLog(module = "管理员管理",business = "删除管理员")
|
|
|
public Integer delete( Integer id){
|
|
public Integer delete( Integer id){
|
|
|
return adminService.delete(id);
|
|
return adminService.delete(id);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @PostMapping("update")
|
|
|
|
|
- @TraceLog(module = "管理员管理",business = "修改管理员")
|
|
|
|
|
- public Integer update(@RequestBody AdminDTO adminDTO){
|
|
|
|
|
- return adminService.update(adminDTO);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// @PostMapping("update")
|
|
|
|
|
+// @TraceLog(module = "管理员管理",business = "修改管理员")
|
|
|
|
|
+// public Integer update(@RequestBody AdminDTO adminDTO){
|
|
|
|
|
+// return adminService.update(adminDTO);
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
@GetMapping("select")
|
|
@GetMapping("select")
|
|
|
@TraceLog(module = "管理员管理",business = "查询管理员列表")
|
|
@TraceLog(module = "管理员管理",business = "查询管理员列表")
|