This commit is contained in:
2023-01-11 11:00:43 +08:00
commit ff55141a1e
791 changed files with 177427 additions and 0 deletions

15
modules/.gitignore vendored Normal file
View File

@@ -0,0 +1,15 @@
*
!.gitignore
!pull-all.sh
!README.md
!/Cms/
!/Gout/
!/Linker/
!/Mall/
!/Notification/
!/Payment/
!/Storage/
!/User/
!/Coupon/
!/Configuration/
!/Settlement/

4
modules/Cms/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
.idea
vendor
.DS_Store
composer.lock

49
modules/Cms/README.md Normal file
View File

@@ -0,0 +1,49 @@
# CMS
## 安装
```shell
composer require overtrue/laravel-versionable
```
## 接口文档
### 1. 文章
#### 1. 文章列表
> GET: /api/cms/articles
#### 2. 文章详情
> GET: /api/cms/articles/{article_id}
### 2. 单页
#### 1. 单页列表
> GET: /api/cms/pages
#### 2. 单页详情
> GET: /api/cms/pages/{page_id}
### 3. 分类
#### 1. 分类列表
> GET: /api/cms/categories
#### 2. 分类详情
> GET: /api/cms/categories/{category_id}
### 4. 标签
#### 1. 标签列表
> GET: /api/cms/tags
#### 2. 标签详情
> GET: /api/cms/tags/{tag_id}

4
modules/Configuration/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
.idea
vendor
.DS_Store
composer.lock

View File

@@ -0,0 +1,6 @@
# laravel-configuration-module
# 参数配置模块
## 需要config的模块配置

4
modules/Coupon/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
.idea
vendor
.DS_Store
composer.lock

10
modules/Coupon/README.md Normal file
View File

@@ -0,0 +1,10 @@
# 优惠券模块
> 1、发布config并配置相关模型
> 2、关联traits
```php
Shop Model
use HasStores,HasCoupons;
```

4
modules/Linker/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
.idea
vendor
.DS_Store
composer.lock

22
modules/Linker/README.md Normal file
View File

@@ -0,0 +1,22 @@
# 链接模块
## 1. 使用
### 1. 模型 Trait
```php
use Modules\Linker\Traits\HasLinker;
```
### 2. laravel-admin
自动增加三个字段,
1. 选择链接地址
2. 替换链接地址里的参数
3. 参数替换模式
```php
use Modules\Linker\Traits\WithLinker;
$this->withUrl($form,'字段名称');
```

4
modules/Mall/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
.idea
vendor
.DS_Store
composer.lock

37
modules/Mall/README.md Normal file
View File

@@ -0,0 +1,37 @@
# UzTech Mall Module 多用户商城模块
## 1. 使用
> php artisan module:publish-config Mall
## 2. traits 说明
### 1. UserHasAddress 用户地址列表
## 3. 功能说明
### 1. 物流管理,主后台添加一个主表,各商户,通过多对多的关系来确定使用哪些物流
### 2.
## 4. 工作流说明
> 参考文档
>
> https://github.com/brexis/laravel-workflow
>
> https://symfony.com/doc/current/components/workflow.html
```php
$order = Order::find(2);
// 方法1
$app = app('workflow');
$workflow = $app->get($order);
if ($workflow->can($order, 'pay')) {
$workflow->apply($order, 'pay')
}
// 方法2引入 WithWorkflow
$order->can('pay');
// 方法3
$workflow = Modules\Mall\Facades\Workflow::get($order)->can('pay');
```

View File

