|
@@ -6,13 +6,49 @@ use Illuminate\Http\JsonResponse;
|
|
|
use Illuminate\Http\Request;
|
|
|
use Illuminate\Support\Facades\Redis;
|
|
|
|
|
|
+/**
|
|
|
+ * 枚举数据控制器
|
|
|
+ * @group 通用接口
|
|
|
+ */
|
|
|
class EnumController extends Controller
|
|
|
{
|
|
|
/**
|
|
|
* 获取枚举数据
|
|
|
*
|
|
|
- * @param Request $request
|
|
|
- * @return JsonResponse
|
|
|
+ * @queryParam enum string required 枚举类名称,例如:UserType,OrderStatus等 Example: UserType
|
|
|
+ *
|
|
|
+ * @response 200 {
|
|
|
+ * "data": {
|
|
|
+ * "items": [
|
|
|
+ * {
|
|
|
+ * "label": "普通用户",
|
|
|
+ * "value": 1
|
|
|
+ * },
|
|
|
+ * {
|
|
|
+ * "label": "VIP用户",
|
|
|
+ * "value": 2
|
|
|
+ * }
|
|
|
+ * ],
|
|
|
+ * "msg": "success",
|
|
|
+ * "status": 200
|
|
|
+ * }
|
|
|
+ * }
|
|
|
+ *
|
|
|
+ * @response 400 {
|
|
|
+ * "data": {
|
|
|
+ * "items": [],
|
|
|
+ * "msg": "枚举名称不能为空",
|
|
|
+ * "status": 400
|
|
|
+ * }
|
|
|
+ * }
|
|
|
+ *
|
|
|
+ * @response 404 {
|
|
|
+ * "data": {
|
|
|
+ * "items": [],
|
|
|
+ * "msg": "枚举类不存在",
|
|
|
+ * "status": 404
|
|
|
+ * }
|
|
|
+ * }
|
|
|
*/
|
|
|
public function getEnumData(Request $request): JsonResponse
|
|
|
{
|