Add doc
This commit is contained in:
@@ -3,6 +3,12 @@ package top.fatweb.api.converter.permission
|
||||
import top.fatweb.api.entity.permission.Element
|
||||
import top.fatweb.api.vo.permission.ElementVo
|
||||
|
||||
/**
|
||||
* Element converter
|
||||
*
|
||||
* @author FatttSnake
|
||||
* @since 1.0.0
|
||||
*/
|
||||
object ElementConverter {
|
||||
fun elementToElementVo(element: Element) = ElementVo(
|
||||
id = element.id,
|
||||
|
||||
@@ -10,6 +10,12 @@ import top.fatweb.api.vo.PageVo
|
||||
import top.fatweb.api.vo.permission.GroupVo
|
||||
import top.fatweb.api.vo.permission.GroupWithRoleVo
|
||||
|
||||
/**
|
||||
* Group converter
|
||||
*
|
||||
* @author FatttSnake
|
||||
* @since 1.0.0
|
||||
*/
|
||||
object GroupConverter {
|
||||
fun groupToGroupVo(group: Group) = GroupVo(
|
||||
id = group.id,
|
||||
|
||||
@@ -3,6 +3,12 @@ package top.fatweb.api.converter.permission
|
||||
import top.fatweb.api.entity.permission.Menu
|
||||
import top.fatweb.api.vo.permission.MenuVo
|
||||
|
||||
/**
|
||||
* Menu converter
|
||||
*
|
||||
* @author FatttSnake
|
||||
* @since 1.0.0
|
||||
*/
|
||||
object MenuConverter {
|
||||
fun menuToMenuVo(menu: Menu) = MenuVo(
|
||||
id = menu.id,
|
||||
|
||||
@@ -3,6 +3,12 @@ package top.fatweb.api.converter.permission
|
||||
import top.fatweb.api.entity.permission.Module
|
||||
import top.fatweb.api.vo.permission.ModuleVo
|
||||
|
||||
/**
|
||||
* Module converter
|
||||
*
|
||||
* @author FatttSnake
|
||||
* @since 1.0.0
|
||||
*/
|
||||
object ModuleConverter {
|
||||
fun moduleToModuleVo(module: Module) = ModuleVo(
|
||||
id = module.id,
|
||||
|
||||
@@ -3,6 +3,12 @@ package top.fatweb.api.converter.permission
|
||||
import top.fatweb.api.entity.permission.Operation
|
||||
import top.fatweb.api.vo.permission.OperationVo
|
||||
|
||||
/**
|
||||
* Operation converter
|
||||
*
|
||||
* @author FatttSnake
|
||||
* @since 1.0.0
|
||||
*/
|
||||
object OperationConverter {
|
||||
fun operationToOperationVo(operation: Operation) = OperationVo(
|
||||
id = operation.id,
|
||||
|
||||
@@ -3,6 +3,12 @@ package top.fatweb.api.converter.permission
|
||||
import top.fatweb.api.entity.permission.PowerSet
|
||||
import top.fatweb.api.vo.permission.PowerSetVo
|
||||
|
||||
/**
|
||||
* Power converter
|
||||
*
|
||||
* @author FatttSnake
|
||||
* @since 1.0.0
|
||||
*/
|
||||
object PowerConverter {
|
||||
fun powerSetToPowerSetVo(powerSet: PowerSet) = PowerSetVo(
|
||||
moduleList = powerSet.moduleList?.map { ModuleConverter.moduleToModuleVo(it) },
|
||||
|
||||
@@ -10,6 +10,12 @@ import top.fatweb.api.vo.PageVo
|
||||
import top.fatweb.api.vo.permission.RoleVo
|
||||
import top.fatweb.api.vo.permission.RoleWithPowerVo
|
||||
|
||||
/**
|
||||
* Role converter
|
||||
*
|
||||
* @author FatttSnake
|
||||
* @since 1.0.0
|
||||
*/
|
||||
object RoleConverter {
|
||||
fun roleToRoleVo(role: Role) = RoleVo(
|
||||
id = role.id,
|
||||
|
||||
@@ -4,6 +4,12 @@ import top.fatweb.api.entity.permission.User
|
||||
import top.fatweb.api.param.authentication.LoginParam
|
||||
import top.fatweb.api.vo.permission.*
|
||||
|
||||
/**
|
||||
* User converter
|
||||
*
|
||||
* @author FatttSnake
|
||||
* @since 1.0.0
|
||||
*/
|
||||
object UserConverter {
|
||||
fun loginParamToUser(loginParam: LoginParam) = User().apply {
|
||||
username = loginParam.username
|
||||
|
||||
@@ -3,6 +3,12 @@ package top.fatweb.api.converter.permission
|
||||
import top.fatweb.api.entity.permission.UserInfo
|
||||
import top.fatweb.api.vo.permission.UserInfoVo
|
||||
|
||||
/**
|
||||
* User information converter
|
||||
*
|
||||
* @author FatttSnake
|
||||
* @since 1.0.0
|
||||
*/
|
||||
object UserInfoConverter {
|
||||
fun userInfoToUserInfoVo(userInfo: UserInfo) = UserInfoVo(
|
||||
id = userInfo.id,
|
||||
|
||||
@@ -3,16 +3,22 @@ package top.fatweb.api.converter.system
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage
|
||||
import top.fatweb.api.entity.system.SysLog
|
||||
import top.fatweb.api.vo.PageVo
|
||||
import top.fatweb.api.vo.system.SysLogGetVo
|
||||
import top.fatweb.api.vo.system.SysLogVo
|
||||
|
||||
/**
|
||||
* System log converter
|
||||
*
|
||||
* @author FatttSnake
|
||||
* @since 1.0.0
|
||||
*/
|
||||
object SysLogConverter {
|
||||
fun sysLogPageToSysLogPageVo(syslogPage: IPage<SysLog>): PageVo<SysLogGetVo> = PageVo(
|
||||
fun sysLogPageToSysLogPageVo(syslogPage: IPage<SysLog>): PageVo<SysLogVo> = PageVo(
|
||||
syslogPage.total,
|
||||
syslogPage.pages,
|
||||
syslogPage.size,
|
||||
syslogPage.current,
|
||||
syslogPage.records.map {
|
||||
SysLogGetVo(
|
||||
SysLogVo(
|
||||
id = it.id,
|
||||
logType = it.logType,
|
||||
operateUserId = it.operateUserId,
|
||||
|
||||
Reference in New Issue
Block a user