Esempio n. 1
0
def review_comment_requirement(review_id):
    comment, result = parse_json_form('review_comment')
    RequirementReviewBusiness.review_modify(review_id, comment, result)

    # 数据同步到需求列表中
    ret = RequirementBusiness.review_modify(result)
    return json_detail_render(ret)
Esempio n. 2
0
def issue_priority_batch_switch_handler():
    """
    @api {post} /v1/taskcase/priority/ 修改 多个taskcase的优先级
    @apiName ChangeTaskCasesPriority
    @apiGroup 项目
    @apiDescription 修改多个taskcase的优先级
    @apiParam {int} priority 优先级 0:紧急 1:高 2:中 3:低
    @apiParam {int} project_id 项目id
    @apiParam {list} case_list taskcase的列表
    @apiParamExample {json} Request-Example:
    {
        "case_list": [1,2,3],
        "priority": 1,
        "project_id": 4
    }
    @apiSuccessExample {json} Success-Response:
     HTTP/1.1 200 OK
     {
        "code": 0,
        "data": [],
        "message": "ok"
    }
    """
    project_id, case_list, priority = parse_json_form('priority_batch_switch')
    ret = TaskCaseBusiness.priority_batch_switch(project_id, case_list,
                                                 priority)
    return json_detail_render(ret)
Esempio n. 3
0
def issue_add_handler():
    """
    @api {post} /v1/issue 新增 缺陷
    @apiName CreateIssue
    @apiGroup 项目
    @apiDescription 新增 缺陷
    @apiParam {int} module_id 模块 ID
    @apiParam {int} handler 处理人 ID
    @apiParam {int} issue_type 类型
    @apiParam {int} chance 出现几率
    @apiParam {int} level 级别
    @apiParam {int} priority 优先级
    @apiParam {int} system 系统
    @apiParam {string} title 标题
    @apiParam {string} attach 福建
    @apiParam {string} description 描述
    @apiParam {int} detection_chance 用户识别度
    @apiParam {int} project_id 项目 ID
    @apiParam {int} version 版本
    @apiParam {int} creator 创建人 ID
    @apiParam {int} modifier 修改人 ID
    @apiParam {int} [requirement_id] 关联的 需求 ID
    @apiParamExample {json} Request-Example:
    {
        "module_id": 340,
        "handler": 93,
        "issue_type": 0,
        "chance": 0,
        "level": 0,
        "priority": 0,
        "system": 4,
        "title": "123",
        "attach": "{\"images\":[],\"files\":[],\"videos\":[]}",
        "description": "<p>test</p>",
        "detection_chance": 0,
        "project_id": 4,
        "version": 168,
        "creator": 93,
        "modifier": 93,
        "requirement_id": 123
    }
    @apiSuccessExample {json} Success-Response:
     HTTP/1.1 200 OK
    {
        "code": 0,
        "data": [],
        "message": "ok"
    }
    """
    (system, version, project_id, module_id, creator, modifier, handler,
     issue_type, chance, level, priority, stage, title, attach, handle_status,
     description, comment, detection_chance, requirement_id,
     case_covered) = parse_json_form('issue_create')
    ret = IssueBusiness.create(system, version, project_id, module_id, creator,
                               modifier, handler, issue_type, chance, level,
                               priority, stage, title, attach, handle_status,
                               description, comment, detection_chance,
                               requirement_id, case_covered)

    return json_detail_render(ret)
Esempio n. 4
0
def project_details_handler(pid):
    """
    @api {post} /v1/project/{id} 修改项目
    @apiName ModifyProject
    @apiGroup 项目
    @apiDescription 修改项目
    @apiParam {string} name 项目名称
    @apiParam {string} description 描述
    @apiParam {string} logo logo图片
    @apiParam {int} weight 权重
    @apiParamExample {json} Request-Example:
    {
        "name": "电梯贷款",
        "description": "",
        "logo":"pic",
        "weight": 2
    }
    @apiSuccessExample {json} Success-Response:
     HTTP/1.1 200 OK
    {
    "code":0,
    "data":[],
    "message":"ok"
    }
    """
    name, description, weight, logo = parse_json_form('modifyproject')
    ret, msg = ProjectBusiness.modify(pid, name, description, weight, logo)
    return json_detail_render(ret, [], msg)
