Browse Source

提交接口类

alexzy 4 years ago
commit
3d1a735385
6 changed files with 108 additions and 0 deletions
  1. 4 0
      .gitignore
  2. 19 0
      composer.json
  3. 20 0
      composer.lock
  4. 24 0
      src/AliOssServiceInterface.php
  5. 24 0
      src/GameDownServiceInterface.php
  6. 17 0
      src/PromoteApplyServiceInterface.php

+ 4 - 0
.gitignore

@@ -0,0 +1,4 @@
+.idea/
+.git/
+
+vendor/

+ 19 - 0
composer.json

@@ -0,0 +1,19 @@
+{
+    "name": "yxy/service",
+    "description": "游戏友微服务接口",
+    "type": "library",
+    "authors": [
+        {
+            "name": "alexzy",
+            "email": "1003057931@qq.com"
+        }
+    ],
+    "require": {
+        "php": ">=7.4"
+    },
+    "autoload": {
+        "psr-4": {
+            "Yxy\\Service\\": "src/"
+        }
+    }
+}

+ 20 - 0
composer.lock

@@ -0,0 +1,20 @@
+{
+    "_readme": [
+        "This file locks the dependencies of your project to a known state",
+        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
+        "This file is @generated automatically"
+    ],
+    "content-hash": "96fb5222e1e719dfab59c3096295ad28",
+    "packages": [],
+    "packages-dev": [],
+    "aliases": [],
+    "minimum-stability": "stable",
+    "stability-flags": [],
+    "prefer-stable": false,
+    "prefer-lowest": false,
+    "platform": {
+        "php": ">=7.4"
+    },
+    "platform-dev": [],
+    "plugin-api-version": "2.0.0"
+}

+ 24 - 0
src/AliOssServiceInterface.php

@@ -0,0 +1,24 @@
+<?php
+
+
+namespace Yxy\Service;
+
+
+interface AliOssServiceInterface
+{
+    /**
+     * 创建oss软连接
+     * @param string $object
+     * @param string $link
+     * @return mixed
+     */
+    public function putSymlink(string $object, string $link);
+
+    /**
+     * 创建有效期链接
+     * @param string $object
+     * @param int $time_out
+     * @return mixed
+     */
+    public function makeSignUrl(string $object, int $time_out = 20);
+}

+ 24 - 0
src/GameDownServiceInterface.php

@@ -0,0 +1,24 @@
+<?php
+
+
+namespace Yxy\Service;
+
+
+interface GameDownServiceInterface
+{
+    /**
+     * 获取游戏下载token
+     * @param int $promote_id
+     * @param int $game_id
+     * @return mixed
+     */
+    public function createGameDownToken(int $game_id, int $promote_id = 0);
+
+    /**
+     * 获取游戏下载地址
+     * @param string $token
+     * @param string $password
+     * @return mixed
+     */
+    public function createGameDownUrl(string $token, string $password);
+}

+ 17 - 0
src/PromoteApplyServiceInterface.php

@@ -0,0 +1,17 @@
+<?php
+
+
+namespace Yxy\Service;
+
+
+interface PromoteApplyServiceInterface
+{
+    /**
+     * 根据
+     * @param int $game_id
+     * @param int $promote_id
+     * @param string[] $field
+     * @return mixed
+     */
+    public function getByGameIdAndPromoteId(int $game_id, int $promote_id, array $field = ['*']): array;
+}