feat: 数据字典相关接口提交

This commit is contained in:
2025-12-01 21:05:19 +08:00
parent 991f6850c7
commit f56b903bcc
33 changed files with 391 additions and 508 deletions

View File

@ -1,18 +1,7 @@
package day.gitlab.dolphin.rbac.controller;
import com.mybatisflex.core.paginate.Page;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.beans.factory.annotation.Autowired;
import day.gitlab.dolphin.rbac.entity.Department;
import day.gitlab.dolphin.rbac.service.DepartmentService;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 部门表 控制层。
@ -23,73 +12,4 @@ import java.util.List;
@RestController
@RequestMapping("/department")
public class DepartmentController {
@Autowired
private DepartmentService departmentService;
/**
* 保存部门表。
*
* @param department 部门表
* @return {@code true} 保存成功,{@code false} 保存失败
*/
@PostMapping("save")
public boolean save(@RequestBody Department department) {
return departmentService.save(department);
}
/**
* 根据主键删除部门表。
*
* @param id 主键
* @return {@code true} 删除成功,{@code false} 删除失败
*/
@DeleteMapping("remove/{id}")
public boolean remove(@PathVariable String id) {
return departmentService.removeById(id);
}
/**
* 根据主键更新部门表。
*
* @param department 部门表
* @return {@code true} 更新成功,{@code false} 更新失败
*/
@PutMapping("update")
public boolean update(@RequestBody Department department) {
return departmentService.updateById(department);
}
/**
* 查询所有部门表。
*
* @return 所有数据
*/
@GetMapping("list")
public List<Department> list() {
return departmentService.list();
}
/**
* 根据主键获取部门表。
*
* @param id 部门表主键
* @return 部门表详情
*/
@GetMapping("getInfo/{id}")
public Department getInfo(@PathVariable String id) {
return departmentService.getById(id);
}
/**
* 分页查询部门表。
*
* @param page 分页对象
* @return 分页对象
*/
@GetMapping("page")
public Page<Department> page(Page<Department> page) {
return departmentService.page(page);
}
}

View File

@ -23,73 +23,4 @@ import java.util.List;
@RestController
@RequestMapping("/region")
public class RegionController {
@Autowired
private RegionService regionService;
/**
* 保存区划项。
*
* @param region 区划项
* @return {@code true} 保存成功,{@code false} 保存失败
*/
@PostMapping("save")
public boolean save(@RequestBody Region region) {
return regionService.save(region);
}
/**
* 根据主键删除区划项。
*
* @param id 主键
* @return {@code true} 删除成功,{@code false} 删除失败
*/
@DeleteMapping("remove/{id}")
public boolean remove(@PathVariable String id) {
return regionService.removeById(id);
}
/**
* 根据主键更新区划项。
*
* @param region 区划项
* @return {@code true} 更新成功,{@code false} 更新失败
*/
@PutMapping("update")
public boolean update(@RequestBody Region region) {
return regionService.updateById(region);
}
/**
* 查询所有区划项。
*
* @return 所有数据
*/
@GetMapping("list")
public List<Region> list() {
return regionService.list();
}
/**
* 根据主键获取区划项。
*
* @param id 区划项主键
* @return 区划项详情
*/
@GetMapping("getInfo/{id}")
public Region getInfo(@PathVariable String id) {
return regionService.getById(id);
}
/**
* 分页查询区划项。
*
* @param page 分页对象
* @return 分页对象
*/
@GetMapping("page")
public Page<Region> page(Page<Region> page) {
return regionService.page(page);
}
}

View File

@ -1,18 +1,7 @@
package day.gitlab.dolphin.rbac.controller;
import com.mybatisflex.core.paginate.Page;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.beans.factory.annotation.Autowired;
import day.gitlab.dolphin.rbac.entity.Role;
import day.gitlab.dolphin.rbac.service.RoleService;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 角色表 控制层。
@ -23,73 +12,4 @@ import java.util.List;
@RestController
@RequestMapping("/role")
public class RoleController {
@Autowired
private RoleService roleService;
/**
* 保存角色表。
*
* @param role 角色表
* @return {@code true} 保存成功,{@code false} 保存失败
*/
@PostMapping("save")
public boolean save(@RequestBody Role role) {
return roleService.save(role);
}
/**
* 根据主键删除角色表。
*
* @param id 主键
* @return {@code true} 删除成功,{@code false} 删除失败
*/
@DeleteMapping("remove/{id}")
public boolean remove(@PathVariable String id) {
return roleService.removeById(id);
}
/**
* 根据主键更新角色表。
*
* @param role 角色表
* @return {@code true} 更新成功,{@code false} 更新失败
*/
@PutMapping("update")
public boolean update(@RequestBody Role role) {
return roleService.updateById(role);
}
/**
* 查询所有角色表。
*
* @return 所有数据
*/
@GetMapping("list")
public List<Role> list() {
return roleService.list();
}
/**
* 根据主键获取角色表。
*
* @param id 角色表主键
* @return 角色表详情
*/
@GetMapping("getInfo/{id}")
public Role getInfo(@PathVariable String id) {
return roleService.getById(id);
}
/**
* 分页查询角色表。
*
* @param page 分页对象
* @return 分页对象
*/
@GetMapping("page")
public Page<Role> page(Page<Role> page) {
return roleService.page(page);
}
}

View File

