Jelajahi Sumber

Merge remote-tracking branch 'origin/master'

hidewnd 2 bulan lalu
induk
melakukan
c9c3d47f9b

+ 2 - 0
yt-common/src/main/java/com/ytpm/app/param/DyzAdRecordParam.java

@@ -13,6 +13,8 @@ public class DyzAdRecordParam {
     private String recordId;
     @ApiModelProperty("用户ID")
     private String userId;
+    @ApiModelProperty("IosId")
+    private String iosId;
     @ApiModelProperty("用户昵称")
     private String nickName;
     @ApiModelProperty("广告位ID")

+ 2 - 2
yt-ios-lemon/lemon-ios-service/pom.xml

@@ -50,7 +50,7 @@
     </dependencies>
 
     <build>
-        <finalName>lemon-service</finalName>
+        <finalName>lemonios-service</finalName>
         <plugins>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
@@ -76,7 +76,7 @@
                 </executions>
                 <configuration>
                     <includeSystemScope>true</includeSystemScope>
-                    <mainClass>com.ytpm.lemon.LemonApplication</mainClass>
+                    <mainClass>com.ytpm.lemonios.LemoniosApplication</mainClass>
                 </configuration>
             </plugin>
         </plugins>

+ 1 - 1
yt-ios-lemon/lemon-ios-service/src/main/java/com/ytpm/lemonios/controller/WxController.java

@@ -132,7 +132,7 @@ public class WxController {
     }
 
     private IosUserInfo setIosUserInfo(IosLoginParam param){
-        IosUserInfo  userInfo = new IosUserInfo();
+        IosUserInfo userInfo = new IosUserInfo();
         userInfo.setOpenid(param.getIosId());
         userInfo.setHeadimgurl(param.getIconUrl());
         userInfo.setNickname(param.getAlias());

+ 5 - 0
yt-ios-lemon/lemon-ios-service/src/main/java/com/ytpm/lemonios/dao/AppUserMapper.java

@@ -28,6 +28,11 @@ public interface AppUserMapper {
      */
     YtDyzUser selectById(@Param("userId")String userId);
 
+    /**
+     * IOSId查询用户信息
+     */
+    YtDyzUser selectByIosId(@Param("iosId")String iosId);
+
     /**
      * openid查询用户信息
      */

+ 7 - 1
yt-ios-lemon/lemon-ios-service/src/main/java/com/ytpm/lemonios/service/impl/AdServiceImpl.java

@@ -55,7 +55,12 @@ public class AdServiceImpl implements AdService {
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Result<?> saveRecord(DyzAdRecordParam param) {
-        YtDyzUser user = appUserMapper.selectPrimaryKey(param.getUserId());
+        YtDyzUser user;
+        if (param.getUserId().isEmpty()) {
+            user = appUserMapper.selectByIosId((param.getIosId()));
+        } else {
+            user = appUserMapper.selectPrimaryKey(param.getUserId());
+        }
         if(Objects.isNull(user)){
             return Result.resultOk(RepMessage.SAVE_SUCCESS);
         }
@@ -282,6 +287,7 @@ public class AdServiceImpl implements AdService {
         }
         BeanUtils.copyProperties(param, adRecord);
         adRecord.setRecordId(IdUtil.fastSimpleUUID());
+        adRecord.setUserId(user.getUserId());
         adRecord.setNetworkName(AdPlatformTypeEnum.getDesc(Integer.parseInt(param.getNetworkFormId())));
         adRecordMapper.addOne(adRecord);
         //修改用户信息, 广告次数+1  总收益 + revenue

+ 7 - 7
yt-ios-lemon/lemon-ios-service/src/main/resources/bootstrap.yml

@@ -1,5 +1,5 @@
 server:
-  port: 24401
+  port: 25903
 yt:
   port: 8848
   local: 127.0.0.1
@@ -7,30 +7,30 @@ yt:
   prod_2: 119.45.117.147
 spring:
   profiles:
-    active: local
+    active: prod
 ---
 spring:
   profiles: local
   main:
     allow-bean-definition-overriding: true
   application:
-    name: lemon-service
+    name: lemonios-service
   cloud:
     nacos:
       discovery:
         server-addr: ${yt.local}:${yt.port}
-        namespace: 52439154-ea03-4121-9759-44d0cacc4765
+        namespace: 059740b0-1325-454c-8d86-5208d036caba
       config:
         server-addr: ${yt.local}:${yt.port}
         file-extension: yml
-        namespace: 52439154-ea03-4121-9759-44d0cacc4765
+        namespace: 059740b0-1325-454c-8d86-5208d036caba
 ---
 spring:
   profiles: dev
   main:
     allow-bean-definition-overriding: true
   application:
-    name: lemon-service
+    name: lemonios-service
   cloud:
     nacos:
       discovery:
@@ -45,7 +45,7 @@ spring:
 spring:
   profiles: prod
   application:
-    name: lemon-service
+    name: lemonios-service
   cloud:
     nacos:
       discovery:

+ 7 - 1
yt-ios-lemon/lemon-ios-service/src/main/resources/mapper/AppUserMapper.xml

@@ -248,6 +248,12 @@
         from yt_dyz_user
         where user_id = #{userId}
     </select>
+    <select id="selectByIosId" resultType="com.ytpm.app.model.YtDyzUser">
+        select
+            user_id, app_id,phone,device_id, ditch_id, nick_name,head_img, power, registry_time, last_login_time, last_login_ip, login_days, total_video, total_income, red_packet_balance, red_packet_amount, points_balance, points_total, withdraw_total, sign_days, user_status, risk_reason, wx_open_id, ios_id, platform_id
+        from yt_dyz_user
+        where ios_id = #{iosId}
+    </select>
     <select id="getYtAppUserForIos" resultType="com.ytpm.app.model.YtDyzUser">
         select
             user_id, app_id,phone,device_id, ditch_id, nick_name,head_img, power, registry_time, last_login_time, last_login_ip, login_days, total_video, total_income, red_packet_balance, red_packet_amount, points_balance, points_total, withdraw_total, sign_days, user_status, risk_reason, wx_open_id, ios_id, platform_id
@@ -454,7 +460,7 @@
     </select>
     <select id="getDefaultConfigByAppId" resultType="com.ytpm.app.view.WxDefaultConfig">
         select
-            config_id, config_name, open_id appId, secret, app_id platformAppId, app_key platformAppSecret, app_type,user_path,login_path,ad_path,answer_path,power_path
+            config_id, config_name, open_id, secret, app_id, app_key, app_type,user_path,login_path,ad_path,answer_path,power_path
              ,can_simulator,taku_app_id,taku_key,taku_banner_pid,taku_interstitial_pid,taku_reward_pid,taku_native_pid,can_use_adb,can_accumulation,can_use_float,can_use_root,ditch_id,power_wait_time,interstitial_interval_time
         from yt_app_default_config
         where app_id = #{appId}