diff --git a/dating-agency-mall-server/src/main/java/com/qniao/dam/api/command/ccur/user/ContactCardUsageRecordUserCommandController.java b/dating-agency-mall-server/src/main/java/com/qniao/dam/api/command/ccur/user/ContactCardUsageRecordUserCommandController.java index 3c0e016..b827697 100644 --- a/dating-agency-mall-server/src/main/java/com/qniao/dam/api/command/ccur/user/ContactCardUsageRecordUserCommandController.java +++ b/dating-agency-mall-server/src/main/java/com/qniao/dam/api/command/ccur/user/ContactCardUsageRecordUserCommandController.java @@ -1,8 +1,9 @@ package com.qniao.dam.api.command.ccur.user; +import com.qniao.dam.api.command.ccur.user.request.UserUseContactCardDto; import com.qniao.dam.api.command.ccur.user.response.UserUseContactCardVo; -import com.qniao.dam.api.command.pcur.user.request.UserUseProfileCardDto; import com.qniao.dam.application.service.ccur.ContactCardUsageRecordApplicationService; +import com.qniao.dam.domain.aggregate.ccur.vobj.ContactCardUsageRecord; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.*; @@ -18,9 +19,11 @@ public class ContactCardUsageRecordUserCommandController { @ApiOperation("用户使用联系卡") @PostMapping("use/contact-card") - public UserUseContactCardVo userUseContactCard(@RequestBody @Valid UserUseProfileCardDto dto, + public UserUseContactCardVo userUseContactCard(@RequestBody @Valid UserUseContactCardDto dto, @RequestParam("userId") Long userId) { + ContactCardUsageRecord usageRecord = dto.trans2Domain(); + usageRecord.setUserId(userId); return null; } diff --git a/dating-agency-mall-server/src/main/java/com/qniao/dam/api/command/ccur/user/request/UserUseContactCardDto.java b/dating-agency-mall-server/src/main/java/com/qniao/dam/api/command/ccur/user/request/UserUseContactCardDto.java new file mode 100644 index 0000000..a7807ac --- /dev/null +++ b/dating-agency-mall-server/src/main/java/com/qniao/dam/api/command/ccur/user/request/UserUseContactCardDto.java @@ -0,0 +1,22 @@ +package com.qniao.dam.api.command.ccur.user.request; + +import com.qniao.dam.domain.aggregate.ccur.vobj.ContactCardUsageRecord; +import com.qniao.dam.domain.aggregate.pcur.vobj.ProfileCardUsageRecord; +import com.qniao.domain.Trans2DomainAssembler; +import com.qniao.framework.utils.TypeConvertUtils; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +public class UserUseContactCardDto implements Trans2DomainAssembler { + + @ApiModelProperty("目标资料标识") + private Long targetMiId; + + @Override + public ContactCardUsageRecord trans2Domain() { + return TypeConvertUtils.convert(this, ContactCardUsageRecord.class); + } + +} + diff --git a/dating-agency-mall-server/src/main/java/com/qniao/dam/application/service/pcur/ProfileCardUsageRecordApplicationService.java b/dating-agency-mall-server/src/main/java/com/qniao/dam/application/service/pcur/ProfileCardUsageRecordApplicationService.java index e3c88d9..baddc26 100644 --- a/dating-agency-mall-server/src/main/java/com/qniao/dam/application/service/pcur/ProfileCardUsageRecordApplicationService.java +++ b/dating-agency-mall-server/src/main/java/com/qniao/dam/application/service/pcur/ProfileCardUsageRecordApplicationService.java @@ -36,6 +36,7 @@ public class ProfileCardUsageRecordApplicationService { if (usageFreeCount < 3) { ProfileCardUsageRecord record = ProfileCardUsageRecord.build(usageRecord.getUserId(), usageRecord.getTargetMiId(), CardUsageTyepEnum.FREE); profileCardUsageRecordDao.insert(record); + vo.setSuccess(true); } else { MarriageInformation marriageInformation = marriageInformationQueryService.queryByUserId(usageRecord.getUserId()); vo.setRealNameAuthenticated(StrUtil.isNotBlank(marriageInformation.getIdentityCard()));