Browse Source

清除学员激活状态与会员信息接口(测试专用)

小么熊🐻 2 years ago
parent
commit
67403d54e1

+ 19 - 0
jsjp-admin/src/main/java/com/miaxis/app/controller/gzpt/GzptUserInfoController.java

@@ -19,6 +19,8 @@ import com.miaxis.newgzpt.service.IGzptSchPayLogService;
 import com.miaxis.newgzpt.service.IGzptUserInfoService;
 import com.miaxis.newgzpt.vo.GzptSchActivationVO;
 import com.miaxis.newgzpt.vo.GzptVideoVipVO;
+import com.miaxis.userInfo.domain.UserVip;
+import com.miaxis.userInfo.service.IUserVipService;
 import com.miaxis.wx.domain.WxJsOrder;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -53,6 +55,9 @@ public class GzptUserInfoController extends BaseController {
     @Autowired
     private IGzptSchActivationService schActivationService;
 
+    @Autowired
+    private IUserVipService userVipService;
+
     /**
      * 获取用户id获取详细信息
      */
@@ -87,6 +92,20 @@ public class GzptUserInfoController extends BaseController {
 
     }
 
+    /**
+     * 清除学员激活状态与会员信息接口(测试专用)
+     */
+    @GetMapping("/activa")
+    @ApiOperation("清除学员激活状态与会员信息接口(测试专用)")
+    public Response clearUserVip(GzptVideoVipDTO gzptVideoVipDTO) throws Exception {
+        GzptUserInfo gzptUserInfo = userInfoService.getInfoById(gzptVideoVipDTO.getUserId());
+        //清除会员信息
+        userVipService.removeByUserId(gzptVideoVipDTO.getUserId());
+        //清除激活信息
+        schActivationService.delSchActivationByStuId(gzptUserInfo.getOutId());
+        return Response.success();
+
+    }
 
     /**
      * 绑定学员账号

+ 0 - 1
jsjp-service/src/main/java/com/miaxis/userInfo/mapper/UserVipMapper.java

@@ -3,7 +3,6 @@ package com.miaxis.userInfo.mapper;
 import java.util.List;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.miaxis.userInfo.domain.UserVip;
-import com.miaxis.userInfo.dto.UserVipDTO;
 
 /**
  * 会员信息Mapper接口

+ 0 - 1
jsjp-service/src/main/java/com/miaxis/userInfo/service/IUserVipService.java

@@ -20,7 +20,6 @@ public interface IUserVipService extends IService<UserVip> {
      */
     public List<UserVip> selectUserVipList(UserVip userVip);
 
-
     public UserVip getUserVipByUserId(Long userId);
 
     public int removeByUserId(Long userId);

+ 1 - 1
jsjp-service/src/main/java/com/miaxis/userInfo/service/impl/UserVipServiceImpl.java

@@ -39,7 +39,7 @@ public class UserVipServiceImpl extends ServiceImpl<UserVipMapper, UserVip> impl
 
     @Override
     public int removeByUserId(Long userId) {
-        return userVipMapper.removeByUserId(userId);
+        return userVipMapper.deleteById(userId);
     }
 
 }

+ 5 - 3
jsjp-service/src/main/resources/mapper/newgzpt/GzptUserInfoMapper.xml

@@ -20,6 +20,10 @@
     </select>
 
 
+    <delete id="removeVipByUserId" parameterType="long">
+        delete from user_vip where user_id = #{userId}
+    </delete>
+
     <select id="getGzptVideoVipByUserId" resultType="com.miaxis.newgzpt.domain.GzptVideoVip" parameterType="com.miaxis.userInfo.dto.UserVipDTO">
         select * from GZPT_VIDEO_VIP
         <where>
@@ -36,8 +40,6 @@
     </select>
 
 
-    <delete id="removeByUserId" parameterType="long">
-        delete from user_vip where user_id = #{userId}
-    </delete>
+
 
 </mapper>

+ 0 - 3
jsjp-service/src/main/resources/mapper/userInfo/UserVipMapper.xml

@@ -32,9 +32,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
     </select>
 
-    <delete id="removeByUserId" parameterType="long">
-        delete from user_vip where user_id = #{userId}
-    </delete>
 
 
     <select id="getUserVipByUserId" resultType="com.miaxis.userInfo.domain.UserVip" parameterType="com.miaxis.userInfo.dto.UserVipDTO">