Commit 900aff4d authored by liudong1993's avatar liudong1993
parents 52e0f11c 42fffb76
using EduSpider.Model.Entity;
using EduSpider.Model.Extend;
using EduSpider.Model.Query;
using System.Collections.Generic;
using VTX.FW.Config;
using VTX.FW.DB;
using System.Text;
using System.Linq;
using EduSpider.Model.Query;
using EduSpider.Model.Extend;
namespace EduSpider.IRepository
{
......@@ -21,6 +19,13 @@ namespace EduSpider.IRepository
/// <returns></returns>
public bool BatchSetStuHomeWorkRepository(List<RB_Stu_HomeWork> homeWorks);
/// <summary>
/// 创建课程作业评论
/// </summary>
/// <param name="CourseId">课程编号</param>
/// <returns></returns>
public List<ExamWorkResult> CreateHomeWorkCommentRepository(int CourseId);
/// <summary>
/// 获取学生作业列表
/// </summary>
......
......@@ -130,5 +130,12 @@ namespace EduSpider.IServices
/// </summary>
/// <returns></returns>
public List<RB_Comment> GetSysComment();
/// <summary>
/// 创建课程作业评论
/// </summary>
/// <param name="CourseId">课程编号</param>
/// <returns></returns>
public void CreateHomeWorkComment(int CourseId);
}
}
......@@ -115,7 +115,7 @@ namespace EduSpider.Model.Extend
string str = "";
switch (this.HomeWorkStatus)
{
case 0: str = "未交作业"; break;
case 0: str = "未提交"; break;
case 1: str = "未批阅"; break;
case 2: str = "已批阅"; break;
}
......
......@@ -436,6 +436,16 @@ namespace EduSpider.Services
var list = CommentRepository.GetCommentListRepository();
return list;
}
/// <summary>
/// 创建课程作业评论
/// </summary>
/// <param name="CourseId">课程编号</param>
/// <returns></returns>
public void CreateHomeWorkComment(int CourseId)
{
StuHomeWorkRepository.CreateHomeWorkCommentRepository(CourseId);
}
}
}
......@@ -427,5 +427,18 @@ namespace EduSpider.WebApi.Controllers
var list = CourseService.RemoveStuComment(Ids);
return ApiResult.Success(data: list);
}
[HttpPost]
[HttpGet]
/// <summary>
/// 生成课程评论
/// </summary>
/// <returns></returns>
public ApiResult CreateCourseComment()
{
int CourseId = base.ReqParameters.GetInt("CourseId");
CourseService.CreateHomeWorkComment(CourseId);
return ApiResult.Success();
}
}
}
......@@ -26,9 +26,9 @@ namespace TicketSpider.Spiders.ClassInRule
Console.WriteLine("开始获取老师信息");
new TeacherManager().RunTeacher(loginCookies);
Console.WriteLine("老师信息更新结束");
//new StudentManager().RunAsync(loginCookies);
//new CourseManager().RunCourse(loginCookies);
//new HomeWorkManager().RunHomeWork(loginCookies);
new StudentManager().RunAsync(loginCookies);
CourseManager.RunCourse(loginCookies);
HomeWorkManager.RunHomeWork(loginCookies);
}
}
}
......@@ -30,6 +30,7 @@ namespace EduSpider.Spiders.ClassInRule
string paramStr = string.Format(queryStr, pageCount, perpage);
var content = new StringContent(paramStr, System.Text.Encoding.UTF8, "application/x-www-form-urlencoded");
IHomeWorkRepository homeWorkRepository = new HomeWorkRepository();
IStuHomeWorkRepository stuHomeWorkRepository = new StuHomeWorkRepository();
int totalCount = 0;
Console.WriteLine(string.Format("开始第{0}次获取家庭作业", pageCount));
......@@ -90,6 +91,10 @@ namespace EduSpider.Spiders.ClassInRule
{
RunStuHomeWork(cookie, sItem.Homework_id, sItem.Course_id);
}
if (i == totalCount)
{
stuHomeWorkRepository.CreateHomeWorkCommentRepository(0);
}
}
}
}
......@@ -97,7 +102,6 @@ namespace EduSpider.Spiders.ClassInRule
}
}
}
}
/// <summary>
......@@ -255,7 +259,5 @@ namespace EduSpider.Spiders.ClassInRule
stuHomeWorkRepository.BatchSetStuHomeWorkRepository(list);
}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment