Browse Source

用户使用联系卡

master
张彭杰 1 month ago
parent
commit
e395708a76
3 changed files with 28 additions and 2 deletions
  1. 7
      dating-agency-mall-server/src/main/java/com/qniao/dam/api/command/ccur/user/ContactCardUsageRecordUserCommandController.java
  2. 22
      dating-agency-mall-server/src/main/java/com/qniao/dam/api/command/ccur/user/request/UserUseContactCardDto.java
  3. 1
      dating-agency-mall-server/src/main/java/com/qniao/dam/application/service/pcur/ProfileCardUsageRecordApplicationService.java

7
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;
}

22
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<ContactCardUsageRecord> {
@ApiModelProperty("目标资料标识")
private Long targetMiId;
@Override
public ContactCardUsageRecord trans2Domain() {
return TypeConvertUtils.convert(this, ContactCardUsageRecord.class);
}
}

1
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()));

Loading…
Cancel
Save