Skip to content

Commit

Permalink
Merge pull request #611 from netresj/feature_enhance_search_train_his…
Browse files Browse the repository at this point in the history
…tory

検索機能向けapiの追加
  • Loading branch information
Reiw98 authored Mar 31, 2022
2 parents 8d9a904 + 01b382a commit f9b1200
Show file tree
Hide file tree
Showing 26 changed files with 3,583 additions and 2,824 deletions.
570 changes: 570 additions & 0 deletions swagger.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
namespace Nssol.Platypus.ApiModels.TrainingApiModels
{
/// <summary>
/// 詳細検索の入力モデル。
/// </summary>
public class SearchDetailInputModel
{
/// <summary>
/// IDの検索条件。
/// この数値以上のIDが検索される。
/// </summary>
public long? IdLower { get; set; }

/// <summary>
/// IDの検索条件。
/// この数値以下のIDが検索される。
/// </summary>
public long? IdUpper { get; set; }

/// <summary>
/// 名前
/// 複数のワードが含まれる場合は","区切り
/// </summary>
public string Name { get; set; }

/// <summary>
/// 名前がor検索かand検索か
/// </summary>
public bool? NameOr { get; set; }

/// <summary>
/// 親学習名
/// 複数のワードが含まれる場合は","区切り
/// </summary>
public string ParentName { get; set; }

/// <summary>
/// 親学習名がor検索かand検索か
/// </summary>
public bool? ParentNameOr { get; set; }

/// <summary>
/// 実行時刻の検索の期間の開始の条件。日付の形式。
/// "2018/01/01" → 2018/01/01 00:00:00 以降が検索される。
/// </summary>
public string StartedAtLower { get; set; }

/// <summary>
/// 実行時刻の検索の期間の終了の条件。日付の形式。
/// "2018/01/01" → 2018/01/01 23:59:59 以前が検索される。
/// </summary>
public string StartedAtUpper { get; set; }

/// <summary>
/// 実行者
/// 複数のワードが含まれる場合は","区切り
/// </summary>
public string StartedBy { get; set; }

/// <summary>
/// 実行者の検索がor検索かand検索か
/// </summary>
public bool? StartedByOr { get; set; }

/// <summary>
/// データセット名
/// 複数のワードが含まれる場合は","区切り
/// </summary>
public string DataSet { get; set; }

/// <summary>
/// データセット名がor検索かand検索か
/// </summary>
public bool? DataSetOr { get; set; }

/// <summary>
/// メモ
/// 複数のワードが含まれる場合は","区切り
/// </summary>
public string Memo { get; set; }

/// <summary>
/// メモがor検索かand検索か
/// </summary>
public bool? MemoOr { get; set; }

/// <summary>
/// ステータス
/// 複数のワードが含まれる場合は","区切り
/// </summary>
public string Status { get; set; }

/// <summary>
/// ステータスがor検索かand検索か
/// </summary>
public bool? StatusOr { get; set; }

/// <summary>
/// 実行コマンド
/// 複数のワードが含まれる場合は","区切り
/// </summary>
public string EntryPoint { get; set; }

/// <summary>
/// 実行コマンドがor検索かand検索か
/// </summary>
public bool? EntryPointOr { get; set; }

/// <summary>
/// タグ
/// 複数のワードが含まれる場合は","区切り
/// </summary>
public string Tags { get; set; }

/// <summary>
/// タグがor検索かand検索か
/// </summary>
public bool? TagsOr { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System.ComponentModel.DataAnnotations;

namespace Nssol.Platypus.ApiModels.TrainingApiModels
{
/// <summary>
/// 検索履歴入力モデル
/// </summary>
public class SearchHistoryInputModel
{
/// <summary>
/// 検索履歴の名前
/// </summary>
[Required]
[MinLength(4)]
public string Name { set; get; }

/// <summary>
/// 詳細検索入力モデル
/// </summary>
public SearchDetailInputModel SearchDetailInputModel { set; get; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
using Nssol.Platypus.Models.TenantModels;

namespace Nssol.Platypus.ApiModels.TrainingApiModels
{
/// <summary>
/// 検索履歴出力モデル
/// </summary>
public class SearchHistoryOutputModel : Components.OutputModelBase
{
/// <summary>
/// コンストラクタ
/// </summary>
public SearchHistoryOutputModel(TrainingSearchHistories history) : base(history)
{
Name = history.Name;
Id = history.Id;
SearchDetail = new SearchDetailInputModel();
SearchDetail.IdUpper = history.IdUpper;
SearchDetail.IdLower = history.IdLower;
SearchDetail.StartedAtLower = history.StartedAtLower;
SearchDetail.StartedAtUpper = history.StartedAtUpper;
if (string.IsNullOrEmpty(history.TrainingName) == false)
{
SearchDetail.Name = history.TrainingName;
SearchDetail.NameOr = history.TrainingNameOr;
}
else
{
SearchDetail.NameOr = true;
}
if (string.IsNullOrEmpty(history.ParentName) == false)
{
SearchDetail.ParentName = history.ParentName;
SearchDetail.ParentNameOr = history.ParentNameOr;
}
else
{
SearchDetail.ParentNameOr = true;
}
if (string.IsNullOrEmpty(history.StartedBy) == false)
{
SearchDetail.StartedBy = history.StartedBy;
SearchDetail.StartedByOr = history.StartedByOr;
}
else
{
SearchDetail.StartedByOr = true;
}
if (string.IsNullOrEmpty(history.DataSet) == false)
{
SearchDetail.DataSet = history.DataSet;
SearchDetail.DataSetOr = history.DataSetOr;
}
else
{
SearchDetail.DataSetOr = true;
}
if (string.IsNullOrEmpty(history.EntryPoint) == false)
{
SearchDetail.EntryPoint = history.EntryPoint;
SearchDetail.EntryPointOr = history.EntryPointOr;
}
else
{
SearchDetail.EntryPointOr = true;
}
if (string.IsNullOrEmpty(history.Memo) == false)
{
SearchDetail.Memo = history.Memo;
SearchDetail.MemoOr = history.MemoOr;
}
else
{
SearchDetail.MemoOr = true;
}
if (string.IsNullOrEmpty(history.Tags) == false)
{
SearchDetail.Tags = history.Tags;
SearchDetail.TagsOr = history.TagsOr;
}
else
{
SearchDetail.TagsOr = true;
}
if (string.IsNullOrEmpty(history.Status) == false)
{
SearchDetail.Status = history.Status;
SearchDetail.StatusOr = history.StatusOr;
}
else
{
SearchDetail.StatusOr = true;
}
}

/// <summary>
/// 履歴の登録名
/// </summary>
public string Name { get; set; }

/// <summary>
/// 履歴のid
/// </summary>
public long Id { get; set; }

/// <summary>
/// 検索の内容
/// </summary>
public SearchDetailInputModel SearchDetail { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace Nssol.Platypus.ApiModels.TrainingApiModels
{
/// <summary>
/// 付与または削除するタグ入力モデル
/// </summary>
public class TagsInputModel
{
/// <summary>
/// タグを付与、または、削除したい対象の学習履歴のId
/// </summary>
[Required]
public IEnumerable<long> Id { get; set; }

/// <summary>
/// 付与、または、削除したいタグ
/// </summary>
[Required]
public IEnumerable<string> Tags { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System.Collections.Generic;

namespace Nssol.Platypus.ApiModels.TrainingApiModels
{
/// <summary>
/// 学習検索項目補完出力モデル
/// </summary>
public class TrainingSearchFillOutputModel
{
/// <summary>
/// 実行者名の一覧
/// </summary>
public IEnumerable<string> CreatedBy { get; set; }

/// <summary>
/// ステータスの一覧
/// </summary>
public IEnumerable<string> Status { get; set; }

/// <summary>
/// タグの一覧
/// </summary>
public IEnumerable<string> Tags { get; set; }

/// <summary>
/// データセットの補完
/// </summary>
public IEnumerable<string> Datasets { get; set; }
}
}
Loading

0 comments on commit f9b1200

Please sign in to comment.