示例#1
0
def course_schedule():
    """
    swagger-doc: 'do allot query'
    required: []
    req:
      page_limit:
        description: 'records in one page'
        type: 'integer'
      page_no:
        description: 'page no'
        type: 'integer'
      course_id:
        description: '课包id'
        type: 'string'
    res:
      num_results:
        description: 'objects returned by query in current page'
        type: 'integer'
      page:
        description: 'current page no in total pages'
        type: 'integer'
      total_pages:
        description: 'total pages'
        type: 'integer'
      objects:
        description: 'objects returned by query'
        type: array
        items:
          type: object
          properties:
            id:
              description: 'course_schedule_id'
              type: 'integer'
            name:
              description: '课程名称'
              type: 'integer'
            start:
              description: '开始时间'
              type: 'string'
            end:
              description: '结束时间'
              type: 'string'
            courseware_num:
              description: '课件数量'
              type: 'string'
            schedule_type:
              description: '课程状态'
              type: 'string'
    """
    j = request.json
    datetime_param_sql_format(j, ['class_at']),
    return jsonify(do_query(j, course_schedule_sql))
示例#2
0
def course_common():
    """
    swagger-doc: 'do allot query'
    required: []
    req:
      page_limit:
        description: 'records in one page'
        type: 'integer'
      page_no:
        description: 'page no'
        type: 'integer'
      teacher_name:
        description: '教师名称'
        type: 'string'
      teacher_id:
        description: '教师id'
        type: 'string'
      student_id:
        description: '学生id'
        type: 'string'
      course_name:
        description: '课包名称'
        type: 'string'
      student_name:
        description: '学生名称'
        type: 'string'
      class_at:
        description: '上课时间 start in sql format YYYY-mm-dd HH:MM:ss.SSS'
        type: 'string'
      state:
        description: '课程状态,1:带排课,2:上课中,3:已完成'
        type: 'string'
      courseware:
        description: '课件状态,0:未上传,1:已上传'
        type: 'string'
    res:
      num_results:
        description: 'objects returned by query in current page'
        type: 'integer'
      page:
        description: 'current page no in total pages'
        type: 'integer'
      total_pages:
        description: 'total pages'
        type: 'integer'
      objects:
        description: 'objects returned by query'
        type: array
        items:
          type: object
          properties:
            id:
              description: '课程id'
              type: 'integer'
            teacher_name:
              description: '教师账号'
              type: 'integer'
            course_name:
              description: '课包英文名称'
              type: 'string'
            course_name_zh:
              description: '课包中文名称'
              type: 'string'
            student_name:
              description: '学生账号'
              type: 'string'
            start:
              description: '开始时间,如果没有就是带排课'
              type: 'string'
            end:
              description: '结束时间'
              type: 'string'
            classes_number:
              description: '总课程数'
              type: 'string'
            finish:
              description: '已经上完的程数'
              type: 'string'
            course_schedule_id:
              description: '总排课数大于0就是已经排课,0未排课'
              type: 'string'
            courseware_num:
              description: '大于0就是已经上传,否则未上传'
              type: 'int'
    """
    j = request.json
    datetime_param_sql_format(j, ['class_at']),
    return jsonify(do_query(j, course_common_sql))
示例#3
0
def query():
    """
    swagger-doc: 'do package query'
    required: []
    req:
      page_limit:
        description: 'records in one page'
        type: 'integer'
      page_no:
        description: 'page no'
        type: 'integer'
      category_1:
        description: '一级分类'
        type: 'string'
      category_2:
        description: '二级分类'
        type: 'string'
      category_3:
        description: '三级分类'
        type: 'string'
      course_name:
        description: '课程名称'
        type: 'string'
      course_id:
        description: '课程id'
        type: 'string'
      updated_by:
        description: '更新操作人'
        type: 'string'
      created_at_start:
        description: '上课开始时间 in sql format YYYY-mm-dd HH:MM:ss.SSS'
        type: 'string'
      created_at_end:
        description: '上课结束时间 in sql format YYYY-mm-dd HH:MM:ss.SSS'
        type: 'string'
      course_type:
        description: '课程类型'
        type: 'string'
      course_state:
        description: '课程状态'
        type: 'string'
    res:
      num_results:
        description: 'objects returned by query in current page'
        type: 'integer'
      page:
        description: 'current page no in total pages'
        type: 'integer'
      total_pages:
        description: 'total pages'
        type: 'integer'
      objects:
        description: 'objects returned by query'
        type: array
        items:
          type: object
          properties:
            id:
              description: '课程id'
              type: 'integer'
            course_name:
              description: '课程英文名称'
              type: 'string'
            course_name_zh:
              description: '课程中文名称'
              type: 'string'
            course_type:
              description: '课程类型'
              type: 'integer'
            course_state:
              description: '课程状态'
              type: 'integer'
            updated_by:
              description: '最后更新人'
              type: 'string'
            created_at:
              description: '创建时间'
              type: 'string'
            teacher_name:
              description: '教师名称'
              type: 'string'
    """
    j = request.json
    datetime_param_sql_format(j, ['created_at_start', 'created_at_end']),
    return jsonify(do_query(j, generate_sql))
