initProject

This commit is contained in:
2024-05-08 11:01:54 +08:00
commit e7cea71567
4078 changed files with 579425 additions and 0 deletions
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
namespace WebApi.Controllers
{
public class DataSyncUserInfoController: ApiController
{
[HttpGet]
public Model.ResponeData GetHrInfoList()
{
BLL.APIService.SyncUserInfoService.GetSyncUserInfo();
var result = new Model.ResponeData();
result.message = "接口已请求";
return result;
}
}
}
@@ -0,0 +1,77 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using WebApi.Filter;
using Model;
namespace WebApi.Controllers
{
public class EprojectController: ApiController
{
[HttpPost]
public Model.ResponeData GetLogin([FromBody] LoginInput input)
{
var responeData = new Model.ResponeData();
if (string.IsNullOrEmpty(input.username) && string.IsNullOrEmpty(input.password))
{
responeData.code = 1001;
responeData.message = "用户名或密码不能为空";
return responeData;
}
//加密token
var token = BLL.CommonService.Base64Code($"{input.username}{input.password}");
//读取config配置文件的数据
var _myusername = "eproject_admin";
var _mypassword = "eproject$P@ssW0rd";
var _mytoken = BLL.CommonService.Base64Code($"{_myusername}{_mypassword}");
if (!token.Equals(_mytoken))
{
responeData.code = 1002;
responeData.message = "用户名或密码不正确";
return responeData;
}
responeData.code = 1000;
responeData.data = token;
responeData.message = "登录成功";
return responeData;
}
#region EProject信息列表
/// <summary>
/// 获取EProject信息列表
/// </summary>
/// <param name="jobNo">任务代码</param>
/// <param name="jobStatus">任务状态</param>
/// <param name="startCreateTime">创建日期起</param>
/// <param name="endCreateTime">创建日期止</param>
/// <param name="startUpdateTime">修改日期起</param>
/// <param name="endUpdateTime">修改日期止</param>
/// <returns>EProject信息列表</returns>
[HttpGet]
[Validate]
public Model.ResponeData GetEprojectInfoList(string jobNo, string jobStatus, DateTime? startCreateTime, DateTime? endCreateTime, DateTime? startUpdateTime, DateTime? endUpdateTime)
{
var responeData = new Model.ResponeData();
responeData.timestamp = BLL.Funs.DateTimeToTimestamp(DateTime.Now).ToString();
try
{
responeData.data = BLL.APIEpojectService.GetEprojectList(jobNo, jobStatus, startCreateTime, endCreateTime, startUpdateTime, endUpdateTime);
}
catch (Exception ex)
{
responeData.success = false;
responeData.code = 1010;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
}
}
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace WebApi.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
ViewBag.Title = "Home Page";
return View();
}
}
}