Esempio n. 5
0
def version_modify_handler(version_id):
    """
    @api {post} /v1/version/{version_id} 修改版本
    @apiName ModifyVersion
    @apiGroup 项目
    @apiDescription 修改版本
    @apiParam {string} title 标题
    @apiParam {int} project_id 项目ID
    @apiParam {string} start_time 版本开始时间
    @apiParam {string} end_time 版本结束时间
    @apiParam {int} publish_status 发布状态0:未发布1:已发布
    @apiParam {string} description 描述
    @apiParam {string} comment 备注
    @apiParamExample {json} Request-Example:
    {
        "title": "str",
        "project_id": 1,
        "start_time": "2018-11-11",
        "end_time": "2018-11-11",
        "publish_status": 1,
        "description": "str",
        "comment": "str"
    }
    @apiSuccessExample {json} Success-Response:
     HTTP/1.1 200 OK
    {
    "code":0,
    "data":[],
    "message":"ok"
    }
    """
    title, start_time, end_time, description = parse_json_form('versionmodify')
    ret = VersionBusiness.version_modify(version_id, title, start_time, end_time, description)
    return json_detail_render(ret)
Esempio n. 6
0
def virtual_assets_detail_handler(pid):
    """
    @api {post/delete} /v1/asset/virtual 更新/删除 虚拟资产
    @apiName UpdateDeleteVirtualList
    @apiGroup 项目
    @apiDescription 更新 虚拟资产
    @apiParam {int} asset_id 资产编号
    @apiParam {int} [passwd] 密码
    @apiParam {int} [administrator] 管理员
    @apiParam {int} [idcard] id 卡
    @apiParam {int} [asset_type] 资产类型
    @apiParam {int} [operator] 操作者
    @apiParamExample {json} Request-Example:
    {
        "asset_id": "123",
        "passwd": "123",
        "administrator": "123",
        "bind_tel": "123",
        "idcard": "123",
        "operator": "123",
        "asset_type": 2,
        "borrow_id": 93
    }
    @apiSuccessExample {json} Success-Response:
    HTTP/1.1 200 OK
    {
     "code": 0,
     "data": [],
     "message": "ok"
    }
    """
    asset_id, passwd, administrator, bind_tel, idcard, asset_type, operator = parse_json_form('virtual_asset_update')
    ret, msg = VirtualAssetBusiness.update(pid, asset_id, passwd, administrator, bind_tel, idcard, asset_type, operator)

    return json_detail_render(ret, [], msg)
Esempio n. 7
0
def case_import():
    """
    @api {post} /v1/case/import 导入 用例
    @apiName ImportCases
    @apiGroup 项目
    @apiDescription 导入用例
    @apiParam {string} url_path oss url
    @apiParam {int} creator 创建人
    @apiParam {int} project_id 项目id
    @apiParam {int} module_id 模块id
    @apiParamExample {json} Request-Example:
    {
        "url_path": "http://tcloud-static.oss-cn-beijing.aliyuncs.com/v1/case_export/96/1564575657.xls",
        "project_id":4,
        "creator":96,
        "module_id":342
    }
    @apiSuccessExample {json} Success-Response:
     HTTP/1.1 200 OK
    {
        "code":0,
        "data":"",
        "message":"ok"
    }
    """
    url_path, creator, project_id, module_id = parse_json_form('fileimport')
    code, message = CaseBusiness.case_import(url_path, creator, project_id,
                                             module_id)
    return json_detail_render(code, [], message)