@@ -0,0 +1,154 @@
# Notification
通知模块
## 1. 安装
```shell
composer require getuilaboratory/getui-pushapi-php-client-v2
```
## 2. 接口文档
### 1. 获取未读消息数量不登陆返回0
> GET: /api/notifications/counts
```json
{
"status": "SUCCESS",
"status_code": 200,
"data": 16
}
```
### 2. 消息主页
> GET: /api/notifications
```json
{
"status": "SUCCESS",
"status_code": 200,
"data": [
{
"type": "SystemNotification",
"icon": "",
"name": "系统通知",
"count": 16,
"title": "登录成功"
},
{
"type": "OrderNotification",
"icon": "",
"name": "订单通知",
"count": 0,
"title": ""
},
{
"type": "ActivityNotification",
"icon": "",
"name": "活动通知",
"count": 0,
"title": ""
}
]
}
```
### 3. 分类消息的列表
> GET: /api/notifications/{type}/list
```json
{
"status": "SUCCESS",
"status_code": 200,
"data": {
"data": [
{
"notification_id": "91e31d1e-95e1-40ff-88d8-8049df974860",
"type": "SystemNotification",
"title": "登录成功",
"content": "您于北京时间2021-07-02 15:31:03通过【账号密码】渠道在IP1.190.203.218成功登录系统。请注意保管好您的账号密码。",
"read_at": "",
"created_at": "2021-07-02 15:31:03"
}
],
"page": {
"current": 1,
"total_page": 2,
"per_page": 15,
"has_more": true,
"total": 16
}
}
}
```
### 4. 消息详情
> GET: /api/notifications/{notification_id}
```json
{
"status": "SUCCESS",
"status_code": 200,
"data": {
"notification_id": "91e31d1e-95e1-40ff-88d8-8049df974860",
"type": "SystemNotification",
"title": "登录成功",
"content": "您于北京时间2021-07-02 15:31:03通过【账号密码】渠道在IP1.190.203.218成功登录系统。请注意保管好您的账号密码。",
"read_at": "2021-07-02 16:27:07",
"created_at": "2021-07-02 15:31:03"
}
}
```
### 5. 全部标记已读
> PUT: /api/notifications
```json
{
"status": "SUCCESS",
"status_code": 200,
"data": ""
}
```
### 6. 全部标记已读(分类)
> PUT: /api/notifications/{type}
```json
{
"status": "SUCCESS",
"status_code": 200,
"data": ""
}
```
### 7. 清空全部消息
> DELETE: /api/notifications
```json
{
"status": "SUCCESS",
"status_code": 200,
"data": ""
}
```
### 8. 清空分类消息
> DELETE: /api/notifications/{type}
```json
{
"status": "SUCCESS",
"status_code": 200,
"data": ""
}
```

4
modules/Payment/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
.idea
vendor
.DS_Store
composer.lock

46
modules/Payment/README.md Normal file
View File

@@ -0,0 +1,46 @@
# 支付模块
## 1. 安装
```shell
composer require yansongda/pay
```
## 2. 文档参考
> https://github.com/yansongda/pay
## 3. 生成支付订单
```php
use Modules\Payment\Traits\WithPayments;
$order = Order::first();
$payment = $order->createWechatPayment(User::first(), -1, 'mp');
$payment->getPaymentParams();
```
## 4. 支付渠道 GATEWAY 参考值
// 支付宝
//web 电脑支付 array $order Response
//wap 手机网站支付 array $order Response
//app APP 支付 array $order Response
//mini 小程序支付 array $order Collection
//scan 扫码支付 array $order Collection
// 不支持的
//pos 刷卡支付 array $order Collection
//transfer 账户转账 array $order Collection
// 微信支付
//mp 公众号支付 array $order Collection
//wap 手机网站支付 array $order Response
//app APP 支付 array $order JsonResponse
//miniapp 小程序支付 array $order Collection
//scan 扫码支付 array $order Collection
// 不支持的
//pos 刷卡支付 array $order Collection
//transfer 账户转账 array $order Collection
//redpack 普通红包 array $order Collection
//groupRedpack 裂变红包 array $order Collection

27
modules/README.md Normal file
View File

