Parcourir la source

删除会员信息接口

小么熊🐻 il y a 3 ans
Parent
commit
8bfbc6d07c

+ 23 - 3
jsjp-admin/src/main/java/com/miaxis/app/controller/gzpt/GzptVideoVipController.java

@@ -1,25 +1,27 @@
 package com.miaxis.app.controller.gzpt;
 
 
+import com.miaxis.common.annotation.Log;
 import com.miaxis.common.constant.Constants;
 import com.miaxis.common.core.controller.BaseController;
 import com.miaxis.common.core.domain.Response;
+import com.miaxis.common.enums.BusinessTypeEnum;
 import com.miaxis.newgzpt.domain.GzptVideoVip;
 import com.miaxis.newgzpt.dto.GzptVideoVipDTO;
 import com.miaxis.newgzpt.service.IGzptVideoVipService;
 import com.miaxis.newgzpt.vo.GzptVideoVipVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.security.KeyFactory;
 import java.security.PrivateKey;
 import java.security.Signature;
 import java.security.spec.PKCS8EncodedKeySpec;
+import java.util.Arrays;
 import java.util.Base64;
 import java.util.Date;
 
@@ -71,6 +73,24 @@ public class GzptVideoVipController extends BaseController {
     }
 
 
+
+
+    /**
+     * 删除会员信息
+     */
+    @Log(title = "删除会员信息", businessType = BusinessTypeEnum.DELETE)
+    @DeleteMapping("/{userId}")
+    @ApiOperation("删除会员信息")
+    public Response<Integer> remove(
+            @ApiParam(name = "userId", value = "gzpt用户id", required = true)
+            @PathVariable Long userId
+    ) {
+        return Response.success(gzptVideoVipService.removeByUserId(userId));
+    }
+
+
+
+
     private String getSign(Long userId, Date subject2, Date subject3) throws Exception  {
         String str = userId+"";
        // System.out.println(userId);

+ 2 - 0
jsjp-service/src/main/java/com/miaxis/newgzpt/mapper/GzptVideoVipMapper.java

@@ -21,4 +21,6 @@ public interface GzptVideoVipMapper extends BaseMapper<GzptVideoVip> {
 
     GzptVideoVip getGzptVideoVipByUserId(GzptVideoVipDTO gzptVideoVipDTO);
 
+    int removeByUserId(Long userId);
+
 }

+ 2 - 0
jsjp-service/src/main/java/com/miaxis/newgzpt/service/IGzptVideoVipService.java

@@ -23,4 +23,6 @@ public interface IGzptVideoVipService extends IService<GzptVideoVip> {
     GzptVideoVip getGzptVideoVipByUserId(GzptVideoVipDTO gzptVideoVipDTO);
 
     GzptVideoVip getGzptVideoVipByUserIdForLocal(GzptVideoVipDTO gzptVideoVipDTO);
+
+    int removeByUserId(Long userId);
 }

+ 5 - 0
jsjp-service/src/main/java/com/miaxis/newgzpt/service/impl/GzptVideoVipServiceImpl.java

@@ -67,4 +67,9 @@ public class GzptVideoVipServiceImpl extends ServiceImpl<GzptVideoVipMapper, Gzp
         return mapper.getGzptVideoVipByUserId(gzptVideoVipDTO);
     }
 
+    @Override
+    public int removeByUserId(Long userId) {
+      return mapper.removeByUserId(userId);
+    }
+
 }

+ 3 - 1
jsjp-service/src/main/resources/mapper/newgzpt/GzptVideoVipMapper.xml

@@ -25,7 +25,9 @@
         </where>
     </select>
 
-
+    <delete id="removeByUserId" parameterType="long">
+        delete from GZPT_VIDEO_VIP where user_id = #{userId}
+    </delete>