Эх сурвалжийг харах

feat:后端项目,在业务模块中实现内部使用获取用户关联对应接口信息的接口;实现获取用户关联接口信息的方法;实现接口调用次数+1的接口;编写SQL;

yang yi 9 сар өмнө
parent
commit
b71126cecb

+ 1 - 0
src/main/java/space/anyi/openAPI/mapper/UserInterfaceInfoMapper.java

@@ -11,6 +11,7 @@ import space.anyi.openAPI.comom.model.userInterfaceInfo.UserInterfaceInfo;
 */
 public interface UserInterfaceInfoMapper extends BaseMapper<UserInterfaceInfo> {
 
+    int invokeSuccess(Long id);
 }
 
 

+ 34 - 0
src/main/java/space/anyi/openAPI/service/impl/inside/InsideUserInterfaceInfoServiceImpl.java

@@ -0,0 +1,34 @@
+package space.anyi.openAPI.service.impl.inside;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import org.apache.dubbo.config.annotation.DubboService;
+import space.anyi.openAPI.comom.model.userInterfaceInfo.UserInterfaceInfo;
+import space.anyi.openAPI.comom.service.inside.InsideUserInterfaceInfoService;
+import space.anyi.openAPI.mapper.UserInterfaceInfoMapper;
+
+/**
+ * @ProjectName: yangyi-open-api-platform
+ * @FileName: InsideUserInterfaceInfoServiceImpl
+ * @Author: 杨逸
+ * @Data:2025/12/3 20:04
+ * @Description:
+ */
+@DubboService(registry = "nacos-registry")
+public class InsideUserInterfaceInfoServiceImpl implements InsideUserInterfaceInfoService {
+    private final UserInterfaceInfoMapper userInterfaceInfoMapper;
+
+    @Override
+    public boolean invokeSuccess(Long id) {
+        int count  = userInterfaceInfoMapper.invokeSuccess(id);
+        return false;
+    }
+
+    public InsideUserInterfaceInfoServiceImpl(UserInterfaceInfoMapper userInterfaceInfoMapper) {
+        this.userInterfaceInfoMapper = userInterfaceInfoMapper;
+    }
+
+    @Override
+    public UserInterfaceInfo getUserInterfaceInfoByUserIdAndInterfaceInfoId(Long userId, Long interfaceInfoId) {
+        return userInterfaceInfoMapper.selectOne(new LambdaQueryWrapper<UserInterfaceInfo>().eq(UserInterfaceInfo::getUserId, userId).eq(UserInterfaceInfo::getInterfaceInfoId, interfaceInfoId));
+    }
+}

+ 5 - 0
src/main/resources/mapper/UserInterfaceInfoMapper.xml

@@ -21,4 +21,9 @@
         total_num,left_num,status,
         create_time,update_time,delete_flag
     </sql>
+    <update id="invokeSuccess">
+        update user_interface_info
+        set left_num = left_num - 1,total_num = total_num + 1
+        where id = #{id}
+    </update>
 </mapper>