Esempio n. 8
0
def phone_move_handler(pid):
    """
    @api {post} /v1/asset/phone/move/{int:id} 流转 资产设备
    @apiName MovePhone
    @apiGroup 项目
    @apiDescription 流转 资产设备
    @apiParam {int} id
    @apiParam {int} borrow_id 流转人 ID
    @apiParamExample {json} Request-Example:
    {
        "borrow_id": 2
    }
    @apiSuccessExample {json} Success-Response:
     HTTP/1.1 200 OK
     {
          "code": 0,
          "data": [],
          "message": "ok"
    }
    """
    if is_admin() or PhoneBusiness.can_move_status(pid):
        borrow_id = parse_json_form('phone_move')
        ret, msg = PhoneBusiness.move_to_user(pid, borrow_id)
        return json_detail_render(ret, [], msg)
    else:
        return json_detail_render(403)
Esempio n. 9
0
def create_tag():
    """
    @api {post} /v1/tag 新增 标签
    @apiName CreateTag
    @apiGroup 项目
    @apiDescription 新增 标签
    @apiParam {int} tag  标签名称
    @apiParam {int} project_id 项目ID
    @apiParam {int} description 描述
    @apiParamExample {json} Request-Example:
    {
        "tag": "标签a",
        "project_id": 4,
        "description": "这是一个标签a"
    }
    @apiSuccessExample {json} Success-Response:
     HTTP/1.1 200 OK
    {
        "code": 0,
        "data": [],
        "message": "ok"
    }
    """
    tag_name, project_id, description = parse_json_form('createtag')
    code = TagBusiness.create(tag_name, project_id, description)
    return {'code': code}
Esempio n. 10
0
def post_project_config(project_id):
    """
    @api {post} /v1/boardconfig/{project_id} 修改 项目看板配置
    @apiName ModifyBoardConfig
    @apiGroup 项目
    @apiDescription 修改项目看板配置
    @apiParam {string} issue 缺陷
    @apiParam {string} requirement 需求
    @apiParamExample {json} Request-Example:
    {
        "issue":"1,2,3",
        "requirement":"2,4,6"
    }
    @apiSuccessExample {json} Success-Response:
     HTTP/1.1 200 OK
     {
        "code": 0,
        "data": [],
        "message": "ok"
    }
    """
    issue, requirement = parse_json_form('boardconfig')
    ret = BoardConfigBusiness.update(project_id, issue, requirement)

    return json_detail_render(ret)
Esempio n. 11
0
def module_indexs_handler():
    """
    @api {post} /v1/module/ 新增 模块
    @apiName CreateModule
    @apiGroup 项目
    @apiDescription 新增模块,分为父模块还是子模块
    @apiParam {string} name 名称
    @apiParam {int} project_id 项目od
    @apiParam {string} description 描述
    @apiParam {int} parent_id 父模块id
    @apiParamExample {json} Request-Example:
    {
        "name":"用力模块",
        "project_id":4,
        "description":"",
        "parent_id":110
    }
    @apiSuccessExample {json} Success-Response:
     HTTP/1.1 200 OK
     {
        "code": 0,
        "data": "",
        "message": "ok"
    }
    """
    name, project_id, description, parent_id = parse_json_form('modulecreate')
    ret, msg = ModuleBusiness.module_create(name, project_id, description,
                                            parent_id)

    return json_detail_render(ret, [], msg)
Esempio n. 12
0
def project_detach_users():
    """
    @api {post} /v1/project/bindusers 项目解绑用户
    @apiName DetachUserForProject
    @apiGroup 项目
    @apiDescription 项目解绑用户
    @apiParam {int} user_id 用户ID
    @apiParam {int} project_id 项目ID
    @apiParamExample {json} Request-Example:
    {
        "project_id": 75,
        "user_id":1
    }
    @apiSuccessExample {json} Success-Response:
     HTTP/1.1 200 OK
    {
    "code":0,
    "data":[],
    "message":"ok"
    }
    """
    project_id, user_id = parse_json_form('projectdetachusers')
    ret, msg = ProjectBusiness.detach_users(project_id, user_id)

    return json_detail_render(ret, [], msg)
Esempio n. 13
0
def project_indexs_handler():
    """
    @api {post} /v1/project/ 新增项目
    @apiName CreateProject
    @apiGroup 项目
    @apiDescription 新增项目
    @apiParam {string} name 项目名称
    @apiParam {string} description 描述
    @apiParam {string} logo logo图片
    @apiParamExample {json} Request-Example:
    {
        "name": "电梯贷款",
        "description": "description",
        "logo":"pic"
    }
    @apiSuccessExample {json} Success-Response:
     HTTP/1.1 200 OK
    {
    "code":0,
    "data":[],
    "message":"ok"
    }
    """
    name, description, logo = parse_json_form('addproject')
    ret, msg = ProjectBusiness.create_new_project(name, description, logo)

    return json_detail_render(ret, [], msg)
Esempio n. 14
0
def module_details_handler(mid):
    """
    @api {post} /v1/module/{id} 修改 模块
    @apiName ModifyModule
    @apiGroup 项目
    @apiDescription 修改模块,应该只是修改名称描述,感觉后续可能要修改parent_id
    @apiParam {string} name 名称
    @apiParam {int} project_id 项目od
    @apiParam {string} description 描述
    @apiParam {int} weight weight
    @apiParamExample {json} Request-Example:
    {
        "name":"用力模块",
        "project_id":"4",
        "description":"",
        "weight":1
    }
    @apiSuccessExample {json} Success-Response:
     HTTP/1.1 200 OK
     {
        "code": 0,
        "data": "",
        "message": "ok"
    }
    """
    name, project_id, description, weight = parse_json_form('modulemodify')
    ret, msg = ModuleBusiness.module_modify(mid, name, project_id, description,
                                            weight)

    return json_detail_render(ret, [], msg)
Esempio n. 15
0
def task_case_dashboard_project_handler():
    """
    @api {post} /v1/taskcase/dashboard/project 查询 各个项目的case汇总
    @apiName TaskCaseDashboardProject
    @apiGroup 项目
    @apiDescription 查询各个项目的case汇总
    @apiParam {string} start_date 开始日期
    @apiParam {string} end_date 结束日期
    @apiParamExample {json} Request-Example:
    {
        "start_date": "2018-11-11",
        "end_date": "2018-11-22"
    }
    @apiSuccessExample {json} Success-Response:
     HTTP/1.1 200 OK
    {
      "code": 0,
      "data": [
        {
              "info": [
                {
                  "count": 2,
                  "date": "2018-12-17"
                }
              ],
              "userid": 1,
              "username": "******"
            }
      "message": "ok"
    }
    """
    start_date, end_date = parse_json_form('issuedashboard')
    data = TaskDashBoardBusiness.task_case_project_dashboard(
        start_date, end_date)
    return json_detail_render(0, data)
