glance-project/photo-service
Composer 安装命令:
composer require glance-project/photo-service
包简介
Glance project service for managing user photos
README 文档
README
Repository for the common service used by the GLANCE team to manage photo consent.
Usage
Install
Install using composer:
composer-require glance-project/photo-service
Usecases
Get User Consent
Find members who have registered their consent in certain application:
use Glance\PhotoService\UserConsent\Infrastructure\Provider\UserConsentProviderFactory;
$provider = UserConsentProviderFactory::getUserConsentInstance(
"<photo-db-username>",
"<photo-db-password>",
"<photo-db-dns>"
);
$details = $provider->findUserConsentDetailsByApplicationId("<your-application-id>");
Find consent of given member in your application:
use Glance\PhotoService\UserConsent\Infrastructure\Provider\UserConsentProviderFactory;
$provider = UserConsentProviderFactory::getUserConsentInstance(
"<photo-db-username>",
"<photo-db-password>",
"<photo-db-dns>"
);
$details = $provider->findUserConsentDetailsByPersonId(<member-person-id>,"<your-application-id>");
Get User Consent History
To get the consent history based on the person id of the member:
use Glance\PhotoService\UserConsent\Infrastructure\Provider\UserConsentProviderFactory;
$provider = UserConsentProviderFactory::getUserConsentInstance(
"<photo-db-username>",
"<photo-db-password>",
"<photo-db-dns>"
);
$details = $provider->findUserConsentHistoryDetailsByPersonId(<member-person-id>, "<your-application-id>");
To get the consent history based on the application id only:
use Glance\PhotoService\UserConsent\Infrastructure\Provider\UserConsentProviderFactory;
$provider = UserConsentProviderFactory::getUserConsentInstance(
"<photo-db-username>",
"<photo-db-password>",
"<photo-db-dns>"
);
$details = $provider->findUserConsentHistoryDetailsByApplicationId("<your-application-id>");
Update Consent
use Glance\PhotoService\UserConsent\Infrastructure\Provider\UserConsentProviderFactory;
$provider = UserConsentProviderFactory::getUserConsentInstance(
"<photo-db-username>",
"<photo-db-password>",
"<photo-db-dns>"
);
$details = $provider->updateUserConsent(
<member-person-id>,
(bool) <new-consent>,
"<your-application-id>",
<agent-person-id>
);
Get Photo
A UnableToFetchFromAdamsException is thrown if the ADAMS api is not answering correctly.
A UserHasNotGivenConsent is thrown if the user has not given consent.
use Glance\PhotoService\Photo\Infrastructure\Provider\PhotoProviderFactory;
$photoProvider = PhotoProviderFactory::getPhotoProvider(
"<service-account-username>",
"<service-account-password>",
"<experiment-api-endpoint>",
"<photo-db-username>",
"<photo-db-password>",
"<photo-db-dns>"
);
$photoProvider->getPhoto(
<person-id>,
"<application-id>"
);
Test environment setup
We rely on .env files to handle secret values.
Therefore, create a new .env.local, if it doesn't yet exist, and copy everything from .env to the local one. The database credentials must be from the photo DB.
# .env.local
DB_USERNAME=<username>
DB_DNS=<dns>
DB_PASSWORD=<password>
Starting the container
In order to start developing, after you've cloned the repository you'll need to start the container for the service. To do that, run the following command:
docker-compose up -d
Once the container is up and running, execute docker exec -it photo-service bash so you are prompted to the container CLI.
Installing php dependencies
In order to install the php dependencies, run composer install inside the container so composer will install exactly the specific versions set on the composer.lock file.
glance-project/photo-service 适用场景与选型建议
glance-project/photo-service 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 11.96k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 02 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「api」 「photo」 「alice」 「atlas」 「glance」 「lhcb」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 glance-project/photo-service 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 glance-project/photo-service 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 glance-project/photo-service 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Symfony2 Bundle for loading fixture data with the Alice library.
Alice extension for Behat
An archive of the now-lost Symfony bundle to manage fixtures with Alice and Faker. Archived by the Bettergist Collective.
Symfony bundle to manage fixtures with Alice and Faker.
Creates a basic photo gallery pagetype with albums and photos. Photos within albums are opened with a lightbox.
some helpful Behat contexts
统计信息
- 总下载量: 11.96k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: proprietary
- 更新时间: 2023-02-02