@ -1,18 +1,7 @@
package day.gitlab.dolphin.rbac.controller;
import com.mybatisflex.core.paginate.Page;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.beans.factory.annotation.Autowired;
import day.gitlab.dolphin.rbac.entity.User;
import day.gitlab.dolphin.rbac.service.UserService;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 用户表 控制层。
@ -23,73 +12,4 @@ import java.util.List;
@RestController
@RequestMapping("/user")
public class UserController {
@Autowired
private UserService userService;
/**
* 保存用户表。
*
* @param user 用户表
* @return {@code true} 保存成功,{@code false} 保存失败
*/
@PostMapping("save")
public boolean save(@RequestBody User user) {
return userService.save(user);
}
/**
* 根据主键删除用户表。
*
* @param id 主键
* @return {@code true} 删除成功,{@code false} 删除失败
*/
@DeleteMapping("remove/{id}")
public boolean remove(@PathVariable String id) {
return userService.removeById(id);
}
/**
* 根据主键更新用户表。
*
* @param user 用户表
* @return {@code true} 更新成功,{@code false} 更新失败
*/
@PutMapping("update")
public boolean update(@RequestBody User user) {
return userService.updateById(user);
}
/**
* 查询所有用户表。
*
* @return 所有数据
*/
@GetMapping("list")
public List<User> list() {
return userService.list();
}
/**
* 根据主键获取用户表。
*
* @param id 用户表主键
* @return 用户表详情
*/
@GetMapping("getInfo/{id}")
public User getInfo(@PathVariable String id) {
return userService.getById(id);
}
/**
* 分页查询用户表。
*
* @param page 分页对象
* @return 分页对象
*/
@GetMapping("page")
public Page<User> page(Page<User> page) {
return userService.page(page);
}
}

View File

@ -1,14 +1,11 @@
package day.gitlab.dolphin.rbac.service;
import com.mybatisflex.core.service.IService;
import day.gitlab.dolphin.rbac.entity.Department;
/**
* 部门表 服务层。
*
* @author jiangyc
* @since 2025-11-28
*/
public interface DepartmentService extends IService<Department> {
public interface DepartmentService {
}

View File

@ -1,14 +1,11 @@
package day.gitlab.dolphin.rbac.service;
import com.mybatisflex.core.service.IService;
import day.gitlab.dolphin.rbac.entity.Region;
/**
* 区划项 服务层。
*
* @author jiangyc
* @since 2025-11-28
*/
public interface RegionService extends IService<Region> {
public interface RegionService {
}

View File

@ -1,14 +1,11 @@
package day.gitlab.dolphin.rbac.service;
import com.mybatisflex.core.service.IService;
import day.gitlab.dolphin.rbac.entity.Role;
/**
* 角色表 服务层。
*
* @author jiangyc
* @since 2025-11-28
*/
public interface RoleService extends IService<Role> {
public interface RoleService {
}

View File

@ -1,14 +1,11 @@
package day.gitlab.dolphin.rbac.service;
import com.mybatisflex.core.service.IService;
import day.gitlab.dolphin.rbac.entity.User;
/**
* 用户表 服务层。
*
* @author jiangyc
* @since 2025-11-28
*/
public interface UserService extends IService<User> {
public interface UserService {
}

View File

@ -1,8 +1,5 @@
package day.gitlab.dolphin.rbac.service.impl;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import day.gitlab.dolphin.rbac.entity.Department;
import day.gitlab.dolphin.rbac.mapper.DepartmentMapper;
import day.gitlab.dolphin.rbac.service.DepartmentService;
import org.springframework.stereotype.Service;
@ -13,6 +10,6 @@ import org.springframework.stereotype.Service;
* @since 2025-11-28
*/
@Service
public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Department> implements DepartmentService{
public class DepartmentServiceImpl implements DepartmentService {
}

View File

@ -1,8 +1,5 @@
package day.gitlab.dolphin.rbac.service.impl;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import day.gitlab.dolphin.rbac.entity.Region;
import day.gitlab.dolphin.rbac.mapper.RegionMapper;
import day.gitlab.dolphin.rbac.service.RegionService;
import org.springframework.stereotype.Service;
@ -13,6 +10,6 @@ import org.springframework.stereotype.Service;
* @since 2025-11-28
*/
@Service
public class RegionServiceImpl extends ServiceImpl<RegionMapper, Region> implements RegionService{
public class RegionServiceImpl implements RegionService {
}

View File

@ -1,8 +1,5 @@
package day.gitlab.dolphin.rbac.service.impl;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import day.gitlab.dolphin.rbac.entity.Role;
import day.gitlab.dolphin.rbac.mapper.RoleMapper;
import day.gitlab.dolphin.rbac.service.RoleService;
import org.springframework.stereotype.Service;
@ -13,6 +10,6 @@ import org.springframework.stereotype.Service;
* @since 2025-11-28
*/
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements RoleService{
public class RoleServiceImpl implements RoleService {
}

View File

@ -1,8 +1,5 @@
package day.gitlab.dolphin.rbac.service.impl;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import day.gitlab.dolphin.rbac.entity.User;
import day.gitlab.dolphin.rbac.mapper.UserMapper;
import day.gitlab.dolphin.rbac.service.UserService;
import org.springframework.stereotype.Service;
@ -13,6 +10,6 @@ import org.springframework.stereotype.Service;
* @since 2025-11-28
*/
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService{
public class UserServiceImpl implements UserService {
}