feat: 移除 API 文档注释

This commit is contained in:
mkm 2024-06-14 15:53:47 +08:00
parent 83f03f126d
commit e14290ef82
135 changed files with 1390 additions and 9043 deletions

View File

@ -63,6 +63,34 @@ class UserLogic extends BaseLogic
return false;
}
}
public static function StoreAdd(array $params)
{
$passwordSalt = Config::get('project.unique_identification');
$password = create_password($params['password'], $passwordSalt);
$defaultAvatar = config('project.default_image.admin_avatar');
$avatar = !empty($params['avatar']) ? FileService::setFileUrl($params['avatar']) : $defaultAvatar;
Db::startTrans();
try {
$res=User::create([
'avatar' => $avatar,
'real_name' =>'',
'nickname' => '用户'.time(),
'account' => $params['mobile'],
'password' => $password,
'mobile' => $params['mobile'],
'user_money' => $params['user_money']
]);
Db::commit();
return $res;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
/**
* @notes 编辑用户列表
* @param array $params

View File

@ -27,7 +27,14 @@ class UserValidate extends BaseValidate
'mobile' => 'require|mobile',
'is_disable' => 'in:0,1',
'sex' => 'in:1,2',
'user_money' => 'float'
'user_money' => 'float',
'province' => 'require',
'city' => 'require',
'district' => 'require',
'street' => 'require',
'village' => 'require',
'brigade' => 'require',
'user_ship' => 'require',
];
@ -45,6 +52,13 @@ class UserValidate extends BaseValidate
'is_disable' => '是否禁用',
'sex' => '用户性别',
'user_money' => '用户余额',
'province' => '省',
'city' => '市',
'district' => '区',
'street' => '街道',
'village' => '村',
'brigade' => ' 队',
'user_ship' => ' 会员类型',
];
@ -59,6 +73,10 @@ class UserValidate extends BaseValidate
return $this->remove('id',true);
}
public function scenestoreAdd()
{
return $this->only(['mobile','province','city','district','street','village','brigade','user_ship']);
}
/**
* @notes 编辑场景

View File

@ -2,8 +2,7 @@
namespace app\api\controller;
use app\common\controller\BaseLikeController;
use hg\apidoc\annotation as ApiDoc;
#[ApiDoc\NotParse()]
class BaseApiController extends BaseLikeController
{

View File

@ -13,13 +13,12 @@ use Exception;
use support\Cache;
use think\facade\Db;
use Webman\Config;
use hg\apidoc\annotation as ApiDoc;
use support\Log;
use Yansongda\Pay\Exception\InvalidSignException;
use Monolog\Handler\RotatingFileHandler;
use Webman\RedisQueue\Redis;
#[ApiDoc\NotParse()]
class IndexController extends BaseApiController
{
@ -27,36 +26,35 @@ class IndexController extends BaseApiController
public function index()
{
$arr=StoreBranchProduct::where('store_id',5)->select();
foreach ($arr as $item){
StoreProductLogic::updateGoodsclass($item['cate_id'],5);
$arr = StoreBranchProduct::where('store_id', 5)->select();
foreach ($arr as $item) {
StoreProductLogic::updateGoodsclass($item['cate_id'], 5);
}
try {
$wechat = new PayService(1);
$time = time();
$order = [
'out_trade_no' => 'PF1717558027664507',
'out_refund_no' => 'BO'.$time,
'amount' => [
'refund' => 1,
'total' => 1,
'currency' => 'CNY',
],
// '_action' => 'jsapi', // jsapi 退款,默认
// '_action' => 'app', // app 退款
// '_action' => 'combine', // 合单退款
// '_action' => 'h5', // h5 退款
// '_action' => 'miniapp', // 小程序退款
// '_action' => 'native', // native 退款
$wechat = new PayService(1);
$time = time();
$order = [
'out_trade_no' => 'PF1717558027664507',
'out_refund_no' => 'BO' . $time,
'amount' => [
'refund' => 1,
'total' => 1,
'currency' => 'CNY',
],
// '_action' => 'jsapi', // jsapi 退款,默认
// '_action' => 'app', // app 退款
// '_action' => 'combine', // 合单退款
// '_action' => 'h5', // h5 退款
// '_action' => 'miniapp', // 小程序退款
// '_action' => 'native', // native 退款
];
];
$res = $wechat->wechat->refund($order);
Cache::set('kk',json_decode($res,true));
$res = $wechat->wechat->refund($order);
Cache::set('kk', json_decode($res, true));
} catch (Exception $e) {
\support\Log::info($e->extra['message']?? $e->getMessage());
throw new \Exception($e->extra['message']?? $e->getMessage());
\support\Log::info($e->extra['message'] ?? $e->getMessage());
throw new \Exception($e->extra['message'] ?? $e->getMessage());
}
d(1);
@ -67,15 +65,15 @@ class IndexController extends BaseApiController
try{
$a=new WechatTemplate();
$a->NewQuotationNotification(['openid'=>'ocqhF6UfFQXE-SbzbP5YVQJlQAh0','data1'=>'阿萨','data2'=>date('Y-m-d H:i:s'),'data3'=>'占山','data3'=>18982406440]);
}catch (Exception $e){
try {
$a = new WechatTemplate();
$a->NewQuotationNotification(['openid' => 'ocqhF6UfFQXE-SbzbP5YVQJlQAh0', 'data1' => '阿萨', 'data2' => date('Y-m-d H:i:s'), 'data3' => '占山', 'data3' => 18982406440]);
} catch (Exception $e) {
d($e);
}
d(22);
d(22);
$auth_code = $this->request->get('code');
$pay = (new PayService());
$order = [
@ -85,7 +83,7 @@ d(22);
'auth_code' => (string)$auth_code
],
'amount' => [
'total' =>1,
'total' => 1,
],
'scene_info' => [
"store_info" => [
@ -93,14 +91,13 @@ d(22);
]
],
];
try{
$a= $pay->wechat->pos($order);
}catch (\Exception $th) {
d($th);
try {
$a = $pay->wechat->pos($order);
} catch (\Exception $th) {
d($th);
}
d($a);
d($a);
$params = ['store_id' => 2, 'pay_type' => 17];
$a = StoreOrderLogic::createOrder([1], 0, null, $params);
d($a);
@ -143,7 +140,7 @@ d($a);
*/
public function city()
{
$province_code = $this->request->get('code');
$province_code = $this->request->get('province_code');
$list = Db::name('geo_city')->where('province_code', $province_code)->select()?->toArray();
return $this->success('ok', $list);
}
@ -152,7 +149,7 @@ d($a);
*/
public function area()
{
$city_code = $this->request->get('code');
$city_code = $this->request->get('city_code');
$list = Db::name('geo_area')->where('city_code', $city_code)->select()?->toArray();
return $this->success('ok', $list);
}
@ -165,4 +162,22 @@ d($a);
$list = Db::name('geo_street')->where('area_code', $area_code)->select()?->toArray();
return $this->success('ok', $list);
}
/**
* @notes 获取村列表
*/
public function village()
{
$area_code = $this->request->get('street_code');
$list = Db::name('geo_village')->where('street_code', $area_code)->select()?->toArray();
return $this->success('ok', $list);
}
/**
* @notes 获取队列表
*/
public function brigade()
{
$list = Db::name('geo_brigade')->select()?->toArray();
return $this->success('ok', $list);
}
}

View File

