| | |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import com.moral.api.entity.ManageAccount; |
| | | import com.moral.api.pojo.dto.account.AccountDeleteDTO; |
| | | import com.moral.constant.ResponseCodeEnum; |
| | | import lombok.Data; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | |
| | | |
| | | public class AccountDeleteVO extends AccountVO { |
| | | |
| | | /* |
| | | * 删除成功 |
| | | * */ |
| | | public final static String SUCCESS = "0"; |
| | | |
| | | /* |
| | | * 用户不存在 |
| | | * */ |
| | | public final static String ACCOUNT_NOT_EXIST = "-1"; |
| | | |
| | | public static AccountDeleteVO convert(AccountDeleteDTO dto) { |
| | | if (dto.getCode() != ResponseCodeEnum.SUCCESS.getCode()) |
| | | return null; |
| | | AccountDeleteVO vo = new AccountDeleteVO(); |
| | | vo.setCode(dto.getCode()); |
| | | if (!ObjectUtils.isEmpty(dto.getAccount())) { |
| | | ManageAccount account = dto.getAccount(); |
| | | vo.setId(account.getId()); |
| | | vo.setUserName(account.getUserName()); |
| | | } |
| | | ManageAccount account = dto.getAccount(); |
| | | vo.setId(account.getId()); |
| | | vo.setUserName(account.getUserName()); |
| | | return vo; |
| | | } |
| | | } |