Classification.php 2.02 KB
Newer Older
刘剑华 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
<?php

namespace app\api\controller\v1;

use app\api\controller\Api;

class Classification {


    public $restMethodList = 'get|post|put|';
    /**
     * @SWG\Get(
     *     path="/index",
     *     tags={"用户信息"},
     *     operationId="read",
     *     summary="Add a new pet to the store",
     *     description="",
     *     consumes={"multipart/form-data"},
     *     produces={"multipart/form-data"},
     *     @SWG\Parameter(
     *         name="id",
     *         description="Pet object that needs to be added to the store",
     *         required=false,
     *          paramType="form",
     *         @SWG\Schema(ref="#/definitions/Pet"),
     *     ),
     *     @SWG\Response(
     *         response=405,
     *         description="Invalid input",
     *     ),
     *     security={{"petstore_auth":{"write:pets", "read:pets"}}}
     * )
     */
    public function index(){


    }

    public function read($id){
        //获取4大分类下的子分类
        $groupModel = model('Classification');
        $list=$groupModel->get_all_class($id);
        $result=new Api();
        if($list){
            return $result->sendSuccess($list,'SUCCESS','200');
        }else{
            return $result->sendSuccess($list,'SUCCESS','200');
        }




    }
    public function case_list($id){
        //获取子分类下的案例列表
        $groupModel = model('Classification');
        $list=$groupModel->get_case_list($id);
        $result=new Api();

        if($list){

//            print_json($list);die;
            return $result->sendSuccess($list,'SUCCESS','200');
        }else{
            return $result->sendSuccess($list,'SUCCESS','200');
        }

    }

    public function case_details($id){

        $groupModel = model('Classification');
        $list=$groupModel->get_case_details($id);
        $result=new Api();
        if($list){
            return $result->sendSuccess($list,'SUCCESS','200');
        }else{
            return $result->sendSuccess($list,'SUCCESS','200');
        }
    }




}