fix 管理员信息响应数据类型问题
This commit is contained in:
@@ -4,11 +4,15 @@ import com.cool.core.base.TenantEntity;
|
|||||||
import com.mybatisflex.annotation.Column;
|
import com.mybatisflex.annotation.Column;
|
||||||
import com.mybatisflex.annotation.Table;
|
import com.mybatisflex.annotation.Table;
|
||||||
import com.tangzc.mybatisflex.autotable.annotation.ColumnDefine;
|
import com.tangzc.mybatisflex.autotable.annotation.ColumnDefine;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
import org.dromara.autotable.annotation.Ignore;
|
||||||
import org.dromara.autotable.annotation.Index;
|
import org.dromara.autotable.annotation.Index;
|
||||||
import org.dromara.autotable.annotation.enums.IndexTypeEnum;
|
import org.dromara.autotable.annotation.enums.IndexTypeEnum;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@Table(value = "base_sys_user", comment = "系统用户表")
|
@Table(value = "base_sys_user", comment = "系统用户表")
|
||||||
@@ -58,4 +62,11 @@ public class BaseSysUserEntity extends TenantEntity<BaseSysUserEntity> {
|
|||||||
|
|
||||||
@ColumnDefine(comment = "socketId")
|
@ColumnDefine(comment = "socketId")
|
||||||
private String socketId;
|
private String socketId;
|
||||||
|
|
||||||
|
|
||||||
|
@Ignore
|
||||||
|
@Schema( description = "角色列表" )
|
||||||
|
private List<Long> roleIdList;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import org.dromara.autotable.core.constants.DatabaseDialect;
|
import org.dromara.autotable.core.constants.DatabaseDialect;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统用户
|
* 系统用户
|
||||||
*/
|
*/
|
||||||
@@ -171,13 +173,17 @@ public class BaseSysUserServiceImpl extends BaseServiceImpl<BaseSysUserMapper, B
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object info(Long id) {
|
public BaseSysUserEntity info(Long id) {
|
||||||
BaseSysUserEntity userEntity = getById(id);
|
BaseSysUserEntity userEntity = getById(id);
|
||||||
Long[] roleIdList = baseSysPermsService.getRoles(id);
|
Long[] roleIdList = baseSysPermsService.getRoles(id);
|
||||||
BaseSysDepartmentEntity departmentEntity = baseSysDepartmentMapper.selectOneById(
|
BaseSysDepartmentEntity departmentEntity = baseSysDepartmentMapper.selectOneById(
|
||||||
userEntity.getDepartmentId());
|
userEntity.getDepartmentId());
|
||||||
userEntity.setPassword(null);
|
userEntity.setPassword(null);
|
||||||
return Dict.parse(userEntity).set("roleIdList", roleIdList).set("departmentName",
|
|
||||||
departmentEntity != null ? departmentEntity.getName() : null);
|
|
||||||
|
userEntity.setRoleIdList(List.of(roleIdList));
|
||||||
|
userEntity.setDepartmentName(departmentEntity != null ? departmentEntity.getName() : userEntity.getDepartmentName() );
|
||||||
|
|
||||||
|
return userEntity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user