Search in sources :

Example 1 with InformationObject

use of com.ganster.cms.admin.dto.InformationObject in project Ganster-CMS by Gangster-trio.

the class InformationController method findInformation.

@GetMapping("/{UserId}")
public Message findInformation(@PathVariable("UserId") Integer userId) {
    Message message = new Message();
    InformationObject informationObject = new InformationObject();
    User user = userService.selectByPrimaryKey(userId);
    informationObject.setUserName(user.getUserName());
    informationObject.setUserPhone(user.getUserPhone());
    informationObject.setUserEmail(user.getUserEmail());
    informationObject.setUserStatus(user.getUserStatus());
    informationObject.setUserCreateTime(user.getUserCreateTime());
    informationObject.setUserOrg(user.getUserOrg());
    List<String> groupName = groupService.selectByUserId(userId).stream().map(group -> "<input type='text' disabled='disabled' value='" + group.getGroupName() + "'" + "class='layui-input'" + "/>").collect(Collectors.toList());
    informationObject.setUserGroup(groupName);
    message.setData(informationObject);
    return message;
}
Also used : Logger(org.slf4j.Logger) LoggerFactory(org.slf4j.LoggerFactory) Autowired(org.springframework.beans.factory.annotation.Autowired) Message(com.ganster.cms.admin.dto.Message) Collectors(java.util.stream.Collectors) UserService(com.ganster.cms.core.service.UserService) ArrayList(java.util.ArrayList) List(java.util.List) InformationObject(com.ganster.cms.admin.dto.InformationObject) org.springframework.web.bind.annotation(org.springframework.web.bind.annotation) User(com.ganster.cms.core.pojo.User) Group(com.ganster.cms.core.pojo.Group) GroupService(com.ganster.cms.core.service.GroupService) SecurityUtils(org.apache.shiro.SecurityUtils) User(com.ganster.cms.core.pojo.User) Message(com.ganster.cms.admin.dto.Message) InformationObject(com.ganster.cms.admin.dto.InformationObject)

Aggregations

InformationObject (com.ganster.cms.admin.dto.InformationObject)1 Message (com.ganster.cms.admin.dto.Message)1 Group (com.ganster.cms.core.pojo.Group)1 User (com.ganster.cms.core.pojo.User)1 GroupService (com.ganster.cms.core.service.GroupService)1 UserService (com.ganster.cms.core.service.UserService)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 SecurityUtils (org.apache.shiro.SecurityUtils)1 Logger (org.slf4j.Logger)1 LoggerFactory (org.slf4j.LoggerFactory)1 Autowired (org.springframework.beans.factory.annotation.Autowired)1 org.springframework.web.bind.annotation (org.springframework.web.bind.annotation)1