Esempio n. 16
0
def task_add_handler():
    """
    @api {post} /v1/task/ 新增 任务
    @apiName CreateTask
    @apiGroup 项目
    @apiDescription 新增任务
    @apiParam {string} description 任务描述
    @apiParam {string} tmethod 任务方法:自动化or人工测试
    @apiParam {string} ttype 任务类型:功能测试,兼容性测试…
    @apiParam {int} creator 创建任务的人
    @apiParam {int} executor 执行任务的人
    @apiParam {int} priority 优先级0:紧急1:高2:中3:低
    @apiParam {list} case_list 关联的case列表
    @apiParam {string} name 名称
    @apiParam {int} project_id 项目ID
    @apiParam {string} start_date 开始时间
    @apiParam {string} end_date 结束时间
    @apiParam {int} version 版本ID
    @apiParam {string} testreport 测试总结
    @apiParam {string} attach 附件:测试报告附件
    @apiParam {string} attachment 附件:新建修改任务的时候上传的 附件文件
    @apiParamExample {json} Request-Example:
    {
        "case_list": [1,2,3],
        "description": "str",
        "tmethod": "str",
        "ttype": "str",
        "creator": 1,
        "executor": 1,
        "start_date": "2018-11-11",
        "end_date": "2018-11-22",
        "project_id": 1,
        "version": 1,
        "name": "str12",
        "testreport": "str123",
        "attach": "str1234",
        "priority": 1,
        "attachmenet": "",
    }
    @apiSuccessExample {json} Success-Response:
     HTTP/1.1 200 OK
     {
        "code": 0,
        "data": [],
        "message": "ok"
    }
    """
    (name, description, tmethod, ttype, creator, executor, start_time,
     end_time, priority, project_id, version, case_list, testreport, attach,
     tag, attachment) = parse_json_form('task_create')
    ret = TaskBusiness.create(name, description, tmethod, ttype, creator,
                              executor, start_time, end_time, priority,
                              project_id, version, case_list, testreport,
                              attach, tag, attachment)

    return json_detail_render(ret)
Esempio n. 17
0
def review_requirement():
    (title, requirement_list, project_id, version_id, creator, modifier,
     reviewer, status, attach, comment, weight,
     review_status) = parse_json_form('review_create')
    ret = RequirementReviewBusiness.review_create(title, requirement_list,
                                                  project_id, version_id,
                                                  creator, modifier, reviewer,
                                                  status, attach, comment,
                                                  weight, review_status)
    return json_detail_render(ret)
Esempio n. 18
0
def phone_modify_details_handler(pid):
    """
    @api {post} /v1/asset/phone/{int:id} 更新 资产
    @apiName UpdatePhone
    @apiGroup 项目
    @apiDescription 更新 资产设备
    @apiParam {string} [name] 资产名称
    @apiParam {string} [vendor] 制造商
    @apiParam {string} [os] 操作系统
    @apiParam {string} [resolution] 分辨率
    @apiParam {int} [borrower_id] 持有人 ID
    @apiParam {int} [asset_id] 资产编号
    @apiParam {string} [cpu] cpu 型号
    @apiParam {int} [core] cpu 核心数
    @apiParam {int} [ram] 内存大小
    @apiParam {int} [rom] 存储大小
    @apiParam {string} [buy_date] 购买日期
    @apiParam {string} [region] 地区
    @apiParam {string} [device_source] 设备来源
    @apiParam {string} [device_belong] 设备所属
    @apiParam {string} [device_number] 设备序列号
    @apiParamExample {json} Request-Example:
    {
        "name": "iphone xs 4",
        "asset_id": "XHAH600004",
        "vendor": "apple",
        "os": "ios 12.3",
        "cpu": "a13",
        "core": 8,
        "ram": 4,
        "rom": 64,
        "resolution": "2015x1080",
        "buy_date": "2019-06-11",
        "region": "ShangHai",
        "status": "0",
        "borrow_id": 93,
        "device_source": "JingDong",
        "device_belong": "Innotech",
        "device_number": "RTYUJBG678HH761D"
    }
    @apiSuccessExample {json} Success-Response:
     HTTP/1.1 200 OK
     {
          "code": 0,
          "data": [],
          "message": "ok"
    }
    """
    (name, asset_id, vendor, device_number, os, cpu, core, ram, rom, resolution, buy_date, region, borrow_id,
     device_source, device_belong, creator_id) = parse_json_form(
        'phone_update')
    ret, msg = PhoneBusiness.update(pid, name, asset_id, vendor, device_number, os, cpu, core, ram, rom, resolution,
                                    buy_date, region, borrow_id, device_source, device_belong, creator_id)

    return json_detail_render(ret, [], msg)