@@ -0,0 +1,27 @@
# 模块存放目录
## 1. 模块列表
### 1. User 【用户模块】
> 模块地址http://git.yuzhankeji.cn/UzTech/laravel-user-module.git
>
> 后台菜单排序10
### 2. Cms 【内容管理】
> 模块地址https://git.yuzhankeji.cn/UzTech/laravel-cms-module
>
> 后台菜单排序15
### 3. Mall 【商城模块】
> 模块地址https://git.yuzhankeji.cn/UzTech/laravel-mall-module
>
> 后台菜单排序20
### 4. Payment 【支付中心】
> 模块地址https://git.yuzhankeji.cn/UzTech/laravel-payment-module
>
> 后台菜单排序25

4
modules/Storage/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
.idea
vendor
.DS_Store
composer.lock

70
modules/Storage/README.md Normal file
View File

@@ -0,0 +1,70 @@
# 文件存储模块
## 1. 前端上传接口
## 2. 配置STS直传
### 步骤一创建RAM用户
- 登录RAM控制台。
- 在左侧导航栏的人员管理菜单下,单击用户。
- 单击新建用户。
- 输入登录名称和显示名称。
- 在访问方式区域下,选择编程访问,然后单击确定。
- 单击复制保存访问密钥AccessKey ID 和 AccessKey Secret
### 步骤二为RAM用户授予请求AssumeRole的权限
- 单击已创建RAM用户右侧对应的添加权限。
- 在添加权限页面选择AliyunSTSAssumeRoleAccess权限。
- 单击确定。
### 步骤三:创建用于获取临时访问凭证的角色
- 在左侧导航栏单击RAM角色管理。
- 单击新建RAM角色选择可信实体类型为阿里云账号单击下一步。
- 在新建RAM角色页面RAM角色名称填写为RamOssTest选择云账号为当前云账号。
- 单击完成。
- 单击复制保存角色的ARN。
### 步骤四:为角色授予上传文件的权限
- 在左侧导航栏的权限管理菜单下,单击权限策略管理。
- 单击创建权限策略。
- 在新建自定义权限策略页面填写策略名称配置模式选择脚本配置并在策略内容中赋予角色向目标存储空间examplebucket下的目录exampledir上传文件的权限。
```json
{
"Version": "1",
"Statement": [
{
"Effect": "Allow",
"Action": [
"oss:PutObject"
],
"Resource": [
"acs:oss:*:*:examplebucket/exampledir",
"acs:oss:*:*:examplebucket/exampledir/*"
]
}
]
}
```
- 单击确定。
### 步骤五:获取临时访问凭证
- 您可以通过调用STS服务接口AssumeRole 或者使用各语言STS SDK来获取临时访问凭证。
> 说明 临时访问凭证有效时间单位为秒最小值为900最大值以当前角色设定的最大会话时间为准。详情请参见设置角色最大会话时间。
### 步骤六使用临时访问凭证上传文件至OSS
### 常见问题
- 报错The security token you provided is invalid.如何处理?
> 请确保完整填写步骤五获取到的SecurityToken。
- 报错The OSS Access Key Id you provided does not exist in our records.如何处理?
> 临时访问凭证已过期过期后自动失效。请使用临时访问密钥AccessKeyId和AccessKeySecret向App服务器申请新的临时访问凭证。具体操作请参见步骤五。
- 获取STS时报错NoSuchBucket如何处理
> 出现这种报错通常是STS的endpoint填写错误。请根据您的地域填写正确的STS接入地址。各地域的STS接入地址请参见接入地址。

4
modules/User/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
.idea
vendor
.DS_Store
composer.lock

12
modules/User/README.md Normal file
View File

@@ -0,0 +1,12 @@
# 用户模块
## 1. 安装
```shell
composer require overtrue/wechat
composer require overtrue/easy-sms
composer require overtrue/socialite
composer require propaganistas/laravel-phone
composer require vinkla/hashids
composer require yangjisen/laravel-cache-provider
```