根据Id查询数据

master
xiaochanghai 1 year ago
parent de41ca5310
commit 6720ac4227
  1. 9
      Tiobon.Core.Api/Controllers/Ghre/Ghre_QuestionController.cs
  2. 8
      Tiobon.Core.Api/Tiobon.Core.xml
  3. 2
      Tiobon.Core.IServices/Ghre/IGhre_QuestionServices.cs
  4. 52
      Tiobon.Core.Model/ViewModels/Extend/FromGhre_QuestionInput.cs
  5. 87
      Tiobon.Core.Services/Ghre/Ghre_QuestionServices.cs
  6. 18
      Tiobon.Core/Tiobon.Core.xml

@ -1,4 +1,6 @@
namespace Tiobon.Core.Api.Controllers;
using System.Dynamic;
namespace Tiobon.Core.Api.Controllers;
/// <summary>
/// 题目(Controller)
@ -33,6 +35,11 @@ public class Ghre_QuestionController : BaseController<IGhre_QuestionServices, Gh
else
return Success(entity, "获取成功");
}
[HttpPost("QueryFrom/{Id}")]
public async Task<ServiceResult<FromGhre_QuestionInput>> QueryFrom(long Id)
{
return await _service.QueryFrom(Id);
}
#endregion
#region 新增

@ -323,6 +323,7 @@
<param name="logger"></param>
<param name="configuration"></param>
<param name="hostingEnvironment"></param>
<param name="ghre_AttachmentServices"></param>
</member>
<member name="M:Tiobon.Core.Controllers.FileController.UploadImageAsync(Microsoft.AspNetCore.Http.IFormFileCollection)">
<summary>
@ -331,6 +332,13 @@
<param name="fileList"></param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Controllers.FileController.Download(System.Int64)">
<summary>
获取图片
</summary>
<param name="Id">主键ID</param>
<returns></returns>
</member>
<member name="T:Tiobon.Core.Controllers.LoginController">
<summary>
登录管理【无权限】

@ -1,4 +1,5 @@
using Tiobon.Core.IServices.BASE;
using Tiobon.Core.Model;
using Tiobon.Core.Model.Models;
namespace Tiobon.Core.IServices
@ -8,5 +9,6 @@ namespace Tiobon.Core.IServices
/// </summary>
public interface IGhre_QuestionServices :IBaseServices<Ghre_Question, Ghre_QuestionDto, InsertGhre_QuestionInput, EditGhre_QuestionInput>
{
Task<ServiceResult<FromGhre_QuestionInput>> QueryFrom(long Id);
}
}

@ -0,0 +1,52 @@
namespace Tiobon.Core.Model;
public class FromGhre_QuestionInput
{
public List<FromGhre_QuestionColumn> Column { get; set; } = new List<FromGhre_QuestionColumn>();
public FromGhre_QuestionPageData PageData { get; set; } = new FromGhre_QuestionPageData();
}
public class FromGhre_QuestionColumn
{
public string label { get; set; }
public string field { get; set; }
public string elementType { get; set; }
public bool required { get; set; }
public bool multipleSelect { get; set; }
public bool editable { get; set; }
public string dataSource { get; set; }
public string placeholder { get; set; }
}
public class FromGhre_QuestionPageData
{
public FromGhre_QuestionBaseData baseData { get; set; } = new FromGhre_QuestionBaseData();
public List<FromGhre_QuestionQuestionType> questionType { get; set; } = new List<FromGhre_QuestionQuestionType> { };
}
public class FromGhre_QuestionBaseData
{
public List<long> courseID { get; set; } = new List<long> { };
public string questionNo { get; set; }
}
public class FromGhre_QuestionQuestionType
{
public string label { get; set; }
public string type { get; set; }
public int isActive { get; set; } = 0;
public FromGhre_QuestionQuestionTypeDetail detail { get; set; } = new FromGhre_QuestionQuestionTypeDetail();
}
public class FromGhre_QuestionQuestionTypeDetail
{
public string difficulty { get; set; }
public string content { get; set; }
public string answer { get; set; }
public List<FromGhre_QuestionQuestionAnswerList> answerList { get; set; } = new List<FromGhre_QuestionQuestionAnswerList> { };
}
public class FromGhre_QuestionQuestionAnswerList
{
public string No { get; set; }
public string label { get; set; }
public string imageUrl { get; set; }
public int imgWidthPc { get; set; }
public int imgWidthApp { get; set; }
}