Esempio n. 19
0
def phone_indexs_handler():
    """
    @api {post} /v1/asset/phone 新增 资产
    @apiName CreatePhone
    @apiGroup 项目
    @apiDescription 查询 资产设备列表
    @apiParam {string} name 资产名称
    @apiParam {string} vendor 制造商
    @apiParam {string} os 操作系统
    @apiParam {string} resolution 分辨率
    @apiParam {int} borrower_id 持有人 ID
    @apiParam {int} asset_id 资产编号
    @apiParam {string} cpu cpu 型号
    @apiParam {int} core cpu 核心数
    @apiParam {int} ram 内存大小
    @apiParam {int} rom 存储大小
    @apiParam {string} buy_date 购买日期
    @apiParam {string} region 地区
    @apiParam {string} device_source 设备来源
    @apiParam {string} device_belong 设备所属
    @apiParam {string} device_number 设备序列号
    @apiParamExample {json} Request-Example:
    {
        "name": "iphone xs 4",
        "asset_id": "XHAH600004",
        "vendor": "apple",
        "os": "ios 12.3",
        "cpu": "a13",
        "core": 8,
        "ram": 4,
        "rom": 64,
        "resolution": "2015x1080",
        "buy_date": "2019-06-11",
        "region": "ShangHai",
        "status": "0",
        "borrow_id": 93,
        "device_source": "JingDong",
        "device_belong": "Innotech",
        "device_number": "RTYUJBG678HH761D"
    }
    @apiSuccessExample {json} Success-Response:
     HTTP/1.1 200 OK
     {
          "code": 0,
          "data": [],
          "message": "ok"
    }
    """
    (name, asset_id, vendor, device_number, os, cpu, core, ram, rom, resolution, buy_date, region, borrow_id,
     device_source, device_belong, creator_id) = parse_json_form('phone_create')
    ret, msg = PhoneBusiness.create(name, asset_id, vendor, device_number, os, cpu, core, ram, rom, resolution,
                                    buy_date, region, borrow_id, device_source, device_belong, creator_id)

    return json_detail_render(ret, [], msg)
Esempio n. 20
0
def tester_task_case_work_handler():
    """
    @api {post} /v1/task/dashboard/tester 查询 测试人员每天执行的case个数
    @apiName GetTaskTester
    @apiGroup 项目
    @apiDescription 查询测试人员每天执行的case个数
    @apiParam {string} start_time 开始日期
    @apiParam {string} end_time 结束日期
    @apiParamExample {json} Request-Example:
    {
        "start_time": "2018-11-22",
        "end_time": "2018-11-22",
    }
    @apiSuccessExample {json} Success-Response:
     HTTP/1.1 200 OK
    {
      "code": 0,
      "data": [
        {
          "creator": [
            {
              "id": 1,
              "name": "wiggens"
            }
          ],
          "description": "description",
          "end_time": "2018-11-22",
          "executor": [
            {
              "id": 1,
              "name": "wiggens"
            }
          ],
          "id": 1,
          "name": "name",
          "priority": 1,
          "project_id": 1,
          "start_time": "2018-11-22",
          "status": 0,
          "tmethod": "1",
          "ttype": "1",
          "version": "1.1.1"
        }
      ],
      "limit": 999999,
      "message": "ok",
      "offset": 0
    }
    """
    start_date, end_date = parse_json_form('issuedashboard')
    data = TaskDashBoardBusiness.task_case_all_tester_dashboard(
        start_date, end_date)

    return json_detail_render(0, data)
Esempio n. 21
0
def update_tag():
    tag_id, project_id, description, tag_type = parse_json_form('updatetag')
    data = TagBusiness.judage_tag(project_id, tag_type)
    content_list = []

    for i in range(0, len(data)):
        content_list.append(data[i]['tag'])

    if tag_id in content_list:
        return json_detail_render(102, [], '增加的tag已经存在')
    ret = TagBusiness.create(tag_id, project_id, description, tag_type)
    return json_detail_render(ret)