示例#4
0
def my_course():
    """
    swagger-doc: 'do my course query'
    required: []
    req:
      page_limit:
        description: 'records in one page'
        type: 'integer'
      page_no:
        description: 'page no'
        type: 'integer'
      course_name:
        description: '课程名称'
        type: 'string'
      course_id:
        description: '课程id'
        type: 'string'
      teacher_name:
        description: '教师名称'
        type: 'string'
      course_time:
        description: '上课时间in sql format YYYY-mm-dd HH:MM:ss.SSS'
        type: 'string'
      course_status:
        description: '课程状态 1:已上完,2:未上'
        type: 'string'

    res:
      num_results:
        description: 'objects returned by query in current page'
        type: 'integer'
      page:
        description: 'current page no in total pages'
        type: 'integer'
      total_pages:
        description: 'total pages'
        type: 'integer'
      objects:
        description: 'objects returned by query'
        type: array
        items:
          type: object
          properties:
            id:
              description: '课程计划id'
              type: 'integer'
            course_id:
              description: '课程id'
              type: 'string'
            student_id:
              description: '学生id'
              type: 'string'
            course_name:
              description: '课程名称'
              type: 'string'
            course_desc:
              description: '课程描述'
              type: 'string'
            teacher_avatar:
              description: '教师头像'
              type: 'string'
            teacher_name:
              description: '教师名称'
              type: 'string'
            finish:
              description: '已经上完的数量'
              type: 'integer'
            classes_number:
              description: '课节总数'
              type: 'integer'
            start:
              description: '上课开始时间'
              type: 'string'
            end:
              description: '上课结束时间'
              type: 'string'
    """
    j = request.json
    datetime_param_sql_format(j, ['course_time']),
    return jsonify(do_query(j, my_course_sql))
示例#5
0
def my_order():
    """
    swagger-doc: 'do my course query'
    required: []
    req:
      page_limit:
        description: 'records in one page'
        type: 'integer'
      page_no:
        description: 'page no'
        type: 'integer'
      course_name:
        description: '课程名称'
        type: 'string'
      teacher_name:
        description: '教师名称'
        type: 'string'
      order_id:
        description: '订单id'
        type: 'string'
      payment_state:
        description: '支付状态,参考枚举值'
        type: 'string'
      created_at_start:
        description: '上课开始时间 format YYYY-mm-dd HH:MM:ss.SSS'
        type: 'string'
      created_at_end:
        description: '上课结束时间 format YYYY-mm-dd HH:MM:ss.SSS'
        type: 'string'

    res:
      num_results:
        description: 'objects returned by query in current page'
        type: 'integer'
      page:
        description: 'current page no in total pages'
        type: 'integer'
      total_pages:
        description: 'total pages'
        type: 'integer'
      objects:
        description: 'objects returned by query'
        type: array
        items:
          type: object
          properties:
            id:
              description: '订单id'
              type: 'integer'
            course_name:
              description: '课程名称'
              type: 'string'
            classes_number:
              description: '总课节数'
              type: 'integer'
            order_type:
              description: '订单类型参考枚举'
              type: 'integer'
            payment_state:
              description: '支付状态'
              type: 'string'
            created_at:
              description: '订单创建时间'
              type: 'string'
            teacher_name:
              description: '教师名称'
              type: 'string'
            order_amount:
              description: '订单金额'
              type: 'integer'
    """
    j = request.json
    datetime_param_sql_format(j, ['created_at_start', 'created_at_end']),
    return jsonify(do_query(j, my_order_sql))
示例#6
0
def query():
    """
    swagger-doc: 'do order query'
    required: []
    req:
      page_limit:
        description: 'records in one page 分页中每页条数'
        type: 'integer'
      page_no:
        description: 'page no, start from 1 分页中页序号'
        type: 'integer'
      category_1:
        description: '一级分类'
        type: 'string'
      category_2:
        description: '二级分类'
        type: 'string'
      category_3:
        description: '三级分类'
        type: 'string'
      course_name:
        description: 'course name 课程名称'
        type: 'string'
      course_id:
        description: 'course id 课程编号'
        type: 'string'
      updated_by:
        description: 'updated by 下单人'
        type: 'string'
      created_at_start:
        description: '订单创建时间开始,格式: YYYY-mm-ddTHH:MM:ss.SSSZ'
        type: 'string'
      created_at_end:
        description: '订单创建时间结束,格式: YYYY-mm-ddTHH:MM:ss.SSSZ'
        type: 'string'
      order_type:
        description: 'order type 订单类型'
        type: 'string'
      order_state:
        description: 'order state 订单状态'
        type: 'string'
    res:
      num_results:
        description: 'objects returned by query in current page'
        type: 'integer'
      page:
        description: 'current page no in total pages'
        type: 'integer'
      total_pages:
        description: 'total pages'
        type: 'integer'
      objects:
        description: 'objects returned by query'
        type: array
        items:
          type: object
          properties:
            id:
              description: 'course id'
              type: 'integer'
            course_name:
              description: 'course name'
              type: 'string'
            classes_number:
              description: 'classes number in this order'
              type: 'integer'
            order_type:
              description: 'order type'
              type: 'integer'
            order_state:
              description: 'order state'
              type: 'integer'
            updated_by:
              description: 'order updated by'
              type: 'string'
            created_at:
              description: 'order created at'
              type: 'string'
            teacher_name:
              description: 'teacher name of order'
              type: 'string'
            student_name:
              description: 'student name of order'
              type: 'string'
            order_amount:
              description: 'order price amount'
              type: 'integer'
    """
    j = request.json
    return jsonify(
        do_query(
            datetime_param_sql_format(j,
                                      ['created_at_start', 'created_at_end']),
            generate_sql))