|
|
@@ -4,6 +4,7 @@ import com.github.microservice.auth.client.content.ResultState;
|
|
|
import com.github.microservice.auth.client.service.UserService;
|
|
|
import com.zhongshu.card.client.model.school.CardInfoModel;
|
|
|
import com.zhongshu.card.client.model.school.CardInfoParam;
|
|
|
+import com.zhongshu.card.client.model.school.CardInfoSimpleModel;
|
|
|
import com.zhongshu.card.client.model.school.CardLossParam;
|
|
|
import com.zhongshu.card.client.ret.ResultContent;
|
|
|
import com.zhongshu.card.client.ret.ResultMessage;
|
|
|
@@ -338,13 +339,13 @@ public class CardInfoServiceImpl extends SuperService implements CardInfoService
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public ResultContent<CardInfoModel> getCardDetailByCode(String code) {
|
|
|
+ public ResultContent<CardInfoSimpleModel> getCardDetailByCode(String code) {
|
|
|
Assert.hasText(code, "code不能为空");
|
|
|
CardInfo cardInfo = cardInfoDao.findByCode(code);
|
|
|
if (ObjectUtils.isEmpty(cardInfo)) {
|
|
|
return ResultContent.buildFail(String.format(ResultMessage.DATA_NOT_EXIST, code));
|
|
|
}
|
|
|
- CardInfoModel model = toModel(cardInfo);
|
|
|
+ CardInfoSimpleModel model = toSimpleModel(cardInfo);
|
|
|
return ResultContent.buildSuccess(model);
|
|
|
}
|
|
|
|
|
|
@@ -356,4 +357,14 @@ public class CardInfoServiceImpl extends SuperService implements CardInfoService
|
|
|
}
|
|
|
return model;
|
|
|
}
|
|
|
+
|
|
|
+ public CardInfoSimpleModel toSimpleModel(CardInfo entity) {
|
|
|
+ CardInfoSimpleModel model = null;
|
|
|
+ if (ObjectUtils.isNotEmpty(entity)) {
|
|
|
+ model = new CardInfoSimpleModel();
|
|
|
+ BeanUtils.copyProperties(entity, model);
|
|
|
+ }
|
|
|
+ return model;
|
|
|
+ }
|
|
|
+
|
|
|
}
|