Переглянути джерело

fix 大学生认证额度开关

zoujiajian 1 місяць тому
батько
коміт
985b3b5a01

+ 5 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/UserActivity.java

@@ -50,6 +50,11 @@ public class UserActivity extends BaseEntity {
 	@TableField(updateStrategy = FieldStrategy.IGNORED)
 	private String couponIds;
 
+	/**
+	 * 是否发放API站额度券
+	 */
+	private Boolean apiQuotaCouponEnabled;
+
 	/**
 	 * 图片
 	 */

+ 6 - 0
netflix-dao/src/main/java/com/cyksj/model/views/UserActivityView.java

@@ -50,6 +50,12 @@ public class UserActivityView {
 	@DbField("ua.coupon_ids")
 	private String couponIds;
 
+	/**
+	 * 是否发放API站额度券
+	 */
+	@DbField("ua.api_quota_coupon_enabled")
+	private Boolean apiQuotaCouponEnabled;
+
 	@DbField("ua.img")
 	private String img;
 

+ 7 - 5
netflix-service/src/main/java/com/cyksj/service/user/impl/UserActivityServiceImpl.java

@@ -61,11 +61,13 @@ public class UserActivityServiceImpl extends ServiceImpl<UserActivityMapper, Use
 			}
 		}
 		ReceiveGptActivityTicketResp apiQuotaTicketResp = null;
-		try {
-			apiQuotaTicketResp = groupRelationFrontService.receiveStudentCertGptApiQuotaTicket(sendUserId);
-			log.info("uid:{}大学生认证成功,发放API站额度券:{}", sendUserId, apiQuotaTicketResp.getRedeemCode());
-		} catch (Exception e) {
-			log.error("uid:{}大学生认证发放API站额度券失败", sendUserId, e);
+		if (Boolean.TRUE.equals(activity.getApiQuotaCouponEnabled())) {
+			try {
+				apiQuotaTicketResp = groupRelationFrontService.receiveStudentCertGptApiQuotaTicket(sendUserId);
+				log.info("uid:{}大学生认证成功,发放API站额度券:{}", sendUserId, apiQuotaTicketResp.getRedeemCode());
+			} catch (Exception e) {
+				log.error("uid:{}大学生认证发放API站额度券失败", sendUserId, e);
+			}
 		}
 		try {
 			UserStudentCertRecord record = new UserStudentCertRecord();