diff --git a/Tiobon.Core.Api/Controllers/Ghre/Ghre_QuestionController.cs b/Tiobon.Core.Api/Controllers/Ghre/Ghre_QuestionController.cs index 7c6134d3..08928e96 100644 --- a/Tiobon.Core.Api/Controllers/Ghre/Ghre_QuestionController.cs +++ b/Tiobon.Core.Api/Controllers/Ghre/Ghre_QuestionController.cs @@ -1,4 +1,6 @@ -namespace Tiobon.Core.Api.Controllers; +using System.Dynamic; + +namespace Tiobon.Core.Api.Controllers; /// /// 题目(Controller) @@ -33,6 +35,11 @@ public class Ghre_QuestionController : BaseController> QueryFrom(long Id) + { + return await _service.QueryFrom(Id); + } #endregion #region 新增 diff --git a/Tiobon.Core.Api/Tiobon.Core.xml b/Tiobon.Core.Api/Tiobon.Core.xml index 08b68d8f..6ad696e6 100644 --- a/Tiobon.Core.Api/Tiobon.Core.xml +++ b/Tiobon.Core.Api/Tiobon.Core.xml @@ -323,6 +323,7 @@ + @@ -331,6 +332,13 @@ + + + 获取图片 + + 主键ID + + 登录管理【无权限】 diff --git a/Tiobon.Core.IServices/Ghre/IGhre_QuestionServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_QuestionServices.cs index 076eaed2..3087e766 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_QuestionServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_QuestionServices.cs @@ -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 /// public interface IGhre_QuestionServices :IBaseServices { + Task> QueryFrom(long Id); } } \ No newline at end of file diff --git a/Tiobon.Core.Model/ViewModels/Extend/FromGhre_QuestionInput.cs b/Tiobon.Core.Model/ViewModels/Extend/FromGhre_QuestionInput.cs new file mode 100644 index 00000000..5413bd0a --- /dev/null +++ b/Tiobon.Core.Model/ViewModels/Extend/FromGhre_QuestionInput.cs @@ -0,0 +1,52 @@ +namespace Tiobon.Core.Model; + +public class FromGhre_QuestionInput +{ + public List Column { get; set; } = new List(); + 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 questionType { get; set; } = new List { }; +} +public class FromGhre_QuestionBaseData +{ + public List courseID { get; set; } = new List { }; + 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 answerList { get; set; } = new List { }; +} +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; } +} \ No newline at end of file diff --git a/Tiobon.Core.Services/Ghre/Ghre_QuestionServices.cs b/Tiobon.Core.Services/Ghre/Ghre_QuestionServices.cs index d3536607..a9777274 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_QuestionServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_QuestionServices.cs @@ -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 { - /// - /// 题目 (服务) - /// + /// + /// 题目 (服务) + /// public class Ghre_QuestionServices : BaseServices, IGhre_QuestionServices { private readonly IBaseRepository _dal; @@ -17,5 +20,83 @@ namespace Tiobon.Core.Services this._dal = dal; base.BaseDal = dal; } + + /// + /// + /// + /// + /// + public async Task> 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 + { + 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.OprateSuccess("查询成功!", data); + } } } \ No newline at end of file diff --git a/Tiobon.Core/Tiobon.Core.xml b/Tiobon.Core/Tiobon.Core.xml index f5346e86..6ad696e6 100644 --- a/Tiobon.Core/Tiobon.Core.xml +++ b/Tiobon.Core/Tiobon.Core.xml @@ -311,12 +311,19 @@ 文件服务 - + + + 配置信息 + + + 构造函数 - + + + @@ -325,6 +332,13 @@ + + + 获取图片 + + 主键ID + + 登录管理【无权限】