Esempio n. 22
0
def task_case_board_query_handler():
    """
    @api {post} /v1/taskcase/board/ taskcase看板
    @apiName TaskCaseBoard
    @apiGroup 项目
    @apiDescription 根据user,project,version,task查询tack_case
    @apiParam {int} task_id 任务ID
    @apiParam {int} user 用户ID,根据taskcase表的executor字段筛选
    @apiParam {int} project_id 项目ID
    @apiParam {int} version 版本ID
    @apiParamExample {json} Request-Example:
    {
        "user": 1,
        "task_id": 1,
        "project_id": 1,
        "version": 1
    }
    @apiSuccessExample {json} Success-Response:
     HTTP/1.1 200 OK
    {
      "code": 0,
      "data": [
        {
          "creator": [
            {
              "id": 1,
              "name": "wiggens"
            }
          ],
          "description": "str",
          "end_time": "",
          "executor": [
            {
              "id": 2,
              "name": "max"
            }
          ],
          "id": 2,
          "name": "str",
          "priority": 6,
          "start_time": "",
          "status": 0,
          "tmethod": "str3",
          "ttype": "str"
        }
      ],
      "message": "ok"
    }
    """
    user, project_id, version, task_id = parse_json_form('task_case_board')
    ret = TaskCaseBusiness.query_borad(user, project_id, version, task_id)
    return json_detail_render(0, ret)
Esempio n. 23
0
def task_case_modify_handler(task_case_id):
    """
    @api {post} /v1/taskcase/{taskcaseid} 修改 单个任务用例
    @apiName ModifyTaskCase
    @apiGroup 项目
    @apiDescription 修改单个任务用例
    @apiParam {int} executor 用例执行者保存的为用户id
    @apiParam {int} exe_way 执行方式,0:批量执行1:单个执行
    @apiParam {string} case_number 编号
    @apiParam {int} module_id 用例模块
    @apiParam {string} case_type 用例类型
    @apiParam {string} title 标题
    @apiParam {string} case_describe 用例描述
    @apiParam {string} precondition 前置条件
    @apiParam {string} step_result 用例步骤及预期结果json->string格式存入
    @apiParam {int} is_auto 是否可转自动化
    @apiParam {int} status 用例任务状态
    @apiParam {string} comment 备注
    @apiParam {int} version 版本
    @apiParamExample {json} Request-Example:
    {
        "version": 1,
        "module_id": 1,
        "executor": 1,
        "exe_way": 1,
        "case_type": "str112",
        "title": "title",
        "case_describe": "str",
        "precondition": "str",
        "step_result": "str",
        "is_auto": 1,
        "status": 1,
        "comment": "str"
    }
    @apiSuccessExample {json} Success-Response:
     HTTP/1.1 200 OK
    {
        "code": 0,
        "data": [],
        "message": "ok"
    }
    """
    (module_id, project_id, version, executor, exe_way, ctype, title,
     description, precondition, step_result, is_auto, status, comment,
     priority) = parse_json_form('task_case_modify')
    ret = TaskCaseBusiness.modify(task_case_id, module_id, project_id, version,
                                  executor, exe_way, ctype, title, description,
                                  precondition, step_result, is_auto, status,
                                  comment, priority)
    return json_detail_render(ret)
Esempio n. 24
0
def credit_create_handler():
    """
    @api {post} /v1/credit 初始化 信用积分
    @apiName CreateCredit
    @apiGroup 项目
    @apiDescription 初始化 信用积分
    @apiParamExample {json} Request-Example:
    {
        "user_id": 4
    }
    @apiSuccessExample {json} Success-Response:
    HTTP/1.1 200 OK
    {
        "code": 0,
        "data": [],
        "message": 8,
    }
    """
    user_id = parse_json_form('credit_create')
    ret, msg = CreditBusiness.create(user_id=user_id, score=100, status=0)
    return json_detail_render(ret, [], msg)