@ -6,8 +6,7 @@ use app\api\logic\LoginLogic;
use app\common\model\system_store\SystemStore;
use app\api\validate\{LoginAccountValidate, WechatLoginValidate};
use app\common\model\user\UserAuth;
use hg\apidoc\annotation as ApiDoc;
#[ApiDoc\NotParse()]
class LoginController extends BaseApiController
{

View File

@ -9,8 +9,7 @@ use app\common\model\store_order\StoreOrder;
use app\common\service\pay\PayService;
use support\Cache;
use support\Log;
use hg\apidoc\annotation as ApiDoc;
#[ApiDoc\NotParse()]
/**
* 支付

View File

@ -4,8 +4,7 @@
use app\common\service\UploadService;
use Exception;
use hg\apidoc\annotation as ApiDoc;
#[ApiDoc\NotParse()]
class UploadController extends BaseApiController
{

View File

@ -5,8 +5,7 @@ namespace app\api\controller\cate;
use app\api\controller\BaseApiController;
use app\api\lists\cate\CateLists;
use hg\apidoc\annotation as ApiDoc;
#[ApiDoc\NotParse()]
/**
* 商品分类控制器

View File

@ -8,9 +8,8 @@ use app\api\controller\BaseApiController;
use app\api\lists\order\CartList;
use app\common\model\order\Cart;
use app\common\model\store_branch_product\StoreBranchProduct;
use hg\apidoc\annotation as ApiDoc;
#[ApiDoc\NotParse()]
class CartController extends BaseApiController
{
public function list()

View File

@ -16,9 +16,7 @@ use app\common\model\system_store\SystemStoreStaff;
use app\common\model\user\User;
use app\common\model\user\UserAddress;
use Webman\RedisQueue\Redis;
use hg\apidoc\annotation as ApiDoc;
#[ApiDoc\title('订单')]
class OrderController extends BaseApiController
{
public $notNeedLogin = ['refund_reason'];
@ -32,15 +30,15 @@ class OrderController extends BaseApiController
return $this->dataLists(new OrderList());
}
#[
ApiDoc\Title('核销码查数据'),
ApiDoc\url('/api/order/order/write_code'),
ApiDoc\Method('POST'),
ApiDoc\Param(name: "code", type: "string", require: false, desc: "核销码"),
ApiDoc\NotHeaders(),
ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('核销码查数据'),
// ApiDoc\url('/api/order/order/write_code'),
// ApiDoc\Method('POST'),
// ApiDoc\Param(name: "code", type: "string", require: false, desc: "核销码"),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function write_code()
{
$code = $this->request->post('code');
@ -54,18 +52,18 @@ class OrderController extends BaseApiController
return $this->success('ok', $res);
}
#[
ApiDoc\Title('核销订单列表'),
ApiDoc\url('/api/order/order/write_list'),
ApiDoc\Method('POST'),
ApiDoc\Param(name: "status", type: "int", require: true, desc: "1待核销2已核销"),
ApiDoc\Param(name: "name", type: "string", require: false, desc: "搜商品或者订单id"),
ApiDoc\Param(name: "page_no", type: "int", require: true, desc: "默认1页数"),
ApiDoc\Param(name: "page_size", type: "int", require: false, desc: "条数默认15"),
ApiDoc\NotHeaders(),
ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('核销订单列表'),
// ApiDoc\url('/api/order/order/write_list'),
// ApiDoc\Method('POST'),
// ApiDoc\Param(name: "status", type: "int", require: true, desc: "1待核销2已核销"),
// ApiDoc\Param(name: "name", type: "string", require: false, desc: "搜商品或者订单id"),
// ApiDoc\Param(name: "page_no", type: "int", require: true, desc: "默认1页数"),
// ApiDoc\Param(name: "page_size", type: "int", require: false, desc: "条数默认15"),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function write_list()
{
$status = (int)$this->request->post('status', 1);
@ -83,15 +81,15 @@ class OrderController extends BaseApiController
return $this->success('ok', $res);
}
#[
ApiDoc\Title('核销数量'),
ApiDoc\url('/api/order/order/write_count'),
ApiDoc\Method('POST'),
ApiDoc\Param(name: "name", type: "string", require: false, desc: "搜商品或者订单id"),
ApiDoc\NotHeaders(),
ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('核销数量'),
// ApiDoc\url('/api/order/order/write_count'),
// ApiDoc\Method('POST'),
// ApiDoc\Param(name: "name", type: "string", require: false, desc: "搜商品或者订单id"),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function write_count()
{
$info = $this->userInfo;
@ -100,41 +98,41 @@ class OrderController extends BaseApiController
return $this->success('ok', $res);
}
#[
ApiDoc\Title('订单校验'),
ApiDoc\url('/api/order/order/checkOrder'),
ApiDoc\Method('POST'),
ApiDoc\Param(name: "cart_id", type: "int", require: true, desc: "购物车id"),
ApiDoc\Param(name: "address_id", type: "int", require: true, desc: "地址id"),
ApiDoc\Param(name: "store_id", type: "int", require: true, desc: "店铺id"),
ApiDoc\Param(name: "verify_code", type: "int", require: true, desc: "校验码"),
ApiDoc\Param(name: "shipping_type", type: "int", require: true, desc: "配送方式"),
ApiDoc\Param(name: "pay_type", type: "int", require: true, desc: "支付类型"),
ApiDoc\NotHeaders(),
ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
ApiDoc\ResponseSuccess("data", type: "array", children: [
['name' => 'order', 'desc' => '订单信息', 'type' => 'array', 'children' => [
['name' => 'create_time', 'desc' => '订单创建时间', 'type' => 'int'],
['name' => 'order_id', 'desc' => '订单id', 'type' => 'int'],
['name' => 'total_price', 'desc' => '订单总金额', 'type' => 'float'],
['name' => 'pay_price', 'desc' => '实际支付金额', 'type' => 'float'],
['name' => 'total_num', 'desc' => '订单总数量', 'type' => 'int'],
['name' => 'pay_type', 'desc' => '支付方式', 'type' => 'int'],
['name' => 'cart_id', 'desc' => '购物车id', 'type' => 'string'],
['name' => 'store_id', 'desc' => '店铺id', 'type' => 'int'],
['name' => 'shipping_type', 'desc' => '配送方式', 'type' => 'int'],
]],
['name' => 'cart_list', 'desc' => '购物车商品列表', 'type' => 'array', 'children' => [
['name' => 'goods', 'desc' => '商品id', 'type' => 'int'],
['name' => 'cart_num', 'desc' => '购买数量', 'type' => 'int'],
['name' => 'total', 'desc' => '商品总价', 'type' => 'float'],
['name' => 'price', 'desc' => '商品单价', 'type' => 'float'],
['name' => 'product_id', 'desc' => '商品id', 'type' => 'int'],
['name' => 'old_cart_id', 'desc' => '原购物车id', 'type' => 'string'],
['name' => 'verify_code', 'desc' => '校验码', 'type' => 'string'],
]],
]),
]
// #[
// ApiDoc\Title('订单校验'),
// ApiDoc\url('/api/order/order/checkOrder'),
// ApiDoc\Method('POST'),
// ApiDoc\Param(name: "cart_id", type: "int", require: true, desc: "购物车id"),
// ApiDoc\Param(name: "address_id", type: "int", require: true, desc: "地址id"),
// ApiDoc\Param(name: "store_id", type: "int", require: true, desc: "店铺id"),
// ApiDoc\Param(name: "verify_code", type: "int", require: true, desc: "校验码"),
// ApiDoc\Param(name: "shipping_type", type: "int", require: true, desc: "配送方式"),
// ApiDoc\Param(name: "pay_type", type: "int", require: true, desc: "支付类型"),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
// ApiDoc\ResponseSuccess("data", type: "array", children: [
// ['name' => 'order', 'desc' => '订单信息', 'type' => 'array', 'children' => [
// ['name' => 'create_time', 'desc' => '订单创建时间', 'type' => 'int'],
// ['name' => 'order_id', 'desc' => '订单id', 'type' => 'int'],
// ['name' => 'total_price', 'desc' => '订单总金额', 'type' => 'float'],
// ['name' => 'pay_price', 'desc' => '实际支付金额', 'type' => 'float'],
// ['name' => 'total_num', 'desc' => '订单总数量', 'type' => 'int'],
// ['name' => 'pay_type', 'desc' => '支付方式', 'type' => 'int'],
// ['name' => 'cart_id', 'desc' => '购物车id', 'type' => 'string'],
// ['name' => 'store_id', 'desc' => '店铺id', 'type' => 'int'],
// ['name' => 'shipping_type', 'desc' => '配送方式', 'type' => 'int'],
// ]],
// ['name' => 'cart_list', 'desc' => '购物车商品列表', 'type' => 'array', 'children' => [
// ['name' => 'goods', 'desc' => '商品id', 'type' => 'int'],
// ['name' => 'cart_num', 'desc' => '购买数量', 'type' => 'int'],
// ['name' => 'total', 'desc' => '商品总价', 'type' => 'float'],
// ['name' => 'price', 'desc' => '商品单价', 'type' => 'float'],
// ['name' => 'product_id', 'desc' => '商品id', 'type' => 'int'],
// ['name' => 'old_cart_id', 'desc' => '原购物车id', 'type' => 'string'],
// ['name' => 'verify_code', 'desc' => '校验码', 'type' => 'string'],
// ]],
// ]),
// ]
public function checkOrder()
{
$cartId = (array)$this->request->post('cart_id', []);
@ -154,19 +152,19 @@ class OrderController extends BaseApiController
return $this->data($res);
}
#[
ApiDoc\Title('创建订单'),
ApiDoc\url('/api/order/order/createOrder'),
ApiDoc\Method('POST'),
ApiDoc\Param(name: "cart_id", type: "int", require: true, desc: "id"),
ApiDoc\Param(name: "store_id", type: "int", require: true, desc: "店铺id"),
ApiDoc\Param(name: "address_id", type: "int", require: true, desc: "地址id"),
ApiDoc\Param(name: "auth_code", type: "string", require: true, desc: "付款码"),
ApiDoc\Param(name: "pay_type", type: "int", require: true, desc: "支付类型"),
ApiDoc\NotHeaders(),
ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('创建订单'),
// ApiDoc\url('/api/order/order/createOrder'),
// ApiDoc\Method('POST'),
// ApiDoc\Param(name: "cart_id", type: "int", require: true, desc: "id"),
// ApiDoc\Param(name: "store_id", type: "int", require: true, desc: "店铺id"),
// ApiDoc\Param(name: "address_id", type: "int", require: true, desc: "地址id"),
// ApiDoc\Param(name: "auth_code", type: "string", require: true, desc: "付款码"),
// ApiDoc\Param(name: "pay_type", type: "int", require: true, desc: "支付类型"),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function createOrder()
{
$cartId = (array)$this->request->post('cart_id', []);
@ -263,18 +261,18 @@ class OrderController extends BaseApiController
return $this->success('ok', ['no_pay' => $no_pay, 'waiting' => $waiting, 'receiving' => $receiving, 'all' => $all, 'applyRefund' => $applyRefund, 'refund' => $refund]);
}
#[
ApiDoc\Title('订单支付'),
ApiDoc\url('/api/order/order/pay'),
ApiDoc\Method('POST'),
ApiDoc\Param(name: "order_id", type: "int", require: true, desc: "订单id"),
ApiDoc\Param(name: "address_id", type: "int", require: true, desc: "地址id"),
ApiDoc\Param(name: "auth_code", type: "string", require: true, desc: "付款码"),
ApiDoc\Param(name: "pay_type", type: "int", require: true, desc: "支付类型"),
ApiDoc\NotHeaders(),
ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('订单支付'),
// ApiDoc\url('/api/order/order/pay'),
// ApiDoc\Method('POST'),
// ApiDoc\Param(name: "order_id", type: "int", require: true, desc: "订单id"),
// ApiDoc\Param(name: "address_id", type: "int", require: true, desc: "地址id"),
// ApiDoc\Param(name: "auth_code", type: "string", require: true, desc: "付款码"),
// ApiDoc\Param(name: "pay_type", type: "int", require: true, desc: "支付类型"),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function pay()
{
$order_id = (int)$this->request->post('order_id');
@ -352,14 +350,14 @@ class OrderController extends BaseApiController
}
#[
ApiDoc\Title('订单详情'),
ApiDoc\url('/api/order/order/detail'),
ApiDoc\Method('GET'),
ApiDoc\Param(name: "order_id", type: "int", require: true, desc: "订单id"),
ApiDoc\NotHeaders(),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('订单详情'),
// ApiDoc\url('/api/order/order/detail'),
// ApiDoc\Method('GET'),
// ApiDoc\Param(name: "order_id", type: "int", require: true, desc: "订单id"),
// ApiDoc\NotHeaders(),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function detail()
{
$order_id = (int)$this->request->get('order_id');
@ -447,15 +445,15 @@ class OrderController extends BaseApiController
}
}
#[
ApiDoc\Title('核销'),
ApiDoc\url('/api/order/order/writeoff_order'),
ApiDoc\Method('POST'),
ApiDoc\Param(name: "verify_code", type: "string", require: true, desc: "验证码"),
ApiDoc\NotHeaders(),
ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('核销'),
// ApiDoc\url('/api/order/order/writeoff_order'),
// ApiDoc\Method('POST'),
// ApiDoc\Param(name: "verify_code", type: "string", require: true, desc: "验证码"),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function writeoff_order()
{
$params = (new OrderValidate())->post()->goCheck('check');
@ -487,19 +485,19 @@ class OrderController extends BaseApiController
}
#[
ApiDoc\Title('订单退款申请'),
ApiDoc\url('/api/order/order/apply_refund'),
ApiDoc\Method('POST'),
ApiDoc\Param(name: "refund_message", type: "string", require: true, desc: "退款原因"),
ApiDoc\Param(name: "refund_num", type: "int", require: true, desc: "退款数量"),
ApiDoc\Param(name: "id", type: "int", require: true, desc: "订单id"),
ApiDoc\Param(name: "old_cart_id", type: "int", require: true, desc: "购物车id"),
ApiDoc\Param(name: "refund_type", type: "int", require: true, desc: "退款申请类型"),
ApiDoc\NotHeaders(),
ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('订单退款申请'),
// ApiDoc\url('/api/order/order/apply_refund'),
// ApiDoc\Method('POST'),
// ApiDoc\Param(name: "refund_message", type: "string", require: true, desc: "退款原因"),
// ApiDoc\Param(name: "refund_num", type: "int", require: true, desc: "退款数量"),
// ApiDoc\Param(name: "id", type: "int", require: true, desc: "订单id"),
// ApiDoc\Param(name: "old_cart_id", type: "int", require: true, desc: "购物车id"),
// ApiDoc\Param(name: "refund_type", type: "int", require: true, desc: "退款申请类型"),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function apply_refund()
{
$params = (new OrderValidate())->post()->goCheck('add');
@ -509,14 +507,14 @@ class OrderController extends BaseApiController
return $this->success('申请成功');
}
#[
ApiDoc\Title('订单退款原因'),
ApiDoc\url('/api/order/order/refund_reason'),
ApiDoc\Method('GET'),
ApiDoc\Param(),
ApiDoc\NotHeaders(),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('订单退款原因'),
// ApiDoc\url('/api/order/order/refund_reason'),
// ApiDoc\Method('GET'),
// ApiDoc\Param(),
// ApiDoc\NotHeaders(),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function refund_reason()
{
$data = DictData::where('type_value', 'reason')->where('status', YesNoEnum::YES)
@ -525,14 +523,14 @@ class OrderController extends BaseApiController
}
#[
ApiDoc\Title('取消售后'),
ApiDoc\url('/api/order/order/cancel_sale'),
ApiDoc\Method('GET'),
ApiDoc\Param(name: "order_id", type: "int", require: true, desc: "订单id"),
ApiDoc\NotHeaders(),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('取消售后'),
// ApiDoc\url('/api/order/order/cancel_sale'),
// ApiDoc\Method('GET'),
// ApiDoc\Param(name: "order_id", type: "int", require: true, desc: "订单id"),
// ApiDoc\NotHeaders(),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function cancel_sale()
{
$order_id = (int)$this->request->get('order_id');

View File

@ -3,8 +3,7 @@
namespace app\api\controller\product;
use app\api\controller\BaseApiController;
use app\api\lists\product\ProductLists;
use hg\apidoc\annotation as ApiDoc;
#[ApiDoc\NotParse()]
class ProductController extends BaseApiController{
public $notNeedLogin = ['lists'];

View File

@ -9,8 +9,7 @@ use app\common\model\dict\DictData;
use app\common\model\merchant\Merchant;
use app\common\model\supplier\Supplier;
use think\facade\Db;
use hg\apidoc\annotation as ApiDoc;
#[ApiDoc\NotParse()]
class IndexController extends BaseApiController{
public $notNeedLogin = ['apply','get_token','merchat_type','record','apply_detail'];

View File

@ -3,8 +3,6 @@
namespace app\api\controller\store;
use app\api\controller\BaseApiController;
use hg\apidoc\annotation as ApiDoc;
#[ApiDoc\title('收银机商品统计')]
class ProductRecordController extends BaseApiController
{

View File

@ -7,8 +7,7 @@ use app\api\controller\BaseApiController;
use app\api\logic\store\StoreLogic;
use app\common\service\pay\PayService;
use Webman\Config;
use hg\apidoc\annotation as ApiDoc;
#[ApiDoc\NotParse()]
class StoreController extends BaseApiController
{

View File

@ -3,8 +3,7 @@
namespace app\api\controller\store;
use app\api\controller\BaseApiController;
use hg\apidoc\annotation as ApiDoc;
#[ApiDoc\title('收银机盈收统计')]
class TransactionRecordController extends BaseApiController
{

View File

@ -6,8 +6,7 @@ use app\api\controller\BaseApiController;
use app\api\lists\user\UserAddressList;
use app\api\logic\user\AddressLogic;
use app\api\validate\UserAddressValidate;
use hg\apidoc\annotation as ApiDoc;
#[ApiDoc\NotParse()]
class AddressController extends BaseApiController
{

View File

@ -7,10 +7,7 @@ use app\api\logic\user\UserLogic;
use app\api\validate\UserValidate;
use app\common\enum\PayEnum;
use app\common\logic\PaymentLogic;
use hg\apidoc\annotation as ApiDoc;
use taoser\Validate;
#[ApiDoc\title('用户')]
/**
* 用户控制器
@ -19,15 +16,15 @@ use taoser\Validate;
*/
class UserController extends BaseApiController
{
#[
ApiDoc\Title('获取小程序手机号'),
ApiDoc\url('/api/user/user/getMobileByMnp'),
ApiDoc\Method('POST'),
ApiDoc\Param(name: "code", type: "string", require: true, desc: "换取手机的code"),
ApiDoc\NotHeaders(),
ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('获取小程序手机号'),
// ApiDoc\url('/api/user/user/getMobileByMnp'),
// ApiDoc\Method('POST'),
// ApiDoc\Param(name: "code", type: "string", require: true, desc: "换取手机的code"),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function getMobileByMnp()
{
$params = (new UserValidate())->post()->goCheck('getMobileByMnp');
@ -41,45 +38,45 @@ class UserController extends BaseApiController
}
#[
ApiDoc\Title('用户个人信息'),
ApiDoc\url('/api/user/user/info'),
ApiDoc\Method('POST'),
ApiDoc\Param(),
ApiDoc\NotHeaders(),
ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('用户个人信息'),
// ApiDoc\url('/api/user/user/info'),
// ApiDoc\Method('POST'),
// ApiDoc\Param(),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function info()
{
return $this->success('success', UserLogic::info($this->userId));
}
#[
ApiDoc\Title('充值金额'),
ApiDoc\url('/api/user/user/rechange_amount'),
ApiDoc\Method('Get'),
ApiDoc\Param(),
ApiDoc\NotHeaders(),
ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('充值金额'),
// ApiDoc\url('/api/user/user/rechange_amount'),
// ApiDoc\Method('Get'),
// ApiDoc\Param(),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function rechange_amount()
{
$res = UserLogic::rechange_level();
return $this->success('ok',$res);
}
#[
ApiDoc\Title('小程序充值'),
ApiDoc\url('/api/user/user/recharge'),
ApiDoc\Method('POST'),
ApiDoc\Param(name: "price", type: "string", require: true, desc: "金额"),
ApiDoc\NotHeaders(),
ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('小程序充值'),
// ApiDoc\url('/api/user/user/recharge'),
// ApiDoc\Method('POST'),
// ApiDoc\Param(name: "price", type: "string", require: true, desc: "金额"),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function recharge()
{
$params = (new UserValidate())->post()->goCheck('rechargeMoney');
@ -95,16 +92,16 @@ class UserController extends BaseApiController
}
#[
ApiDoc\Title('会员账户详情'),
ApiDoc\url('/api/user/user/capital_flow'),
ApiDoc\Method('POST'),
ApiDoc\Param(name: "page_no", type: "int", require: true, desc: "默认1页数"),
ApiDoc\Param(name: "page_size", type: "int", require: false, desc: "条数默认15"),
ApiDoc\NotHeaders(),
ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('会员账户详情'),
// ApiDoc\url('/api/user/user/capital_flow'),
// ApiDoc\Method('POST'),
// ApiDoc\Param(name: "page_no", type: "int", require: true, desc: "默认1页数"),
// ApiDoc\Param(name: "page_size", type: "int", require: false, desc: "条数默认15"),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function capital_flow()
{
$page_no = (int)$this->request->post('page_no',1);
@ -122,15 +119,15 @@ class UserController extends BaseApiController
return $this->success('ok',$res);
}
#[
ApiDoc\Title('会员账户统计'),
ApiDoc\url('/api/user/user/capital_count'),
ApiDoc\Method('POST'),
ApiDoc\Param(),
ApiDoc\NotHeaders(),
ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('会员账户统计'),
// ApiDoc\url('/api/user/user/capital_count'),
// ApiDoc\Method('POST'),
// ApiDoc\Param(),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function capital_count()
{
$res = UserLogic::capital_count($this->userId);

View File

@ -6,8 +6,7 @@
use app\api\logic\user\UserFeedbackLogic;
use app\admin\validate\user\UserFeedbackValidate;
use app\api\controller\BaseApiController;
use hg\apidoc\annotation as ApiDoc;
#[ApiDoc\NotParse()]
class UserFeedbackController extends BaseApiController
{

View File

@ -5,25 +5,23 @@ namespace app\api\controller\user;
use app\api\controller\BaseApiController;
use app\api\logic\user\UserVisitLogic;
use app\api\validate\VisitValidate;
use hg\apidoc\annotation as ApiDoc;
use Illuminate\Support\Facades\Request;
use support\Response;
#[ApiDoc\title('用户访问')]
class UserVisitController extends BaseApiController
{
public $notNeedLogin = ['productLog'];
#[
ApiDoc\Title('添加访问商品记录'),
ApiDoc\url('/api/user/UserVisit/productLog'),
ApiDoc\Method('POST'),
ApiDoc\Param(name: "product_id", type: "int", require: true, desc: "product_id商品id"),
ApiDoc\Param(name: "cate_id", type: "int", require: true, desc: "分类id"),
ApiDoc\NotHeaders(),
ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('添加访问商品记录'),
// ApiDoc\url('/api/user/UserVisit/productLog'),
// ApiDoc\Method('POST'),
// ApiDoc\Param(name: "product_id", type: "int", require: true, desc: "product_id商品id"),
// ApiDoc\Param(name: "cate_id", type: "int", require: true, desc: "分类id"),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function productLog(): Response
{
$params = (new VisitValidate())->post()->goCheck('add');
@ -37,16 +35,16 @@ class UserVisitController extends BaseApiController
}
#[
ApiDoc\Title('用户访问页面记录'),
ApiDoc\url('/api/user/UserVisit/htmlLog'),
ApiDoc\Method('POST'),
ApiDoc\Param(name: "url", type: "string", require: true, desc: "路径"),
ApiDoc\Param(name: "stay_time", type: "int", require: true, desc: "停留时间"),
ApiDoc\NotHeaders(),
ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('用户访问页面记录'),
// ApiDoc\url('/api/user/UserVisit/htmlLog'),
// ApiDoc\Method('POST'),
// ApiDoc\Param(name: "url", type: "string", require: true, desc: "路径"),
// ApiDoc\Param(name: "stay_time", type: "int", require: true, desc: "停留时间"),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function htmlLog()
{
$ip = $this->request->getRealIp();

View File

@ -7,9 +7,8 @@ namespace app\common\controller;
use app\BaseController;
use app\common\lists\BaseDataLists;
use app\common\service\JsonService;
use hg\apidoc\annotation as ApiDoc;
#[ApiDoc\NotParse()]
class BaseLikeController extends BaseController
{
public $notNeedLogin = [];
@ -74,10 +73,10 @@ class BaseLikeController extends BaseController
return JsonService::fail($msg, $data, $code, $show);
}
#[ApiDoc\NotParse()]
#[
ApiDoc\Title('是否免登录验证'),
]
// #[
// ApiDoc\Title('是否免登录验证'),
// ]
public function isNotNeedLogin() : bool
{
$notNeedLogin = $this->notNeedLogin;

View File

@ -2,22 +2,21 @@
namespace app\common\controller;
use hg\apidoc\annotation as ApiDoc;
class Definitions
{
#[
ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
]
// #[
// ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
// ]
public function token()
{
}
#[
ApiDoc\Query("page_no", type: "int", require: false, default: 1, desc: "页码"),
ApiDoc\Query("page_size", type: "int", require: false, default: 25, desc: "每页条数"),
]
// #[
// ApiDoc\Query("page_no", type: "int", require: false, default: 1, desc: "页码"),
// ApiDoc\Query("page_size", type: "int", require: false, default: 25, desc: "每页条数"),
// ]
public function page()
{

View File

@ -0,0 +1,60 @@
<?php
namespace app\common\lists\user;
use app\admin\lists\BaseAdminDataLists;
use app\common\model\user\UserShip;
/**
* 会员类型
*/
class UserShipLists extends BaseAdminDataLists
{
/**
* @notes 搜索条件
* @return array
* @author 乔峰
* @date 2022/9/22 15:50
*/
public function setSearch(): array
{
return [
];
}
/**
* @notes 获会员类型列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author 乔峰
* @date 2022/9/22 15:50
*/
public function lists(): array
{
$field = "id,title";
$lists = UserShip::where($this->searchWhere)
->limit($this->limitOffset, $this->limitLength)
->field($field)
->order('sort desc')
->select()->toArray();
return $lists;
}
/**
* @notes 获取数量
* @return int
* @author 乔峰
* @date 2022/9/22 15:51
*/
public function count(): int
{
return UserShip::where($this->searchWhere)->count();
}
}

View File

@ -5,9 +5,7 @@ namespace app\store\controller;
use app\common\controller\BaseLikeController;
use app\common\lists\BaseDataLists;
use hg\apidoc\annotation as ApiDoc;
#[ApiDoc\NotParse()]
class BaseAdminController extends BaseLikeController
{

View File

@ -19,7 +19,6 @@ use app\admin\logic\system_store\SystemStoreLogic;
use app\common\controller\Definitions;
use app\common\service\ConfigService;
use app\common\service\FileService;
use hg\apidoc\annotation as ApiDoc;
use think\facade\Db;
/**
@ -27,27 +26,26 @@ use think\facade\Db;
* Class ConfigController
* @package app\admin\controller
*/
#[ApiDoc\title('站点配置')]
class ConfigController extends BaseAdminController
{
public $notNeedLogin = ['getConfig', 'dict'];
#[
ApiDoc\Title('站点配置'),
ApiDoc\url('/store/config/getConfig'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Author('中国队长'),
ApiDoc\ResponseSuccess("data", type: "array", children: [
['name' => 'oss_domain', 'desc' => 'oss域名', 'type' => 'string'],
['name' => 'web_name', 'desc' => '站点名称', 'type' => 'string'],
['name' => 'web_favicon', 'desc' => '站点图标', 'type' => 'string'],
['name' => 'web_logo', 'desc' => '站点logo', 'type' => 'string'],
['name' => 'login_image', 'desc' => '登录页背景图', 'type' => 'string'],
['name' => 'copyright_config', 'desc' => '版权信息', 'type' => 'array'],
]),
]
// #[
// ApiDoc\Title('站点配置'),
// ApiDoc\url('/store/config/getConfig'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Author('中国队长'),
// ApiDoc\ResponseSuccess("data", type: "array", children: [
// ['name' => 'oss_domain', 'desc' => 'oss域名', 'type' => 'string'],
// ['name' => 'web_name', 'desc' => '站点名称', 'type' => 'string'],
// ['name' => 'web_favicon', 'desc' => '站点图标', 'type' => 'string'],
// ['name' => 'web_logo', 'desc' => '站点logo', 'type' => 'string'],
// ['name' => 'login_image', 'desc' => '登录页背景图', 'type' => 'string'],
// ['name' => 'copyright_config', 'desc' => '版权信息', 'type' => 'array'],
// ]),
// ]
public function getConfig()
{
// $data = ConfigLogic::getConfig();
@ -70,15 +68,15 @@ class ConfigController extends BaseAdminController
return $this->data($data);
}
#[
ApiDoc\Title('门店配置'),
ApiDoc\url('/store/config/store'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Author('中国队长'),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('门店配置'),
// ApiDoc\url('/store/config/store'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Author('中国队长'),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function store()
{
$params['id'] = $this->request->adminInfo['store_id'];
@ -86,15 +84,15 @@ class ConfigController extends BaseAdminController
return $this->data($result);
}
#[
ApiDoc\Title('保存门店配置'),
ApiDoc\url('/store/config/saveStore'),
ApiDoc\Method('POST'),
ApiDoc\NotHeaders(),
ApiDoc\Author('中国队长'),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('保存门店配置'),
// ApiDoc\url('/store/config/saveStore'),
// ApiDoc\Method('POST'),
// ApiDoc\NotHeaders(),
// ApiDoc\Author('中国队长'),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function saveStore()
{
$params = $this->request->post();
@ -103,31 +101,31 @@ class ConfigController extends BaseAdminController
return $this->success('操作成功', [], 1, 1);
}
#[
ApiDoc\Title('省列表'),
ApiDoc\url('/store/config/province'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Author('中国队长'),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('省列表'),
// ApiDoc\url('/store/config/province'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Author('中国队长'),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function province()
{
$list = Db::name('geo_province')->select()->toArray();
return $this->success('ok', $list);
}
#[
ApiDoc\Title('市列表'),
ApiDoc\url('/store/config/city'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Author('中国队长'),
ApiDoc\Query(name: 'code', type: 'int', require: true, desc: '省份代码'),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('市列表'),
// ApiDoc\url('/store/config/city'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Author('中国队长'),
// ApiDoc\Query(name: 'code', type: 'int', require: true, desc: '省份代码'),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function city()
{
$province_code = $this->request->get('code');
@ -135,16 +133,16 @@ class ConfigController extends BaseAdminController
return $this->success('ok', $list);
}
#[
ApiDoc\Title('区列表'),
ApiDoc\url('/store/config/area'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Author('中国队长'),
ApiDoc\Query(name: 'code', type: 'int', require: true, desc: '城市代码'),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('区列表'),
// ApiDoc\url('/store/config/area'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Author('中国队长'),
// ApiDoc\Query(name: 'code', type: 'int', require: true, desc: '城市代码'),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function area()
{
$city_code = $this->request->get('code');

View File

@ -5,41 +5,39 @@ namespace app\store\controller;
use app\common\controller\Definitions;
use app\common\lists\DeliveryServiceLists;
use app\common\logic\DeliveryServiceLogic;
use hg\apidoc\annotation as ApiDoc;
#[ApiDoc\title('配送员管理')]
class DeliveryController extends BaseAdminController
{
#[
ApiDoc\Title('列表'),
ApiDoc\url('/store/delivery/lists'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Author('中国队长'),
ApiDoc\Query(name: 'keyword', type: 'string', require: false, desc: '名称/手机号'),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\Query(ref: [Definitions::class, "page"]),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('列表'),
// ApiDoc\url('/store/delivery/lists'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Author('中国队长'),
// ApiDoc\Query(name: 'keyword', type: 'string', require: false, desc: '名称/手机号'),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\Query(ref: [Definitions::class, "page"]),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function lists()
{
return $this->dataLists(new DeliveryServiceLists());
}
#[
ApiDoc\Title('添加'),
ApiDoc\url('/store/delivery/add'),
ApiDoc\Method('POST'),
ApiDoc\NotHeaders(),
ApiDoc\Author('中国队长'),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\Param(name: 'avatar', type: 'string', require: true, desc: '头像'),
ApiDoc\Param(name: 'nickname', type: 'string', require: true, desc: '店员名称'),
ApiDoc\Param(name: 'phone', type: 'string', require: true, desc: '手机号'),
ApiDoc\Param(name: 'status', type: 'string', require: true, desc: '状态1启用0禁用'),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('添加'),
// ApiDoc\url('/store/delivery/add'),
// ApiDoc\Method('POST'),
// ApiDoc\NotHeaders(),
// ApiDoc\Author('中国队长'),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\Param(name: 'avatar', type: 'string', require: true, desc: '头像'),
// ApiDoc\Param(name: 'nickname', type: 'string', require: true, desc: '店员名称'),
// ApiDoc\Param(name: 'phone', type: 'string', require: true, desc: '手机号'),
// ApiDoc\Param(name: 'status', type: 'string', require: true, desc: '状态1启用0禁用'),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function add(DeliveryServiceLogic $logic)
{
$params = $this->request->post();
@ -47,20 +45,20 @@ class DeliveryController extends BaseAdminController
return $this->success('操作成功', [], 1, 1);
}
#[
ApiDoc\Title('编辑'),
ApiDoc\url('/store/delivery/edit'),
ApiDoc\Method('POST'),
ApiDoc\NotHeaders(),
ApiDoc\Author('中国队长'),
ApiDoc\Param(name: 'id', type: 'int', require: true, desc: 'id'),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\Param(name: 'avatar', type: 'string', require: true, desc: '头像'),
ApiDoc\Param(name: 'nickname', type: 'string', require: true, desc: '店员名称'),
ApiDoc\Param(name: 'phone', type: 'string', require: true, desc: '手机号'),
ApiDoc\Param(name: 'status', type: 'string', require: true, desc: '状态1启用0禁用'),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('编辑'),
// ApiDoc\url('/store/delivery/edit'),
// ApiDoc\Method('POST'),
// ApiDoc\NotHeaders(),
// ApiDoc\Author('中国队长'),
// ApiDoc\Param(name: 'id', type: 'int', require: true, desc: 'id'),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\Param(name: 'avatar', type: 'string', require: true, desc: '头像'),
// ApiDoc\Param(name: 'nickname', type: 'string', require: true, desc: '店员名称'),
// ApiDoc\Param(name: 'phone', type: 'string', require: true, desc: '手机号'),
// ApiDoc\Param(name: 'status', type: 'string', require: true, desc: '状态1启用0禁用'),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function edit(DeliveryServiceLogic $logic)
{
$id = $this->request->post('id');
@ -69,16 +67,16 @@ class DeliveryController extends BaseAdminController
return $this->success('操作成功', [], 1, 1);
}
#[
ApiDoc\Title('删除'),
ApiDoc\url('/store/delivery/delete'),
ApiDoc\Method('POST'),
ApiDoc\NotHeaders(),
ApiDoc\Author('中国队长'),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\Param(name: 'id', type: 'int', require: true, desc: 'id'),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('删除'),
// ApiDoc\url('/store/delivery/delete'),
// ApiDoc\Method('POST'),
// ApiDoc\NotHeaders(),
// ApiDoc\Author('中国队长'),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\Param(name: 'id', type: 'int', require: true, desc: 'id'),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function delete(DeliveryServiceLogic $logic)
{
$id = $this->request->post('id');
@ -86,27 +84,27 @@ class DeliveryController extends BaseAdminController
return $this->success('操作成功', [], 1, 1);
}
#[
ApiDoc\Title('详情'),
ApiDoc\url('/store/delivery/detail'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Author('中国队长'),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\Query(name: 'id', type: 'int', require: true, desc: 'id'),
ApiDoc\ResponseSuccess("data", type: "array", children: [
['name' => 'id', 'desc' => 'ID', 'type' => 'int'],
['name' => 'account', 'desc' => '账号', 'type' => 'string'],
['name' => 'avatar', 'desc' => '头像', 'type' => 'string'],
['name' => 'staff_name', 'desc' => '店员名称', 'type' => 'string'],
['name' => 'phone', 'desc' => '手机号', 'type' => 'string'],
['name' => 'verify_status', 'desc' => '核销开关1开启0关闭', 'type' => 'int'],
['name' => 'order_status', 'desc' => '订单状态1开启0关闭', 'type' => 'int'],
['name' => 'is_admin', 'desc' => '是否管理员1是0不是', 'type' => 'int'],
['name' => 'is_manager', 'desc' => '是否是店长1是0不是', 'type' => 'int'],
['name' => 'status', 'desc' => '状态1启用0禁用', 'type' => 'int'],
]),
]
// #[
// ApiDoc\Title('详情'),
// ApiDoc\url('/store/delivery/detail'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Author('中国队长'),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\Query(name: 'id', type: 'int', require: true, desc: 'id'),
// ApiDoc\ResponseSuccess("data", type: "array", children: [
// ['name' => 'id', 'desc' => 'ID', 'type' => 'int'],
// ['name' => 'account', 'desc' => '账号', 'type' => 'string'],
// ['name' => 'avatar', 'desc' => '头像', 'type' => 'string'],
// ['name' => 'staff_name', 'desc' => '店员名称', 'type' => 'string'],
// ['name' => 'phone', 'desc' => '手机号', 'type' => 'string'],
// ['name' => 'verify_status', 'desc' => '核销开关1开启0关闭', 'type' => 'int'],
// ['name' => 'order_status', 'desc' => '订单状态1开启0关闭', 'type' => 'int'],
// ['name' => 'is_admin', 'desc' => '是否管理员1是0不是', 'type' => 'int'],
// ['name' => 'is_manager', 'desc' => '是否是店长1是0不是', 'type' => 'int'],
// ['name' => 'status', 'desc' => '状态1启用0禁用', 'type' => 'int'],
// ]),
// ]
public function detail(DeliveryServiceLogic $logic)
{
$id = $this->request->get('id');
@ -114,16 +112,16 @@ class DeliveryController extends BaseAdminController
return $this->data($data);
}
#[
ApiDoc\Title('开启/关闭'),
ApiDoc\url('/store/delivery/status'),
ApiDoc\Method('POST'),
ApiDoc\NotHeaders(),
ApiDoc\Author('中国队长'),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\Param(name: 'id', type: 'int', require: true, desc: 'id'),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('开启/关闭'),
// ApiDoc\url('/store/delivery/status'),
// ApiDoc\Method('POST'),
// ApiDoc\NotHeaders(),
// ApiDoc\Author('中国队长'),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\Param(name: 'id', type: 'int', require: true, desc: 'id'),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function status(DeliveryServiceLogic $logic)
{
$id = $this->request->post('id');

View File

@ -7,8 +7,7 @@ namespace app\store\controller;
use app\common\cache\ExportCache;
use app\common\service\JsonService;
use support\Cache;
use hg\apidoc\annotation as ApiDoc;
#[ApiDoc\NotParse()]
class DownloadController extends BaseAdminController
{

View File

@ -7,33 +7,32 @@ use app\admin\lists\file\FileLists;
use app\admin\logic\FileLogic;
use app\admin\validate\FileValidate;
use app\common\controller\Definitions;
use hg\apidoc\annotation as ApiDoc;
#[ApiDoc\title('文件管理')]
// #[ApiDoc\title('文件管理')]
class FileController extends BaseAdminController
{
#[
ApiDoc\Title('列表'),
ApiDoc\url('/store/file/lists'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\Query(ref: [Definitions::class, "page"]),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('列表'),
// ApiDoc\url('/store/file/lists'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\Query(ref: [Definitions::class, "page"]),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function lists()
{
return $this->dataLists(new FileLists());
}
#[
ApiDoc\Title('移动'),
ApiDoc\url('/store/file/move'),
ApiDoc\Method('POST'),
ApiDoc\NotHeaders(),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('移动'),
// ApiDoc\url('/store/file/move'),
// ApiDoc\Method('POST'),
// ApiDoc\NotHeaders(),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function move()
{
$params = (new FileValidate())->post()->goCheck('move');
@ -41,13 +40,13 @@ class FileController extends BaseAdminController
return $this->success('移动成功', [], 1, 1);
}
#[
ApiDoc\Title('重命名'),
ApiDoc\url('/store/file/rename'),
ApiDoc\Method('POST'),
ApiDoc\NotHeaders(),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('重命名'),
// ApiDoc\url('/store/file/rename'),
// ApiDoc\Method('POST'),
// ApiDoc\NotHeaders(),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function rename()
{
$params = (new FileValidate())->post()->goCheck('rename');
@ -55,13 +54,13 @@ class FileController extends BaseAdminController
return $this->success('重命名成功', [], 1, 1);
}
#[
ApiDoc\Title('删除'),
ApiDoc\url('/store/file/delete'),
ApiDoc\Method('POST'),
ApiDoc\NotHeaders(),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('删除'),
// ApiDoc\url('/store/file/delete'),
// ApiDoc\Method('POST'),
// ApiDoc\NotHeaders(),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function delete()
{
$params = (new FileValidate())->post()->goCheck('delete');
@ -69,25 +68,25 @@ class FileController extends BaseAdminController
return $this->success('删除成功', [], 1, 1);
}
#[
ApiDoc\Title('分类列表'),
ApiDoc\url('/store/file/listCate'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('分类列表'),
// ApiDoc\url('/store/file/listCate'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function listCate()
{
return $this->dataLists(new FileCateLists());
}
#[
ApiDoc\Title('添加文件分类'),
ApiDoc\url('/store/file/addCate'),
ApiDoc\Method('POST'),
ApiDoc\NotHeaders(),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('添加文件分类'),
// ApiDoc\url('/store/file/addCate'),
// ApiDoc\Method('POST'),
// ApiDoc\NotHeaders(),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function addCate()
{
$params = (new FileValidate())->post()->goCheck('addCate');
@ -95,13 +94,13 @@ class FileController extends BaseAdminController
return $this->success('添加成功', [], 1, 1);
}
#[
ApiDoc\Title('编辑文件分类'),
ApiDoc\url('/store/file/editCate'),
ApiDoc\Method('POST'),
ApiDoc\NotHeaders(),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('编辑文件分类'),
// ApiDoc\url('/store/file/editCate'),
// ApiDoc\Method('POST'),
// ApiDoc\NotHeaders(),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function editCate()
{
$params = (new FileValidate())->post()->goCheck('editCate');
@ -109,13 +108,13 @@ class FileController extends BaseAdminController
return $this->success('编辑成功', [], 1, 1);
}
#[
ApiDoc\Title('删除文件分类'),
ApiDoc\url('/store/file/delCate'),
ApiDoc\Method('POST'),
ApiDoc\NotHeaders(),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('删除文件分类'),
// ApiDoc\url('/store/file/delCate'),
// ApiDoc\Method('POST'),
// ApiDoc\NotHeaders(),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function delCate()
{
$params = (new FileValidate())->post()->goCheck('id');

View File

@ -17,34 +17,33 @@ namespace app\store\controller;
use app\store\logic\LoginLogic;
use app\store\validate\LoginValidate;
use think\facade\Cache;
use hg\apidoc\annotation as ApiDoc;
/**
* 管理员登录控制器
* Class LoginController
* @package app\store\controller
*/
#[ApiDoc\title('登入登出')]
// #[ApiDoc\title('登入登出')]
class LoginController extends BaseAdminController
{
public $notNeedLogin = ['account'];
#[
ApiDoc\Title('账号登录'),
ApiDoc\url('/store/login/account'),
ApiDoc\Method('POST'),
ApiDoc\Param(name: "account", type: "string", require: true, desc: "账号"),
ApiDoc\Param(name: "password", type: "string", require: true, desc: "密码"),
ApiDoc\Param(name: "terminal", type: "integer", require: true, default: 1, desc: "终端类型1-PC2-H5"),
ApiDoc\NotHeaders(),
ApiDoc\ResponseSuccess("data", type: "array", children: [
['name' => 'name', 'desc' => '用户名', 'type' => 'string'],
['name' => 'avatar', 'desc' => '头像', 'type' => 'string'],
['name' => 'token', 'desc' => 'token', 'type' => 'string'],
['name' => 'role_name', 'desc' => '角色名称', 'type' => 'integer'],
]),
]
// #[
// ApiDoc\Title('账号登录'),
// ApiDoc\url('/store/login/account'),
// ApiDoc\Method('POST'),
// ApiDoc\Param(name: "account", type: "string", require: true, desc: "账号"),
// ApiDoc\Param(name: "password", type: "string", require: true, desc: "密码"),
// ApiDoc\Param(name: "terminal", type: "integer", require: true, default: 1, desc: "终端类型1-PC2-H5"),
// ApiDoc\NotHeaders(),
// ApiDoc\ResponseSuccess("data", type: "array", children: [
// ['name' => 'name', 'desc' => '用户名', 'type' => 'string'],
// ['name' => 'avatar', 'desc' => '头像', 'type' => 'string'],
// ['name' => 'token', 'desc' => 'token', 'type' => 'string'],
// ['name' => 'role_name', 'desc' => '角色名称', 'type' => 'integer'],
// ]),
// ]
public function account()
{
$params = (new LoginValidate())->post()->goCheck();
@ -52,14 +51,14 @@ class LoginController extends BaseAdminController
return $this->data((new LoginLogic())->login($params));
}
#[
ApiDoc\Title('退出登录'),
ApiDoc\url('/store/login/logout'),
ApiDoc\Method('POST'),
ApiDoc\NotHeaders(),
ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('退出登录'),
// ApiDoc\url('/store/login/logout'),
// ApiDoc\Method('POST'),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function logout()
{
//退出登录情况特殊只有成功的情况也不需要token验证

View File

@ -5,53 +5,52 @@ namespace app\store\controller;
use app\common\controller\Definitions;
use app\common\lists\StoreStaffLists;
use app\common\logic\SystemStoreStaffLogic;
use hg\apidoc\annotation as ApiDoc;
#[ApiDoc\title('店员管理')]
// #[ApiDoc\title('店员管理')]
class StaffController extends BaseAdminController
{
#[
ApiDoc\Title('列表'),
ApiDoc\url('/store/staff/lists'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Author('中国队长'),
ApiDoc\Query(name: 'keyword', type: 'string', require: false, desc: '店员名称/手机号/账号'),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\Query(ref: [Definitions::class, "page"]),
ApiDoc\ResponseSuccess("data", type: "array", children: [
['name' => 'id', 'desc' => 'id', 'type' => 'int'],
['name' => 'staff_name', 'desc' => '店员名称', 'type' => 'string'],
['name' => 'avatar', 'desc' => '头像', 'type' => 'string'],
['name' => 'account', 'desc' => '账号', 'type' => 'string'],
['name' => 'phone', 'desc' => '手机号', 'type' => 'string'],
['name' => 'is_admin', 'desc' => '是否是管理员1是0不是', 'type' => 'int'],
['name' => 'is_manager', 'desc' => '是否是店长1是0不是', 'type' => 'int'],
]),
]
// #[
// ApiDoc\Title('列表'),
// ApiDoc\url('/store/staff/lists'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Author('中国队长'),
// ApiDoc\Query(name: 'keyword', type: 'string', require: false, desc: '店员名称/手机号/账号'),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\Query(ref: [Definitions::class, "page"]),
// ApiDoc\ResponseSuccess("data", type: "array", children: [
// ['name' => 'id', 'desc' => 'id', 'type' => 'int'],
// ['name' => 'staff_name', 'desc' => '店员名称', 'type' => 'string'],
// ['name' => 'avatar', 'desc' => '头像', 'type' => 'string'],
// ['name' => 'account', 'desc' => '账号', 'type' => 'string'],
// ['name' => 'phone', 'desc' => '手机号', 'type' => 'string'],
// ['name' => 'is_admin', 'desc' => '是否是管理员1是0不是', 'type' => 'int'],
// ['name' => 'is_manager', 'desc' => '是否是店长1是0不是', 'type' => 'int'],
// ]),
// ]
public function lists()
{
return $this->dataLists(new StoreStaffLists());
}
#[
ApiDoc\Title('添加'),
ApiDoc\url('/store/staff/add'),
ApiDoc\Method('POST'),
ApiDoc\NotHeaders(),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\Param(name: 'account', type: 'string', require: true, desc: '账号'),
ApiDoc\Param(name: 'pwd', type: 'string', require: true, desc: '密码'),
ApiDoc\Param(name: 'avatar', type: 'string', require: true, desc: '头像'),
ApiDoc\Param(name: 'staff_name', type: 'string', require: true, desc: '店员名称'),
ApiDoc\Param(name: 'phone', type: 'string', require: true, desc: '手机号'),
ApiDoc\Param(name: 'verify_status', type: 'string', require: true, desc: '核销开关1开启0关闭'),
ApiDoc\Param(name: 'order_status', type: 'string', require: true, desc: '订单状态1开启0关闭'),
ApiDoc\Param(name: 'is_manager', type: 'string', require: true, desc: '是否是店长1是0不是'),
ApiDoc\Param(name: 'status', type: 'string', require: true, desc: '状态1启用0禁用'),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('添加'),
// ApiDoc\url('/store/staff/add'),
// ApiDoc\Method('POST'),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\Param(name: 'account', type: 'string', require: true, desc: '账号'),
// ApiDoc\Param(name: 'pwd', type: 'string', require: true, desc: '密码'),
// ApiDoc\Param(name: 'avatar', type: 'string', require: true, desc: '头像'),
// ApiDoc\Param(name: 'staff_name', type: 'string', require: true, desc: '店员名称'),
// ApiDoc\Param(name: 'phone', type: 'string', require: true, desc: '手机号'),
// ApiDoc\Param(name: 'verify_status', type: 'string', require: true, desc: '核销开关1开启0关闭'),
// ApiDoc\Param(name: 'order_status', type: 'string', require: true, desc: '订单状态1开启0关闭'),
// ApiDoc\Param(name: 'is_manager', type: 'string', require: true, desc: '是否是店长1是0不是'),
// ApiDoc\Param(name: 'status', type: 'string', require: true, desc: '状态1启用0禁用'),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function add(SystemStoreStaffLogic $staffLogic)
{
$params = $this->request->post();
@ -59,24 +58,24 @@ class StaffController extends BaseAdminController
return $this->success('操作成功', [], 1, 1);
}
#[
ApiDoc\Title('编辑'),
ApiDoc\url('/store/staff/edit'),
ApiDoc\Method('POST'),
ApiDoc\NotHeaders(),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\Param(name: 'id', type: 'int', require: true, desc: 'id'),
ApiDoc\Param(name: 'account', type: 'string', require: true, desc: '账号'),
ApiDoc\Param(name: 'pwd', type: 'string', require: true, desc: '密码'),
ApiDoc\Param(name: 'avatar', type: 'string', require: true, desc: '头像'),
ApiDoc\Param(name: 'staff_name', type: 'string', require: true, desc: '店员名称'),
ApiDoc\Param(name: 'phone', type: 'string', require: true, desc: '手机号'),
ApiDoc\Param(name: 'verify_status', type: 'string', require: true, desc: '核销开关1开启0关闭'),
ApiDoc\Param(name: 'order_status', type: 'string', require: true, desc: '订单状态1开启0关闭'),
ApiDoc\Param(name: 'is_manager', type: 'string', require: true, desc: '是否是店长1是0不是'),
ApiDoc\Param(name: 'status', type: 'string', require: true, desc: '状态1启用0禁用'),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('编辑'),
// ApiDoc\url('/store/staff/edit'),
// ApiDoc\Method('POST'),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\Param(name: 'id', type: 'int', require: true, desc: 'id'),
// ApiDoc\Param(name: 'account', type: 'string', require: true, desc: '账号'),
// ApiDoc\Param(name: 'pwd', type: 'string', require: true, desc: '密码'),
// ApiDoc\Param(name: 'avatar', type: 'string', require: true, desc: '头像'),
// ApiDoc\Param(name: 'staff_name', type: 'string', require: true, desc: '店员名称'),
// ApiDoc\Param(name: 'phone', type: 'string', require: true, desc: '手机号'),
// ApiDoc\Param(name: 'verify_status', type: 'string', require: true, desc: '核销开关1开启0关闭'),
// ApiDoc\Param(name: 'order_status', type: 'string', require: true, desc: '订单状态1开启0关闭'),
// ApiDoc\Param(name: 'is_manager', type: 'string', require: true, desc: '是否是店长1是0不是'),
// ApiDoc\Param(name: 'status', type: 'string', require: true, desc: '状态1启用0禁用'),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function edit(SystemStoreStaffLogic $staffLogic)
{
$id = $this->request->post('id');
@ -85,15 +84,15 @@ class StaffController extends BaseAdminController
return $this->success('操作成功', [], 1, 1);
}
#[
ApiDoc\Title('删除'),
ApiDoc\url('/store/staff/delete'),
ApiDoc\Method('POST'),
ApiDoc\NotHeaders(),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\Param(name: 'id', type: 'int', require: true, desc: 'id'),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('删除'),
// ApiDoc\url('/store/staff/delete'),
// ApiDoc\Method('POST'),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\Param(name: 'id', type: 'int', require: true, desc: 'id'),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function delete(SystemStoreStaffLogic $staffLogic)
{
$id = $this->request->post('id');
@ -101,26 +100,26 @@ class StaffController extends BaseAdminController
return $this->success('操作成功', [], 1, 1);
}
#[
ApiDoc\Title('详情'),
ApiDoc\url('/store/staff/detail'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\Query(name: 'id', type: 'int', require: true, desc: 'id'),
ApiDoc\ResponseSuccess("data", type: "array", children: [
['name' => 'id', 'desc' => 'ID', 'type' => 'int'],
['name' => 'account', 'desc' => '账号', 'type' => 'string'],
['name' => 'avatar', 'desc' => '头像', 'type' => 'string'],
['name' => 'staff_name', 'desc' => '店员名称', 'type' => 'string'],
['name' => 'phone', 'desc' => '手机号', 'type' => 'string'],
['name' => 'verify_status', 'desc' => '核销开关1开启0关闭', 'type' => 'int'],
['name' => 'order_status', 'desc' => '订单状态1开启0关闭', 'type' => 'int'],
['name' => 'is_admin', 'desc' => '是否管理员1是0不是', 'type' => 'int'],
['name' => 'is_manager', 'desc' => '是否是店长1是0不是', 'type' => 'int'],
['name' => 'status', 'desc' => '状态1启用0禁用', 'type' => 'int'],
]),
]
// #[
// ApiDoc\Title('详情'),
// ApiDoc\url('/store/staff/detail'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\Query(name: 'id', type: 'int', require: true, desc: 'id'),
// ApiDoc\ResponseSuccess("data", type: "array", children: [
// ['name' => 'id', 'desc' => 'ID', 'type' => 'int'],
// ['name' => 'account', 'desc' => '账号', 'type' => 'string'],
// ['name' => 'avatar', 'desc' => '头像', 'type' => 'string'],
// ['name' => 'staff_name', 'desc' => '店员名称', 'type' => 'string'],
// ['name' => 'phone', 'desc' => '手机号', 'type' => 'string'],
// ['name' => 'verify_status', 'desc' => '核销开关1开启0关闭', 'type' => 'int'],
// ['name' => 'order_status', 'desc' => '订单状态1开启0关闭', 'type' => 'int'],
// ['name' => 'is_admin', 'desc' => '是否管理员1是0不是', 'type' => 'int'],
// ['name' => 'is_manager', 'desc' => '是否是店长1是0不是', 'type' => 'int'],
// ['name' => 'status', 'desc' => '状态1启用0禁用', 'type' => 'int'],
// ]),
// ]
public function detail(SystemStoreStaffLogic $staffLogic)
{
$id = $this->request->get('id');
@ -128,15 +127,15 @@ class StaffController extends BaseAdminController
return $this->data($data);
}
#[
ApiDoc\Title('开启/关闭'),
ApiDoc\url('/store/staff/status'),
ApiDoc\Method('POST'),
ApiDoc\NotHeaders(),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\Param(name: 'id', type: 'int', require: true, desc: 'id'),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('开启/关闭'),
// ApiDoc\url('/store/staff/status'),
// ApiDoc\Method('POST'),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\Param(name: 'id', type: 'int', require: true, desc: 'id'),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function status(SystemStoreStaffLogic $logic)
{
$id = $this->request->post('id');

View File

@ -6,9 +6,7 @@ namespace app\store\controller;
use app\common\service\UploadService;
use Exception;
use Tinywan\Storage\Storage;
use hg\apidoc\annotation as ApiDoc;
#[ApiDoc\NotParse()]
class UploadController extends BaseAdminController
{

View File

@ -5,23 +5,22 @@ namespace app\store\controller;
use app\common\controller\Definitions;
use app\store\lists\store_order\StoreOrderLists;
use app\store\logic\WorkbenchLogic;
use hg\apidoc\annotation as ApiDoc;
#[ApiDoc\Title('工作台')]
// #[ApiDoc\Title('工作台')]
class WorkbenchController extends BaseAdminController
{
#[
ApiDoc\Title('交易统计'),
ApiDoc\url('/store/workbench/index'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Author('中国队长'),
ApiDoc\Query(name: 'start_time', type: 'string', require: true, desc: '开始时间'),
ApiDoc\Query(name: 'end_time', type: 'string', require: true, desc: '结束时间'),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('交易统计'),
// ApiDoc\url('/store/workbench/index'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Author('中国队长'),
// ApiDoc\Query(name: 'start_time', type: 'string', require: true, desc: '开始时间'),
// ApiDoc\Query(name: 'end_time', type: 'string', require: true, desc: '结束时间'),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function index()
{
$params = $this->request->get();
@ -30,17 +29,17 @@ class WorkbenchController extends BaseAdminController
return $this->data($result);
}
#[
ApiDoc\Title('商品统计(暂时不用)'),
ApiDoc\url('/store/workbench/product'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Author('中国队长'),
ApiDoc\Query(name: 'start_time', type: 'string', require: true, desc: '开始时间'),
ApiDoc\Query(name: 'end_time', type: 'string', require: true, desc: '结束时间'),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('商品统计(暂时不用)'),
// ApiDoc\url('/store/workbench/product'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Author('中国队长'),
// ApiDoc\Query(name: 'start_time', type: 'string', require: true, desc: '开始时间'),
// ApiDoc\Query(name: 'end_time', type: 'string', require: true, desc: '结束时间'),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function product()
{
$params = $this->request->get();
@ -49,17 +48,17 @@ class WorkbenchController extends BaseAdminController
return $this->data($result);
}
#[
ApiDoc\Title('配送统计'),
ApiDoc\url('/store/workbench/delivery'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Author('中国队长'),
ApiDoc\Query(name: 'start_time', type: 'string', require: true, desc: '开始时间'),
ApiDoc\Query(name: 'end_time', type: 'string', require: true, desc: '结束时间'),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('配送统计'),
// ApiDoc\url('/store/workbench/delivery'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Author('中国队长'),
// ApiDoc\Query(name: 'start_time', type: 'string', require: true, desc: '开始时间'),
// ApiDoc\Query(name: 'end_time', type: 'string', require: true, desc: '结束时间'),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function delivery()
{
$params = $this->request->get();
@ -68,18 +67,18 @@ class WorkbenchController extends BaseAdminController
return $this->data($result);
}
#[
ApiDoc\Title('配送订单统计'),
ApiDoc\url('/store/workbench/deliveryOrder'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Author('中国队长'),
ApiDoc\Query(name: 'start_time', type: 'string', require: true, desc: '开始时间'),
ApiDoc\Query(name: 'end_time', type: 'string', require: true, desc: '结束时间'),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\Query(ref: [Definitions::class, "page"]),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('配送订单统计'),
// ApiDoc\url('/store/workbench/deliveryOrder'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Author('中国队长'),
// ApiDoc\Query(name: 'start_time', type: 'string', require: true, desc: '开始时间'),
// ApiDoc\Query(name: 'end_time', type: 'string', require: true, desc: '结束时间'),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\Query(ref: [Definitions::class, "page"]),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function deliveryOrder()
{
$params = $this->request->get();
@ -88,17 +87,17 @@ class WorkbenchController extends BaseAdminController
return $this->data($result);
}
#[
ApiDoc\Title('商品统计-概况'),
ApiDoc\url('/store/workbench/get_basic'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Author('中国队长'),
ApiDoc\Query(name: 'start_time', type: 'string', require: true, desc: '开始时间'),
ApiDoc\Query(name: 'end_time', type: 'string', require: true, desc: '结束时间'),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('商品统计-概况'),
// ApiDoc\url('/store/workbench/get_basic'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Author('中国队长'),
// ApiDoc\Query(name: 'start_time', type: 'string', require: true, desc: '开始时间'),
// ApiDoc\Query(name: 'end_time', type: 'string', require: true, desc: '结束时间'),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function get_basic(\app\admin\controller\WorkbenchController $workbench)
{
$params = $this->request->get();
@ -106,17 +105,17 @@ class WorkbenchController extends BaseAdminController
return $workbench->get_basic();
}
#[
ApiDoc\Title('商品统计-图表'),
ApiDoc\url('/store/workbench/get_trend'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Author('中国队长'),
ApiDoc\Query(name: 'start_time', type: 'string', require: true, desc: '开始时间'),
ApiDoc\Query(name: 'end_time', type: 'string', require: true, desc: '结束时间'),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('商品统计-图表'),
// ApiDoc\url('/store/workbench/get_trend'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Author('中国队长'),
// ApiDoc\Query(name: 'start_time', type: 'string', require: true, desc: '开始时间'),
// ApiDoc\Query(name: 'end_time', type: 'string', require: true, desc: '结束时间'),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function get_trend(\app\admin\controller\WorkbenchController $workbench)
{
$params = $this->request->get();
@ -124,17 +123,17 @@ class WorkbenchController extends BaseAdminController
return $workbench->get_trend();
}
#[
ApiDoc\Title('商品统计-排行'),
ApiDoc\url('/store/workbench/get_product_ranking'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Author('中国队长'),
ApiDoc\Query(name: 'start_time', type: 'string', require: true, desc: '开始时间'),
ApiDoc\Query(name: 'end_time', type: 'string', require: true, desc: '结束时间'),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('商品统计-排行'),
// ApiDoc\url('/store/workbench/get_product_ranking'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Author('中国队长'),
// ApiDoc\Query(name: 'start_time', type: 'string', require: true, desc: '开始时间'),
// ApiDoc\Query(name: 'end_time', type: 'string', require: true, desc: '结束时间'),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function get_product_ranking(\app\admin\controller\WorkbenchController $workbench)
{
$params = $this->request->get();
@ -143,16 +142,16 @@ class WorkbenchController extends BaseAdminController
}
#[
ApiDoc\Title('收银台数据统计'),
ApiDoc\url('/store/workbench/business_statistics'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Author('中国队长'),
ApiDoc\Query(),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('收银台数据统计'),
// ApiDoc\url('/store/workbench/business_statistics'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Author('中国队长'),
// ApiDoc\Query(),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function business_statistics()
{
$params = $this->request->get();

View File

@ -19,38 +19,37 @@ use app\store\lists\auth\AdminLists;
use app\store\validate\auth\AdminValidate;
use app\store\logic\auth\AdminLogic;
use app\store\validate\auth\editSelfValidate;
use hg\apidoc\annotation as ApiDoc;
/**
* 管理员控制器
* Class AdminController
* @package app\store\controller\auth
*/
#[ApiDoc\title('管理员信息')]
// #[ApiDoc\title('管理员信息')]
class AdminController extends BaseAdminController
{
#[
ApiDoc\Title("查看管理员列表"),
ApiDoc\url('/store/auth/admin/lists'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title("查看管理员列表"),
// ApiDoc\url('/store/auth/admin/lists'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function lists()
{
return $this->dataLists(new AdminLists());
}
#[
ApiDoc\Title("添加管理员"),
ApiDoc\url('/store/auth/admin/add'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title("添加管理员"),
// ApiDoc\url('/store/auth/admin/add'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function add()
{
$params = (new AdminValidate())->post()->goCheck('add');
@ -61,14 +60,14 @@ class AdminController extends BaseAdminController
return $this->fail(AdminLogic::getError());
}
#[
ApiDoc\Title("编辑管理员"),
ApiDoc\url('/store/auth/admin/edit'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title("编辑管理员"),
// ApiDoc\url('/store/auth/admin/edit'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function edit()
{
$params = (new AdminValidate())->post()->goCheck('edit');
@ -79,14 +78,14 @@ class AdminController extends BaseAdminController
return $this->fail(AdminLogic::getError());
}
#[
ApiDoc\Title("删除管理员"),
ApiDoc\url('/store/auth/admin/delete'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title("删除管理员"),
// ApiDoc\url('/store/auth/admin/delete'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function delete()
{
$params = (new AdminValidate())->post()->goCheck('delete');
@ -97,14 +96,14 @@ class AdminController extends BaseAdminController
return $this->fail(AdminLogic::getError());
}
#[
ApiDoc\Title("查看管理员详情"),
ApiDoc\url('/store/auth/admin/detail'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title("查看管理员详情"),
// ApiDoc\url('/store/auth/admin/detail'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function detail()
{
$params = (new AdminValidate())->goCheck('detail');
@ -112,28 +111,28 @@ class AdminController extends BaseAdminController
return $this->data($result);
}
#[
ApiDoc\Title("获取当前管理员信息"),
ApiDoc\url('/store/auth/admin/mySelf'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title("获取当前管理员信息"),
// ApiDoc\url('/store/auth/admin/mySelf'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function mySelf()
{
$result = AdminLogic::detail(['id' => $this->adminId], 'auth');
return $this->data($result);
}
#[
ApiDoc\Title("编辑超级管理员信息"),
ApiDoc\url('/store/auth/admin/editSelf'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title("编辑超级管理员信息"),
// ApiDoc\url('/store/auth/admin/editSelf'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function editSelf()
{
$params = (new editSelfValidate())->post()->goCheck('', ['admin_id' => $this->adminId]);

View File

@ -19,7 +19,6 @@ use app\store\controller\BaseAdminController;
use app\store\lists\auth\MenuLists;
use app\store\logic\auth\MenuLogic;
use app\store\validate\auth\MenuValidate;
use hg\apidoc\annotation as ApiDoc;
/**
@ -27,7 +26,7 @@ use hg\apidoc\annotation as ApiDoc;
* Class MenuController
* @package app\store\controller\setting\system
*/
#[ApiDoc\NotParse()]
class MenuController extends BaseAdminController
{

View File

@ -20,14 +20,12 @@ use app\store\{
validate\auth\RoleValidate,
controller\BaseAdminController
};
use hg\apidoc\annotation as ApiDoc;
/**
* 角色控制器
* Class RoleController
* @package app\store\controller\auth
*/
#[ApiDoc\NotParse()]
class RoleController extends BaseAdminController
{

View File

@ -8,9 +8,8 @@ use app\common\model\store_branch_product\StoreBranchProduct;
use app\store\lists\cart\CartList;
use app\common\model\order\Cart;
use app\store\controller\BaseAdminController;
use hg\apidoc\annotation as ApiDoc;
#[ApiDoc\NotParse()]
class CartController extends BaseAdminController
{
public function list()

View File

@ -5,8 +5,7 @@ namespace app\store\controller\cate;
use app\store\controller\BaseAdminController;
use app\api\lists\cate\CateLists;
use hg\apidoc\annotation as ApiDoc;
#[ApiDoc\NotParse()]
/**
* 商品分类控制器

View File

@ -6,54 +6,53 @@ use app\admin\lists\store_finance_flow\StoreFinanceFlowLists;
use app\common\controller\Definitions;
use app\common\logic\StoreFinanceFlowLogic;
use app\store\controller\BaseAdminController;
use hg\apidoc\annotation as ApiDoc;
#[ApiDoc\title('财务')]
// #[ApiDoc\title('财务')]
class FinanceController extends BaseAdminController
{
#[
ApiDoc\Title('财务流水'),
ApiDoc\url('/store/finance/finance/lists'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Author('中国队长'),
ApiDoc\Query(name: 'keyword', type: 'string', require: false, desc: '订单编号'),
ApiDoc\Query(name: 'staff_id', type: 'int', require: false, desc: '店员id'),
ApiDoc\Query(name: 'start_time', type: 'string', require: false, desc: '开始时间'),
ApiDoc\Query(name: 'end_time', type: 'string', require: false, desc: '结束时间'),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\Query(ref: [Definitions::class, "page"]),
ApiDoc\ResponseSuccess("data", type: "array", children: [
['name' => 'id', 'desc' => 'ID', 'type' => 'int'],
['name' => 'financial_record_sn', 'desc' => '流水号', 'type' => 'string'],
['name' => 'order_sn', 'desc' => '订单号', 'type' => 'string'],
['name' => 'number', 'desc' => '金额', 'type' => 'float'],
['name' => 'create_time', 'desc' => '创建时间', 'type' => 'string'],
['name' => 'nickname', 'desc' => '用户昵称', 'type' => 'string'],
['name' => 'staff_name', 'desc' => '店员', 'type' => 'string'],
['name' => 'store_name', 'desc' => '店铺名称', 'type' => 'string'],
['name' => 'pay_type_name', 'desc' => '支付方式', 'type' => 'string'],
['name' => 'financial_type_name', 'desc' => '流水类型', 'type' => 'string'],
['name' => 'remark', 'desc' => '备注', 'type' => 'string'],
]),
]
// #[
// ApiDoc\Title('财务流水'),
// ApiDoc\url('/store/finance/finance/lists'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Author('中国队长'),
// ApiDoc\Query(name: 'keyword', type: 'string', require: false, desc: '订单编号'),
// ApiDoc\Query(name: 'staff_id', type: 'int', require: false, desc: '店员id'),
// ApiDoc\Query(name: 'start_time', type: 'string', require: false, desc: '开始时间'),
// ApiDoc\Query(name: 'end_time', type: 'string', require: false, desc: '结束时间'),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\Query(ref: [Definitions::class, "page"]),
// ApiDoc\ResponseSuccess("data", type: "array", children: [
// ['name' => 'id', 'desc' => 'ID', 'type' => 'int'],
// ['name' => 'financial_record_sn', 'desc' => '流水号', 'type' => 'string'],
// ['name' => 'order_sn', 'desc' => '订单号', 'type' => 'string'],
// ['name' => 'number', 'desc' => '金额', 'type' => 'float'],
// ['name' => 'create_time', 'desc' => '创建时间', 'type' => 'string'],
// ['name' => 'nickname', 'desc' => '用户昵称', 'type' => 'string'],
// ['name' => 'staff_name', 'desc' => '店员', 'type' => 'string'],
// ['name' => 'store_name', 'desc' => '店铺名称', 'type' => 'string'],
// ['name' => 'pay_type_name', 'desc' => '支付方式', 'type' => 'string'],
// ['name' => 'financial_type_name', 'desc' => '流水类型', 'type' => 'string'],
// ['name' => 'remark', 'desc' => '备注', 'type' => 'string'],
// ]),
// ]
public function lists()
{
return $this->dataLists(new StoreFinanceFlowLists());
}
#[
ApiDoc\Title('备注'),
ApiDoc\url('/store/finance/finance/remark'),
ApiDoc\Method('POST'),
ApiDoc\NotHeaders(),
ApiDoc\Author('中国队长'),
ApiDoc\Param(name: 'id', type: 'int', require: true, desc: 'id'),
ApiDoc\Param(name: 'remark', type: 'string', require: true, desc: '备注'),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('备注'),
// ApiDoc\url('/store/finance/finance/remark'),
// ApiDoc\Method('POST'),
// ApiDoc\NotHeaders(),
// ApiDoc\Author('中国队长'),
// ApiDoc\Param(name: 'id', type: 'int', require: true, desc: 'id'),
// ApiDoc\Param(name: 'remark', type: 'string', require: true, desc: '备注'),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function remark(StoreFinanceFlowLogic $logic)
{
$id = $this->request->post('id');

View File

@ -6,46 +6,45 @@ use app\admin\lists\store_finance_flow\StoreFinanceFlowLists;
use app\common\controller\Definitions;
use app\common\lists\StoreBillLists;
use app\store\controller\BaseAdminController;
use hg\apidoc\annotation as ApiDoc;
#[ApiDoc\title('账单记录')]
// #[ApiDoc\title('账单记录')]
class StoreBillController extends BaseAdminController
{
#[
ApiDoc\Title('列表'),
ApiDoc\url('/store/finance/storeBill/lists'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Author('中国队长'),
ApiDoc\Query(name: 'type', type: 'int', require: false, desc: '类型1日账单2周账单3月账单'),
ApiDoc\Query(name: 'start_time', type: 'string', require: false, desc: '开始时间'),
ApiDoc\Query(name: 'end_time', type: 'string', require: false, desc: '结束时间'),
ApiDoc\Query(name: 'export', type: 'int', require: false, desc: '是否导出2是'),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\Query(ref: [Definitions::class, "page"]),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('列表'),
// ApiDoc\url('/store/finance/storeBill/lists'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Author('中国队长'),
// ApiDoc\Query(name: 'type', type: 'int', require: false, desc: '类型1日账单2周账单3月账单'),
// ApiDoc\Query(name: 'start_time', type: 'string', require: false, desc: '开始时间'),
// ApiDoc\Query(name: 'end_time', type: 'string', require: false, desc: '结束时间'),
// ApiDoc\Query(name: 'export', type: 'int', require: false, desc: '是否导出2是'),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\Query(ref: [Definitions::class, "page"]),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function lists()
{
return $this->dataLists(new StoreBillLists());
}
#[
ApiDoc\Title('详情'),
ApiDoc\url('/store/finance/storeBill/detail'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Author('中国队长'),
ApiDoc\Param(name: 'id', type: 'int', require: true, desc: 'id'),
ApiDoc\Query(name: 'date_type', type: 'int', require: false, desc: '日期类型1日账单2周账单3月账单'),
ApiDoc\Query(name: 'date', type: 'string', require: false, desc: '日期日账单2021-01-01周账单2024-W23月账单2021-01'),
ApiDoc\Query(name: 'staff_id', type: 'int', require: false, desc: '店员id'),
ApiDoc\Query(name: 'keyword', type: 'string', require: false, desc: '流水号/用户昵称'),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\Query(ref: [Definitions::class, "page"]),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('详情'),
// ApiDoc\url('/store/finance/storeBill/detail'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Author('中国队长'),
// ApiDoc\Param(name: 'id', type: 'int', require: true, desc: 'id'),
// ApiDoc\Query(name: 'date_type', type: 'int', require: false, desc: '日期类型1日账单2周账单3月账单'),
// ApiDoc\Query(name: 'date', type: 'string', require: false, desc: '日期日账单2021-01-01周账单2024-W23月账单2021-01'),
// ApiDoc\Query(name: 'staff_id', type: 'int', require: false, desc: '店员id'),
// ApiDoc\Query(name: 'keyword', type: 'string', require: false, desc: '流水号/用户昵称'),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\Query(ref: [Definitions::class, "page"]),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function detail()
{
return $this->dataLists(new StoreFinanceFlowLists());

View File

@ -14,7 +14,6 @@ use app\store\controller\BaseAdminController;
use app\common\logic\store_order\StoreOrderLogic;
use app\common\model\store_order\StoreOrder;
use app\store\validate\store_order\StoreOrderValidate;
use hg\apidoc\annotation as ApiDoc;
use support\Log;
use Webman\RedisQueue\Redis;
@ -23,59 +22,59 @@ use Webman\RedisQueue\Redis;
* Class StoreOrderController
* @package app\store\controller\store_order
*/
#[ApiDoc\title('订单')]
// #[ApiDoc\title('订单')]
class StoreOrderController extends BaseAdminController
{
#[
ApiDoc\Title('订单列表'),
ApiDoc\url('/store/store_order/storeOrder/lists'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Author('中国队长'),
ApiDoc\Query(name: 'order_id', type: 'string', require: false, desc: '订单编号'),
ApiDoc\Query(name: 'staff_id', type: 'int', require: false, desc: '店员id'),
ApiDoc\Query(name: 'delivery_phone', type: 'int', require: false, desc: '配送员手机号'),
ApiDoc\Query(name: 'shipping_type', type: 'int', require: false, desc: '订单配送方式1配送订单2核销订单3收银台订单'),
ApiDoc\Query(name: 'start_time', type: 'string', require: false, desc: '开始时间'),
ApiDoc\Query(name: 'end_time', type: 'string', require: false, desc: '结束时间'),
ApiDoc\Query(name: 'status', type: 'int', require: false, desc: '状态:-1待支付0待发货1待收货2已完成'),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\Query(ref: [Definitions::class, "page"]),
ApiDoc\ResponseSuccess("data", type: "array", children: [
['name' => 'id', 'desc' => 'ID', 'type' => 'int'],
['name' => 'order_id', 'desc' => '订单编号', 'type' => 'string'],
['name' => 'pay_price', 'desc' => '支付金额', 'type' => 'string'],
['name' => 'pay_time', 'desc' => '支付时间', 'type' => 'float'],
['name' => 'pay_type', 'desc' => '支付方式', 'type' => 'float'],
['name' => 'status_name', 'desc' => '状态', 'type' => 'int'],
['name' => 'staff_name', 'desc' => '店员', 'type' => 'int'],
['name' => 'nickname', 'desc' => '用户昵称', 'type' => 'string'],
['name' => 'avatar', 'desc' => '用户头像', 'type' => 'string'],
['name' => 'product', 'desc' => '商品信息', 'type' => 'array', 'children' => [
['name' => 'cart_info', 'desc' => '商品信息', 'type' => 'array', 'children' => [
['name' => 'name', 'desc' => '商品名称', 'type' => 'int'],
['name' => 'image', 'desc' => '图片', 'type' => 'string'],
['name' => 'cart_num', 'desc' => '购买数量', 'type' => 'string'],
['name' => 'price', 'desc' => '单价', 'type' => 'string'],
]],
]],
]),
]
// #[
// ApiDoc\Title('订单列表'),
// ApiDoc\url('/store/store_order/storeOrder/lists'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Author('中国队长'),
// ApiDoc\Query(name: 'order_id', type: 'string', require: false, desc: '订单编号'),
// ApiDoc\Query(name: 'staff_id', type: 'int', require: false, desc: '店员id'),
// ApiDoc\Query(name: 'delivery_phone', type: 'int', require: false, desc: '配送员手机号'),
// ApiDoc\Query(name: 'shipping_type', type: 'int', require: false, desc: '订单配送方式1配送订单2核销订单3收银台订单'),
// ApiDoc\Query(name: 'start_time', type: 'string', require: false, desc: '开始时间'),
// ApiDoc\Query(name: 'end_time', type: 'string', require: false, desc: '结束时间'),
// ApiDoc\Query(name: 'status', type: 'int', require: false, desc: '状态:-1待支付0待发货1待收货2已完成'),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\Query(ref: [Definitions::class, "page"]),
// ApiDoc\ResponseSuccess("data", type: "array", children: [
// ['name' => 'id', 'desc' => 'ID', 'type' => 'int'],
// ['name' => 'order_id', 'desc' => '订单编号', 'type' => 'string'],
// ['name' => 'pay_price', 'desc' => '支付金额', 'type' => 'string'],
// ['name' => 'pay_time', 'desc' => '支付时间', 'type' => 'float'],
// ['name' => 'pay_type', 'desc' => '支付方式', 'type' => 'float'],
// ['name' => 'status_name', 'desc' => '状态', 'type' => 'int'],
// ['name' => 'staff_name', 'desc' => '店员', 'type' => 'int'],
// ['name' => 'nickname', 'desc' => '用户昵称', 'type' => 'string'],
// ['name' => 'avatar', 'desc' => '用户头像', 'type' => 'string'],
// ['name' => 'product', 'desc' => '商品信息', 'type' => 'array', 'children' => [
// ['name' => 'cart_info', 'desc' => '商品信息', 'type' => 'array', 'children' => [
// ['name' => 'name', 'desc' => '商品名称', 'type' => 'int'],
// ['name' => 'image', 'desc' => '图片', 'type' => 'string'],
// ['name' => 'cart_num', 'desc' => '购买数量', 'type' => 'string'],
// ['name' => 'price', 'desc' => '单价', 'type' => 'string'],
// ]],
// ]],
// ]),
// ]
public function lists()
{
return $this->dataLists(new StoreOrderLists());
}
#[
ApiDoc\Title('订单统计'),
ApiDoc\url('/store/store_order/storeOrder/title'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Author('中国队长'),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('订单统计'),
// ApiDoc\url('/store/store_order/storeOrder/title'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Author('中国队长'),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function title(SystemStoreStaffLogic $staffLogic, StoreOrderLogic $orderLogic)
{
return $this->data([
@ -90,17 +89,17 @@ class StoreOrderController extends BaseAdminController
]);
}
#[
ApiDoc\Title('订单详情'),
ApiDoc\url('/store/store_order/storeOrder/detail'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Author('中国队长'),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\Query(name: 'id', type: 'int', require: false, desc: '订单id'),
ApiDoc\Query(name: 'verify_code', type: 'string', require: false, desc: '核销码'),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('订单详情'),
// ApiDoc\url('/store/store_order/storeOrder/detail'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Author('中国队长'),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\Query(name: 'id', type: 'int', require: false, desc: '订单id'),
// ApiDoc\Query(name: 'verify_code', type: 'string', require: false, desc: '核销码'),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function detail(StoreOrderLogic $orderLogic)
{
$params = (new StoreOrderValidate())->goCheck('detail');
@ -253,17 +252,17 @@ class StoreOrderController extends BaseAdminController
}
#[
ApiDoc\Title('订单已核销列表'),
ApiDoc\url('/store/store_order/storeOrder/writeoff_list'),
ApiDoc\Method('POST'),
ApiDoc\NotHeaders(),
ApiDoc\Author('中国队长'),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\Query(name: 'page_no', type: 'int', require: false, desc: '页数 默认1'),
ApiDoc\Query(name: 'page_size', type: 'int', require: false, desc: '每页条数 默认15'),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('订单已核销列表'),
// ApiDoc\url('/store/store_order/storeOrder/writeoff_list'),
// ApiDoc\Method('POST'),
// ApiDoc\NotHeaders(),
// ApiDoc\Author('中国队长'),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\Query(name: 'page_no', type: 'int', require: false, desc: '页数 默认1'),
// ApiDoc\Query(name: 'page_size', type: 'int', require: false, desc: '每页条数 默认15'),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function writeoff_list(StoreOrderLogic $orderLogic)
{
$page_no = (int)$this->request->post('page_no', 1);

View File

@ -7,66 +7,65 @@ use app\common\lists\order\StoreRefundOrderLists;
use app\store\controller\BaseAdminController;
use app\common\logic\store_order\StoreOrderLogic;
use app\store\validate\store_order\StoreOrderValidate;
use hg\apidoc\annotation as ApiDoc;
/**
* 订单列表控制器
* Class StoreOrderController
* @package app\store\controller\store_order
*/
#[ApiDoc\title('退款订单')]
// #[ApiDoc\title('退款订单')]
class StoreRefundOrderController extends BaseAdminController
{
#[
ApiDoc\Title('订单列表'),
ApiDoc\url('/store/store_order/storeRefundOrder/lists'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Author('中国队长'),
ApiDoc\Query(name: 'order_id', type: 'string', require: false, desc: '订单编号'),
ApiDoc\Query(name: 'start_time', type: 'string', require: false, desc: '开始时间', mock: "@datetime('yyyy-MM-dd')"),
ApiDoc\Query(name: 'end_time', type: 'string', require: false, desc: '结束时间', mock: "@datetime('yyyy-MM-dd')"),
ApiDoc\Query(name: 'refund_type', type: 'int', require: false, desc: '状态1仅退款2退款退货3拒绝退款4商品待退货5退货待收货6已退款', mock: "@integer(1, 6)"),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\Query(ref: [Definitions::class, "page"]),
ApiDoc\ResponseSuccess("data", type: "array", children: [
['name' => 'id', 'desc' => 'ID', 'type' => 'int'],
['name' => 'order_id', 'desc' => '订单编号', 'type' => 'string'],
['name' => 'pay_price', 'desc' => '支付金额', 'type' => 'string'],
['name' => 'pay_time', 'desc' => '支付时间', 'type' => 'float'],
['name' => 'pay_type', 'desc' => '支付方式', 'type' => 'float'],
['name' => 'status_name', 'desc' => '状态', 'type' => 'int'],
['name' => 'refund_status_name', 'desc' => '退款状态', 'type' => 'string'],
['name' => 'refund_type_name', 'desc' => '退款类型', 'type' => 'string'],
['name' => 'refund_reason_time', 'desc' => '退款时间', 'type' => 'int'],
['name' => 'staff_name', 'desc' => '店员', 'type' => 'int'],
['name' => 'nickname', 'desc' => '用户昵称', 'type' => 'string'],
['name' => 'avatar', 'desc' => '用户头像', 'type' => 'string'],
['name' => 'product', 'desc' => '商品信息', 'type' => 'array', 'children' => [
['name' => 'cart_info', 'desc' => '商品信息', 'type' => 'array', 'children' => [
['name' => 'name', 'desc' => '商品名称', 'type' => 'int'],
['name' => 'image', 'desc' => '图片', 'type' => 'string'],
['name' => 'cart_num', 'desc' => '购买数量', 'type' => 'string'],
['name' => 'price', 'desc' => '单价', 'type' => 'string'],
]],
]],
]),
]
// #[
// ApiDoc\Title('订单列表'),
// ApiDoc\url('/store/store_order/storeRefundOrder/lists'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Author('中国队长'),
// ApiDoc\Query(name: 'order_id', type: 'string', require: false, desc: '订单编号'),
// ApiDoc\Query(name: 'start_time', type: 'string', require: false, desc: '开始时间', mock: "@datetime('yyyy-MM-dd')"),
// ApiDoc\Query(name: 'end_time', type: 'string', require: false, desc: '结束时间', mock: "@datetime('yyyy-MM-dd')"),
// ApiDoc\Query(name: 'refund_type', type: 'int', require: false, desc: '状态1仅退款2退款退货3拒绝退款4商品待退货5退货待收货6已退款', mock: "@integer(1, 6)"),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\Query(ref: [Definitions::class, "page"]),
// ApiDoc\ResponseSuccess("data", type: "array", children: [
// ['name' => 'id', 'desc' => 'ID', 'type' => 'int'],
// ['name' => 'order_id', 'desc' => '订单编号', 'type' => 'string'],
// ['name' => 'pay_price', 'desc' => '支付金额', 'type' => 'string'],
// ['name' => 'pay_time', 'desc' => '支付时间', 'type' => 'float'],
// ['name' => 'pay_type', 'desc' => '支付方式', 'type' => 'float'],
// ['name' => 'status_name', 'desc' => '状态', 'type' => 'int'],
// ['name' => 'refund_status_name', 'desc' => '退款状态', 'type' => 'string'],
// ['name' => 'refund_type_name', 'desc' => '退款类型', 'type' => 'string'],
// ['name' => 'refund_reason_time', 'desc' => '退款时间', 'type' => 'int'],
// ['name' => 'staff_name', 'desc' => '店员', 'type' => 'int'],
// ['name' => 'nickname', 'desc' => '用户昵称', 'type' => 'string'],
// ['name' => 'avatar', 'desc' => '用户头像', 'type' => 'string'],
// ['name' => 'product', 'desc' => '商品信息', 'type' => 'array', 'children' => [
// ['name' => 'cart_info', 'desc' => '商品信息', 'type' => 'array', 'children' => [
// ['name' => 'name', 'desc' => '商品名称', 'type' => 'int'],
// ['name' => 'image', 'desc' => '图片', 'type' => 'string'],
// ['name' => 'cart_num', 'desc' => '购买数量', 'type' => 'string'],
// ['name' => 'price', 'desc' => '单价', 'type' => 'string'],
// ]],
// ]],
// ]),
// ]
public function lists()
{
return $this->dataLists(new StoreRefundOrderLists());
}
#[
ApiDoc\Title('编辑订单'),
ApiDoc\url('/store/store_order/storeRefundOrder/edit'),
ApiDoc\Method('POST'),
ApiDoc\NotHeaders(),
ApiDoc\Author('中国队长'),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('编辑订单'),
// ApiDoc\url('/store/store_order/storeRefundOrder/edit'),
// ApiDoc\Method('POST'),
// ApiDoc\NotHeaders(),
// ApiDoc\Author('中国队长'),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function edit()
{
$params = (new StoreOrderValidate())->post()->goCheck('edit');
@ -77,16 +76,16 @@ class StoreRefundOrderController extends BaseAdminController
return $this->fail(StoreOrderLogic::getError());
}
#[
ApiDoc\Title('订单详情'),
ApiDoc\url('/store/store_order/storeRefundOrder/detail'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Author('中国队长'),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\Query(name: 'id', type: 'int', require: true, desc: '订单id'),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('订单详情'),
// ApiDoc\url('/store/store_order/storeRefundOrder/detail'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Author('中国队长'),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\Query(name: 'id', type: 'int', require: true, desc: '订单id'),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function detail(StoreOrderLogic $orderLogic)
{
$params = (new StoreOrderValidate())->goCheck('detail');

View File

@ -9,7 +9,6 @@ use app\store\controller\BaseAdminController;
use app\store\logic\store_branch_product\StoreBranchProductLogic;
use app\store\logic\store_product\StoreProductLogic;
use app\store\validate\store_product\StoreProductValidate;
use hg\apidoc\annotation as ApiDoc;
/**
@ -17,57 +16,57 @@ use hg\apidoc\annotation as ApiDoc;
* Class StoreProductController
* @package app\store\controller\store_product
*/
#[ApiDoc\title('商品列表')]
// #[ApiDoc\title('商品列表')]
class StoreProductController extends BaseAdminController
{
#[
ApiDoc\Title('商品列表'),
ApiDoc\url('/store/store_product/storeProduct/lists'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Query(name: 'cate_id', type: 'int', require: false, desc: '分类id'),
ApiDoc\Query(name: 'store_name', type: 'string', require: false, desc: '商品名称'),
ApiDoc\Query(name: 'status', type: 'int', require: false, desc: '状态1上架2下架3售罄4库存告警'),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\Query(ref: [Definitions::class, "page"]),
ApiDoc\ResponseSuccess("data", type: "array", children: [
['name' => 'id', 'desc' => 'ID', 'type' => 'int'],
['name' => 'product_id', 'desc' => '商品ID', 'type' => 'int'],
['name' => 'image', 'desc' => '图片', 'type' => 'string'],
['name' => 'store_name', 'desc' => '商品名称', 'type' => 'string'],
['name' => 'price', 'desc' => '零售价', 'type' => 'float'],
['name' => 'cost', 'desc' => '成本价', 'type' => 'float'],
['name' => 'sales', 'desc' => '销量', 'type' => 'int'],
['name' => 'stock', 'desc' => '库存', 'type' => 'int'],
['name' => 'unit_name', 'desc' => '单位', 'type' => 'string'],
['name' => 'cate_name', 'desc' => '分类', 'type' => 'string'],
['name' => 'status', 'desc' => '状态1上架0下架', 'type' => 'string'],
]),
]
// #[
// ApiDoc\Title('商品列表'),
// ApiDoc\url('/store/store_product/storeProduct/lists'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Query(name: 'cate_id', type: 'int', require: false, desc: '分类id'),
// ApiDoc\Query(name: 'store_name', type: 'string', require: false, desc: '商品名称'),
// ApiDoc\Query(name: 'status', type: 'int', require: false, desc: '状态1上架2下架3售罄4库存告警'),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\Query(ref: [Definitions::class, "page"]),
// ApiDoc\ResponseSuccess("data", type: "array", children: [
// ['name' => 'id', 'desc' => 'ID', 'type' => 'int'],
// ['name' => 'product_id', 'desc' => '商品ID', 'type' => 'int'],
// ['name' => 'image', 'desc' => '图片', 'type' => 'string'],
// ['name' => 'store_name', 'desc' => '商品名称', 'type' => 'string'],
// ['name' => 'price', 'desc' => '零售价', 'type' => 'float'],
// ['name' => 'cost', 'desc' => '成本价', 'type' => 'float'],
// ['name' => 'sales', 'desc' => '销量', 'type' => 'int'],
// ['name' => 'stock', 'desc' => '库存', 'type' => 'int'],
// ['name' => 'unit_name', 'desc' => '单位', 'type' => 'string'],
// ['name' => 'cate_name', 'desc' => '分类', 'type' => 'string'],
// ['name' => 'status', 'desc' => '状态1上架0下架', 'type' => 'string'],
// ]),
// ]
public function lists()
{
return $this->dataLists(new StoreBranchProductLists());
}
#[
ApiDoc\Title('添加商品'),
ApiDoc\url('/store/store_product/storeProduct/add'),
ApiDoc\Method('POST'),
ApiDoc\NotHeaders(),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\ResponseSuccess("data", type: "array", children: [
['name' => 'id', 'desc' => 'ID', 'type' => 'int'],
['name' => 'image', 'desc' => '图片', 'type' => 'string'],
['name' => 'store_name', 'desc' => '商品名称', 'type' => 'string'],
['name' => 'price', 'desc' => '零售价', 'type' => 'float'],
['name' => 'cost', 'desc' => '成本价', 'type' => 'float'],
['name' => 'sales', 'desc' => '销量', 'type' => 'int'],
['name' => 'stock', 'desc' => '库存', 'type' => 'int'],
['name' => 'unit_name', 'desc' => '单位', 'type' => 'string'],
['name' => 'cate_name', 'desc' => '分类', 'type' => 'string'],
]),
]
// #[
// ApiDoc\Title('添加商品'),
// ApiDoc\url('/store/store_product/storeProduct/add'),
// ApiDoc\Method('POST'),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\ResponseSuccess("data", type: "array", children: [
// ['name' => 'id', 'desc' => 'ID', 'type' => 'int'],
// ['name' => 'image', 'desc' => '图片', 'type' => 'string'],
// ['name' => 'store_name', 'desc' => '商品名称', 'type' => 'string'],
// ['name' => 'price', 'desc' => '零售价', 'type' => 'float'],
// ['name' => 'cost', 'desc' => '成本价', 'type' => 'float'],
// ['name' => 'sales', 'desc' => '销量', 'type' => 'int'],
// ['name' => 'stock', 'desc' => '库存', 'type' => 'int'],
// ['name' => 'unit_name', 'desc' => '单位', 'type' => 'string'],
// ['name' => 'cate_name', 'desc' => '分类', 'type' => 'string'],
// ]),
// ]
public function add()
{
$params = (new StoreProductValidate())->post()->goCheck('add');
@ -78,25 +77,25 @@ class StoreProductController extends BaseAdminController
return $this->fail(StoreProductLogic::getError());
}
#[
ApiDoc\Title('编辑商品'),
ApiDoc\url('/store/store_product/storeProduct/edit'),
ApiDoc\Method('POST'),
ApiDoc\NotHeaders(),
ApiDoc\Query(name: "id", type: "int", require: true, desc: "id"),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\ResponseSuccess("data", type: "array", children: [
['name' => 'id', 'desc' => 'ID', 'type' => 'int'],
['name' => 'image', 'desc' => '图片', 'type' => 'string'],
['name' => 'store_name', 'desc' => '商品名称', 'type' => 'string'],
['name' => 'price', 'desc' => '零售价', 'type' => 'float'],
['name' => 'cost', 'desc' => '成本价', 'type' => 'float'],
['name' => 'sales', 'desc' => '销量', 'type' => 'int'],
['name' => 'stock', 'desc' => '库存', 'type' => 'int'],
['name' => 'unit_name', 'desc' => '单位', 'type' => 'string'],
['name' => 'cate_name', 'desc' => '分类', 'type' => 'string'],
]),
]
// #[
// ApiDoc\Title('编辑商品'),
// ApiDoc\url('/store/store_product/storeProduct/edit'),
// ApiDoc\Method('POST'),
// ApiDoc\NotHeaders(),
// ApiDoc\Query(name: "id", type: "int", require: true, desc: "id"),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\ResponseSuccess("data", type: "array", children: [
// ['name' => 'id', 'desc' => 'ID', 'type' => 'int'],
// ['name' => 'image', 'desc' => '图片', 'type' => 'string'],
// ['name' => 'store_name', 'desc' => '商品名称', 'type' => 'string'],
// ['name' => 'price', 'desc' => '零售价', 'type' => 'float'],
// ['name' => 'cost', 'desc' => '成本价', 'type' => 'float'],
// ['name' => 'sales', 'desc' => '销量', 'type' => 'int'],
// ['name' => 'stock', 'desc' => '库存', 'type' => 'int'],
// ['name' => 'unit_name', 'desc' => '单位', 'type' => 'string'],
// ['name' => 'cate_name', 'desc' => '分类', 'type' => 'string'],
// ]),
// ]
public function edit()
{
$params = (new StoreProductValidate())->post()->goCheck('edit');
@ -107,25 +106,25 @@ class StoreProductController extends BaseAdminController
return $this->fail(StoreProductLogic::getError());
}
#[
ApiDoc\Title('删除商品'),
ApiDoc\url('/store/store_product/storeProduct/delete'),
ApiDoc\Method('POST'),
ApiDoc\NotHeaders(),
ApiDoc\Param(name: "id", type: "int", require: true, desc: "id"),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\ResponseSuccess("data", type: "array", children: [
['name' => 'id', 'desc' => 'ID', 'type' => 'int'],
['name' => 'image', 'desc' => '图片', 'type' => 'string'],
['name' => 'store_name', 'desc' => '商品名称', 'type' => 'string'],
['name' => 'price', 'desc' => '零售价', 'type' => 'float'],
['name' => 'cost', 'desc' => '成本价', 'type' => 'float'],
['name' => 'sales', 'desc' => '销量', 'type' => 'int'],
['name' => 'stock', 'desc' => '库存', 'type' => 'int'],
['name' => 'unit_name', 'desc' => '单位', 'type' => 'string'],
['name' => 'cate_name', 'desc' => '分类', 'type' => 'string'],
]),
]
// #[
// ApiDoc\Title('删除商品'),
// ApiDoc\url('/store/store_product/storeProduct/delete'),
// ApiDoc\Method('POST'),
// ApiDoc\NotHeaders(),
// ApiDoc\Param(name: "id", type: "int", require: true, desc: "id"),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\ResponseSuccess("data", type: "array", children: [
// ['name' => 'id', 'desc' => 'ID', 'type' => 'int'],
// ['name' => 'image', 'desc' => '图片', 'type' => 'string'],
// ['name' => 'store_name', 'desc' => '商品名称', 'type' => 'string'],
// ['name' => 'price', 'desc' => '零售价', 'type' => 'float'],
// ['name' => 'cost', 'desc' => '成本价', 'type' => 'float'],
// ['name' => 'sales', 'desc' => '销量', 'type' => 'int'],
// ['name' => 'stock', 'desc' => '库存', 'type' => 'int'],
// ['name' => 'unit_name', 'desc' => '单位', 'type' => 'string'],
// ['name' => 'cate_name', 'desc' => '分类', 'type' => 'string'],
// ]),
// ]
public function delete()
{
$params = (new StoreProductValidate())->post()->goCheck('delete');
@ -133,25 +132,25 @@ class StoreProductController extends BaseAdminController
return $this->success('删除成功', [], 1, 1);
}
#[
ApiDoc\Title('商品详情'),
ApiDoc\url('/store/store_product/storeProduct/detail'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Query(name: "id", type: "int", require: true, desc: "id"),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\ResponseSuccess("data", type: "array", children: [
['name' => 'id', 'desc' => 'ID', 'type' => 'int'],
['name' => 'image', 'desc' => '图片', 'type' => 'string'],
['name' => 'store_name', 'desc' => '商品名称', 'type' => 'string'],
['name' => 'price', 'desc' => '零售价', 'type' => 'float'],
['name' => 'cost', 'desc' => '成本价', 'type' => 'float'],
['name' => 'sales', 'desc' => '销量', 'type' => 'int'],
['name' => 'stock', 'desc' => '库存', 'type' => 'int'],
['name' => 'unit_name', 'desc' => '单位', 'type' => 'string'],
['name' => 'cate_name', 'desc' => '分类', 'type' => 'string'],
]),
]
// #[
// ApiDoc\Title('商品详情'),
// ApiDoc\url('/store/store_product/storeProduct/detail'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Query(name: "id", type: "int", require: true, desc: "id"),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\ResponseSuccess("data", type: "array", children: [
// ['name' => 'id', 'desc' => 'ID', 'type' => 'int'],
// ['name' => 'image', 'desc' => '图片', 'type' => 'string'],
// ['name' => 'store_name', 'desc' => '商品名称', 'type' => 'string'],
// ['name' => 'price', 'desc' => '零售价', 'type' => 'float'],
// ['name' => 'cost', 'desc' => '成本价', 'type' => 'float'],
// ['name' => 'sales', 'desc' => '销量', 'type' => 'int'],
// ['name' => 'stock', 'desc' => '库存', 'type' => 'int'],
// ['name' => 'unit_name', 'desc' => '单位', 'type' => 'string'],
// ['name' => 'cate_name', 'desc' => '分类', 'type' => 'string'],
// ]),
// ]
public function detail()
{
$params = (new StoreProductValidate())->goCheck('detail');
@ -159,15 +158,15 @@ class StoreProductController extends BaseAdminController
return $this->data($result);
}
#[
ApiDoc\Title('商品上下架'),
ApiDoc\url('/store/store_product/storeProduct/status'),
ApiDoc\Method('POST'),
ApiDoc\NotHeaders(),
ApiDoc\Param(name: "id", type: "int", require: true, desc: "id"),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('商品上下架'),
// ApiDoc\url('/store/store_product/storeProduct/status'),
// ApiDoc\Method('POST'),
// ApiDoc\NotHeaders(),
// ApiDoc\Param(name: "id", type: "int", require: true, desc: "id"),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function status()
{
$params = (new StoreProductValidate())->post()->goCheck('detail');
@ -175,19 +174,19 @@ class StoreProductController extends BaseAdminController
return $this->success('操作成功', [], 1, 1);
}
#[
ApiDoc\Title('商品库存增减'),
ApiDoc\url('/store/store_product/storeProduct/stock'),
ApiDoc\Method('POST'),
ApiDoc\Param(name: "attrs", type: "array", require: true, desc: "id", children: [
['name' => 'unique', 'desc' => '唯一值', 'type' => 'string'],
['name' => 'type', 'desc' => '类型1增加2减少', 'type' => 'int'],
['name' => 'number', 'desc' => '数量', 'type' => 'int'],
]),
ApiDoc\NotHeaders(),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('商品库存增减'),
// ApiDoc\url('/store/store_product/storeProduct/stock'),
// ApiDoc\Method('POST'),
// ApiDoc\Param(name: "attrs", type: "array", require: true, desc: "id", children: [
// ['name' => 'unique', 'desc' => '唯一值', 'type' => 'string'],
// ['name' => 'type', 'desc' => '类型1增加2减少', 'type' => 'int'],
// ['name' => 'number', 'desc' => '数量', 'type' => 'int'],
// ]),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function stock()
{
$params = (new StoreProductValidate())->post()->goCheck('stock');

View File

@ -7,38 +7,37 @@ use app\store\controller\BaseAdminController;
use app\admin\lists\system_store_storage\SystemStoreStorageLists;
use app\admin\logic\system_store_storage\SystemStoreStorageLogic;
use app\admin\validate\system_store_storage\SystemStoreStorageValidate;
use hg\apidoc\annotation as ApiDoc;
#[ApiDoc\title('入库管理')]
// #[ApiDoc\title('入库管理')]
class StoreStorageController extends BaseAdminController
{
#[
ApiDoc\Title('入库记录'),
ApiDoc\url('/store/store_product/storeStorage/lists'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Query(name: 'store_id', type: 'int', require: false, desc: '门店id'),
ApiDoc\Query(name: 'staff_id', type: 'int', require: false, desc: '店员id'),
ApiDoc\Query(name: 'status', type: 'int', require: false, desc: '状态0-待确认1-已确认'),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\Query(ref: [Definitions::class, "page"]),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('入库记录'),
// ApiDoc\url('/store/store_product/storeStorage/lists'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Query(name: 'store_id', type: 'int', require: false, desc: '门店id'),
// ApiDoc\Query(name: 'staff_id', type: 'int', require: false, desc: '店员id'),
// ApiDoc\Query(name: 'status', type: 'int', require: false, desc: '状态0-待确认1-已确认'),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\Query(ref: [Definitions::class, "page"]),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function lists()
{
return $this->dataLists(new SystemStoreStorageLists());
}
#[
ApiDoc\Title('确认入库'),
ApiDoc\url('/store/store_product/storeStorage/confirm'),
ApiDoc\Method('POST'),
ApiDoc\NotHeaders(),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\Param(name: 'id', type: 'int', require: true, desc: 'id'),
ApiDoc\ResponseSuccess("data", type: "array"),
]
// #[
// ApiDoc\Title('确认入库'),
// ApiDoc\url('/store/store_product/storeStorage/confirm'),
// ApiDoc\Method('POST'),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\Param(name: 'id', type: 'int', require: true, desc: 'id'),
// ApiDoc\ResponseSuccess("data", type: "array"),
// ]
public function confirm()
{
$params = (new SystemStoreStorageValidate())->post()->goCheck('edit');

View File

@ -8,7 +8,6 @@ use app\store\controller\BaseAdminController;
use app\store\lists\store_product_attr_value\StoreProductAttrValueLists;
use app\store\logic\store_product_attr_value\StoreProductAttrValueLogic;
use app\store\validate\store_product_attr_value\StoreProductAttrValueValidate;
use hg\apidoc\annotation as ApiDoc;
/**
@ -16,47 +15,47 @@ use hg\apidoc\annotation as ApiDoc;
* Class StoreProductAttrValueController
* @package app\store\controller\store_product_attr_value
*/
#[ApiDoc\title('商品属性值')]
// #[ApiDoc\title('商品属性值')]
class StoreProductAttrValueController extends BaseAdminController
{
#[
ApiDoc\Title('商品属性值列表'),
ApiDoc\url('/store/store_product_attr_value/storeProductAttrValue/lists'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\Query(ref: [Definitions::class, "page"]),
ApiDoc\Query(name: 'product_id', type: 'int', require: true, desc: '商品ID'),
ApiDoc\Query(name: 'store_id', type: 'int', require: true, desc: '门店ID'),
ApiDoc\ResponseSuccess("data", type: "array", children: [
['name' => 'count', 'desc' => '总数', 'type' => 'int'],
['name' => 'page_no', 'desc' => '页码', 'type' => 'int'],
['name' => 'page_size', 'desc' => '每页数量', 'type' => 'int'],
['name' => 'extend', 'desc' => '扩展数据', 'type' => 'array'],
['name' => 'lists', 'desc' => '列表数据', 'type' => 'array', 'children' => [
['name' => 'id', 'desc' => 'ID', 'type' => 'int'],
['name' => 'product_id', 'desc' => '商品ID', 'type' => 'int'],
['name' => 'stock', 'desc' => '库存', 'type' => 'int'],
['name' => 'unique', 'desc' => '唯一值', 'type' => 'string'],
['name' => 'sales', 'desc' => '销量', 'type' => 'int'],
['name' => 'bar_code', 'desc' => '条码', 'type' => 'string'],
['name' => 'image', 'desc' => '规格图片', 'type' => 'string'],
]],
]),
]
// #[
// ApiDoc\Title('商品属性值列表'),
// ApiDoc\url('/store/store_product_attr_value/storeProductAttrValue/lists'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ApiDoc\Query(ref: [Definitions::class, "page"]),
// ApiDoc\Query(name: 'product_id', type: 'int', require: true, desc: '商品ID'),
// ApiDoc\Query(name: 'store_id', type: 'int', require: true, desc: '门店ID'),
// ApiDoc\ResponseSuccess("data", type: "array", children: [
// ['name' => 'count', 'desc' => '总数', 'type' => 'int'],
// ['name' => 'page_no', 'desc' => '页码', 'type' => 'int'],
// ['name' => 'page_size', 'desc' => '每页数量', 'type' => 'int'],
// ['name' => 'extend', 'desc' => '扩展数据', 'type' => 'array'],
// ['name' => 'lists', 'desc' => '列表数据', 'type' => 'array', 'children' => [
// ['name' => 'id', 'desc' => 'ID', 'type' => 'int'],
// ['name' => 'product_id', 'desc' => '商品ID', 'type' => 'int'],
// ['name' => 'stock', 'desc' => '库存', 'type' => 'int'],
// ['name' => 'unique', 'desc' => '唯一值', 'type' => 'string'],
// ['name' => 'sales', 'desc' => '销量', 'type' => 'int'],
// ['name' => 'bar_code', 'desc' => '条码', 'type' => 'string'],
// ['name' => 'image', 'desc' => '规格图片', 'type' => 'string'],
// ]],
// ]),
// ]
public function lists()
{
return $this->dataLists(new StoreProductAttrValueLists());
}
#[
ApiDoc\Title('添加商品属性值'),
ApiDoc\url('/store/store_product_attr_value/storeProductAttrValue/add'),
ApiDoc\Method('POST'),
ApiDoc\NotHeaders(),
ApiDoc\Header(ref: [Definitions::class, "token"]),
]
// #[
// ApiDoc\Title('添加商品属性值'),
// ApiDoc\url('/store/store_product_attr_value/storeProductAttrValue/add'),
// ApiDoc\Method('POST'),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ]
public function add()
{
$params = (new StoreProductAttrValueValidate())->post()->goCheck('add');
@ -67,13 +66,13 @@ class StoreProductAttrValueController extends BaseAdminController
return $this->fail(StoreProductAttrValueLogic::getError());
}
#[
ApiDoc\Title('编辑商品属性值'),
ApiDoc\url('/store/store_product_attr_value/storeProductAttrValue/edit'),
ApiDoc\Method('POST'),
ApiDoc\NotHeaders(),
ApiDoc\Header(ref: [Definitions::class, "token"]),
]
// #[
// ApiDoc\Title('编辑商品属性值'),
// ApiDoc\url('/store/store_product_attr_value/storeProductAttrValue/edit'),
// ApiDoc\Method('POST'),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ]
public function edit()
{
$params = (new StoreProductAttrValueValidate())->post()->goCheck('edit');
@ -84,13 +83,13 @@ class StoreProductAttrValueController extends BaseAdminController
return $this->fail(StoreProductAttrValueLogic::getError());
}
#[
ApiDoc\Title('删除商品属性值'),
ApiDoc\url('/store/store_product_attr_value/storeProductAttrValue/delete'),
ApiDoc\Method('POST'),
ApiDoc\NotHeaders(),
ApiDoc\Header(ref: [Definitions::class, "token"]),
]
// #[
// ApiDoc\Title('删除商品属性值'),
// ApiDoc\url('/store/store_product_attr_value/storeProductAttrValue/delete'),
// ApiDoc\Method('POST'),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ]
public function delete()
{
$params = (new StoreProductAttrValueValidate())->post()->goCheck('delete');
@ -98,14 +97,14 @@ class StoreProductAttrValueController extends BaseAdminController
return $this->success('删除成功', [], 1, 1);
}
#[
ApiDoc\Title('获取商品属性值详情'),
ApiDoc\url('/store/store_product_attr_value/storeProductAttrValue/detail'),
ApiDoc\Method('GET'),
ApiDoc\Author('中国队长'),
ApiDoc\NotHeaders(),
ApiDoc\Header(ref: [Definitions::class, "token"]),
]
// #[
// ApiDoc\Title('获取商品属性值详情'),
// ApiDoc\url('/store/store_product_attr_value/storeProductAttrValue/detail'),
// ApiDoc\Method('GET'),
// ApiDoc\Author('中国队长'),
// ApiDoc\NotHeaders(),
// ApiDoc\Header(ref: [Definitions::class, "token"]),
// ]
public function detail()
{
$params = (new StoreProductAttrValueValidate())->goCheck('detail');

View File

@ -9,7 +9,6 @@ use app\admin\logic\system_store_storage\SystemStoreStorageLogic;
use app\admin\validate\system_store_storage\SystemStoreStorageValidate;
use app\common\model\store_branch_product\StoreBranchProduct;
use app\common\model\system_store_storage\SystemStoreStorage;
use hg\apidoc\annotation as ApiDoc;
/**
@ -17,16 +16,16 @@ use hg\apidoc\annotation as ApiDoc;
* Class SystemStoreStorageController
* @package app\admin\controller\system_store_storage
*/
#[ApiDoc\title('门店入库记录')]
// #[ApiDoc\title('门店入库记录')]
class SystemStoreStorageController extends BaseAdminController
{
#[
ApiDoc\Title('列表'),
ApiDoc\url('/store/system_store_storage/systemstorestorage/lists'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
]
// #[
// ApiDoc\Title('列表'),
// ApiDoc\url('/store/system_store_storage/systemstorestorage/lists'),
// ApiDoc\Method('GET'),
// ApiDoc\NotHeaders(),
// ]
public function lists()
{
return $this->dataLists(new SystemStoreStorageLists());

View File

@ -0,0 +1,41 @@
<?php
namespace app\store\controller\user;
use app\store\controller\BaseAdminController;
use app\store\lists\user\UserLists;
use app\admin\logic\user\UserLogic;
use app\admin\validate\user\UserValidate;
class UserController extends BaseAdminController
{
public function lists()
{
return $this->dataLists(new UserLists());
}
public function add()
{
$params = (new UserValidate())->post()->goCheck('storeAdd');
d($params);
$result = UserLogic::StoreAdd($params);
if (true === $result) {
return $this->success('添加成功', [], 1, 1);
}
return $this->fail(UserLogic::getError());
}
public function detail()
{
$params = (new UserValidate())->goCheck('detail');
$detail = UserLogic::detail($params['id']);
return $this->success('', $detail);
}
}

View File

@ -0,0 +1,18 @@
<?php
namespace app\store\controller\user;
use app\store\controller\BaseAdminController;
use app\common\lists\user\UserShipLists;
class UserShipController extends BaseAdminController
{
public function lists()
{
return $this->dataLists(new UserShipLists());
}
}

View File

@ -0,0 +1,60 @@
<?php
namespace app\store\lists\user;
use app\store\lists\BaseAdminDataLists;
use app\common\model\user\User;
class UserLists extends BaseAdminDataLists
{
/**
* @notes 搜索条件
* @return array
* @author 乔峰
* @date 2022/9/22 15:50
*/
public function setSearch(): array
{
return [
'=' => ['mobile'],
];
}
/**
* @notes 获取用户列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author 乔峰
* @date 2022/9/22 15:50
*/
public function lists(): array
{
$field = "id,nickname,real_name,sex,avatar,account,mobile,user_money,create_time";
$lists = User::where($this->searchWhere)
->limit($this->limitOffset, $this->limitLength)
->field($field)
->order('id desc')
->select()->each(function($data){
$data['sex_text'] = $data->sex_text;
$data['mobile'] = substr_replace($data['mobile'], '****', 3, 4);
})->toArray();
return $lists;
}
/**
* @notes 获取数量
* @return int
* @author 乔峰
* @date 2022/9/22 15:51
*/
public function count(): int
{
return User::where($this->searchWhere)->count();
}
}

View File

@ -54,7 +54,6 @@
"ext-bcmath": "*",
"jpush/jpush": "^3.6",
"workerman/crontab": "^1.0",
"hg/apidoc": "^5.2",
"intervention/image": "^3.6",
"picqer/php-barcode-generator": "^2.4"
},

71
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "8c97deb23217033cd0ab2cb6e5b5d195",
"content-hash": "974978f64812f55d8825aabadc43739f",
"packages": [
{
"name": "aliyuncs/oss-sdk-php",
@ -1240,75 +1240,6 @@
],
"time": "2023-12-03T19:50:20+00:00"
},
{
"name": "hg/apidoc",
"version": "v5.2.3",
"source": {
"type": "git",
"url": "https://github.com/HGthecode/apidoc-php.git",
"reference": "328aa4fe177ed7393f680724bf3eeb485052c2fe"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/HGthecode/apidoc-php/zipball/328aa4fe177ed7393f680724bf3eeb485052c2fe",
"reference": "328aa4fe177ed7393f680724bf3eeb485052c2fe",
"shasum": ""
},
"require": {
"doctrine/annotations": "^1 || ^2",
"php": "^7.1 || ^8.0"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"hg\\apidoc\\providers\\LaravelService"
]
},
"think": {
"services": [
"hg\\apidoc\\providers\\ThinkPHPService"
],
"config": {
"apidoc": "src/config.php"
}
},
"hyperf": {
"config": "hg\\apidoc\\ConfigProvider"
}
},
"autoload": {
"psr-4": {
"hg\\apidoc\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "hg-code",
"email": "376401263@qq.com"
}
],
"description": "根据注解生成API文档兼容Laravel、ThinkPHP、Hyperf、Webman等框架在线调试、Markdown文档、多应用/多版本、Mock数据、授权访问、接口生成器、代码生成器等众多实用功能",
"keywords": [
"apidoc",
"api文档",
"markdown",
"php接口文档",
"接口文档",
"注解",
"注释生成",
"自动生成api"
],
"support": {
"issues": "https://github.com/HGthecode/apidoc-php/issues",
"source": "https://github.com/HGthecode/apidoc-php/tree/v5.2.3"
},
"time": "2024-03-22T02:25:31+00:00"
},
{
"name": "hyperf/context",
"version": "v3.1.15",

View File

@ -1,105 +0,0 @@
<?php
return [
'enable' => true,
'apidoc' => [
// (选配)文档标题,显示在左上角与首页
'title' => '接口文档',
// (选配)文档描述,显示在首页
'desc' => '',
// (必须)设置文档的应用/版本
'apps' => [
[
// (必须)标题
'title' => 'store接口',
// (必须)控制器目录地址
'path' => 'app\store\controller',
// 必须唯一的key
'key' => 'storeApi',
],
[
// (必须)标题
'title' => 'api接口',
// (必须)控制器目录地址
'path' => 'app\api\controller',
// 必须唯一的key
'key' => 'apiApi',
]
],
// (必须)指定通用注释定义的文件地址
'definitions' => "app\common\controller\Definitions",
// 必须自动生成url规则当接口不添加@Apidoc\Url ("xxx")注解时,使用以下规则自动生成
'auto_url' => [
// 字母规则lcfirst=首字母小写ucfirst=首字母大写;
'letter_rule' => "lcfirst",
// url前缀
'prefix' => "",
],
// (选配)是否自动注册路由
'auto_register_routes' => true,
// (必须)缓存配置
'cache' => [
// 是否开启缓存
'enable' => false,
],
// (必须)权限认证配置
'auth' => [
// 是否启用密码验证
'enable' => true,
// 全局访问密码
'password' => "qwe123",
// 密码加密盐
'secret_key' => "qwe123",
// 授权访问后的有效期
'expire' => 86400 * 7
],
// 全局参数
'params' => [
// 选配全局的请求Header
'header' => [
// name=字段名type=字段类型require=是否必须default=默认值desc=字段描述
['name' => 'Authorization', 'type' => 'string', 'require' => true, 'desc' => '身份令牌Token'],
],
// 选配全局的请求Query
'query' => [
// 同上 header
],
// 选配全局的请求Body
'body' => [
// 同上 header
],
],
// 全局响应体
'responses' => [
// 成功响应体
'success' => [
['name' => 'code', 'desc' => '业务代码', 'type' => 'int', 'require' => 1],
['name' => 'message', 'desc' => '业务信息', 'type' => 'string', 'require' => 1],
//参数同上 headersmain=true来指定接口Returned参数挂载节点
['name' => 'data', 'desc' => '业务数据', 'main' => true, 'type' => 'object', 'require' => 1],
],
// 异常响应体
'error' => [
['name' => 'code', 'desc' => '业务代码', 'type' => 'int', 'require' => 1, 'md' => '/docs/HttpError.md'],
['name' => 'message', 'desc' => '业务信息', 'type' => 'string', 'require' => 1],
]
],
//(选配)默认作者
'default_author' => '',
//(选配)默认请求类型
'default_method' => 'GET',
//选配Apidoc允许跨域访问
'allowCrossDomain' => false,
/**
* (选配)解析时忽略带@注解的关键词,当注解中存在带@字符并且非Apidoc注解 @key test此时Apidoc页面报类似以下错误时:
* [Semantical Error] The annotation "@key" in method xxx() was never imported. Did you maybe forget to add a "use" statement for this annotation?
*/
'ignored_annitation' => [],
// (选配)数据库配置
'database' => [],
// 选配Markdown文档
'docs' => [],
// (选配)接口生成器配置 注意:是一个二维数组
'generator' => []
]
];

View File

@ -1,3 +0,0 @@
<?php
// 注册Apidoc路由
hg\apidoc\providers\WebmanService::register();

View File

@ -10,7 +10,6 @@ return array(
'think\\' => array($vendorDir . '/topthink/think-container/src', $vendorDir . '/topthink/think-helper/src', $vendorDir . '/topthink/think-orm/src'),
'taoser\\' => array($vendorDir . '/taoser/webman-validate/src'),
'support\\' => array($vendorDir . '/workerman/webman-framework/src/support'),
'hg\\apidoc\\' => array($vendorDir . '/hg/apidoc/src'),
'app\\View\\Components\\' => array($baseDir . '/app/view/components'),
'app\\' => array($baseDir . '/app'),
'ZipStream\\' => array($vendorDir . '/maennchen/zipstream-php/src'),

View File

@ -57,10 +57,6 @@ class ComposerStaticInitcefecbcff919f3c1c8084830bbb72adc
array (
'support\\' => 8,
),
'h' =>
array (
'hg\\apidoc\\' => 10,
),
'a' =>
array (
'app\\View\\Components\\' => 20,
@ -247,10 +243,6 @@ class ComposerStaticInitcefecbcff919f3c1c8084830bbb72adc
array (
0 => __DIR__ . '/..' . '/workerman/webman-framework/src/support',
),
'hg\\apidoc\\' =>
array (
0 => __DIR__ . '/..' . '/hg/apidoc/src',
),
'app\\View\\Components\\' =>
array (
0 => __DIR__ . '/../..' . '/app/view/components',

View File

@ -1282,78 +1282,6 @@
],
"install-path": "../guzzlehttp/uri-template"
},
{
"name": "hg/apidoc",
"version": "v5.2.3",
"version_normalized": "5.2.3.0",
"source": {
"type": "git",
"url": "https://github.com/HGthecode/apidoc-php.git",
"reference": "328aa4fe177ed7393f680724bf3eeb485052c2fe"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/HGthecode/apidoc-php/zipball/328aa4fe177ed7393f680724bf3eeb485052c2fe",
"reference": "328aa4fe177ed7393f680724bf3eeb485052c2fe",
"shasum": ""
},
"require": {
"doctrine/annotations": "^1 || ^2",
"php": "^7.1 || ^8.0"
},
"time": "2024-03-22T02:25:31+00:00",
"type": "library",
"extra": {
"laravel": {
"providers": [
"hg\\apidoc\\providers\\LaravelService"
]
},
"think": {
"services": [
"hg\\apidoc\\providers\\ThinkPHPService"
],
"config": {
"apidoc": "src/config.php"
}
},
"hyperf": {
"config": "hg\\apidoc\\ConfigProvider"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"hg\\apidoc\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "hg-code",
"email": "376401263@qq.com"
}
],
"description": "根据注解生成API文档兼容Laravel、ThinkPHP、Hyperf、Webman等框架在线调试、Markdown文档、多应用/多版本、Mock数据、授权访问、接口生成器、代码生成器等众多实用功能",
"keywords": [
"apidoc",
"api文档",
"markdown",
"php接口文档",
"接口文档",
"注解",
"注释生成",
"自动生成api"
],
"support": {
"issues": "https://github.com/HGthecode/apidoc-php/issues",
"source": "https://github.com/HGthecode/apidoc-php/tree/v5.2.3"
},
"install-path": "../hg/apidoc"
},
{
"name": "hyperf/context",
"version": "v3.1.15",

View File

@ -1,9 +1,9 @@
<?php return array(
'root' => array(
'name' => 'workerman/webman',
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '4b5122f1ac239cde50650106617717ac4ed3db2b',
'pretty_version' => '1.0.0+no-version-set',
'version' => '1.0.0.0',
'reference' => null,
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@ -154,15 +154,6 @@
'aliases' => array(),
'dev_requirement' => false,
),
'hg/apidoc' => array(
'pretty_version' => 'v5.2.3',
'version' => '5.2.3.0',
'reference' => '328aa4fe177ed7393f680724bf3eeb485052c2fe',
'type' => 'library',
'install_path' => __DIR__ . '/../hg/apidoc',
'aliases' => array(),
'dev_requirement' => false,
),
'hyperf/context' => array(
'pretty_version' => 'v3.1.15',
'version' => '3.1.15.0',
@ -1038,9 +1029,9 @@
'dev_requirement' => false,
),
'workerman/webman' => array(
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '4b5122f1ac239cde50650106617717ac4ed3db2b',
'pretty_version' => '1.0.0+no-version-set',
'version' => '1.0.0.0',
'reference' => null,
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),

View File

@ -1 +0,0 @@
.idea

View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) 2022 HG
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1,88 +0,0 @@
<div align="center">
<img width="160" src="https://docs.apidoc.icu/logo.png">
</div>
<h1 align="center" style="margin-top: 0;padding-top: 0;">
Apidoc
</h1>
<div align="center">
基于PHP的注解生成API文档及Api接口开发工具
</div>
<div align="center" style="margin-top:10px;margin-bottom:50px;">
<a href="https://packagist.org/packages/hg/apidoc"><img src="https://img.shields.io/packagist/v/hg/apidoc"></a>
<a href="https://packagist.org/packages/hg/apidoc"><img src="https://img.shields.io/packagist/dt/hg/apidoc"></a>
<a href="https://packagist.org/packages/hg/apidoc"><img src="https://img.shields.io/packagist/dm/hg/apidoc"></a>
<a href="https://packagist.org/packages/hg/apidoc"><img src="https://img.shields.io/packagist/dd/hg/apidoc"></a>
<a href="https://packagist.org/packages/hg/apidoc"><img src="https://img.shields.io/packagist/l/hg/apidoc"></a>
<a href="https://github.com/HGthecode/apidoc-php"><img src="https://img.shields.io/github/issues/HGthecode/apidoc-php"></a>
<a href="https://github.com/HGthecode/apidoc-php"><img src="https://img.shields.io/github/forks/HGthecode/apidoc-php"></a>
</div>
## 🤷‍♀️ Apidoc是什么
Apidoc是一个通过解析注解生成Api接口文档的PHP composer扩展兼容Laravel、ThinkPHP、Hyperf、Webman等框架
全面的注解引用、数据表字段引用简单的注解即可生成Api文档而Apidoc不仅于接口文档在线接口调试、Mock调试数据、调试事件处理、Json/TypeScript生成、接口生成器、代码生成器等诸多实用功能致力于提高Api接口开发效率。
## ✨特性
- 开箱即用无繁杂的配置、安装后按文档编写注释即可自动生成API文档。
- 轻松编写:支持通用注释引用、业务逻辑层、数据表字段的引用,几句注释即可完成。
- 在线调试:在线文档可直接调试,并支持全局请求/Mock参数/事件处理,接口调试省时省力。
- 安全高效:支持访问密码验证、应用/版本独立密码;支持文档缓存。
- 多应用/多版本可适应各种单应用、多应用、多版本的项目的Api管理。
- 分组/Tag可对控制器/接口进行多级分组或定义Tag。
- Markdown文档支持.md文件的文档展示。
- Json/TypeScript生成文档自动生成接口的Json及TypeScript。
- 代码生成器:配置+模板即可快速生成代码及数据表的创建,大大提高工作效率。
## 📌兼容
以下框架已内置兼容,可开箱即用
|框架|版本|
|-|-|-|
|ThinkPHP|5.1、6.x、8.x|
|Laravel|8.x、9.x、10.x|
|Webman|1.x|
|Hyperf|2.x、3.x|
## 📖使用文档
[https://docs.apidoc.icu](https://docs.apidoc.icu/)
[https://hg-code.gitee.io/apidoc-php/](https://hg-code.gitee.io/apidoc-php/)
## 🏆支持我们
如果本项目对您有所帮助请点个Star支持我们
- [Github](https://github.com/HGthecode/apidoc-php) -> <a href="https://github.com/HGthecode/apidoc-php" target="_blank">
<img height="22" src="https://img.shields.io/github/stars/HGthecode/apidoc-php?style=social" class="attachment-full size-full" alt="Star me on GitHub" data-recalc-dims="1" /></a>
- [Gitee](https://gitee.com/hg-code/apidoc-php) -> <a href="https://gitee.com/hg-code/apidoc-php/stargazers"><img src="https://gitee.com/hg-code/apidoc-php/badge/star.svg" alt="star"></a>
## 🌐交流群
![QQ群](https://docs.apidoc.icu/qq-qun.png)
## 💡鸣谢
<a href="https://github.com/doctrine/annotations" target="_blank">doctrine/annotations</a>
## 🔗链接
<a href="https://github.com/HGthecode/apidoc-ui" target="_blank">ApiDoc UI</a>
<a href="https://github.com/HGthecode/apidoc-demos" target="_blank">ApiDoc Demo</a>

View File

@ -1,50 +0,0 @@
{
"name": "hg/apidoc",
"description": "根据注解生成API文档兼容Laravel、ThinkPHP、Hyperf、Webman等框架在线调试、Markdown文档、多应用/多版本、Mock数据、授权访问、接口生成器、代码生成器等众多实用功能",
"keywords": [
"apidoc",
"api文档",
"接口文档",
"自动生成api",
"注释生成",
"php接口文档",
"api文档",
"Markdown",
"注解"
],
"require": {
"php": "^7.1 || ^8.0",
"doctrine/annotations": "^1 || ^2"
},
"license": "MIT",
"authors": [
{
"name": "hg-code",
"email": "376401263@qq.com"
}
],
"autoload": {
"psr-4": {
"hg\\apidoc\\": "src/"
}
},
"extra": {
"laravel": {
"providers": [
"hg\\apidoc\\providers\\LaravelService"
]
},
"think": {
"services": [
"hg\\apidoc\\providers\\ThinkPHPService"
],
"config": {
"apidoc": "src/config.php"
}
},
"hyperf": {
"config": "hg\\apidoc\\ConfigProvider"
}
},
"minimum-stability": "dev"
}

View File

@ -1,192 +0,0 @@
<?php
declare(strict_types = 1);
namespace hg\apidoc;
use hg\apidoc\exception\ErrorException;
use hg\apidoc\utils\ConfigProvider;
use hg\apidoc\utils\Helper;
class Auth
{
protected $authConfig = [];
public function __construct($config)
{
$authConfig = !empty($config['auth'])?$config['auth']:[];
if (empty($authConfig['secret_key'])){
$authConfig['secret_key'] = "apidoc#hgcode";
}
if (empty($authConfig['expire'])){
$authConfig['expire'] = 86400;
}
$this->authConfig = $authConfig;
}
/**
* 验证密码是否正确
* @param $password
* @return false|string
*/
public function verifyAuth(string $password, string $appKey)
{
$authConfig = $this->authConfig;
if (!empty($appKey)) {
$currentAppConfig = Helper::getCurrentAppConfig($appKey);
$currentApp = $currentAppConfig['appConfig'];
if (!empty($currentApp) && !empty($currentApp['password'])) {
// 应用密码
if (md5($currentApp['password']) === $password) {
return $this->createToken($currentApp['password'],$authConfig['expire']);
}
throw new ErrorException("password error");
}
}
if ($authConfig['enable']) {
// 密码验证
if (md5($authConfig['password']) === $password) {
return $this->createToken($authConfig['password'],$authConfig['expire']);
}
throw new ErrorException("password error");
}
return false;
}
/**
* 验证token是否可用
* @param $request
* @return bool
*/
public function checkAuth($params=[]): bool
{
$authConfig = $this->authConfig;
$token = !empty($params['token'])?$params['token']:"";
$appKey = !empty($params['appKey'])?$params['appKey']:"";
if (!empty($appKey)) {
$currentAppConfig = Helper::getCurrentAppConfig($appKey);
$currentApp = $currentAppConfig['appConfig'];
if (!empty($currentApp) && !empty($currentApp['password'])) {
if (empty($token)) {
throw new ErrorException("token not found");
}
// 应用密码
if ($this->checkToken($token, $currentApp['password'])) {
return true;
} else {
throw new ErrorException("token error");
}
} else if (empty($authConfig['enable'])) {
return true;
}
}
if($authConfig['enable'] && empty($token)){
throw new ErrorException("token not found");
}else if (!empty($token) && !$this->checkToken($token, "") && $authConfig['enable']) {
throw new ErrorException("token error");
}
return true;
}
/**
* 获取tokencode
* @param string $password
* @return string
*/
protected static function getTokenCode(string $password): string
{
return md5(md5($password));
}
/**
* 创建token
* @param string $password
* @return string
*/
public function createToken(string $password): string
{
$authConfig = $this->authConfig;
$data = [
'key'=>static::getTokenCode($password),
'expire'=>time()+$authConfig['expire']
];
$code = json_encode($data);
return static::handleToken($code, "CE",$authConfig['secret_key']);
}
/**
* 验证token是否可用
* @param $token
* @return bool
*/
public function checkToken(string $token, string $password): bool
{
$authConfig = $this->authConfig;
if (empty($password)){
$password = $authConfig['password'];
}
$decode = static::handleToken($token, "DE",$authConfig['secret_key']);
$deData = json_decode($decode,true);
if (!empty($deData['key']) && $deData['key'] === static::getTokenCode($password) && !empty($deData['expire']) && $deData['expire']>time()){
return true;
}
return false;
}
/**
* 处理token
* @param $string
* @param string $operation
* @param string $key
* @param int $expiry
* @return false|string
*/
protected static function handleToken(string $string, string $operation = 'DE', string $key = '', int $expiry = 0):string
{
$ckey_length = 4;
$key = md5($key);
$keya = md5(substr($key, 0, 16));
$keyb = md5(substr($key, 16, 16));
$keyc = $ckey_length ? ($operation == 'DE' ? substr($string, 0, $ckey_length) : substr(md5(microtime()), -$ckey_length)) : '';
$cryptkey = $keya . md5($keya . $keyc);
$key_length = strlen($cryptkey);
$string = $operation == 'DE' ? base64_decode(substr($string, $ckey_length)) : sprintf('%010d', $expiry ? $expiry + time() : 0) . substr(md5($string . $keyb), 0, 16) . $string;
$string_length = strlen($string);
$result = '';
$box = range(0, 255);
$rndkey = array();
for ($i = 0; $i <= 255; $i++) {
$rndkey[$i] = ord($cryptkey[$i % $key_length]);
}
for ($j = $i = 0; $i < 256; $i++) {
$j = ($j + $box[$i] + $rndkey[$i]) % 256;
$tmp = $box[$i];
$box[$i] = $box[$j];
$box[$j] = $tmp;
}
for ($a = $j = $i = 0; $i < $string_length; $i++) {
$a = ($a + 1) % 256;
$j = ($j + $box[$a]) % 256;
$tmp = $box[$a];
$box[$a] = $box[$j];
$box[$j] = $tmp;
$result .= chr(ord($string[$i]) ^ ($box[($box[$a] + $box[$j]) % 256]));
}
if ($operation == 'DE') {
$subNumber = (int)substr($result, 0, 10);
if (($subNumber == 0 || $subNumber - time() > 0) && substr($result, 10, 16) == substr(md5(substr($result, 26) . $keyb), 0, 16)) {
return substr($result, 26);
} else {
return '';
}
} else {
return $keyc . str_replace('=', '', base64_encode($result));
}
}
}

View File

@ -1,24 +0,0 @@
<?php
declare(strict_types=1);
/**
* Hyperf the Config Provider
*/
namespace hg\apidoc;
class ConfigProvider
{
public function __invoke(): array
{
return [
'dependencies' => [],
'publish' => [
[
'id' => 'config',
'description' => 'The config of apidoc.',
'source' => __DIR__ . '/config.php',
'destination' => BASE_PATH . '/config/autoload/apidoc.php',
],
],
];
}
}

View File

@ -1,451 +0,0 @@
<?php
declare(strict_types=1);
namespace hg\apidoc;
use hg\apidoc\parses\ParseApiDetail;
use hg\apidoc\parses\ParseCodeTemplate;
use hg\apidoc\parses\ParseApiMenus;
use hg\apidoc\parses\ParseMarkdown;
use hg\apidoc\utils\ApiShare;
use hg\apidoc\utils\Cache;
use hg\apidoc\utils\ConfigProvider;
use hg\apidoc\utils\DirAndFile;
use hg\apidoc\utils\Helper;
use hg\apidoc\utils\Lang;
use hg\apidoc\utils\Request;
use hg\apidoc\exception\ErrorException;
class Controller
{
protected $config;
protected $requestParams = [];
protected $lang = "";
public function init($checkAuth = false)
{
$this->config = ConfigProvider::get();
if (isset($this->config['enable']) && $this->config['enable'] === false) {
throw new ErrorException("apidoc close");
}
if (!empty($this->config['request_params'])) {
$this->requestParams = $this->config['request_params'];
} else {
$this->requestParams = (new Request())->param();
}
if (!empty($this->requestParams['lang']) && !empty($this->config['lang_register_function'])) {
$this->lang = $this->requestParams['lang'];
$this->config['lang_register_function']($this->lang);
}
if ($checkAuth) {
(new Auth($this->config))->checkAuth($this->requestParams);
}
}
/**
* 验证权限
* @param $config
* @param $params
*/
protected function checkAuth()
{
$config = $this->config;
$params = $this->requestParams;
if (!empty($params['shareKey'])) {
//分享
$shareData = (new ApiShare())->checkShareAuth($config, $params);
$appKey = !empty($params['appKey']) ? $params['appKey'] : "";
if (!empty($shareData['appKeys']) && !in_array($appKey, $shareData['appKeys'])) {
throw new ErrorException("share not exists");
}
return $shareData;
} else {
(new Auth($config))->checkAuth($params);
}
}
/**
* 获取配置
* @return \think\response\Json
*/
public function getConfig()
{
$this->init(false);
$params = $this->requestParams;
if (!empty($params['shareKey'])) {
// 接口分享
$shareData = (new ApiShare())->checkShareAuth($this->config, $params);
if (!empty($shareData['appKeys'])) {
$config = ConfigProvider::getFeConfig($shareData['appKeys']);
} else {
$config = ConfigProvider::getFeConfig();
}
} else {
(new Auth($this->config))->checkAuth($params);
$config = ConfigProvider::getFeConfig();
}
return Helper::showJson(0, "", $config);
}
/**
* 验证密码
*/
public function verifyAuth()
{
$this->init();
$config = $this->config;
$params = $this->requestParams;
if (empty($params['password'])) {
throw new ErrorException("password not found");
}
$appKey = !empty($params['appKey']) ? $params['appKey'] : "";
if (!empty($params['shareKey'])) {
// 接口分享
$shareData = (new ApiShare())->getShareDetailByKey($params['shareKey']);
if (!empty($shareData['password']) && $params['password'] === md5($shareData['password'])) {
$hasAuth = (new Auth($config))->createToken($params['password']);
} else {
throw new ErrorException("password error");
}
} else {
if (!$appKey && !(!empty($config['auth']) && $config['auth']['enable'])) {
throw new ErrorException("password error");
}
$hasAuth = (new Auth($config))->verifyAuth($params['password'], $appKey);
}
$res = [
"token" => $hasAuth
];
return Helper::showJson(0, "", $res);
}
/**
* 获取api文档菜单
*/
public function getApiMenus()
{
$this->init(false);
$config = $this->config;
$params = $this->requestParams;
if (empty($params['appKey'])) {
throw new ErrorException("appkey not found");
}
$appKey = $params['appKey'];
$shareData = $this->checkAuth();
$currentAppConfig = Helper::getCurrentAppConfig($appKey);
$currentApp = $currentAppConfig['appConfig'];
$apiData = $this->getApiMenusByAppKey($appKey);
$groups = !empty($currentApp['groups']) ? $currentApp['groups'] : [];
if (!empty($params['shareKey']) && $shareData['type'] == 'api') {
$apiData['data'] = Helper::filterTreeNodesByKeys($apiData['data'], $shareData['apiKeys'], 'menuKey');
}
$json = [
'data' => $apiData['data'],
'app' => $currentApp,
'groups' => $groups,
'tags' => $apiData['tags'],
];
return Helper::showJson(0, "", $json);
}
protected function getApiMenusByAppKey($appKey)
{
$config = $this->config;
if (!empty($config['cache']) && $config['cache']['enable']) {
$cacheKey = Helper::getCacheKey('apiMenu', $appKey, $this->lang);
$cacheData = (new Cache())->get($cacheKey);
if ($cacheData && empty($params['reload'])) {
$apiData = $cacheData;
} else {
// 生成数据并缓存
$apiData = (new ParseApiMenus($config))->renderApiMenus($appKey);
(new Cache())->set($cacheKey, $apiData);
}
} else {
// 生成数据
$apiData = (new ParseApiMenus($config))->renderApiMenus($appKey);
}
return $apiData;
}
/**
* 获取所有api文档菜单
*/
public function getAllApiMenus()
{
$this->init(true);
$config = $this->config;
$params = $this->requestParams;
$configApps = Helper::handleAppsConfig($config['apps'], false, $config);
$data = ApiShare::getAppShareApis($config, $configApps, "", [], false);
return Helper::showJson(0, "", $data);
}
/**
* 获取接口明细
* @return array
*/
public function getApiDetail()
{
$this->init(false);
$config = $this->config;
$params = $this->requestParams;
if (empty($params['path'])) {
throw new ErrorException("path not found");
}
$appKey = !empty($params['appKey']) ? $params['appKey'] : "";
$apiKey = urldecode($params['path']);
$this->checkAuth();
if (!empty($config['cache']) && $config['cache']['enable']) {
$cacheKey = Helper::getCacheKey('apiDetail', $appKey, $this->lang, $params['path']);
$cacheData = (new Cache())->get($cacheKey);
if ($cacheData && empty($params['reload'])) {
$res = $cacheData;
} else {
// 生成数据并缓存
$res = (new ParseApiDetail($config))->renderApiDetail($appKey, $apiKey);
(new Cache())->set($cacheKey, $res);
}
} else {
// 生成数据
$res = (new ParseApiDetail($config))->renderApiDetail($appKey, $apiKey);
}
$res['appKey'] = $appKey;
return Helper::showJson(0, "", $res);
}
/**
* 获取md菜单
* @return array
*/
public function getMdMenus()
{
$this->init(false);
$config = $this->config;
$params = $this->requestParams;
$appKey = "";
if (!empty($params['appKey'])) {
// 获取指定应用
$appKey = $params['appKey'];
}
$this->checkAuth();
$docs = (new ParseMarkdown($config))->getDocsMenu($appKey, $this->lang);
return Helper::showJson(0, "", $docs);
}
/**
* 获取md文档内容
* @return \think\response\Json
*/
public function getMdDetail()
{
$this->init(false);
$config = $this->config;
$params = $this->requestParams;
$this->checkAuth();
try {
if (empty($params['path'])) {
throw new ErrorException("mdPath not found");
}
if (empty($params['appKey'])) {
throw new ErrorException("appkey not found");
}
$path = urldecode($params['path']);
$content = (new ParseMarkdown($config))->getContent($params['appKey'], $path, $this->lang);
$res = [
'content' => $content,
];
return Helper::showJson(0, "", $res);
} catch (ErrorException $e) {
return Helper::showJson($e->getCode(), $e->getMessage());
}
}
/**
* 创建代码生成器
* @return array
*/
public function createGenerator()
{
$this->init(true);
$config = $this->config;
$params = $this->requestParams;
$res = (new generator\Index($config))->create($params);
return Helper::showJson(0, "", $res);
}
/**
* 删除所有接口缓存
* @return array
*/
public function cancelAllCache()
{
$this->init(true);
$config = $this->config;
$path = APIDOC_STORAGE_PATH . $config['cache']['folder']. '/apis';
$res = DirAndFile::deleteDir($path);
return Helper::showJson(0, "", $path);
}
/**
* 生成所有接口缓存
* @return array
*/
public function createAllCache()
{
$this->init(true);
$config = $this->config;
$params = $this->requestParams;
$apps = Helper::getAllApps($config['apps']);
$cache = new Cache();
DirAndFile::deleteDir(APIDOC_STORAGE_PATH . $config['cache']['folder'] . '/' . 'apis');
if (!empty($apps) && count($apps)) {
try {
foreach ($apps as $app) {
// 缓存菜单
$appKey = $app['appKey'];
$controllerData = (new ParseApiMenus($config))->renderApiMenus($appKey);
if (!empty($controllerData['data']) && count($controllerData['data'])) {
foreach ($controllerData['data'] as $controller) {
if (!empty($controller['children']) && count($controller['children'])) {
foreach ($controller['children'] as $item) {
if (!empty($item['url']) && !empty($item['menuKey'])) {
$apiDetail = (new ParseApiDetail($config))->renderApiDetail($appKey, urldecode($item['menuKey']));
$apiDetailCacheKey = Helper::getCacheKey('apiDetail', $appKey, $this->lang, $item['menuKey']);
$cache->set($apiDetailCacheKey, $apiDetail);
}
}
}
}
}
$cacheKey = Helper::getCacheKey('apiMenu', $appKey, $this->lang);
$cache->set($cacheKey, $controllerData);
}
} catch (\ReflectionException $e) {
DirAndFile::deleteDir(APIDOC_STORAGE_PATH . $config['cache']['folder'] . '/' . 'apis');
throw new ErrorException($e->getMessage());
}
}
return Helper::showJson(0, "", true);
}
/**
* 生成代码模板内容
* @return array
*/
public function renderCodeTemplate()
{
$this->init(true);
$config = $this->config;
$params = $this->requestParams;
$code = (new ParseCodeTemplate($config))->renderCode($params);
return Helper::showJson(0, "", [
'code' => $code
]);
}
/**
* 添加接口分享
* @return array
*/
public function addApiShare()
{
$this->init(true);
$config = $this->config;
$params = $this->requestParams;
if (empty($params['name'])) {
throw new ErrorException('field not found', ['field' => 'name']);
}
if (empty($params['type'])) {
throw new ErrorException('field not found', ['field' => 'type']);
}
if ($params['type'] == 'app' && empty($params['appKeys'])) {
throw new ErrorException('field not found', ['field' => 'appKeys']);
}
if ($params['type'] == 'api' && empty($params['apiKeys'])) {
throw new ErrorException('field not found', ['field' => 'apiKeys']);
}
$res = (new ApiShare())->addApiShare($params);
return Helper::showJson(0, "", $res);
}
/**
* 获取接口分享分页列表
* @return array
*/
public function getApiShareList()
{
$this->init(true);
$config = $this->config;
$params = $this->requestParams;
$pageIndex = !empty($params['pageIndex']) ? $params['pageIndex'] : 1;
$pageSize = 5;
$res = (new ApiShare())->getSharePageList($config, $pageIndex, $pageSize);
return Helper::showJson(0, "", $res);
}
/**
* 获取接口分享记录明细
* @return array
*/
public function getApiShareDetail()
{
$this->init(true);
$config = $this->config;
$params = $this->requestParams;
if (empty($params['key'])) {
throw new ErrorException('field not found', ['field' => 'key']);
}
$cacheData = (new ApiShare())->getShareDetailByKey($params['key']);
return Helper::showJson(0, "", $cacheData);
}
/**
* 删除接口分享记录
* @return array
*/
public function deleteApiShare()
{
$this->init(true);
$config = $this->config;
$params = $this->requestParams;
if (empty($params['key'])) {
throw new ErrorException('field not found', ['field' => 'key']);
}
$cacheKey = ApiShare::getShareCacheKey($params['key']);
$res = (new Cache())->delete($cacheKey);
return Helper::showJson(0, "", $res);
}
/**
* 处理接口分享操作
* @return array
*/
public function handleApiShareAction()
{
$this->init(true);
$config = $this->config;
$params = $this->requestParams;
if (empty($params['key'])) {
throw new ErrorException('field not found', ['field' => 'key']);
}
if (!isset($params['index'])) {
throw new ErrorException('field not found', ['field' => 'index']);
}
$res = (new ApiShare())->handleApiShareAction($config, $params['key'], $params['index']);
return Helper::showJson(0, "", $res);
}
}

View File

@ -1,56 +0,0 @@
<?php
namespace hg\apidoc;
/**
* Webman Install
*/
class Install
{
const WEBMAN_PLUGIN = true;
/**
* @var array
*/
protected static $configPath = array (
'config/plugin/hg/apidoc' => 'config/plugin/hg/apidoc',
);
/**
* Install
* @return void
*/
public static function install()
{
foreach (static::$configPath as $source => $dest) {
if ($pos = strrpos($dest, '/')) {
$parent_dir = base_path() . '/' . substr($dest, 0, $pos);
if (!is_dir($parent_dir)) {
mkdir($parent_dir, 0777, true);
}
}
//symlink(__DIR__ . "/$source", base_path()."/$dest");
copy_dir(__DIR__ . "/$source", base_path() . "/$dest");
echo "Create $dest";
}
}
/**
* Uninstall
* @return void
*/
public static function uninstall()
{
foreach (static::$configPath as $source => $dest) {
$path = base_path()."/$dest";
if (!is_dir($path) && !is_file($path)) {
continue;
}
echo "Remove $dest";
if (is_file($path) || is_link($path)) {
unlink($path);
continue;
}
remove_dir($path);
}
}
}

View File

@ -1,84 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Attribute;
use Doctrine\Common\Annotations\Annotation;
use hg\apidoc\utils\AbstractAnnotation;
/**
* 添加模型的字段
* @package hg\apidoc\annotation
* @Annotation
* @Target({"METHOD"})
*/
#[Attribute(Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
class AddField extends ParamBase
{
/**
* 字段名
* @var string
*/
public $name;
/**
* 类型
* @var string
*/
public $type = 'string';
/**
* 默认值
* @var string
*/
public $default;
/**
* 描述
* @var string
*/
public $desc;
/**
* 必须
* @var bool
*/
public $require = false;
/**
* 说明md内容
* @var string
*/
public $md;
/**
* @param string $name 字段名
* @param string $type 字段类型
* @param string $desc 字段名称
* @param bool $require 是否必须
* @param string $ref 引用注解/模型
* @param string $table 引用数据表
* @param string $md Md文本内容
* @param string $field 指定Ref引入的字段
* @param string $withoutField 排除Ref引入的字段
* @param string $mock Mock规则
* @param string $children 字段子节点
*/
public function __construct(
$name = '',
string $type = '',
string $desc = '',
bool $require = false,
$ref = "",
$table = "",
string $md = "",
$field = "",
$withoutField = "",
string $mock = "",
...$attrs
)
{
parent::__construct(...func_get_args());
}
}

View File

@ -1,59 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Attribute;
use Doctrine\Common\Annotations\Annotation;
/**
* 接口调试前置事件
* @package hg\apidoc\annotation
* @Annotation
* @Target({"METHOD","ANNOTATION"})
*/
#[Attribute(Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
final class After extends EventBase
{
/**
* 事件
* @Enum({"setGlobalHeader", "setGlobalQuery", "setGlobalBody","clearGlobalHeader","clearGlobalQuery","clearGlobalBody","ajax"})
* @var string
*/
public $event;
/**
* @param string $event 事件名
* @param string $name 事件名称
* @param string $appKey 设置全局参数setGlobalHeader、setGlobalParam时指定应用
* @param string $key 字段名
* @param string $value 字段值
* @param string|array $ref 事件引用
* @param string $url ajax事件时的url
* @param string $method ajax事件时的Method
* @param string $contentType ajax事件时的 content-type
* @param string $desc 事件描述
* @param array $before 执行之前的事件
* @param array $after 执行之后的事件
*/
public function __construct(
$event = '',
string $name = '',
string $appKey = "",
string $key = '',
string $value = '',
$ref = "",
string $url = '',
string $method = '',
string $contentType = "",
string $desc = "",
array $before = [],
array $after = []
)
{
parent::__construct(...func_get_args());
}
}

View File

@ -1,25 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Attribute;
use Doctrine\Common\Annotations\Annotation;
use hg\apidoc\utils\AbstractAnnotation;
/**
* 作者
* @package hg\apidoc\annotation
* @Annotation
* @Target({"METHOD"})
*/
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
class Author extends AbstractAnnotation
{
/**
* @param string $value 作者名称
*/
public function __construct(...$value)
{
parent::__construct(...$value);
}
}

View File

@ -1,57 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Attribute;
use Doctrine\Common\Annotations\Annotation;
/**
* 接口调试前置事件
* @package hg\apidoc\annotation
* @Annotation
* @Target({"METHOD","ANNOTATION"})
*/
#[Attribute(Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
final class Before extends EventBase
{
/**
* 事件
* @Enum({"setHeader","setQuery","setBody", "clearHeader", "clearQuery", "clearBody", "setGlobalHeader", "setGlobalQuery", "setGlobalBody","clearGlobalHeader","clearGlobalQuery","clearGlobalBody","ajax"})
* @var string
*/
public $event;
/**
* @param string $event 事件名
* @param string $name 事件名称
* @param string $appKey 设置全局参数setGlobalHeader、setGlobalParam时指定应用
* @param string $key 字段名
* @param string $value 字段值
* @param string|array $ref 事件引用
* @param string $url ajax事件时的url
* @param string $method ajax事件时的Method
* @param string $contentType ajax事件时的 content-type
* @param string $desc 事件描述
* @param array $before 执行之前的事件
* @param array $after 执行之后的事件
*/
public function __construct(
$event = '',
string $name = '',
string $appKey = "",
string $key = '',
string $value = '',
$ref = "",
string $url = '',
string $method = '',
string $contentType = "",
string $desc = "",
array $before = [],
array $after = []
)
{
parent::__construct(...func_get_args());
}
}

View File

@ -1,25 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Attribute;
use Doctrine\Common\Annotations\Annotation;
use hg\apidoc\utils\AbstractAnnotation;
/**
* 调试时请求类型
* @package hg\apidoc\annotation
* @Annotation
* @Target({"METHOD"})
*/
#[Attribute(Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
class ContentType extends AbstractAnnotation
{
/**
* @param string $value 调试时请求类型
*/
public function __construct(...$value)
{
parent::__construct(...$value);
}
}

View File

@ -1,25 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Attribute;
use Doctrine\Common\Annotations\Annotation;
use hg\apidoc\utils\AbstractAnnotation;
/**
* 描述
* @package hg\apidoc\annotation
* @Annotation
* @Target({"METHOD","CLASS"})
*/
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
class Desc extends AbstractAnnotation
{
/**
* @param string $value 描述
*/
public function __construct(...$value)
{
parent::__construct(...$value);
}
}

View File

@ -1,80 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use hg\apidoc\utils\AbstractAnnotation;
abstract class EventBase extends AbstractAnnotation
{
/**
* 名称
* @var string
*/
public $name;
/**
* key
* @var string
*/
public $key;
/**
* 事件处理的值
* @var string
*/
public $value;
/**
* ajax时的url
* @var string
*/
public $url;
/**
* ajax时的Method
* @Enum({"GET", "POST", "PUT", "DELETE"})
* @var string
*/
public $method;
/**
* ajax时的 content-type
* @var string
*/
public $contentType;
/**
* 字段描述
* @var string
*/
public $desc;
/**
* 引用
* @var string|array
*/
public $ref;
/**
* 设置全局参数setGlobalHeader、setGlobalParam时指定应用
* @var string
*/
public $appKey;
/**
* 执行之前的事件
* @var array
*/
public $before;
/**
* 执行之后的事件
* @var array
*/
public $after;
}

View File

@ -1,25 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Attribute;
use Doctrine\Common\Annotations\Annotation;
use hg\apidoc\utils\AbstractAnnotation;
/**
* 指定Ref的字段
* @package hg\apidoc\annotation
* @Annotation
* @Target({"METHOD"})
*/
#[Attribute(Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
class Field extends AbstractAnnotation
{
/**
* @param string|array $value 指定Ref的字段逗号分割
*/
public function __construct(...$value)
{
parent::__construct(...$value);
}
}

View File

@ -1,24 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Attribute;
use hg\apidoc\utils\AbstractAnnotation;
/**
* 分组
* @package hg\apidoc\annotation
* @Annotation
* @Target({"CLASS"})
*/
#[Attribute(Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)]
class Group extends AbstractAnnotation
{
/**
* @param string $name 分组
*/
public function __construct(...$value)
{
parent::__construct(...$value);
}
}

View File

@ -1,50 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Attribute;
/**
* 请求头
* @package hg\apidoc\annotation
* @Annotation
* @Target({"METHOD"})
*/
#[Attribute(Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
class Header extends ParamBase
{
/**
* mock
* @var string
*/
public $mock;
/**
* @param string $name 字段名
* @param string $type 字段类型
* @param string $desc 字段名称
* @param bool $require 是否必须
* @param string|array $ref 引用注解/模型
* @param string $md Md文本内容
* @param string|array $field 指定Ref引入的字段
* @param string|array $withoutField 排除Ref引入的字段
* @param string $mock Mock规则
*/
public function __construct(
$name = '',
string $type = '',
bool $require = false,
$ref = "",
string $desc = '',
string $md = "",
$field = "",
$withoutField = "",
string $mock = ""
)
{
parent::__construct(...func_get_args());
}
}

View File

@ -1,35 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Attribute;
use Doctrine\Common\Annotations\Annotation;
use hg\apidoc\utils\AbstractAnnotation;
/**
* Markdown
* @package hg\apidoc\annotation
* @Annotation
* @Target({"METHOD"})
*/
#[Attribute(Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
class Md extends AbstractAnnotation
{
/**
* 引入md内容
* @var string|array
*/
public $ref;
/**
* @param string $name Markdown文档内容
* @param string $ref 引入md文件路径
*/
public function __construct(
$name = '',
string $ref = ''
)
{
parent::__construct(...func_get_args());
}
}

View File

@ -1,25 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Attribute;
use Doctrine\Common\Annotations\Annotation;
use hg\apidoc\utils\AbstractAnnotation;
/**
* 请求类型
* @package hg\apidoc\annotation
* @Annotation
* @Target({"METHOD"})
*/
#[Attribute(Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
class Method extends AbstractAnnotation
{
/**
* @param string $value 请求类型
*/
public function __construct(...$value)
{
parent::__construct(...$value);
}
}

View File

@ -1,22 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Attribute;
use hg\apidoc\utils\AbstractAnnotation;
/**
* 关闭接口调试
* @package hg\apidoc\annotation
* @Annotation
* @Target({"METHOD","CLASS"})
*/
#[Attribute(Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)]
class NotDebug extends AbstractAnnotation
{
public function __construct(...$value)
{
parent::__construct(...$value);
}
}

View File

@ -1,22 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Attribute;
use hg\apidoc\utils\AbstractAnnotation;
/**
* 不使用默认作者
* @package hg\apidoc\annotation
* @Annotation
* @Target({"METHOD"})
*/
#[Attribute(Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)]
class NotDefaultAuthor extends AbstractAnnotation
{
public function __construct(...$value)
{
parent::__construct(...$value);
}
}

View File

@ -1,22 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Attribute;
use hg\apidoc\utils\AbstractAnnotation;
/**
* 不使用配置中的全局请求Headers参数
* @package hg\apidoc\annotation
* @Annotation
* @Target({"METHOD"})
*/
#[Attribute(Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)]
class NotHeaders extends AbstractAnnotation
{
public function __construct(...$value)
{
parent::__construct(...$value);
}
}

View File

@ -1,22 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Attribute;
use hg\apidoc\utils\AbstractAnnotation;
/**
* 不使用配置中的全局请求Body参数
* @package hg\apidoc\annotation
* @Annotation
* @Target({"METHOD"})
*/
#[Attribute(Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)]
class NotParams extends AbstractAnnotation
{
public function __construct(...$value)
{
parent::__construct(...$value);
}
}

View File

@ -1,24 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Attribute;
use hg\apidoc\utils\AbstractAnnotation;
/**
* 标记不解析的控制器/方法
* @package hg\apidoc\annotation
* @Annotation
* @Target({"METHOD","CLASS"})
*/
#[Attribute(Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)]
class NotParse extends AbstractAnnotation
{
/**
* @param string $value 不解析
*/
public function __construct(...$value)
{
parent::__construct(...$value);
}
}

View File

@ -1,22 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Attribute;
use hg\apidoc\utils\AbstractAnnotation;
/**
* 不使用配置中的全局请求Querys参数
* @package hg\apidoc\annotation
* @Annotation
* @Target({"METHOD"})
*/
#[Attribute(Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)]
class NotQuerys extends AbstractAnnotation
{
public function __construct(...$value)
{
parent::__construct(...$value);
}
}

View File

@ -1,22 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Attribute;
use hg\apidoc\utils\AbstractAnnotation;
/**
* 不使用异常响应体返回数据
* @package hg\apidoc\annotation
* @Annotation
* @Target({"METHOD"})
*/
#[Attribute(Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)]
class NotResponseError extends AbstractAnnotation
{
public function __construct(...$value)
{
parent::__construct(...$value);
}
}

View File

@ -1,22 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Attribute;
use hg\apidoc\utils\AbstractAnnotation;
/**
* 不使用成功响应体返回数据
* @package hg\apidoc\annotation
* @Annotation
* @Target({"METHOD"})
*/
#[Attribute(Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)]
class NotResponseSuccess extends AbstractAnnotation
{
public function __construct(...$value)
{
parent::__construct(...$value);
}
}

View File

@ -1,22 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Attribute;
use hg\apidoc\utils\AbstractAnnotation;
/**
* 不使用统一响应体返回数据
* @package hg\apidoc\annotation
* @Annotation
* @Target({"METHOD"})
*/
#[Attribute(Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)]
class NotResponses extends AbstractAnnotation
{
public function __construct(...$value)
{
parent::__construct(...$value);
}
}

View File

@ -1,62 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Attribute;
/**
* 请求参数
* @Annotation
* @Target({"METHOD","ANNOTATION"})
*/
#[Attribute(Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
class Param extends ParamBase
{
/**
* mock
* @var string
*/
public $mock;
/**
* @param string $name 字段名
* @param string $type 字段类型
* @param bool $require 是否必须
* @param string|int|bool $default 默认值
* @param string|array $ref 引用注解/模型
* @param string $table 引用数据表
* @param string|array $field 指定Ref引入的字段
* @param string|array $withoutField 排除Ref引入的字段
* @param string $desc 字段名称
* @param string $md Md文本内容
* @param string $mock Mock规则
* @param array $children 子参数
* @param string $childrenField 为tree类型时指定children字段
* @param string $childrenDesc 为tree类型时指定children字段说明
* @param string $childrenType 为array类型时指定子节点类型
*/
public function __construct(
$name = '',
string $type = '',
bool $require = false,
$default = "",
$ref = "",
$table = "",
$field = "",
$withoutField = "",
string $desc = '',
string $md = "",
string $mock = "",
array $children = [],
string $childrenField = "",
string $childrenDesc = "children",
string $childrenType = "",
...$attrs
)
{
parent::__construct(...func_get_args());
}
}

View File

@ -1,88 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Doctrine\Common\Annotations\Annotation;
use hg\apidoc\utils\AbstractAnnotation;
abstract class ParamBase extends AbstractAnnotation
{
/**
* 类型
* @Enum({"string", "integer", "int", "boolean", "array", "double", "object", "tree", "file","float","date","time","datetime"})
* @var string
*/
public $type;
/**
* 默认值
* @var string
*/
public $default;
/**
* 描述
* @var string
*/
public $desc;
/**
* 为tree类型时指定children字段
* @var string
*/
public $childrenField = '';
/**
* 为tree类型时指定children字段说明
* @var string
*/
public $childrenDesc = 'children';
/**
* 为array类型时指定子节点类型
* @Enum({"string", "int", "boolean", "array", "object"})
* @var string
*/
public $childrenType = '';
/**
* 指定引入的字段
* @var string
*/
public $field;
/**
* 指定从引入中过滤的字段
* @var string
*/
public $withoutField;
/**
* 说明md内容
* @var string
*/
public $md;
/**
* 必须
* @var bool
*/
public $require = false;
/**
* 引入
* @var string|array
*/
public $ref;
/**
* 子参数
* @var array
*/
public $children;
}

View File

@ -1,25 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Attribute;
use Doctrine\Common\Annotations\Annotation;
use hg\apidoc\utils\AbstractAnnotation;
/**
* 参数类型
* @package hg\apidoc\annotation
* @Annotation
* @Target({"METHOD"})
*/
#[Attribute(Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
class ParamType extends AbstractAnnotation
{
/**
* @param string $value 参数类型formdata
*/
public function __construct(...$value)
{
parent::__construct(...$value);
}
}

View File

@ -1,62 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Attribute;
/**
* 类的属性
* @Annotation
* @Target({"METHOD","ANNOTATION","PROPERTY"})
*/
#[Attribute(Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE | Attribute::TARGET_PROPERTY)]
class Property extends ParamBase
{
/**
* mock
* @var string
*/
public $mock;
/**
* @param string $name 字段名
* @param string $type 字段类型
* @param bool $require 是否必须
* @param string|int|bool $default 默认值
* @param string|array $ref 引用注解/模型
* @param string $table 引用数据表
* @param string|array $field 指定Ref引入的字段
* @param string|array $withoutField 排除Ref引入的字段
* @param string $desc 字段名称
* @param string $md Md文本内容
* @param string $mock Mock规则
* @param array $children 子参数
* @param string $childrenField 为tree类型时指定children字段
* @param string $childrenDesc 为tree类型时指定children字段说明
* @param string $childrenType 为array类型时指定子节点类型
*/
public function __construct(
$name = '',
string $type = '',
bool $require = false,
$default = "",
$ref = "",
$table = "",
$field = "",
$withoutField = "",
string $desc = '',
string $md = "",
string $mock = "",
array $children = [],
string $childrenField = "",
string $childrenDesc = "children",
string $childrenType = "",
...$attrs
)
{
parent::__construct(...func_get_args());
}
}

View File

@ -1,61 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Attribute;
/**
* Query参数
* @package hg\apidoc\annotation
* @Annotation
* @Target({"METHOD","ANNOTATION"})
*/
#[Attribute(Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
final class Query extends ParamBase
{
/**
* mock
* @var string
*/
public $mock;
/**
* @param string $name 字段名
* @param string $type 字段类型
* @param bool $require 是否必须
* @param string|int|bool $default 默认值
* @param string|array $ref 引用注解/模型
* @param string $table 引用数据表
* @param string|array $field 指定Ref引入的字段
* @param string|array $withoutField 排除Ref引入的字段
* @param string $desc 字段名称
* @param string $md Md文本内容
* @param string $mock Mock规则
* @param array $children 子参数
* @param string $childrenField 为tree类型时指定children字段
* @param string $childrenDesc 为tree类型时指定children字段说明
* @param string $childrenType 为array类型时指定子节点类型
*/
public function __construct(
$name = '',
string $type = '',
bool $require = false,
$default = "",
$ref = "",
$table = "",
$field = "",
$withoutField = "",
string $desc = '',
string $md = "",
string $mock = "",
array $children = [],
string $childrenField = "",
string $childrenDesc = "children",
string $childrenType = "",
...$attrs
)
{
parent::__construct(...func_get_args());
}
}

View File

@ -1,52 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Attribute;
use Doctrine\Common\Annotations\Annotation;
/**
* 异常响应体
* @package hg\apidoc\annotation
* @Annotation
* @Target({"METHOD","ANNOTATION"})
*/
#[Attribute(Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
final class ResponseError extends ParamBase
{
/**
* @param string $name 字段名
* @param string $type 字段类型
* @param string $desc 字段名称
* @param bool $require 是否必须
* @param string|int|bool $default 默认值
* @param string|array $ref 引用注解/模型
* @param string $md Md文本内容
* @param string $childrenField 为tree类型时指定children字段
* @param string $childrenDesc 为tree类型时指定children字段说明
* @param string $childrenType 为array类型时指定子节点类型
* @param string|array $field 指定Ref引入的字段
* @param string|array $withoutField 排除Ref引入的字段
*/
public function __construct(
$name = '',
string $type = '',
string $desc = '',
bool $require = false,
$default = "",
$ref = "",
string $md = "",
string $childrenField = "",
string $childrenDesc = "children",
string $childrenType = "",
$field = "",
$withoutField = "",
string $mock = "",
...$attrs
)
{
parent::__construct(...func_get_args());
}
}

View File

@ -1,35 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Attribute;
use Doctrine\Common\Annotations\Annotation;
use hg\apidoc\utils\AbstractAnnotation;
/**
* 异常响应体的Markdown内容
* @package hg\apidoc\annotation
* @Annotation
* @Target({"METHOD"})
*/
#[Attribute(Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
class ResponseErrorMd extends AbstractAnnotation
{
/**
* 引入md文件
* @var string
*/
public $ref;
/**
* @param string $name Markdown文档内容
* @param string $ref 引入md文件路径
*/
public function __construct(
$name = '',
string $ref = ''
)
{
parent::__construct(...func_get_args());
}
}

View File

@ -1,60 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Attribute;
use Doctrine\Common\Annotations\Annotation;
/**
* 成功响应体
* @package hg\apidoc\annotation
* @Annotation
* @Target({"METHOD","ANNOTATION"})
*/
#[Attribute(Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
final class ResponseSuccess extends ParamBase
{
/**
* 数据挂载节点
* @var boolean
*/
public $main;
/**
* @param string $name 字段名
* @param string $type 字段类型
* @param string $desc 字段名称
* @param bool $require 是否必须
* @param string|int|bool $default 默认值
* @param string|array $ref 引用注解/模型
* @param string $md Md文本内容
* @param string $childrenField 为tree类型时指定children字段
* @param string $childrenDesc 为tree类型时指定children字段说明
* @param string $childrenType 为array类型时指定子节点类型
* @param string|array $field 指定Ref引入的字段
* @param string|array $withoutField 排除Ref引入的字段
* @param string $main 数据挂载节点
*/
public function __construct(
$name = '',
string $type = '',
string $desc = '',
bool $require = false,
$default="",
$ref = "",
string $md = "",
string $childrenField = "",
string $childrenDesc = "children",
string $childrenType = "",
$field = "",
$withoutField = "",
string $mock = "",
bool $main = false,
...$attrs
)
{
parent::__construct(...func_get_args());
}
}

View File

@ -1,35 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Attribute;
use Doctrine\Common\Annotations\Annotation;
use hg\apidoc\utils\AbstractAnnotation;
/**
* 成功响应体Markdown内容
* @package hg\apidoc\annotation
* @Annotation
* @Target({"METHOD"})
*/
#[Attribute(Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
class ResponseSuccessMd extends AbstractAnnotation
{
/**
* 引入md内容
* @var string
*/
public $ref;
/**
* @param string $name Markdown文档内容
* @param string $ref 引入md文件路径
*/
public function __construct(
$name = '',
string $ref = ''
)
{
parent::__construct(...func_get_args());
}
}

View File

@ -1,62 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Attribute;
/**
* 返回参数
* @package hg\apidoc\annotation
* @Annotation
* @Target({"METHOD","ANNOTATION"})
*/
#[Attribute(Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
class Returned extends ParamBase
{
/**
* 是否替换全局响应体中的参数
* @var bool
*/
public $replaceGlobal = false;
/**
* @param string $name 字段名
* @param string $type 字段类型
* @param bool $require 是否必须
* @param string|int|bool $default 默认值
* @param string|array $ref 引用注解/模型
* @param string $table 引用数据表
* @param string|array $field 指定Ref引入的字段
* @param string|array $withoutField 排除Ref引入的字段
* @param string $desc 字段名称
* @param string $md Md文本内容
* @param array $children 子参数
* @param string $childrenField 为tree类型时指定children字段
* @param string $childrenDesc 为tree类型时指定children字段说明
* @param string $childrenType 为array类型时指定子节点类型
* @param string $replaceGlobal 是否替换全局响应体参数
*/
public function __construct(
$name = '',
string $type = '',
bool $require = false,
$default = "",
$ref = "",
$table = "",
$field = "",
$withoutField = "",
string $desc = '',
string $md = "",
string $mock = "",
array $children = [],
string $childrenField = "",
string $childrenDesc = "children",
string $childrenType = "",
bool $replaceGlobal = false,
...$attrs
)
{
parent::__construct(...func_get_args());
}
}

View File

@ -1,26 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Attribute;
use Doctrine\Common\Annotations\Annotation;
use hg\apidoc\utils\AbstractAnnotation;
/**
* 路由中间件,自动注册路由时有效
* @package hg\apidoc\annotation
* @Annotation
* @Target({"METHOD","CLASS"})
*/
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
class RouteMiddleware extends AbstractAnnotation
{
/**
* 路由中间件,自动注册路由时有效
* @param array $value
*/
public function __construct(...$value)
{
parent::__construct(...$value);
}
}

View File

@ -1,51 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Attribute;
/**
* 路由参数
* @package hg\apidoc\annotation
* @Annotation
* @Target({"METHOD"})
*/
#[Attribute(Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
class RouteParam extends ParamBase
{
/**
* @param string $name 字段名
* @param string $type 字段类型
* @param bool $require 是否必须
* @param string|int|bool $default 默认值
* @param string|array $ref 引用注解/模型
* @param string|array $field 指定Ref引入的字段
* @param string|array $withoutField 排除Ref引入的字段
* @param string $desc 字段名称
* @param string $md Md文本内容
* @param string $mock Mock规则
*/
public function __construct(
$name = '',
string $type = '',
bool $require = false,
$default = "",
$ref = "",
$field = "",
$withoutField = "",
string $desc = '',
string $md = "",
string $mock = "",
...$attrs
)
{
parent::__construct(...func_get_args());
}
/**
* mock
* @var string
*/
public $mock;
}

View File

@ -1,25 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Attribute;
use Doctrine\Common\Annotations\Annotation;
use hg\apidoc\utils\AbstractAnnotation;
/**
* 排序
* @package hg\apidoc\annotation
* @Annotation
* @Target({"CLASS"})
*/
#[Attribute(Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)]
class Sort extends AbstractAnnotation
{
/**
* @param string|int $value 排序
*/
public function __construct(...$value)
{
parent::__construct(...$value);
}
}

View File

@ -1,25 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Attribute;
use Doctrine\Common\Annotations\Annotation;
use hg\apidoc\utils\AbstractAnnotation;
/**
* Tag
* @package hg\apidoc\annotation
* @Annotation
* @Target({"METHOD"})
*/
#[Attribute(Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
class Tag extends AbstractAnnotation
{
/**
* @param string $value Tag
*/
public function __construct(...$value)
{
parent::__construct(...$value);
}
}

View File

@ -1,25 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Attribute;
use Doctrine\Common\Annotations\Annotation;
use hg\apidoc\utils\AbstractAnnotation;
/**
* 标题
* @package hg\apidoc\annotation
* @Annotation
* @Target({"METHOD","CLASS"})
*/
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
class Title extends AbstractAnnotation
{
/**
* @param string $name 控制器/接口名称
*/
public function __construct(...$value)
{
parent::__construct(...$value);
}
}

View File

@ -1,25 +0,0 @@
<?php
namespace hg\apidoc\annotation;
use Attribute;
use Doctrine\Common\Annotations\Annotation;
use hg\apidoc\utils\AbstractAnnotation;
/**
* 接口Url
* @package hg\apidoc\annotation
* @Annotation
* @Target({"METHOD"})
*/
#[Attribute(Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
class Url extends AbstractAnnotation
{
/**
* @param string $value 接口Url
*/
public function __construct(...$value)
{
parent::__construct(...$value);
}
}

Some files were not shown because too many files have changed in this diff Show More