Commit 6eba9fa4 authored by liudong1993's avatar liudong1993
parents c2eae54e a7ecb561
using EduSpider.Model.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VTX.FW.Config;
using VTX.FW.DB;
namespace EduSpider.IRepository
{
/// <summary>
/// 作业仓储层接口
/// </summary>
public interface IHomeWorkRepository : IDBRepository<RB_HomeWork>, IDependency
{
/// <summary>
/// 批量添加学生家庭作业
/// </summary>
/// <param name="homeWorks"></param>
/// <returns></returns>
public bool BatchSetHomeWorkRepository(List<RB_HomeWork> homeWorks);
}
}
......@@ -110,5 +110,20 @@ namespace EduSpider.Model.Entity
/// 课程类型(1-标准课,公开课)
/// </summary>
public CourseTypeEnum courseType { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime addTime { get; set; }
/// <summary>
/// 课程图片
/// </summary>
public string courseWare { get; set; }
/// <summary>
/// 封面图
/// </summary>
public string coverImg { get; set; }
}
}
......@@ -39,5 +39,10 @@ namespace EduSpider.Model.Entity
/// 课程编号
/// </summary>
public int courseId { get; set; }
/// <summary>
/// 课程教师编号
/// </summary>
public int courseTeacherId { get; set; }
}
}
using System;
using VTX.FW.Attr;
namespace EduSpider.Model.Entity
{
/// <summary>
/// 作业实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_HomeWork
{
/// <summary>
/// 作业编号
/// </summary>
public int homework_id { get; set; }
/// <summary>
/// 作业标题
/// </summary>
public string homework_title { get; set; }
/// <summary>
/// 作业分享Key
/// </summary>
public string homework_share_key { get; set; }
/// <summary>
/// 课程编号
/// </summary>
public int? course_id { get; set; }
/// <summary>
/// 课程名称
/// </summary>
public string course_name { get; set; }
/// <summary>
/// 作业开始时间
/// </summary>
public DateTime? start_time { get; set; }
/// <summary>
/// 作业结束时间
/// </summary>
public DateTime? end_time { get; set; }
/// <summary>
/// 作业状态(0-未开始,1-进行中,2-已结束)
/// </summary>
public int? status { get; set; }
/// <summary>
/// 显示状态(0-客户端显示,1-客户端隐藏)
/// </summary>
public int? is_del { get; set; }
/// <summary>
/// 是否公开作业(1-公开作业,2-不公开,3-公开优秀)
/// </summary>
public string is_open { get; set; }
/// <summary>
/// 公开方式(1-结束后)
/// </summary>
public string open_type { get; set; }
/// <summary>
/// 是否允许补交(1-否,2-是)
/// </summary>
public string is_revise { get; set; }
/// <summary>
/// 学生数
/// </summary>
public int? num { get; set; }
/// <summary>
/// 优秀人数
/// </summary>
public int? cream_num { get; set; }
/// <summary>
/// revised_num
/// </summary>
public int? revised_num { get; set; }
/// <summary>
/// 已批阅
/// </summary>
public int? rnum { get; set; }
/// <summary>
/// 已提交
/// </summary>
public int? cnum { get; set; }
/// <summary>
/// 学校编号
/// </summary>
public int? school_uid { get; set; }
/// <summary>
/// 评分机制(5-自定义,4-不评分,3-等第制,2-十分制,1-百分制)
/// </summary>
public int? score_type { get; set; }
/// <summary>
/// 自定义分数
/// </summary>
public decimal? score_value { get; set; }
/// <summary>
/// 教师账号
/// </summary>
public string teacher_account { get; set; }
/// <summary>
/// 教师姓名
/// </summary>
public string teacher_name { get; set; }
/// <summary>
/// 教师编号
/// </summary>
public int? teacher_uid { get; set; }
/// <summary>
/// th_cancel
/// </summary>
public string th_cancel { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime add_time { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public DateTime update_time { get; set; }
}
}
......@@ -33,7 +33,7 @@ namespace EduSpider.Repository
public List<RB_Course> GetCourseListRepository(CourseQuery query)
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
StringBuilder builder = new();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Course AS A
......@@ -65,7 +65,7 @@ WHERE 1=1
public List<RB_Course> GetCoursePageRepository(int pageIndex, int pageSize, out long rowsCount, CourseQuery query)
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
StringBuilder builder = new();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Course AS A
......
using EduSpider.IRepository;
using EduSpider.Model.Entity;
using EduSpider.Repository.Base;
using System.Collections.Generic;
namespace EduSpider.Repository
{
/// <summary>
/// 作业仓储层实现
/// </summary>
public class HomeWorkRepository : BaseRepository<RB_HomeWork>, IHomeWorkRepository
{
/// <summary>
/// 批量添加学生家庭作业
/// </summary>
/// <param name="homeWorks"></param>
/// <returns></returns>
public bool BatchSetHomeWorkRepository(List<RB_HomeWork> homeWorks)
{
bool flag;
flag = base.BatchInsert(homeWorks, isReplace: true);
return flag;
}
}
}
using Newtonsoft.Json.Linq;
using OpenCvSharp;
using OpenCvSharp;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Interactions;
using OpenQA.Selenium.Remote;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
......@@ -68,8 +60,8 @@ namespace TicketSpider.Spiders.ClassInRule
public static bool RunAsync()
{
var flag = false;
IWebElement inputEle = null;
IWebElement pwdEle = null;
IWebElement inputEle;
IWebElement pwdEle;
var option = new ChromeOptions();
option.AddArgument("--incognito");
option.AddArgument("headless");
......@@ -240,9 +232,8 @@ namespace TicketSpider.Spiders.ClassInRule
var res = new Mat();
Cv2.MatchTemplate(bgPic,tpPic,res, TemplateMatchModes.CCoeffNormed);
double minVal = 0, maxVal = 0;
OpenCvSharp.Point minLoc = new OpenCvSharp.Point(), maxLoc = new OpenCvSharp.Point();
Cv2.MinMaxLoc(res,out minVal,out maxVal,out minLoc,out maxLoc);
Cv2.MinMaxLoc(res,out double minVal,out double maxVal,out minLoc,out maxLoc);
var bt = new OpenCvSharp.Point(maxLoc.X+tpPic.Width,maxLoc.Y+tpPic.Height);
Cv2.Rectangle(bgImg, maxLoc, bt, Scalar.Red, 2);
......@@ -256,16 +247,17 @@ namespace TicketSpider.Spiders.ClassInRule
{
while (_openHeartTimer)
{
var handler = new HttpClientHandler();
handler.AllowAutoRedirect = false;
handler.UseCookies = true;
handler.CookieContainer = CreateCookie();
handler.AutomaticDecompression = DecompressionMethods.GZip;
handler.ClientCertificateOptions = ClientCertificateOption.Automatic;
var handler = new HttpClientHandler
{
AllowAutoRedirect = false,
UseCookies = true,
CookieContainer = CreateCookie(),
AutomaticDecompression = DecompressionMethods.GZip,
ClientCertificateOptions = ClientCertificateOption.Automatic
};
var http = new HttpClient(handler);
http.GetAsync("https://console.eeo.cn/saas/school/index.html#/fullPage/Index?lang=zh-CN");
//TODO:检查是否需要重新登录
Thread.Sleep(60 * 1000);
}
}
......
......@@ -2,7 +2,6 @@
using EduSpider.Model.Entity;
using EduSpider.Repository;
using EduSpider.Utility;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
......
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