Qi-API 开发者文档 Qi-API 开发者文档
首页
  • 简 介
  • 安 装
  • 快速开始
  • 返回响应码
  • API接口

    • 随机毒鸡汤
    • 获取IP信息归属地
    • 随机土味情话
    • 每日星座运势
    • 获取天气信息
    • 随机壁纸
  • 使用配置
赞助
Demo (opens new window)
GitHub (opens new window)
首页
  • 简 介
  • 安 装
  • 快速开始
  • 返回响应码
  • API接口

    • 随机毒鸡汤
    • 获取IP信息归属地
    • 随机土味情话
    • 每日星座运势
    • 获取天气信息
    • 随机壁纸
  • 使用配置
赞助
Demo (opens new window)
GitHub (opens new window)
  • 指南

    • 简 介
    • 安 装
    • 快速开始
    • 返回响应码
  • API接口

    • 随机毒鸡汤
    • 获取IP信息归属地
    • 随机土味情话
    • 每日星座运势
    • 获取天气信息
    • 随机壁纸
    目录

    随机壁纸

    # 接口信息

    • 接口状态 : 正常
    • 请求方式 :GET
    • 返回格式 :JSON
    • 扣除积分数 :1

    # 请求地址

    https://gateway.qimuu.icu/api/randomWallpaper
    
    1

    # 请求参数

    参数名 必选 类型 描述
    method 否 string 输出壁纸端mobile、pc、zsy默认为pc
    lx 否 string 输出分类meizi、dongman、fengjing、suiji,为空随机输出

    # 响应参数

    参数名称 类型 描述
    code int 响应码
    data.imgurl string 随机图片地址url
    message string 响应描述

    # 代码示例

    注意 🔔️

    没有开发者调用凭证无法调用接口哦!!! 前往获取开发者凭证 (opens new window)

    注入Service

    @Resource
    private ApiService apiService;
    
    1
    2
    • 示例一 :推荐👍

    通过yml配置开发者调用凭证

    @GetMapping("/randomWallpaper")
    public ResultResponse getRandomWallpaper(RandomWallpaperParams randomWallpaperParams) {
        ResultResponse resultResponse;
        try {
            RandomWallpaperRequest randomWallpaperRequest = new RandomWallpaperRequest();
            randomWallpaperRequest.setRequestParams(randomWallpaperParams);
            resultResponse = apiService.getRandomWallpaper(randomWallpaperRequest);
        } catch (ApiException e) {
            throw new BusinessException(e.getCode(), e.getMessage());
        }
        return resultResponse;
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    响应示例:

    {
      "imgurl": "https://img.btstu.cn/api/images/5b16259a96cbc.jpg"
    }
    
    1
    2
    3
    • 示例二:推荐👍

    搭配EasyWeb (opens new window)快速开发Web项目

    @GetMapping("/randomWallpaper/easyWeb")
    public BaseResponse<ResultResponse> getRandomWallpaperEasyWeb(RandomWallpaperParams randomWallpaperParams) {
        ResultResponse resultResponse;
        try {
            RandomWallpaperRequest randomWallpaperRequest = new RandomWallpaperRequest();
            randomWallpaperRequest.setRequestParams(randomWallpaperParams);
            resultResponse = apiService.getRandomWallpaper(randomWallpaperRequest);
        } catch (ApiException e) {
            throw new BusinessException(e.getCode(), e.getMessage());
        }
        return ResultUtils.success(resultResponse);
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    响应示例:

    {
      "code": 0,
      "data": {
        "imgurl": "https://img.btstu.cn/api/images/5b35a4886fd85.jpg"
      },
      "message": "ok"
    }
    
    1
    2
    3
    4
    5
    6
    7
    • 示例三:
    @GetMapping("/randomWallpaper/setKey")
    public ResultResponse getRandomWallpaperSetKey(RandomWallpaperParams randomWallpaperParams) {
        ResultResponse resultResponse;
        QiApiClient qiApiClient = new QiApiClient("7052a8594339a519e0ba5eb04a267a60", "d8d6df60ab209385a09ac796f1dfe3e1");
        try {
            RandomWallpaperRequest randomWallpaperRequest = new RandomWallpaperRequest();
            randomWallpaperRequest.setRequestParams(randomWallpaperParams);
            resultResponse = apiService.getRandomWallpaper(qiApiClient, randomWallpaperRequest);
        } catch (ApiException e) {
            throw new BusinessException(e.getCode(), e.getMessage());
        }
        return resultResponse;
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13

    # 更多示例详见:Qi-API-SDK-Demo 示例项目 (opens new window)

    帮助我们改善此页面! (opens new window)
    上次更新: 2023/09/23, 16:56:48
    获取天气信息

    ← 获取天气信息

    Theme by Vdoing | Copyright © 2023-2024 Qi Mu | 豫ICP备2023004098号-1
    • 跟随系统
    • 浅色模式
    • 深色模式
    • 阅读模式