From 79a97b4a02a095855518d495f2820a2dfcdfc721 Mon Sep 17 00:00:00 2001 From: Jasder <2053003901@@qq.com> Date: Fri, 29 May 2020 15:33:17 +0800 Subject: [PATCH 1/2] ADD get commit diff api --- app/controllers/application_controller.rb | 8 ++++-- app/controllers/repositories_controller.rb | 10 ++++--- app/helpers/application_helper.rb | 4 +++ app/helpers/repositories_helper.rb | 5 ++++ .../gitea/repository/commits/get_service.rb | 24 ++++++++++++----- .../repositories/_commit_author.json.jbuilder | 8 ++++++ app/views/repositories/commit.json.jbuilder | 26 +++++++++++++++++++ config/routes.rb | 6 ++--- 8 files changed, 75 insertions(+), 16 deletions(-) create mode 100644 app/views/repositories/_commit_author.json.jbuilder create mode 100644 app/views/repositories/commit.json.jbuilder diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index f16050151..dc56fb47a 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -382,8 +382,8 @@ class ApplicationController < ActionController::Base def current_user if Rails.env.development? - User.find(1) - else + User.current = User.find 36480 + else User.current end # User.current @@ -710,6 +710,10 @@ class ApplicationController < ActionController::Base render_not_found("未找到’#{params[:repo_identifier]}’相关的项目") unless @repo end + def find_repository_by_id + @repo = Repository.find params[:id] + end + def find_project project_id = params[:project_id] ? params[:project_id] : params[:id] project = Project.where(identifier: project_id) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 4447b1d78..f19eb7bf1 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -2,10 +2,11 @@ class RepositoriesController < ApplicationController include ApplicationHelper include OperateProjectAbilityAble before_action :require_login, only: %i[edit update create_file update_file delete_file sync_mirror] - before_action :find_project, except: :tags - before_action :authorizate!, except: [:sync_mirror, :tags] + before_action :find_project, except: [:tags, :commit] + before_action :authorizate!, except: [:sync_mirror, :tags, :commit] before_action :find_repository, only: %i[sync_mirror tags] before_action :authorizate_user_can_edit_project!, only: %i[sync_mirror] + before_action :find_repository_by_id, only: %i[commit] def show @branches_count = Gitea::Repository::BranchesService.new(@project.owner, @project.identifier).call&.size @@ -46,8 +47,9 @@ class RepositoriesController < ApplicationController @hash_commit = Gitea::Repository::Commits::ListService.new(@project.owner, @project.identifier, sha: params[:sha], page: params[:page]).call end - def single_commit - @commit = Gitea::Repository::Commits::GetService.new(@project.owner, @project.identifier, params[:sha]).call + def commit + @commit = Gitea::Repository::Commits::GetService.new(@repo.user.login, @repo.identifier, params[:sha], current_user.gitea_token).call + @custom_commit = Gitea::Repository::Commits::GetService.new(@repo.user.login, @repo.identifier, params[:sha], current_user.gitea_token, true).call end def tags diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 431f4eabb..2dc8c897d 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -432,4 +432,8 @@ module ApplicationHelper def render_unix_time(date) date.to_time.to_i end + + def find_user_by_login(login) + User.find_by_login login + end end diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb index 0923b0e76..440f833aa 100644 --- a/app/helpers/repositories_helper.rb +++ b/app/helpers/repositories_helper.rb @@ -8,4 +8,9 @@ module RepositoriesHelper default_type = %w(xlsx xls ppt pptx pdf zip 7z rar exe pdb obj idb) default_type.include?(str) end + + def render_commit_author(author_json) + return nil if author_json.blank? + find_user_by_login author_json['login'] + end end diff --git a/app/services/gitea/repository/commits/get_service.rb b/app/services/gitea/repository/commits/get_service.rb index fea12493d..019658d1f 100644 --- a/app/services/gitea/repository/commits/get_service.rb +++ b/app/services/gitea/repository/commits/get_service.rb @@ -1,12 +1,16 @@ # Get a single commit from a repository class Gitea::Repository::Commits::GetService < Gitea::ClientService - attr_reader :user, :repo_name, :sha + attr_reader :token, :owner, :repo, :sha, :custom # sha: the commit hash - def initialize(user, repo_name, sha) - @user = user - @sha = sha - @repo_name = repo_name + # ex: Gitea::Repository::Commits::GetService.new(@repo.user.login, repo.identifier, params[:sha], current_user.gitea_token) + # TODO custom参数用于判断调用哪个api + def initialize(owner, repo, sha, token, custom=false) + @token = token + @owner = owner + @sha = sha + @repo = repo + @custom = custom end def call @@ -16,11 +20,17 @@ class Gitea::Repository::Commits::GetService < Gitea::ClientService private def params - Hash.new.merge(token: user.gitea_token) + Hash.new.merge(token: token) end def url - "/repos/#{user.login}/#{repo_name}/git/commits/#{sha}".freeze + if custom + # TODO + # 平台自己编写的gitea接口,后续可能会通过提交pr的形式合并到gitea原有的接口上 + "/repos/#{owner}/#{repo}/commits/diff/#{sha}".freeze + else + "/repos/#{owner}/#{repo}/git/commits/#{sha}".freeze + end end def render_result(response) diff --git a/app/views/repositories/_commit_author.json.jbuilder b/app/views/repositories/_commit_author.json.jbuilder new file mode 100644 index 000000000..77d9b655c --- /dev/null +++ b/app/views/repositories/_commit_author.json.jbuilder @@ -0,0 +1,8 @@ +if user + json.id user.id + json.login user.login + json.name user.real_name + json.image_url url_to_avatar(user) +else + json.nil! +end diff --git a/app/views/repositories/commit.json.jbuilder b/app/views/repositories/commit.json.jbuilder new file mode 100644 index 000000000..7a547316f --- /dev/null +++ b/app/views/repositories/commit.json.jbuilder @@ -0,0 +1,26 @@ +json.key_format! camelize: :lower +json.additions @custom_commit['TotalAddition'] +json.deletions @custom_commit['TotalDeletion'] +json.sha @commit['sha'] +json.url request.url +json.commit do + @commit['commit'].delete('url') + json.author @commit['commit']['author'] + json.committer @commit['commit']['committer'] + json.tree do + @commit['commit']['tree']['sha'] + end +end +json.author do + json.partial! 'commit_author', user: render_commit_author(@commit['author']) +end +json.committer do + json.partial! 'commit_author', user: render_commit_author(@commit['committer']) +end + +json.parents @commit['parents'] do |parent| + json.sha parent['sha'] + json.url EduSetting.get('host_name') + commit_repository_path(@repo, parent['sha']) +end + +json.files @custom_commit['Files'] diff --git a/config/routes.rb b/config/routes.rb index f9f932cdd..9542c5ae4 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -44,7 +44,7 @@ Rails.application.routes.draw do resources :project_languages, only: [:index, :show] resources :ignores, only: [:index, :show] resources :licenses, only: [:index, :show] - + resources :watchers, only: [:index] do collection do post :follow @@ -83,7 +83,7 @@ Rails.application.routes.draw do post :update_status end end - + resources :praise_tread, only: [:index] do collection do post :like @@ -191,7 +191,6 @@ Rails.application.routes.draw do get :entries match :sub_entries, :via => [:get, :put] get :commits - get :single_commit post :files get :tags post :create_file @@ -199,6 +198,7 @@ Rails.application.routes.draw do delete :delete_file post :repo_hook post :sync_mirror + get 'commits/:sha', to: 'repositories#commit', as: 'commit' end end From 6a1b114219d818b60a7c838c9a0dcb04da1f420a Mon Sep 17 00:00:00 2001 From: Jasder <2053003901@@qq.com> Date: Fri, 29 May 2020 15:33:36 +0800 Subject: [PATCH 2/2] FIX update api ducoment --- README.md | 2842 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 2842 insertions(+) diff --git a/README.md b/README.md index 73e51d719..1a2074aeb 100644 --- a/README.md +++ b/README.md @@ -1570,6 +1570,2848 @@ http://localhost:3000/api/repositories/89/commits.json | jq ``` --- +## 获取某个提交记录(包含diff) +``` +GET /api/repositories/:id/commits/:sha +``` +*示例* +``` +curl -X GET \ +http://localhost:3000/api/repositories/5845/commits/b0c4a4a1487d53acebf2addc544b29938cad12df.json | jq +``` +*请求参数说明:* + +|参数名|必选|类型|说明| +|-|-|-|-| +|id |是|int |仓库repository的id | +|sha |否|string |git的ref或者是提交记录commit的sha标识 | + + +*返回参数说明:* + +|参数名|类型|说明| +|-|-|-| +|additions |int|该commit下所有文件增加的总行数| +|deletions |int|该commit下所有文件删除的总行数| +|sha |string|提交记录sha标识| +|url |string|该commit的api访问地址| +|commit |object| | +|-- author |object| commit的作者用户| +|---- login |string|提交commit的用户名称| +|---- email |string|提交commit的用户邮箱| +|---- date |string|提交commit的时间| +|-- committer |object|提交者用户信息| +|---- login |string|committer的用户名称| +|---- email |string|committer的用户邮箱| +|---- date |string|committer的时间| +|-- message |string|提交信息| +|-- tree |object| | +|---- sha |string| tree结构的sha标识| +|author |object|forge平台的提交用户信息| +|-- id |int|用户id| +|-- login |string|用户登录名| +|-- name |string|用户名称| +|-- image_url |string|用户头像| +|committer |object|forge平台的committer用户信息| +|-- id |int|用户id| +|-- login |string|用户登录名| +|-- name |string|用户名称| +|-- image_url |string|用户头像| +|parents |array|父节点| +|-- sha |int|commit父节点的sha标识| +|-- url |string|commit父节点api访问地址| +|author |object|提交用户| +|-- login |string|用户名称| +|-- image_url |string|用户头像| +|files |array|文件数组| +|-- Name |string|文件名称| +|-- OldName |string|旧文件名称| +|-- Addition |string|增加的行数| +|-- Deletion |string|删除的行数| +|-- Type |string|1: 表示是新增加的文件,2:表示是修改的文件, 3: 表示该文件已经被删除| +|-- IsCreated |boolean|是否为新添加的文件,true:是; false:否| +|-- IsDeleted |boolean|是否为删除的文件,true:是;false:否| +|-- IsRenamed |boolean|是否为重命名的文件,true:是,false:否| +|-- IsSubmodule |boolean|收否为子模块,true:是;false:否| +|-- Sections |array| | +|---- Name |string|文件名称| +|------ Lines |array|行数| +|-------- LeftIdx |int|分列视图时用,左侧开始行号, 0:表示没有行号| +|-------- RightIdx |int|分列视图时用,右侧开始行号| +|-------- Type |int|1: 表示未做修改的源代码,2: 表示增加的代码,3: 表示删除的代码,4: 统计说明,如:@@ -0,0 +1,11 @@| +|-------- Content |string|一行的文件内容| +|-------- Comments |string|评论信息| +|-------- SectionInfo |string|用户头像| +|---------- Path |string|文件路径| +|---------- LastLeftIdx |string| | +|---------- LastRightIdx |string| | +|---------- LeftIdx |string| | +|---------- RightIdx |string| | +|---------- LeftHunkSize |string| | +|---------- RightHunkSize |string| | + + +返回值 +``` +{ + "additions": 243, + "deletions": 32, + "sha": "c6c17ad47d6dbe4369d559847197b37b4090a46e", + "url": "http://localhost:3000/api/repositories/5845/commits/c6c17ad47d6dbe4369d559847197b37b4090a46e.json", + "commit": { + "author": { + "name": "GitHub", + "email": "noreply@github.com", + "date": "2020-05-20T20:15:27+08:00" + }, + "committer": { + "name": "GitHub", + "email": "noreply@github.com", + "date": "2020-05-20T20:15:27+08:00" + } + }, + "author": null, + "committer": null, + "parents": [ + { + "sha": "c8b8cfd85e375ad376833d04b9ca499bf9da355b", + "url": "http://localhost:3003//api/repositories/intelligent-test-platform/commits/c8b8cfd85e375ad376833d04b9ca499bf9da355b" + }, + { + "sha": "b0c4a4a1487d53acebf2addc544b29938cad12df", + "url": "http://localhost:3003//api/repositories/intelligent-test-platform/commits/b0c4a4a1487d53acebf2addc544b29938cad12df" + } + ], + "files": [ + { + "Name": "Dockerfile", + "OldName": "Dockerfile", + "Index": 1, + "Addition": 11, + "Deletion": 0, + "Type": 1, + "IsCreated": true, + "IsDeleted": false, + "IsBin": false, + "IsLFSFile": false, + "IsRenamed": false, + "IsSubmodule": false, + "Sections": [ + { + "Name": "", + "Lines": [ + { + "LeftIdx": 0, + "RightIdx": 0, + "Type": 4, + "Content": "@@ -0,0 +1,11 @@", + "Comments": null, + "SectionInfo": { + "Path": "Dockerfile", + "LastLeftIdx": 0, + "LastRightIdx": 0, + "LeftIdx": 0, + "RightIdx": 1, + "LeftHunkSize": 0, + "RightHunkSize": 11 + } + }, + { + "LeftIdx": 0, + "RightIdx": 1, + "Type": 2, + "Content": "+FROM adoptopenjdk/maven-openjdk8:latest", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 2, + "Type": 2, + "Content": "+", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 3, + "Type": 2, + "Content": "+ADD ./target/markov-demo-0.0.1-SNAPSHOT.jar /usr/local/markov-demo-0.0.1-SNAPSHOT.jar", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 4, + "Type": 2, + "Content": "+", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 5, + "Type": 2, + "Content": "+# Add docker-compose-wait tool -------------------", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 6, + "Type": 2, + "Content": "+ENV WAIT_VERSION 2.7.2", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 7, + "Type": 2, + "Content": "+ADD https://github.com/ufoscout/docker-compose-wait/releases/download/$WAIT_VERSION/wait /wait", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 8, + "Type": 2, + "Content": "+RUN chmod +x /wait", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 9, + "Type": 2, + "Content": "+", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 10, + "Type": 2, + "Content": "+EXPOSE 8080", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 11, + "Type": 2, + "Content": "+ENTRYPOINT [ \"java\", \"-jar\", \"/usr/local/markov-demo-0.0.1-SNAPSHOT.jar\" ]", + "Comments": null, + "SectionInfo": null + } + ] + } + ], + "IsIncomplete": false + }, + { + "Name": "docker-compose.yml", + "OldName": "docker-compose.yml", + "Index": 2, + "Addition": 42, + "Deletion": 0, + "Type": 1, + "IsCreated": true, + "IsDeleted": false, + "IsBin": false, + "IsLFSFile": false, + "IsRenamed": false, + "IsSubmodule": false, + "Sections": [ + { + "Name": "", + "Lines": [ + { + "LeftIdx": 0, + "RightIdx": 0, + "Type": 4, + "Content": "@@ -0,0 +1,42 @@", + "Comments": null, + "SectionInfo": { + "Path": "docker-compose.yml", + "LastLeftIdx": 0, + "LastRightIdx": 0, + "LeftIdx": 0, + "RightIdx": 1, + "LeftHunkSize": 0, + "RightHunkSize": 42 + } + }, + { + "LeftIdx": 0, + "RightIdx": 1, + "Type": 2, + "Content": "+version: '3.6'", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 2, + "Type": 2, + "Content": "+", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 3, + "Type": 2, + "Content": "+services:", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 4, + "Type": 2, + "Content": "+ web:", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 5, + "Type": 2, + "Content": "+ build: .", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 6, + "Type": 2, + "Content": "+ command: sh -c \"/wait && java -jar /usr/local/markov-demo-0.0.1-SNAPSHOT.jar\"", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 7, + "Type": 2, + "Content": "+ environment:", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 8, + "Type": 2, + "Content": "+ - WAIT_HOSTS=container-mysql:3306", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 9, + "Type": 2, + "Content": "+ - WAIT_HOSTS_TIMEOUT=300", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 10, + "Type": 2, + "Content": "+ - WAIT_SLEEP_INTERVAL=30", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 11, + "Type": 2, + "Content": "+ - WAIT_HOST_CONNECT_TIMEOUT=30", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 12, + "Type": 2, + "Content": "+ - spring.datasource.url=jdbc:mysql://container-mysql:3306/markov_demo?useUnicode=true&characterEncoding=utf-8", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 13, + "Type": 2, + "Content": "+ depends_on:", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 14, + "Type": 2, + "Content": "+ - container-mysql", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 15, + "Type": 2, + "Content": "+ ports:", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 16, + "Type": 2, + "Content": "+ - '8080:8080'", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 17, + "Type": 2, + "Content": "+ expose:", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 18, + "Type": 2, + "Content": "+ - '8080'", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 19, + "Type": 2, + "Content": "+", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 20, + "Type": 2, + "Content": "+ container-mysql:", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 21, + "Type": 2, + "Content": "+ image: mysql:5.7", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 22, + "Type": 2, + "Content": "+ restart: always", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 23, + "Type": 2, + "Content": "+ environment:", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 24, + "Type": 2, + "Content": "+ MYSQL_DATABASE: 'markov_demo'", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 25, + "Type": 2, + "Content": "+ # So you don't have to use root, but you can if you like", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 26, + "Type": 2, + "Content": "+ MYSQL_USER: 'root'", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 27, + "Type": 2, + "Content": "+ # You can use whatever password you like", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 28, + "Type": 2, + "Content": "+ MYSQL_PASSWORD: '123'", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 29, + "Type": 2, + "Content": "+ # Password for root access", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 30, + "Type": 2, + "Content": "+ MYSQL_ROOT_PASSWORD: '123'", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 31, + "Type": 2, + "Content": "+ ports:", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 32, + "Type": 2, + "Content": "+ # : < MySQL Port running inside container>", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 33, + "Type": 2, + "Content": "+ - '3306:3306'", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 34, + "Type": 2, + "Content": "+ expose:", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 35, + "Type": 2, + "Content": "+ # Opens port 3306 on the container", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 36, + "Type": 2, + "Content": "+ - '3306'", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 37, + "Type": 2, + "Content": "+ # Where our data will be persisted", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 38, + "Type": 2, + "Content": "+ volumes:", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 39, + "Type": 2, + "Content": "+ - my-db:/tmp/mysql", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 40, + "Type": 2, + "Content": "+# Names our volume", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 41, + "Type": 2, + "Content": "+volumes:", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 42, + "Type": 2, + "Content": "+ my-db: {}", + "Comments": null, + "SectionInfo": null + } + ] + } + ], + "IsIncomplete": false + }, + { + "Name": "pom.xml", + "OldName": "pom.xml", + "Index": 3, + "Addition": 5, + "Deletion": 0, + "Type": 2, + "IsCreated": false, + "IsDeleted": false, + "IsBin": false, + "IsLFSFile": false, + "IsRenamed": false, + "IsSubmodule": false, + "Sections": [ + { + "Name": "", + "Lines": [ + { + "LeftIdx": 0, + "RightIdx": 0, + "Type": 4, + "Content": "@@ -26,6 +26,11 @@", + "Comments": null, + "SectionInfo": { + "Path": "pom.xml", + "LastLeftIdx": 0, + "LastRightIdx": 0, + "LeftIdx": 26, + "RightIdx": 26, + "LeftHunkSize": 6, + "RightHunkSize": 11 + } + }, + { + "LeftIdx": 26, + "RightIdx": 26, + "Type": 1, + "Content": " \t\t\tmybatis-spring-boot-starter", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 27, + "RightIdx": 27, + "Type": 1, + "Content": " \t\t\t2.1.2", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 28, + "RightIdx": 28, + "Type": 1, + "Content": " \t\t", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 29, + "Type": 2, + "Content": "+\t\t", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 30, + "Type": 2, + "Content": "+\t\t\torg.flywaydb", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 31, + "Type": 2, + "Content": "+\t\t\tflyway-core", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 32, + "Type": 2, + "Content": "+\t\t\t6.4.2", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 33, + "Type": 2, + "Content": "+\t\t", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 29, + "RightIdx": 34, + "Type": 1, + "Content": " ", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 30, + "RightIdx": 35, + "Type": 1, + "Content": " \t\t", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 31, + "RightIdx": 36, + "Type": 1, + "Content": " \t\t\tmysql", + "Comments": null, + "SectionInfo": null + } + ] + }, + { + "Name": "", + "Lines": [ + { + "LeftIdx": 0, + "RightIdx": 0, + "Type": 4, + "Content": " ", + "Comments": null, + "SectionInfo": { + "Path": "pom.xml", + "LastLeftIdx": 31, + "LastRightIdx": 36, + "LeftIdx": 103, + "RightIdx": 108, + "LeftHunkSize": 0, + "RightHunkSize": 0 + } + } + ] + } + ], + "IsIncomplete": false + }, + { + "Name": "src/main/resources/application.properties", + "OldName": "src/main/resources/application.properties", + "Index": 4, + "Addition": 5, + "Deletion": 4, + "Type": 2, + "IsCreated": false, + "IsDeleted": false, + "IsBin": false, + "IsLFSFile": false, + "IsRenamed": false, + "IsSubmodule": false, + "Sections": [ + { + "Name": "", + "Lines": [ + { + "LeftIdx": 0, + "RightIdx": 0, + "Type": 4, + "Content": "@@ -1,10 +1,11 @@", + "Comments": null, + "SectionInfo": { + "Path": "src/main/resources/application.properties", + "LastLeftIdx": 0, + "LastRightIdx": 0, + "LeftIdx": 1, + "RightIdx": 1, + "LeftHunkSize": 10, + "RightHunkSize": 11 + } + }, + { + "LeftIdx": 1, + "RightIdx": 0, + "Type": 3, + "Content": "-", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 1, + "Type": 2, + "Content": "+# Database configuration", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 2, + "RightIdx": 2, + "Type": 1, + "Content": " spring.datasource.driver-class-name = com.mysql.cj.jdbc.Driver", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 3, + "RightIdx": 3, + "Type": 1, + "Content": " spring.datasource.url = jdbc:mysql://127.0.0.1:3306/markov_demo?useUnicode=true&characterEncoding=utf-8", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 4, + "RightIdx": 4, + "Type": 1, + "Content": " spring.datasource.username = root", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 5, + "RightIdx": 5, + "Type": 1, + "Content": " spring.datasource.password = 123", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 6, + "RightIdx": 6, + "Type": 1, + "Content": " ", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 7, + "RightIdx": 0, + "Type": 3, + "Content": "-", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 8, + "RightIdx": 0, + "Type": 3, + "Content": "-", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 9, + "RightIdx": 0, + "Type": 3, + "Content": "-mybatis.mapper-locations= classpath:mapping/*Mapper.xml", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 7, + "Type": 2, + "Content": "+mybatis.mapper-locations=classpath:mapping/*Mapper.xml", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 10, + "RightIdx": 8, + "Type": 1, + "Content": " mybatis.type-aliases-package=com.alibaba.markovdemo.entity", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 9, + "Type": 2, + "Content": "+", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 10, + "Type": 2, + "Content": "+spring.flyway.default-schema=markov_demo", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 11, + "Type": 2, + "Content": "+spring.flyway.locations=classpath:db/migration", + "Comments": null, + "SectionInfo": null + } + ] + } + ], + "IsIncomplete": false + }, + { + "Name": "src/main/resources/db/migration/V1__init_ddl.sql", + "OldName": "src/main/resources/db/migration/V1__init_ddl.sql", + "Index": 5, + "Addition": 179, + "Deletion": 0, + "Type": 1, + "IsCreated": true, + "IsDeleted": false, + "IsBin": false, + "IsLFSFile": false, + "IsRenamed": false, + "IsSubmodule": false, + "Sections": [ + { + "Name": "", + "Lines": [ + { + "LeftIdx": 0, + "RightIdx": 0, + "Type": 4, + "Content": "@@ -0,0 +1,179 @@", + "Comments": null, + "SectionInfo": { + "Path": "src/main/resources/db/migration/V1__init_ddl.sql", + "LastLeftIdx": 0, + "LastRightIdx": 0, + "LeftIdx": 0, + "RightIdx": 1, + "LeftHunkSize": 0, + "RightHunkSize": 179 + } + }, + { + "LeftIdx": 0, + "RightIdx": 1, + "Type": 2, + "Content": "+create database if not exists markov_demo;", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 2, + "Type": 2, + "Content": "+", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 3, + "Type": 2, + "Content": "+use markov_demo;", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 4, + "Type": 2, + "Content": "+", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 5, + "Type": 2, + "Content": "+CREATE TABLE `got_testcase` (", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 6, + "Type": 2, + "Content": "+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 7, + "Type": 2, + "Content": "+ `scenario_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'scenario id',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 8, + "Type": 2, + "Content": "+ `gmt_create` datetime DEFAULT NULL COMMENT '创建时间',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 9, + "Type": 2, + "Content": "+ `gmt_modified` datetime DEFAULT NULL COMMENT '修改时间',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 10, + "Type": 2, + "Content": "+ `name` longtext COMMENT 'name',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 11, + "Type": 2, + "Content": "+ `description` longtext COMMENT 'description',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 12, + "Type": 2, + "Content": "+ `long_description` longtext COMMENT '详细描述',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 13, + "Type": 2, + "Content": "+ `content` longtext COMMENT '存储case的阶段数据,比如数据准备阶段,数据执行阶段',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 14, + "Type": 2, + "Content": "+ `case_group` varchar(100) DEFAULT NULL COMMENT 'case分组',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 15, + "Type": 2, + "Content": "+ `is_deleted` int(11) DEFAULT '0' COMMENT '用例是否被删除。0-没有删除;1-已删除,此类case不会展示到页面上',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 16, + "Type": 2, + "Content": "+ `case_template` text COMMENT '用例模板 java/c++',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 17, + "Type": 2, + "Content": "+ `features` text COMMENT '业务特征',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 18, + "Type": 2, + "Content": "+ `is_visible` int DEFAULT '0' COMMENT '是否可见用例',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 19, + "Type": 2, + "Content": "+ PRIMARY KEY (`id`)", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 20, + "Type": 2, + "Content": "+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='testcase';", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 21, + "Type": 2, + "Content": "+", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 22, + "Type": 2, + "Content": "+CREATE TABLE `got_pipeline` (", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 23, + "Type": 2, + "Content": "+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键(id)',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 24, + "Type": 2, + "Content": "+ `pipeline` longtext COMMENT 'pipeline的json配置',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 25, + "Type": 2, + "Content": "+ `extend` text COMMENT '扩展字段',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 26, + "Type": 2, + "Content": "+ `tag` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '流程定义/自定义\\n',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 27, + "Type": 2, + "Content": "+ `scenario_id` bigint(20) unsigned DEFAULT NULL COMMENT '场景id',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 28, + "Type": 2, + "Content": "+ PRIMARY KEY (`id`)", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 29, + "Type": 2, + "Content": "+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='存储流程执行的pipeline配置文件';", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 30, + "Type": 2, + "Content": "+", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 31, + "Type": 2, + "Content": "+CREATE TABLE `got_scenario` (", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 32, + "Type": 2, + "Content": "+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 33, + "Type": 2, + "Content": "+ `name` varchar(100) DEFAULT NULL COMMENT 'name',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 34, + "Type": 2, + "Content": "+ PRIMARY KEY (`id`)", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 35, + "Type": 2, + "Content": "+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='测试场景表';", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 36, + "Type": 2, + "Content": "+", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 37, + "Type": 2, + "Content": "+CREATE TABLE `got_envs` (", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 38, + "Type": 2, + "Content": "+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 39, + "Type": 2, + "Content": "+ `gmt_create` datetime DEFAULT NULL COMMENT '创建时间',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 40, + "Type": 2, + "Content": "+ `gmt_modified` datetime DEFAULT NULL COMMENT '修改时间',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 41, + "Type": 2, + "Content": "+ `host_ip` varchar(20) DEFAULT NULL COMMENT 'host_ip',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 42, + "Type": 2, + "Content": "+ `status` varchar(20) DEFAULT NULL COMMENT '状态',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 43, + "Type": 2, + "Content": "+ `name` varchar(200) DEFAULT NULL COMMENT '环境名称',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 44, + "Type": 2, + "Content": "+ `env_detail` text COMMENT '环境详情',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 45, + "Type": 2, + "Content": "+ `scenario_id` bigint(20) unsigned DEFAULT NULL COMMENT '场景id',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 46, + "Type": 2, + "Content": "+ PRIMARY KEY (`id`)", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 47, + "Type": 2, + "Content": "+) ENGINE=InnoDB AUTO_INCREMENT=6928 DEFAULT CHARSET=utf8 COMMENT='环境列表';", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 48, + "Type": 2, + "Content": "+", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 49, + "Type": 2, + "Content": "+CREATE TABLE `pipeline_ui` (", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 50, + "Type": 2, + "Content": "+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 51, + "Type": 2, + "Content": "+ `scenario_id` bigint(20) unsigned DEFAULT NULL COMMENT '场景id',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 52, + "Type": 2, + "Content": "+ `content` text COMMENT 'pipeline_ui的jsonString\\n',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 53, + "Type": 2, + "Content": "+ PRIMARY KEY (`id`)", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 54, + "Type": 2, + "Content": "+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='pipeline_ui表';", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 55, + "Type": 2, + "Content": "+", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 56, + "Type": 2, + "Content": "+CREATE TABLE `got_datasource` (", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 57, + "Type": 2, + "Content": "+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键/场景id',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 58, + "Type": 2, + "Content": "+ `content` longtext COMMENT '数据源内容',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 59, + "Type": 2, + "Content": "+ `scenario_id` bigint(20) unsigned DEFAULT NULL COMMENT '场景id',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 60, + "Type": 2, + "Content": "+ PRIMARY KEY (`id`),", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 61, + "Type": 2, + "Content": "+ KEY `idx_scenario_id` (`scenario_id`)", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 62, + "Type": 2, + "Content": "+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='测试数据源表';", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 63, + "Type": 2, + "Content": "+", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 64, + "Type": 2, + "Content": "+CREATE TABLE `got_menu` (", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 65, + "Type": 2, + "Content": "+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 66, + "Type": 2, + "Content": "+ `content` text COMMENT 'menu的jsonString\\n',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 67, + "Type": 2, + "Content": "+ PRIMARY KEY (`id`)", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 68, + "Type": 2, + "Content": "+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='menu表';", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 69, + "Type": 2, + "Content": "+", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 70, + "Type": 2, + "Content": "+", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 71, + "Type": 2, + "Content": "+insert into got_menu values(0, \"{ \\\"buinfo\\\": { \\\"buid\\\": 1, \\\"appSecneMap\\\": { \\\"1\\\": \\\"1\\\" }, \\\"menu\\\": [{ \\\"businessId\\\": 1, \\\"businessName\\\": \\\"markov-demo\\\", \\\"appMenuList\\\": [{ \\\"appName\\\": \\\"测试模块\\\", \\\"appId\\\": 1, \\\"scenarioMenuList\\\": [{ \\\"isMember\\\": true, \\\"scenarioId\\\": 1, \\\"scenarioName\\\": \\\"场景1\\\" },{ \\\"isMember\\\": true, \\\"scenarioId\\\": 2, \\\"scenarioName\\\": \\\"场景2\\\" }] }] }, ], \\\"buName\\\": \\\"markov-demo\\\" }}\");", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 72, + "Type": 2, + "Content": "+", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 73, + "Type": 2, + "Content": "+", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 74, + "Type": 2, + "Content": "+CREATE TABLE `got_reports` (", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 75, + "Type": 2, + "Content": "+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 76, + "Type": 2, + "Content": "+ `gmt_create` datetime NOT NULL COMMENT '创建时间',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 77, + "Type": 2, + "Content": "+ `gmt_modified` datetime NOT NULL COMMENT '修改时间',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 78, + "Type": 2, + "Content": "+ `user` text COMMENT '执行用户',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 79, + "Type": 2, + "Content": "+ `report_name` text COMMENT '报告名称',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 80, + "Type": 2, + "Content": "+ `status` varchar(100) DEFAULT NULL COMMENT '执行状态',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 81, + "Type": 2, + "Content": "+ `message` text COMMENT '信息',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 82, + "Type": 2, + "Content": "+ `app_id` bigint(20) unsigned DEFAULT NULL COMMENT 'appid',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 83, + "Type": 2, + "Content": "+ `scenario_id` bigint(20) unsigned DEFAULT NULL COMMENT '场景id',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 84, + "Type": 2, + "Content": "+ `run_type` text COMMENT '执行方式',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 85, + "Type": 2, + "Content": "+ `exec_id` text COMMENT '批次id',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 86, + "Type": 2, + "Content": "+ `analysis` text COMMENT '分析报告',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 87, + "Type": 2, + "Content": "+ `task_id` text COMMENT 'zk任务id',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 88, + "Type": 2, + "Content": "+ `zk_info` longtext COMMENT 'zk信息',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 89, + "Type": 2, + "Content": "+ `accuracy_report_id` bigint(20) unsigned DEFAULT NULL COMMENT '精准测试报告id',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 90, + "Type": 2, + "Content": "+ `case_num` int(10) unsigned DEFAULT '0' COMMENT '回归用例数',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 91, + "Type": 2, + "Content": "+ `image_name` text COMMENT '回归的镜像版本',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 92, + "Type": 2, + "Content": "+ `branch_name` text COMMENT '执行用例的分支',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 93, + "Type": 2, + "Content": "+ `git_branch` text COMMENT '测试源码的分支',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 94, + "Type": 2, + "Content": "+ `git_commit` text COMMENT '测试源码的commit版本',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 95, + "Type": 2, + "Content": "+ `cc_cov_rate` text COMMENT '增量代码覆盖率',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 96, + "Type": 2, + "Content": "+ `is_visible` int DEFAULT '0' COMMENT '是否可见报告',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 97, + "Type": 2, + "Content": "+ PRIMARY KEY (`id`),", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 98, + "Type": 2, + "Content": "+ KEY `idx_scenarioid` (`scenario_id`),", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 99, + "Type": 2, + "Content": "+ KEY `idx_appid` (`app_id`)", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 100, + "Type": 2, + "Content": "+) ENGINE=InnoDB AUTO_INCREMENT=7858 DEFAULT CHARSET=utf8mb4 COMMENT='回归测试报告表';", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 101, + "Type": 2, + "Content": "+", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 102, + "Type": 2, + "Content": "+", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 103, + "Type": 2, + "Content": "+CREATE TABLE `got_testcase_snaps` (", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 104, + "Type": 2, + "Content": "+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 105, + "Type": 2, + "Content": "+ `gmt_create` datetime NOT NULL COMMENT '创建时间',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 106, + "Type": 2, + "Content": "+ `gmt_modified` datetime NOT NULL COMMENT '修改时间',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 107, + "Type": 2, + "Content": "+ `scenario_id` bigint(20) unsigned DEFAULT NULL COMMENT '场景id',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 108, + "Type": 2, + "Content": "+ `app_id` bigint(20) unsigned DEFAULT NULL COMMENT 'appid',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 109, + "Type": 2, + "Content": "+ `name` varchar(100) DEFAULT NULL COMMENT '用例名',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 110, + "Type": 2, + "Content": "+ `description` text COMMENT '描述',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 111, + "Type": 2, + "Content": "+ `long_description` longtext COMMENT '详情',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 112, + "Type": 2, + "Content": "+ `content` longtext COMMENT '输入,输出,期望,数据准备',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 113, + "Type": 2, + "Content": "+ `status` varchar(100) DEFAULT NULL COMMENT '用例执行状态',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 114, + "Type": 2, + "Content": "+ `testreport_id` bigint(20) unsigned NOT NULL COMMENT '归属的报告id',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 115, + "Type": 2, + "Content": "+ `testcase_id` bigint(20) unsigned NOT NULL COMMENT '归属的用例id',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 116, + "Type": 2, + "Content": "+ `case_group` varchar(100) DEFAULT NULL COMMENT '测试用例分组',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 117, + "Type": 2, + "Content": "+ `tag` varchar(100) DEFAULT NULL COMMENT 'case标签,可有有多个值',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 118, + "Type": 2, + "Content": "+ `version` varchar(100) DEFAULT NULL COMMENT 'case版本号',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 119, + "Type": 2, + "Content": "+ `run_time` bigint(20) unsigned DEFAULT NULL COMMENT '执行时间',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 120, + "Type": 2, + "Content": "+ `run_time_str` text COMMENT '执行时间标准化',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 121, + "Type": 2, + "Content": "+ `retry_num` bigint(20) unsigned DEFAULT NULL COMMENT '重试次数',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 122, + "Type": 2, + "Content": "+ `constancy` text COMMENT '稳定性',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 123, + "Type": 2, + "Content": "+ `env_name` text COMMENT '环境名',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 124, + "Type": 2, + "Content": "+ `conflict_desc` text COMMENT '冲突用例描述',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 125, + "Type": 2, + "Content": "+ `is_parallel` tinyint(1) DEFAULT NULL COMMENT '是否串行',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 126, + "Type": 2, + "Content": "+ `trouble_shoot_box` longtext COMMENT '智能归因',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 127, + "Type": 2, + "Content": "+ PRIMARY KEY (`id`),", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 128, + "Type": 2, + "Content": "+ KEY `idx_caseid` (`testcase_id`),", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 129, + "Type": 2, + "Content": "+ KEY `idx_reportid` (`testreport_id`)", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 130, + "Type": 2, + "Content": "+) ENGINE=InnoDB AUTO_INCREMENT=303953 DEFAULT CHARSET=utf8mb4 COMMENT='测试报告用例集快照'", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 131, + "Type": 2, + "Content": "+;", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 132, + "Type": 2, + "Content": "+CREATE TABLE `got_features_pool` (", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 133, + "Type": 2, + "Content": "+ `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 134, + "Type": 2, + "Content": "+ `gmt_create` datetime NOT NULL COMMENT '创建时间',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 135, + "Type": 2, + "Content": "+ `gmt_modified` datetime NOT NULL COMMENT '修改时间',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 136, + "Type": 2, + "Content": "+ `scenario_id` bigint unsigned NULL COMMENT 'scenario_id',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 137, + "Type": 2, + "Content": "+ `app_id` bigint unsigned NULL COMMENT 'app_id',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 138, + "Type": 2, + "Content": "+ `features` text NULL COMMENT '特征集',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 139, + "Type": 2, + "Content": "+ PRIMARY KEY (`id`)", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 140, + "Type": 2, + "Content": "+) DEFAULT CHARACTER SET=utf8mb4 COMMENT='特征池';", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 141, + "Type": 2, + "Content": "+", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 142, + "Type": 2, + "Content": "+", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 143, + "Type": 2, + "Content": "+CREATE TABLE `got_case_generate_task` (", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 144, + "Type": 2, + "Content": "+ `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 145, + "Type": 2, + "Content": "+ `gmt_create` datetime NOT NULL COMMENT '创建时间',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 146, + "Type": 2, + "Content": "+ `gmt_modified` datetime NOT NULL COMMENT '修改时间',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 147, + "Type": 2, + "Content": "+ `creator` text COMMENT '任务创建者',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 148, + "Type": 2, + "Content": "+ `seed_case_list` text COMMENT '种子用例id列表,以”,“分隔',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 149, + "Type": 2, + "Content": "+ `scenario_id` bigint unsigned DEFAULT NULL COMMENT '场景id',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 150, + "Type": 2, + "Content": "+ `env_info` text COMMENT '测试环境信息',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 151, + "Type": 2, + "Content": "+ `feature_conf` longtext COMMENT '任务相关配置,jsonObject',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 152, + "Type": 2, + "Content": "+ `task_name` text COMMENT '任务名',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 153, + "Type": 2, + "Content": "+ `task_snap` longtext COMMENT '任务生成信息',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 154, + "Type": 2, + "Content": "+ `task_result` longtext COMMENT '最终生成用例',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 155, + "Type": 2, + "Content": "+ `task_status` text COMMENT 'crate 、executing、success or fail ',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 156, + "Type": 2, + "Content": "+ `gene_bank_snap` longtext COMMENT 'json格式gene bank',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 157, + "Type": 2, + "Content": "+ PRIMARY KEY (`id`)", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 158, + "Type": 2, + "Content": "+) ENGINE=InnoDB AUTO_INCREMENT=98 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='用例智能生成任务记录表';", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 159, + "Type": 2, + "Content": "+", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 160, + "Type": 2, + "Content": "+CREATE TABLE `got_case_accuracy` (", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 161, + "Type": 2, + "Content": "+ `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 162, + "Type": 2, + "Content": "+ `gmt_create` datetime NOT NULL COMMENT '创建时间',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 163, + "Type": 2, + "Content": "+ `gmt_modified` datetime NOT NULL COMMENT '修改时间',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 164, + "Type": 2, + "Content": "+ `case_id` bigint unsigned DEFAULT NULL COMMENT 'case id',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 165, + "Type": 2, + "Content": "+ `exe_id` bigint unsigned DEFAULT NULL COMMENT '回归执行id',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 166, + "Type": 2, + "Content": "+ `cov_line` longtext COMMENT 'case覆盖的代码行,json格式',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 167, + "Type": 2, + "Content": "+ `collect_type` text COMMENT 'single : 单case收集;total:任务整体收集',", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 168, + "Type": 2, + "Content": "+ PRIMARY KEY (`id`),", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 169, + "Type": 2, + "Content": "+ KEY `idx_caseid` (`case_id`),", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 170, + "Type": 2, + "Content": "+ KEY `idx_exe_id` (`exe_id`)", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 171, + "Type": 2, + "Content": "+) ENGINE=InnoDB AUTO_INCREMENT=16001 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='case精准数据覆盖数据记录表';", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 172, + "Type": 2, + "Content": "+", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 173, + "Type": 2, + "Content": "+", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 174, + "Type": 2, + "Content": "+INSERT INTO `got_testcase` (`gmt_create`,`gmt_modified`,`scenario_id`,`name`,`description`,`long_description`,`content`,`case_group`,`is_deleted`,`case_template`,`is_visible`) VALUES ('2020-04-28 19:12:55','2020-04-28 19:12:55',1,'case名','用例智能生成-种子用例','种子用例','{\\\"prepareData\\\":[{\\\"Tair\\\":[{\\\"dsName\\\":\\\"table.markovtair.test\\\",\\\"data\\\":[{\\\"key\\\":\\\"testkey\\\",\\\"value\\\":\\\"testvalue\\\",\\\"property\\\":\\\"\\\"}]}]}],\\\"caseRunStage\\\":[{\\\"group_name\\\":\\\"ERPC校验(第一组)\\\",\\\"data\\\":[{\\\"input\\\":\\\"{\\\\n \\\\\\\"ad_id\\\\\\\": \\\\\\\"222\\\\\\\",\\\\n \\\\\\\"search_key\\\\\\\": \\\\\\\"key1\\\\\\\",\\\\n \\\\\\\"match_level\\\\\\\": 2,\\\\n \\\\\\\"user_type\\\\\\\": \\\\\\\"type1\\\\\\\",\\\\n \\\\\\\"top_num\\\\\\\": 10,\\\\n \\\\\\\"use_feature\\\\\\\": false,\\\\n \\\\\\\"other1\\\\\\\": \\\\\\\"1\\\\\\\",\\\\n \\\\\\\"other2\\\\\\\": \\\\\\\"0\\\\\\\"\\\\n}\\\",\\\"expect\\\":\\\"{\\\\n \\\\\\\"result\\\\\\\": \\\\\\\"1\\\\\\\" \\\\n}\\\",\\\"actual\\\":\\\"null\\\"}]}]}','test',0,'c++',0);", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 175, + "Type": 2, + "Content": "+INSERT INTO `got_testcase` (`gmt_create`,`gmt_modified`,`scenario_id`,`name`,`description`,`long_description`,`content`,`case_group`,`is_deleted`,`case_template`,`is_visible`) VALUES ('2020-04-28 19:12:55','2020-04-28 19:12:55',1,'case名','用例智能推荐用例1','普通用例','{\\\"prepareData\\\":[{\\\"Tair\\\":[{\\\"dsName\\\":\\\"table.markovtair.test\\\",\\\"data\\\":[{\\\"key\\\":\\\"testkey\\\",\\\"value\\\":\\\"testvalue\\\",\\\"property\\\":\\\"\\\"}]}],\\\"Imock\\\":[{\\\"dsName\\\":\\\"erpc_merger_inner\\\",\\\"data\\\":[{\\\"key\\\":\\\"key1\\\",\\\"value\\\":\\\"value1\\\",\\\"property\\\":\\\"\\\"},{\\\"key\\\":\\\"key2\\\",\\\"value\\\":\\\"value2\\\",\\\"property\\\":\\\"\\\"}],\\\"restartFlag\\\":\\\"0\\\"}]}],\\\"caseRunStage\\\":[{\\\"group_name\\\":\\\"ERPC校验(第一组)\\\",\\\"data\\\":[{\\\"input\\\":\\\"{\\\\n \\\\\\\"param_manager\\\\\\\": {\\\\n \\\\\\\"expand_param\\\\\\\": {\\\\n \\\\\\\"key_value_list\\\\\\\": [\\\\n {\\\\n \\\\\\\"key\\\\\\\": \\\\\\\"feature1\\\\\\\",\\\\n \\\\\\\"value\\\\\\\": \\\\\\\"true\\\\\\\"\\\\n },\\\\n {\\\\n \\\\\\\"key\\\\\\\": \\\\\\\"feature2\\\\\\\",\\\\n \\\\\\\"value\\\\\\\": \\\\\\\"3,8;4,16\\\\\\\"\\\\n },\\\\n {\\\\n \\\\\\\"key\\\\\\\": \\\\\\\"feature3\\\\\\\",\\\\n \\\\\\\"value\\\\\\\": \\\\\\\"1\\\\\\\"\\\\n },\\\\n {\\\\n \\\\\\\"key\\\\\\\": \\\\\\\"feature4\\\\\\\",\\\\n \\\\\\\"value\\\\\\\": \\\\\\\"one_phase_model_searching,200,166,1\\\\\\\"\\\\n },\\\\n {\\\\n \\\\\\\"key\\\\\\\": \\\\\\\"feature5\\\\\\\",\\\\n \\\\\\\"value\\\\\\\": \\\\\\\"false\\\\\\\"\\\\n }\\\\n ]\\\\n }\\\\n }\\\\n}\\\",\\\"expect\\\":\\\"{\\\\n \\\\\\\"result\\\\\\\": \\\\\\\"1\\\\\\\"\\\\n}\\\",\\\"actual\\\":\\\"null\\\"}]}]}','猜你喜欢',0,'c++',0);", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 176, + "Type": 2, + "Content": "+INSERT INTO `got_testcase` (`gmt_create`,`gmt_modified`,`scenario_id`,`name`,`description`,`long_description`,`content`,`case_group`,`is_deleted`,`case_template`,`is_visible`) VALUES ('2020-04-28 19:12:55','2020-04-28 19:12:55',1,'case名','用例智能推荐用例2','普通用例','{\\\"prepareData\\\":[{\\\"Tair\\\":[{\\\"dsName\\\":\\\"table.markovtair.test\\\",\\\"data\\\":[{\\\"key\\\":\\\"testkey\\\",\\\"value\\\":\\\"testvalue\\\",\\\"property\\\":\\\"\\\"}]}],\\\"Imock\\\":[{\\\"dsName\\\":\\\"erpc_merger_inner\\\",\\\"data\\\":[{\\\"key\\\":\\\"key1\\\",\\\"value\\\":\\\"confict-value\\\",\\\"property\\\":\\\"\\\"},{\\\"key\\\":\\\"key2\\\",\\\"value\\\":\\\"value2\\\",\\\"property\\\":\\\"\\\"}]}]}],\\\"caseRunStage\\\":[{\\\"group_name\\\":\\\"ERPC校验(第一组)\\\",\\\"data\\\":[{\\\"input\\\":\\\"{\\\\n \\\\\\\"param_manager\\\\\\\": {\\\\n \\\\\\\"expand_param\\\\\\\": {\\\\n \\\\\\\"key_value_list\\\\\\\": [\\\\n {\\\\n \\\\\\\"key\\\\\\\": \\\\\\\"feature1\\\\\\\",\\\\n \\\\\\\"value\\\\\\\": \\\\\\\"true\\\\\\\"\\\\n },\\\\n {\\\\n \\\\\\\"key\\\\\\\": \\\\\\\"feature2\\\\\\\",\\\\n \\\\\\\"value\\\\\\\": \\\\\\\"3,8;4,16\\\\\\\"\\\\n },\\\\n {\\\\n \\\\\\\"key\\\\\\\": \\\\\\\"feature3\\\\\\\",\\\\n \\\\\\\"value\\\\\\\": \\\\\\\"1\\\\\\\"\\\\n },\\\\n {\\\\n \\\\\\\"key\\\\\\\": \\\\\\\"feature4\\\\\\\",\\\\n \\\\\\\"value\\\\\\\": \\\\\\\"one_phase_model_searching,200,166,1\\\\\\\"\\\\n },\\\\n {\\\\n \\\\\\\"key\\\\\\\": \\\\\\\"feature5\\\\\\\",\\\\n \\\\\\\"value\\\\\\\": \\\\\\\"false\\\\\\\"\\\\n }\\\\n ]\\\\n }\\\\n }\\\\n}\\\",\\\"expect\\\":\\\"{\\\\n \\\\\\\"result\\\\\\\": \\\\\\\"1\\\\\\\"\\\\n}\\\"}]}]}','购物车',0,'c++',0);", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 177, + "Type": 2, + "Content": "+INSERT INTO `got_testcase` (`gmt_create`,`gmt_modified`,`scenario_id`,`name`,`description`,`long_description`,`content`,`case_group`,`is_deleted`,`case_template`,`is_visible`) VALUES ('2020-04-28 19:12:55','2020-04-28 19:12:55',1,'case名','用例智能推荐用例3','普通用例','{\\\"prepareData\\\":[{\\\"Tair\\\":[{\\\"dsName\\\":\\\"table.markovtair.test\\\",\\\"data\\\":[{\\\"key\\\":\\\"testkey\\\",\\\"value\\\":\\\"testvalue\\\",\\\"property\\\":\\\"\\\"}]}],\\\"Imock\\\":[{\\\"dsName\\\":\\\"erpc_merger_inner\\\",\\\"data\\\":[{\\\"key\\\":\\\"key1\\\",\\\"value\\\":\\\"value1\\\",\\\"property\\\":\\\"\\\"},{\\\"key\\\":\\\"key3\\\",\\\"value\\\":\\\"value3\\\",\\\"property\\\":\\\"\\\"}]}]}],\\\"caseRunStage\\\":[{\\\"group_name\\\":\\\"ERPC校验(第一组)\\\",\\\"data\\\":[{\\\"input\\\":\\\"{\\\\n \\\\\\\"param_manager\\\\\\\": {\\\\n \\\\\\\"expand_param\\\\\\\": {\\\\n \\\\\\\"key_value_list\\\\\\\": [\\\\n {\\\\n \\\\\\\"key\\\\\\\": \\\\\\\"feature1\\\\\\\",\\\\n \\\\\\\"value\\\\\\\": \\\\\\\"true\\\\\\\"\\\\n },\\\\n {\\\\n \\\\\\\"key\\\\\\\": \\\\\\\"feature2\\\\\\\",\\\\n \\\\\\\"value\\\\\\\": \\\\\\\"3,8;4,16\\\\\\\"\\\\n },\\\\n {\\\\n \\\\\\\"key\\\\\\\": \\\\\\\"feature3\\\\\\\",\\\\n \\\\\\\"value\\\\\\\": \\\\\\\"1\\\\\\\"\\\\n },\\\\n {\\\\n \\\\\\\"key\\\\\\\": \\\\\\\"feature4\\\\\\\",\\\\n \\\\\\\"value\\\\\\\": \\\\\\\"one_phase_model_searching,200,166,1\\\\\\\"\\\\n },\\\\n {\\\\n \\\\\\\"key\\\\\\\": \\\\\\\"feature5\\\\\\\",\\\\n \\\\\\\"value\\\\\\\": \\\\\\\"false\\\\\\\"\\\\n }\\\\n ]\\\\n }\\\\n }\\\\n}\\\",\\\"expect\\\":\\\"{\\\\n \\\\\\\"result\\\\\\\": \\\\\\\"1\\\\\\\"\\\\n}\\\"}]}]}','直播',0,'c++',0);", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 178, + "Type": 2, + "Content": "+", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 179, + "Type": 2, + "Content": "+INSERT INTO `got_envs` (`gmt_create`,`gmt_modified`,`scenario_id`,`name`,`status`,`host_ip`,`env_detail`) VALUES ('2020-04-28 19:12:55','2020-04-28 19:12:55',1,'初始测试环境','SUCCESS','11.167.254.210','123');", + "Comments": null, + "SectionInfo": null + } + ] + } + ], + "IsIncomplete": false + }, + { + "Name": "src/main/resources/static/index.html", + "OldName": "src/main/resources/static/index.html", + "Index": 6, + "Addition": 1, + "Deletion": 1, + "Type": 2, + "IsCreated": false, + "IsDeleted": false, + "IsBin": false, + "IsLFSFile": false, + "IsRenamed": false, + "IsSubmodule": false, + "Sections": [ + { + "Name": "", + "Lines": [ + { + "LeftIdx": 0, + "RightIdx": 0, + "Type": 4, + "Content": "@@ -24,7 +24,7 @@", + "Comments": null, + "SectionInfo": { + "Path": "src/main/resources/static/index.html", + "LastLeftIdx": 0, + "LastRightIdx": 0, + "LeftIdx": 24, + "RightIdx": 24, + "LeftHunkSize": 7, + "RightHunkSize": 7 + } + }, + { + "LeftIdx": 24, + "RightIdx": 24, + "Type": 1, + "Content": " ", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 25, + "RightIdx": 25, + "Type": 1, + "Content": " ", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 26, + "RightIdx": 26, + "Type": 1, + "Content": " ", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 27, + "RightIdx": 0, + "Type": 3, + "Content": "- ", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 0, + "RightIdx": 27, + "Type": 2, + "Content": "+ ", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 28, + "RightIdx": 28, + "Type": 1, + "Content": " ", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 29, + "RightIdx": 29, + "Type": 1, + "Content": " ", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 30, + "RightIdx": 30, + "Type": 1, + "Content": " ", + "Comments": null, + "SectionInfo": null + } + ] + }, + { + "Name": "", + "Lines": [ + { + "LeftIdx": 0, + "RightIdx": 0, + "Type": 4, + "Content": " ", + "Comments": null, + "SectionInfo": { + "Path": "src/main/resources/static/index.html", + "LastLeftIdx": 30, + "LastRightIdx": 30, + "LeftIdx": 43, + "RightIdx": 43, + "LeftHunkSize": 0, + "RightHunkSize": 0 + } + } + ] + } + ], + "IsIncomplete": false + }, + { + "Name": "src/test/java/com/alibaba/markovdemo/MarkovDemoApplicationTests.java", + "OldName": "src/test/java/com/alibaba/markovdemo/MarkovDemoApplicationTests.java", + "Index": 7, + "Addition": 0, + "Deletion": 27, + "Type": 2, + "IsCreated": false, + "IsDeleted": false, + "IsBin": false, + "IsLFSFile": false, + "IsRenamed": false, + "IsSubmodule": false, + "Sections": [ + { + "Name": "", + "Lines": [ + { + "LeftIdx": 0, + "RightIdx": 0, + "Type": 4, + "Content": "@@ -32,36 +32,9 @@ class MarkovDemoApplicationTests {", + "Comments": null, + "SectionInfo": { + "Path": "src/test/java/com/alibaba/markovdemo/MarkovDemoApplicationTests.java", + "LastLeftIdx": 0, + "LastRightIdx": 0, + "LeftIdx": 32, + "RightIdx": 32, + "LeftHunkSize": 36, + "RightHunkSize": 9 + } + }, + { + "LeftIdx": 32, + "RightIdx": 32, + "Type": 1, + "Content": " \t\treturn df2.format(date1);", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 33, + "RightIdx": 33, + "Type": 1, + "Content": " \t}", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 34, + "RightIdx": 34, + "Type": 1, + "Content": " ", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 35, + "RightIdx": 0, + "Type": 3, + "Content": "-", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 36, + "RightIdx": 35, + "Type": 1, + "Content": " \t@Test", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 37, + "RightIdx": 36, + "Type": 1, + "Content": " \tvoid wordTest () throws IOException {", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 38, + "RightIdx": 37, + "Type": 1, + "Content": " ", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 39, + "RightIdx": 0, + "Type": 3, + "Content": "-\t\t// FileInputStream fis = new FileInputStream(\"199801.txt\");", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 40, + "RightIdx": 0, + "Type": 3, + "Content": "-\t\t// FileOutputStream fos = new FileOutputStream(\"dic.txt\");", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 41, + "RightIdx": 0, + "Type": 3, + "Content": "-\t\t// ImportCorpus readF = new ImportCorpus(fis, fos);", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 42, + "RightIdx": 0, + "Type": 3, + "Content": "-\t\t// readF.readDic();", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 43, + "RightIdx": 0, + "Type": 3, + "Content": "-\t\t// System.out.println(\"µ¼Èë½áÊø\");", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 44, + "RightIdx": 0, + "Type": 3, + "Content": "-", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 45, + "RightIdx": 0, + "Type": 3, + "Content": "-\t\tString filename = \"dic.txt\";", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 46, + "RightIdx": 0, + "Type": 3, + "Content": "-\t\tHashMap hm = new HashMap();", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 47, + "RightIdx": 0, + "Type": 3, + "Content": "-\t\tHashMap len = new HashMap();", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 48, + "RightIdx": 0, + "Type": 3, + "Content": "-\t\tGenerateDictionary genDic = new GenerateDictionary();", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 49, + "RightIdx": 0, + "Type": 3, + "Content": "-\t\tSegmentation seg;", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 50, + "RightIdx": 0, + "Type": 3, + "Content": "-", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 51, + "RightIdx": 0, + "Type": 3, + "Content": "-\t\tgenDic.genHashDic(filename, hm, len);", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 52, + "RightIdx": 0, + "Type": 3, + "Content": "-", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 53, + "RightIdx": 0, + "Type": 3, + "Content": "-\t\tInputStreamReader reader = new InputStreamReader(System.in);", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 54, + "RightIdx": 0, + "Type": 3, + "Content": "-\t\tBufferedReader br = new BufferedReader(reader);", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 55, + "RightIdx": 0, + "Type": 3, + "Content": "-\t\tString data = \"\";", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 56, + "RightIdx": 0, + "Type": 3, + "Content": "-\t\tdata = br.readLine();", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 57, + "RightIdx": 0, + "Type": 3, + "Content": "-", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 58, + "RightIdx": 0, + "Type": 3, + "Content": "-\t\tseg = new Segmentation(hm, len);", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 59, + "RightIdx": 0, + "Type": 3, + "Content": "-", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 60, + "RightIdx": 0, + "Type": 3, + "Content": "-\t\tString FmmTarget = seg.Fmm(data);", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 61, + "RightIdx": 0, + "Type": 3, + "Content": "-\t\tString BmmTarget = seg.Bmm(data);", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 62, + "RightIdx": 0, + "Type": 3, + "Content": "-", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 63, + "RightIdx": 0, + "Type": 3, + "Content": "-\t\tSystem.out.println(\"FmmTarget: \" + FmmTarget);", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 64, + "RightIdx": 0, + "Type": 3, + "Content": "-\t\tSystem.out.println(\"BmmTarget: \" + BmmTarget);", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 65, + "RightIdx": 38, + "Type": 1, + "Content": " \t}", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 66, + "RightIdx": 39, + "Type": 1, + "Content": " ", + "Comments": null, + "SectionInfo": null + }, + { + "LeftIdx": 67, + "RightIdx": 40, + "Type": 1, + "Content": " }", + "Comments": null, + "SectionInfo": null + } + ] + } + ], + "IsIncomplete": false + } + ] +} +``` +--- + ### 点赞 ``` POST /api/projects/:id/praise_tread/like