@ -3,12 +3,15 @@ using Tiobon.Core.IServices;
using Tiobon.Core.Model.Models;
using Tiobon.Core.Services.BASE;
using Tiobon.Core.IRepository.Base;
using Tiobon.Core.Model;
using System.Dynamic;
using Newtonsoft.Json.Linq;
namespace Tiobon.Core.Services
{
/// <summary>
/// 题目 (服务)
/// </summary>
/// <summary>
/// 题目 (服务)
/// </summary>
public class Ghre_QuestionServices : BaseServices<Ghre_Question, Ghre_QuestionDto, InsertGhre_QuestionInput, EditGhre_QuestionInput>, IGhre_QuestionServices
{
private readonly IBaseRepository<Ghre_Question> _dal;
@ -17,5 +20,83 @@ namespace Tiobon.Core.Services
this._dal = dal;
base.BaseDal = dal;
}
/// <summary>
///
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public async Task<ServiceResult<FromGhre_QuestionInput>> QueryFrom(long Id)
{
var data = new FromGhre_QuestionInput();
#region Column
data.Column.Add(new FromGhre_QuestionColumn()
{
label = "课程名称",
field = "courseID",
elementType = "ApiSelect",
required = true,
multipleSelect = true,
editable = true,
dataSource = "TBParaDetail_GhrStaff_JTFS"
});
data.Column.Add(new FromGhre_QuestionColumn()
{
label = "题目编号",
field = "questionNo",
elementType = "Input",
required = false,
multipleSelect = false,
editable = false,
dataSource = "",
placeholder = "保存后自动生成"
});
#endregion
#region PageData
data.PageData.questionType = new List<FromGhre_QuestionQuestionType>
{
new FromGhre_QuestionQuestionType()
{
label = "单选题",
type = "Single",
isActive = 1
},
new FromGhre_QuestionQuestionType()
{
label = "多选题",
type = "Multiple",
isActive = 0,
},
new FromGhre_QuestionQuestionType()
{
label = "判断题",
type = "TrueOrFalse",
isActive = 0,
},
new FromGhre_QuestionQuestionType()
{
label = "填空题",
type = "Completion",
isActive = 0,
},
new FromGhre_QuestionQuestionType()
{
label = "简答题",
type = "ShortAnswer",
isActive = 0,
}
};
if (Id != 0)
{
}
#endregion
return ServiceResult<FromGhre_QuestionInput>.OprateSuccess("查询成功!", data);
}
}
}

@ -311,12 +311,19 @@
文件服务
</summary>
</member>
<member name="M:Tiobon.Core.Controllers.FileController.#ctor(Microsoft.Extensions.Logging.ILogger{Tiobon.Core.Controllers.TiobonController})">
<member name="F:Tiobon.Core.Controllers.FileController._configuration">
<summary>
配置信息
</summary>
</member>
<member name="M:Tiobon.Core.Controllers.FileController.#ctor(Microsoft.Extensions.Logging.ILogger{Tiobon.Core.Controllers.TiobonController},Microsoft.Extensions.Configuration.IConfiguration,Microsoft.AspNetCore.Hosting.IWebHostEnvironment,Tiobon.Core.IServices.IGhre_AttachmentServices)">
<summary>
构造函数
</summary>
<param name="logger"></param>
<param name="configuration"></param>
<param name="hostingEnvironment"></param>
<param name="ghre_AttachmentServices"></param>
</member>
<member name="M:Tiobon.Core.Controllers.FileController.UploadImageAsync(Microsoft.AspNetCore.Http.IFormFileCollection)">
<summary>
@ -325,6 +332,13 @@
<param name="fileList"></param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Controllers.FileController.Download(System.Int64)">
<summary>
获取图片
</summary>
<param name="Id">主键ID</param>
<returns></returns>
</member>
<member name="T:Tiobon.Core.Controllers.LoginController">
<summary>
登录管理【无权限】

Loading…
Cancel
Save