kaiyu
2021-05-28 e6854d2d97f55827a04c28a1dbee62a27b64ffa6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package com.moral.api.pojo.vo.menu;
 
import com.moral.api.entity.Menu;
import com.moral.api.pojo.dto.menu.MenuDTO;
import com.moral.constant.ResponseCodeEnum;
 
/**
 * @ClassName MenuInsertVO
 * @Description TODO
 * @Author 陈凯裕
 * @Date 2021/4/26 11:40
 * @Version TODO
 **/
public class MenuInsertVO extends MenuVO {
 
    public static MenuInsertVO convert(MenuDTO dto) {
        if (dto.getCode() != ResponseCodeEnum.SUCCESS.getCode())
            return null;
        MenuInsertVO vo = new MenuInsertVO();
        Menu menu = dto.getMenu();
        vo.setId(menu.getId());
        vo.setParentId(menu.getParentId());
        vo.setName(menu.getName());
        return vo;
    }
}