Esempio n. 25
0
def issue_add_comment_handler(issue_id):
    """
    @api {post} /v1/issue/comment/{int:id} 切换 缺陷备注
    @apiName ModifyIssueComment
    @apiGroup 项目
    @apiDescription 切换 缺陷备注
    @apiParamExample {json} Request-Example:
    {
        "comment": 3
    }
    @apiSuccessExample {json} Success-Response:
     HTTP/1.1 200 OK
    {
        "code": 0,
        "data": [],
        "message": "ok"
    }
    """
    comment = parse_json_form('add_comment')
    ret = IssueBusiness.add_comment(issue_id, comment)

    return json_detail_render(ret)
Esempio n. 26
0
def task_case_add_comment_handler(task_case_id):
    """
    @api {post} /v1/taskcase/comment/{taskcaseid} 修改 taskcase的comment
    @apiName ModifyTaskCaseComment
    @apiGroup 项目
    @apiDescription 修改taskcase的comment
    @apiParam {string} comment 备注
    @apiParamExample {json} Request-Example:
    {
        "comment": "add_comment"
    }
    @apiSuccessExample {json} Success-Response:
     HTTP/1.1 200 OK
     {
        "code": 0,
        "data": [],
        "message": "ok"
    }
    """
    comment = parse_json_form('add_comment')
    ret = TaskCaseBusiness.add_comment(task_case_id, comment)
    return json_detail_render(ret)
Esempio n. 27
0
def issue_board_status_handler(issue_id):
    """
    @api {post} /v1/issue/handlestatus/{int:id} 切换 缺陷状态
    @apiName ModifyIssueStatus
    @apiGroup 项目
    @apiDescription 切换 缺陷状态
    @apiParamExample {json} Request-Example:
    {
        "handle_status": 1
    }
    @apiSuccessExample {json} Success-Response:
     HTTP/1.1 200 OK
    {
        "code": 0,
        "data": [],
        "message": "ok"
    }
    """
    handle_status = parse_json_form('handle_status')[0]
    ret = IssueBusiness.status_switch(issue_id, handle_status)

    return json_detail_render(ret)
Esempio n. 28
0
def issue_handler_switch_handler(issue_id):
    """
    @api {post} /v1/issue/handler/{int:id} 切换 缺陷处理人
    @apiName ModifyIssueSwitch
    @apiGroup 项目
    @apiDescription 切换 缺陷处理人
    @apiParamExample {json} Request-Example:
    {
        "handler": 11
    }
    @apiSuccessExample {json} Success-Response:
     HTTP/1.1 200 OK
    {
        "code": 0,
        "data": [],
        "message": "ok"
    }
    """
    handler = parse_json_form('handler_switch')
    ret = IssueBusiness.handler_switch(issue_id, handler)

    return json_detail_render(ret)
Esempio n. 29
0
def issue_level_switch_handler(issue_id):
    """
    @api {post} /v1/issue/level/{int:id} 切换 缺陷等级
    @apiName ModifyIssueLevel
    @apiGroup 项目
    @apiDescription 切换 缺陷等级
    @apiParamExample {json} Request-Example:
    {
        "level": 3
    }
    @apiSuccessExample {json} Success-Response:
     HTTP/1.1 200 OK
    {
        "code": 0,
        "data": [],
        "message": "ok"
    }
    """
    level = parse_json_form('level_switch')
    ret = IssueBusiness.level_switch(issue_id, level)

    return json_detail_render(ret)
Esempio n. 30
0
def issue_priority_switch_handler(issue_id):
    """
    @api {post} /v1/issue/priority/{int:id} 切换 缺陷优先级
    @apiName ModifyIssuePriority
    @apiGroup 项目
    @apiDescription 切换 缺陷优先级
    @apiParamExample {json} Request-Example:
    {
        "priority": 3
    }
    @apiSuccessExample {json} Success-Response:
     HTTP/1.1 200 OK
    {
        "code": 0,
        "data": [],
        "message": "ok"
    }
    """
    priority = parse_json_form('priority_switch')
    ret = IssueBusiness.priority_switch(issue_id, priority)

    return json_detail_render(ret)