提交
This commit is contained in:
43
api_v1/Appointment.Api/Appointment.Api.sln
Normal file
43
api_v1/Appointment.Api/Appointment.Api.sln
Normal file
@@ -0,0 +1,43 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.30711.63
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Appointment.Api", "Appointment.Api\Appointment.Api.csproj", "{D8C00CB0-D314-4D84-B865-ED50E8BBFB0F}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Appointment.Repository", "..\Appointment.Repository\Appointment.Repository.csproj", "{3F67A123-9CD3-41E3-AF2A-C5EA2DC6B63D}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Appointment.IRepository", "..\Appointment.IRepository\Appointment.IRepository.csproj", "{60B857A7-3AB0-4A5A-8271-FD0775F0A40A}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Appointment.Entity", "..\Appointment.Entity\Appointment.Entity.csproj", "{AB7CA6F6-403E-4E1F-B688-F581D66F4CC4}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{D8C00CB0-D314-4D84-B865-ED50E8BBFB0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D8C00CB0-D314-4D84-B865-ED50E8BBFB0F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D8C00CB0-D314-4D84-B865-ED50E8BBFB0F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D8C00CB0-D314-4D84-B865-ED50E8BBFB0F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{3F67A123-9CD3-41E3-AF2A-C5EA2DC6B63D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{3F67A123-9CD3-41E3-AF2A-C5EA2DC6B63D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{3F67A123-9CD3-41E3-AF2A-C5EA2DC6B63D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{3F67A123-9CD3-41E3-AF2A-C5EA2DC6B63D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{60B857A7-3AB0-4A5A-8271-FD0775F0A40A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{60B857A7-3AB0-4A5A-8271-FD0775F0A40A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{60B857A7-3AB0-4A5A-8271-FD0775F0A40A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{60B857A7-3AB0-4A5A-8271-FD0775F0A40A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{AB7CA6F6-403E-4E1F-B688-F581D66F4CC4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{AB7CA6F6-403E-4E1F-B688-F581D66F4CC4}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{AB7CA6F6-403E-4E1F-B688-F581D66F4CC4}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{AB7CA6F6-403E-4E1F-B688-F581D66F4CC4}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {491C2436-66E3-43C6-817A-F1E718C28A3B}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,39 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<UserSecretsId>6dceff68-1c1d-4ab3-9e5c-af79745ae1a1</UserSecretsId>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<NoWarn>1701;1702;1591</NoWarn>
|
||||
<DocumentationFile>Appointment.Api.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Log4NetCore" Version="1.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Log4Net.AspNetCore" Version="3.1.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="5.6.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Appointment.Entity\Appointment.Entity.csproj" />
|
||||
<ProjectReference Include="..\..\Appointment.IRepository\Appointment.IRepository.csproj" />
|
||||
<ProjectReference Include="..\..\Appointment.Repository\Appointment.Repository.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Update="log4net.Config">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="Appointment.Api.xml">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
</Project>
|
||||
367
api_v1/Appointment.Api/Appointment.Api/Appointment.Api.xml
Normal file
367
api_v1/Appointment.Api/Appointment.Api/Appointment.Api.xml
Normal file
@@ -0,0 +1,367 @@
|
||||
<?xml version="1.0"?>
|
||||
<doc>
|
||||
<assembly>
|
||||
<name>Appointment.Api</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="T:Appointment.Api.Controllers.ApptAuditorController">
|
||||
<summary>
|
||||
预订审核节点接口
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptAuditorController.GroupList">
|
||||
<summary>
|
||||
获取所有组别
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptAuditorController.Add(Appointment.Entity.ApptAuditor)">
|
||||
<summary>
|
||||
审核流程 添加节点
|
||||
</summary>
|
||||
<param name="req">
|
||||
apptTypeId:审核类型;
|
||||
opGroup:角色代码;
|
||||
opDescript:角色名称;
|
||||
pid:前阶段审核主键,第一级审核填0;
|
||||
</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptAuditorController.Delete(Appointment.Entity.ApptAuditor)">
|
||||
<summary>
|
||||
核流程 删除
|
||||
</summary>
|
||||
<param name="req">
|
||||
id:要删除的节点;有子节点时不允许删除
|
||||
</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptAuditorController.GetModel(Appointment.Entity.ApptAuditor)">
|
||||
<summary>
|
||||
根据主键获取实体
|
||||
</summary>
|
||||
<param name="req">
|
||||
id:主键;
|
||||
</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptAuditorController.GetList(Appointment.Entity.ApptAuditor)">
|
||||
<summary>
|
||||
预订审核 审核列表
|
||||
</summary>
|
||||
<param name="req">
|
||||
id:大于0-指定主键;
|
||||
apptTypeId:大于0-指定审核类型;
|
||||
opGroup:不为空-指定组别代码;
|
||||
opDescript:不为空-指定组别名称;
|
||||
</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptAuditorController.Page(Appointment.Entity.CommPageReq)">
|
||||
<summary>
|
||||
预订审核 分页
|
||||
</summary>
|
||||
<param name="req">
|
||||
Keywords:角色名称模糊查询
|
||||
</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptAuditorController.AuditorLine(Appointment.Entity.ApptAuditor)">
|
||||
<summary>
|
||||
获取预订审核线状结构
|
||||
</summary>
|
||||
<param name="req">
|
||||
apptTypeId:审核类型;
|
||||
</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:Appointment.Api.Controllers.ApptController">
|
||||
<summary>
|
||||
预订接口
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptController.UsableMeeting(Appointment.Entity.MeetingReq)">
|
||||
<summary>
|
||||
根据时间段获取可使用的会议厅资源
|
||||
</summary>
|
||||
<param name="req"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptController.UsableMeetingByDay(Appointment.Entity.UsableMeetingReq)">
|
||||
<summary>
|
||||
根据日期与场次获取可使用会议厅资源
|
||||
</summary>
|
||||
<param name="req"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptController.UsableRoom(Appointment.Entity.UsableRoomReq)">
|
||||
<summary>
|
||||
获取可使用的房间资源
|
||||
</summary>
|
||||
<param name="req">启始时间(默认从昨天开始)</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptController.UsableRoomMin(Appointment.Entity.UsableRoomReq)">
|
||||
<summary>
|
||||
根据时间段获取房类最小可用数
|
||||
</summary>
|
||||
<param name="req"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptController.RemarkList">
|
||||
<summary>
|
||||
获取备注列表项
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptController.Add(Appointment.Entity.ApptSummaryReq)">
|
||||
<summary>
|
||||
预订提交
|
||||
</summary>
|
||||
<param name="req"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptController.ApptAudit(Appointment.Entity.ApptAuditReq)">
|
||||
<summary>
|
||||
预订审核
|
||||
</summary>
|
||||
<param name="req"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptController.TransferAudit(Appointment.Entity.TransferAuditReq)">
|
||||
<summary>
|
||||
转审批
|
||||
</summary>
|
||||
<param name="req"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptController.ApptSend(Appointment.Entity.ApptSendReq)">
|
||||
<summary>
|
||||
抄送
|
||||
</summary>
|
||||
<param name="req"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptController.GetModel(Appointment.Entity.ApptSummaryReq)">
|
||||
<summary>
|
||||
根据主键获取实体
|
||||
</summary>
|
||||
<param name="req"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptController.MyApptApplyPageReq(Appointment.Entity.MyApptApplyPageReq)">
|
||||
<summary>
|
||||
我发起的预订列表列表
|
||||
</summary>
|
||||
<param name="req"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptController.MyPartakePage(Appointment.Entity.MyApptAuditPageReq)">
|
||||
<summary>
|
||||
获取我待审核的
|
||||
</summary>
|
||||
<param name="req"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptController.AuditorLogTree(Appointment.Entity.CommIntReq)">
|
||||
<summary>
|
||||
获取预订审核记录表
|
||||
</summary>
|
||||
<param name="req"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptController.Demo(Appointment.Entity.CommPageReq)">
|
||||
<summary>
|
||||
测试
|
||||
</summary>
|
||||
<param name="req"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptJNCController.AddSummary(Appointment.Entity.AddSummaryJncReq)">
|
||||
<summary>
|
||||
创建新的预订单
|
||||
</summary>
|
||||
<param name="req"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptJNCController.UpdateSummary(Appointment.Entity.UpdateSummaryReq)">
|
||||
<summary>
|
||||
修改暂订单
|
||||
</summary>
|
||||
<param name="req"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptJNCController.ApplyOrder(Appointment.Entity.ApplyOrderReq)">
|
||||
<summary>
|
||||
申请确定单
|
||||
</summary>
|
||||
<param name="req"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptJNCController.Cancel(Appointment.Entity.ApplyOrderReq)">
|
||||
<summary>
|
||||
取消OA单
|
||||
</summary>
|
||||
<param name="req"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptJNCController.AuditorSummary(Appointment.Entity.ApplyOrderReq)">
|
||||
<summary>
|
||||
确定单后续审批
|
||||
</summary>
|
||||
<param name="req"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptJNCController.RejectSummary(Appointment.Entity.ApplyOrderReq)">
|
||||
<summary>
|
||||
被驳回
|
||||
</summary>
|
||||
<param name="req"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptJNCController.ManualCopy(Appointment.Entity.ApptSendReq)">
|
||||
<summary>
|
||||
手动抄送
|
||||
</summary>
|
||||
<param name="req"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptJNCController.AddReply(Appointment.Entity.AddMsgReq)">
|
||||
<summary>
|
||||
信息回复
|
||||
</summary>
|
||||
<param name="req"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptJNCController.GetModel(Appointment.Entity.SummaryJncModelReq)">
|
||||
<summary>
|
||||
根据主键获取实体
|
||||
</summary>
|
||||
<param name="req"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptJNCController.SummaryPager(Appointment.Entity.SummaryJNCPageReq)">
|
||||
<summary>
|
||||
分页预订列表
|
||||
</summary>
|
||||
<param name="req"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptJNCController.AuditorLogTree(Appointment.Entity.SummaryJncModelReq)">
|
||||
<summary>
|
||||
获取审批流程
|
||||
</summary>
|
||||
<param name="req"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptJNCController.Disparity(Appointment.Entity.SummaryJncModelReq)">
|
||||
<summary>
|
||||
订单数据差距
|
||||
</summary>
|
||||
<param name="req"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptJNCController.GetReplyPicList(Appointment.Entity.SummaryJncModelReq)">
|
||||
<summary>
|
||||
返回回复中的图片列表
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:Appointment.Api.Controllers.ApptTypeController">
|
||||
<summary>
|
||||
预订类型接口
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptTypeController.Add(Appointment.Entity.ApptTypeAddReq)">
|
||||
<summary>
|
||||
预订类型 添加
|
||||
</summary>
|
||||
<param name="req">status不填写</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptTypeController.Delete(Appointment.Entity.ApptType)">
|
||||
<summary>
|
||||
预订类型 删除
|
||||
</summary>
|
||||
<param name="req">根据id删除一条数据</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptTypeController.Update(Appointment.Entity.ApptType)">
|
||||
<summary>
|
||||
预订类型更新
|
||||
</summary>
|
||||
<param name="req">根据id更新ApptName、Remark</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptTypeController.GetModel(Appointment.Entity.ApptType)">
|
||||
<summary>
|
||||
预订类型获取实体
|
||||
</summary>
|
||||
<param name="req">根据id获取实体</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptTypeController.GetList(Appointment.Entity.ApptType)">
|
||||
<summary>
|
||||
预订类型列表
|
||||
</summary>
|
||||
<param name="req">
|
||||
Id:0-忽略,其他-指定;
|
||||
ApptName:根据类型名称模糊查询;
|
||||
</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.ApptTypeController.Page(Appointment.Entity.CommPageReq)">
|
||||
<summary>
|
||||
预订类型分页
|
||||
</summary>
|
||||
<param name="req">
|
||||
Keywords-根据类型名称模糊查询;
|
||||
</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:Appointment.Api.Controllers.UserController">
|
||||
<summary>
|
||||
登录接口
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.UserController.UserNameLogin(Appointment.Entity.UserLoginAccountReq)">
|
||||
<summary>
|
||||
管理人员 微信小程序授权登录
|
||||
</summary>
|
||||
<param name="req"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.UserController.WxLogin(Appointment.Entity.UserLoginCodeReq)">
|
||||
<summary>
|
||||
管理人员微信小程序登录
|
||||
</summary>
|
||||
<param name="req">wx.login下的code</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.UserController.WxServiceSet(Appointment.Entity.WxServiceSetRes)">
|
||||
<summary>
|
||||
绑定微信服务号OpenId
|
||||
</summary>
|
||||
<param name="req"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.UserController.GetUserAll(Appointment.Entity.BindUserReq)">
|
||||
<summary>
|
||||
获取所有用户
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.Controllers.UserController.GetBindUser(Appointment.Entity.BindUserReq)">
|
||||
<summary>
|
||||
获取已绑定小程序与公众号的用户列表(不包含本用户)
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Appointment.Api.SwaggerSetUp.AddSwaggerSetup(Microsoft.Extensions.DependencyInjection.IServiceCollection)">
|
||||
<summary>
|
||||
注册Swagger服务
|
||||
</summary>
|
||||
<param name="services"></param>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
@@ -0,0 +1,127 @@
|
||||
using Appointment.Entity;
|
||||
using Appointment.IRepository;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Appointment.Api.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 预订审核节点接口
|
||||
/// </summary>
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class ApptAuditorController : ControllerBase
|
||||
{
|
||||
IApptAuditorRepo _ApptAuditorRepo;
|
||||
IManagerGroup _ManagerGroup;
|
||||
public ApptAuditorController(IApptAuditorRepo apptAuditorRepo, IManagerGroup managerGroup)
|
||||
{
|
||||
_ApptAuditorRepo = apptAuditorRepo;
|
||||
_ManagerGroup = managerGroup;
|
||||
}
|
||||
|
||||
// ---- 组别
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有组别
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Route("GroupList")]
|
||||
[HttpPost]
|
||||
public ApiResult<List<UcGroup>> GroupList()
|
||||
{
|
||||
return _ManagerGroup.GetAll();
|
||||
}
|
||||
|
||||
// ---- 审核流程管理
|
||||
|
||||
/// <summary>
|
||||
/// 审核流程 添加节点
|
||||
/// </summary>
|
||||
/// <param name="req">
|
||||
/// apptTypeId:审核类型;
|
||||
/// opGroup:角色代码;
|
||||
/// opDescript:角色名称;
|
||||
/// pid:前阶段审核主键,第一级审核填0;
|
||||
/// </param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("Add")]
|
||||
public ApiResult<ApptAuditor> Add(ApptAuditor req)
|
||||
{
|
||||
return _ApptAuditorRepo.Add(req);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 核流程 删除
|
||||
/// </summary>
|
||||
/// <param name="req">
|
||||
/// id:要删除的节点;有子节点时不允许删除
|
||||
/// </param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("Delete")]
|
||||
public ApiResult Delete(ApptAuditor req)
|
||||
{
|
||||
return _ApptAuditorRepo.Delete(req.Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取实体
|
||||
/// </summary>
|
||||
/// <param name="req">
|
||||
/// id:主键;
|
||||
/// </param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("GetModel")]
|
||||
public ApiResult<ApptAuditor> GetModel(ApptAuditor req)
|
||||
{
|
||||
return _ApptAuditorRepo.GetModel(req.Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 预订审核 审核列表
|
||||
/// </summary>
|
||||
/// <param name="req">
|
||||
/// id:大于0-指定主键;
|
||||
/// apptTypeId:大于0-指定审核类型;
|
||||
/// opGroup:不为空-指定组别代码;
|
||||
/// opDescript:不为空-指定组别名称;
|
||||
/// </param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("GetList")]
|
||||
public ApiResult<List<ApptAuditor>> GetList(ApptAuditor req)
|
||||
{
|
||||
return _ApptAuditorRepo.GetList(req);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 预订审核 分页
|
||||
/// </summary>
|
||||
/// <param name="req">
|
||||
/// Keywords:角色名称模糊查询
|
||||
/// </param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("Page")]
|
||||
public ApiResult<PagerData<ApptAuditor>> Page(CommPageReq req)
|
||||
{
|
||||
return _ApptAuditorRepo.Page(req);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取预订审核线状结构
|
||||
/// </summary>
|
||||
/// <param name="req">
|
||||
/// apptTypeId:审核类型;
|
||||
/// </param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("AuditorLine")]
|
||||
public ApiResult<ApptAuditor> AuditorLine(ApptAuditor req)
|
||||
{
|
||||
return _ApptAuditorRepo.AuditorLine(req.ApptTypeId);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,185 @@
|
||||
using Appointment.Entity;
|
||||
using Appointment.IRepository;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Appointment.Api.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 预订接口
|
||||
/// </summary>
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class ApptController : ControllerBase
|
||||
{
|
||||
IApptRepo _ApptRepo;
|
||||
public ApptController(IApptRepo apptRepo)
|
||||
{
|
||||
_ApptRepo = apptRepo;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据时间段获取可使用的会议厅资源
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("UsableMeeting")]
|
||||
public ApiResult<List<MeetingRes>> UsableMeeting(MeetingReq req)
|
||||
{
|
||||
return _ApptRepo.UsableMeetingList(req);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据日期与场次获取可使用会议厅资源
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("UsableMeetingByDay")]
|
||||
public ApiResult<List<ResCode>> UsableMeetingByDay(UsableMeetingReq req)
|
||||
{
|
||||
return _ApptRepo.UsableMeeting(req);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取可使用的房间资源
|
||||
/// </summary>
|
||||
/// <param name="req">启始时间(默认从昨天开始)</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("UsableRoom")]
|
||||
public ApiResult<List<UsableRoomRes>> UsableRoom(UsableRoomReq req)
|
||||
{
|
||||
return _ApptRepo.UsableRoom(req);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据时间段获取房类最小可用数
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("UsableRoomMin")]
|
||||
public ApiResult<List<UsableRoomRes>> UsableRoomMin(UsableRoomReq req)
|
||||
{
|
||||
return _ApptRepo.UsableRoomMin(req);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取备注列表项
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost("RemarkLis")]
|
||||
public ApiResult<List<string>> RemarkList()
|
||||
{
|
||||
return _ApptRepo.RemarkList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 预订提交
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("Add")]
|
||||
public ApiResult Add(ApptSummaryReq req)
|
||||
{
|
||||
return _ApptRepo.Add(req);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 预订审核
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("ApptAudit")]
|
||||
public ApiResult ApptAudit(ApptAuditReq req)
|
||||
{
|
||||
return _ApptRepo.ApptAudit(req);
|
||||
}
|
||||
|
||||
[HttpPost("CancelAudit")]
|
||||
public ApiResult CancelAudit(ApptAuditReq req)
|
||||
{
|
||||
return _ApptRepo.CancelAudit(req);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 转审批
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("TransferAudit")]
|
||||
public ApiResult TransferAudit(TransferAuditReq req)
|
||||
{
|
||||
return _ApptRepo.TransferAudit(req);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 抄送
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("ApptSend")]
|
||||
public ApiResult ApptSend(ApptSendReq req)
|
||||
{
|
||||
return _ApptRepo.ApptSend(req);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取实体
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("GetModel")]
|
||||
public ApiResult<ApptSummaryReq> GetModel(ApptSummaryReq req)
|
||||
{
|
||||
return _ApptRepo.GetModel(req.Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 我发起的预订列表列表
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("MyApptApplyPageReq")]
|
||||
public ApiResult<PagerData<ApptSummaryReq>> MyApptApplyPageReq(MyApptApplyPageReq req)
|
||||
{
|
||||
return _ApptRepo.MyApptApplyPageReq(req);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取我待审核的
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("MyPartakePage")]
|
||||
public ApiResult<PagerData<ApptSummaryReq>> MyPartakePage(MyApptAuditPageReq req)
|
||||
{
|
||||
return _ApptRepo.MyPartakePage(req);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取预订审核记录表
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("AuditorLogTree")]
|
||||
public ApiResult<AuditorLogTreeRes> AuditorLogTree(CommIntReq req)
|
||||
{
|
||||
return _ApptRepo.AuditorLogTree(req);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测试
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("Demo")]
|
||||
public ApiResult Demo(CommPageReq req)
|
||||
{
|
||||
return _ApptRepo.Demo(req);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
using Appointment.Entity;
|
||||
using Appointment.IRepository;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Appointment.Api.Controllers
|
||||
{
|
||||
[Route("api/[controller]/[action]")]
|
||||
[ApiController]
|
||||
public class ApptJNCController : ControllerBase
|
||||
{
|
||||
IApptRepoJNC apptRepoJNC;
|
||||
|
||||
public ApptJNCController(IApptRepoJNC _apptRepoJNC)
|
||||
{
|
||||
apptRepoJNC = _apptRepoJNC;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建新的预订单
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public ApiResult<int> AddSummary(AddSummaryJncReq req)
|
||||
{
|
||||
return apptRepoJNC.AddApptSummary(req);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 修改暂订单
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public ApiResult<int> UpdateSummary(UpdateSummaryReq req)
|
||||
{
|
||||
return apptRepoJNC.UpdateSummary(req);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 申请确定单
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public ApiResult ApplyOrder(ApplyOrderReq req)
|
||||
{
|
||||
return apptRepoJNC.ApplyOrder(req);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 取消OA单
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public ApiResult Cancel(ApplyOrderReq req)
|
||||
{
|
||||
return apptRepoJNC.Cancel(req);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 确定单后续审批
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public ApiResult AuditorSummary(ApplyOrderReq req)
|
||||
{
|
||||
return apptRepoJNC.AuditorSummary(req);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 被驳回
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public ApiResult RejectSummary(ApplyOrderReq req)
|
||||
{
|
||||
return apptRepoJNC.RejectSummary(req);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 手动抄送
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public ApiResult ManualCopy(ApptSendReq req)
|
||||
{
|
||||
return apptRepoJNC.ManualCopy(req);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 信息回复
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public ApiResult AddReply(AddMsgReq req)
|
||||
{
|
||||
return apptRepoJNC.AddReply(req);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取实体
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public ApiResult<SummaryJncDetailRep> GetModel(SummaryJncModelReq req)
|
||||
{
|
||||
return apptRepoJNC.GetSummaryModel(req);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页预订列表
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public ApiResult<PagerData<SummaryJncDetailRep>> SummaryPager(SummaryJNCPageReq req)
|
||||
{
|
||||
return apptRepoJNC.ApptSummaryPager(req);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取审批流程
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public ApiResult<AuditorLogReq> AuditorLogTree(SummaryJncModelReq req)
|
||||
{
|
||||
return apptRepoJNC.AuditorLogTree(req);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 订单数据差距
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public ApiResult<List<DisparityReq>> Disparity(SummaryJncModelReq req)
|
||||
{
|
||||
return apptRepoJNC.Disparity(req);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 返回回复中的图片列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public ApiResult<List<string>> GetReplyPicList(SummaryJncModelReq req)
|
||||
{
|
||||
return apptRepoJNC.GetReplyPicList(req);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
using Appointment.Entity;
|
||||
using Appointment.IRepository;
|
||||
using Appointment.Repository;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Appointment.Api.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 预订类型接口
|
||||
/// </summary>
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class ApptTypeController : ControllerBase
|
||||
{
|
||||
IApptTypeRepo _ApptTypeRepo;
|
||||
public ApptTypeController(IApptTypeRepo apptTypeRepo)
|
||||
{
|
||||
_ApptTypeRepo = apptTypeRepo;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 预订类型 添加
|
||||
/// </summary>
|
||||
/// <param name="req">status不填写</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("Add")]
|
||||
public ApiResult<ApptType> Add(ApptTypeAddReq req)
|
||||
{
|
||||
return _ApptTypeRepo.Add(req);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 预订类型 删除
|
||||
/// </summary>
|
||||
/// <param name="req">根据id删除一条数据</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("Delete")]
|
||||
public ApiResult Delete(ApptType req)
|
||||
{
|
||||
return _ApptTypeRepo.Delete(req.Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 预订类型更新
|
||||
/// </summary>
|
||||
/// <param name="req">根据id更新ApptName、Remark</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("Update")]
|
||||
public ApiResult<ApptType> Update(ApptType req)
|
||||
{
|
||||
return _ApptTypeRepo.Update(req);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 预订类型获取实体
|
||||
/// </summary>
|
||||
/// <param name="req">根据id获取实体</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("GetModel")]
|
||||
public ApiResult<ApptType> GetModel(ApptType req)
|
||||
{
|
||||
return _ApptTypeRepo.GetModel(req.Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 预订类型列表
|
||||
/// </summary>
|
||||
/// <param name="req">
|
||||
/// Id:0-忽略,其他-指定;
|
||||
/// ApptName:根据类型名称模糊查询;
|
||||
/// </param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("GetList")]
|
||||
public ApiResult<List<ApptType>> GetList(ApptType req)
|
||||
{
|
||||
return _ApptTypeRepo.GetList(req);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 预订类型分页
|
||||
/// </summary>
|
||||
/// <param name="req">
|
||||
/// Keywords-根据类型名称模糊查询;
|
||||
/// </param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("Page")]
|
||||
public ApiResult<PagerData<ApptType>> Page(CommPageReq req)
|
||||
{
|
||||
return _ApptTypeRepo.Page(req);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using Appointment.Entity;
|
||||
using Appointment.IRepository;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Appointment.Api.Controllers
|
||||
{
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class DemoController : ControllerBase
|
||||
{
|
||||
private IApptRepo apptRepo;
|
||||
|
||||
public DemoController(IApptRepo _apptRepo)
|
||||
{
|
||||
apptRepo = _apptRepo;
|
||||
}
|
||||
|
||||
[HttpGet("show")]
|
||||
public IActionResult Show()
|
||||
{
|
||||
return Ok("ok");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
using Appointment.Entity;
|
||||
using Appointment.IRepository;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Appointment.Api.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 登录接口
|
||||
/// </summary>
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class UserController : ControllerBase
|
||||
{
|
||||
IUserRepo _UserRepo;
|
||||
IApptRepo _ApptRepo;
|
||||
public UserController(IUserRepo userRepo, IApptRepo apptRep)
|
||||
{
|
||||
_UserRepo = userRepo;
|
||||
_ApptRepo = apptRep;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 管理人员 微信小程序授权登录
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("UserNameLogin")]
|
||||
public ApiResult<UserInfoRes> UserNameLogin(UserLoginAccountReq req)
|
||||
{
|
||||
return _UserRepo.UserNameLogin(req.UserName, req.UserPwd, req.Code, req.Hotelid);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 管理人员微信小程序登录
|
||||
/// </summary>
|
||||
/// <param name="req">wx.login下的code</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("WxLogin")]
|
||||
public ApiResult<UserInfoRes> WxLogin(UserLoginCodeReq req)
|
||||
{
|
||||
return _UserRepo.WxLogin(req.Code, req.Hotelid);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绑定微信服务号OpenId
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("WxServiceSet")]
|
||||
public ApiResult WxServiceSet(WxServiceSetRes req)
|
||||
{
|
||||
return _UserRepo.WxServiceSet(req);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有用户
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost("GetUserAll")]
|
||||
public ApiResult<List<LoginUserRes>> GetUserAll(BindUserReq req = null)
|
||||
{
|
||||
return _UserRepo.GetSendUserList(req);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取已绑定小程序与公众号的用户列表(不包含本用户)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost("GetTransferAudit")]
|
||||
public ApiResult<List<LoginUserRes>> GetBindUser(BindUserReq req)
|
||||
{
|
||||
return _UserRepo.GetTransferAuditUserList(req);
|
||||
}
|
||||
}
|
||||
}
|
||||
33
api_v1/Appointment.Api/Appointment.Api/Program.cs
Normal file
33
api_v1/Appointment.Api/Appointment.Api/Program.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Appointment.Api
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
CreateHostBuilder(args).Build().Run();
|
||||
}
|
||||
|
||||
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
||||
Host.CreateDefaultBuilder(args)
|
||||
.ConfigureLogging((context, loggingBuilder) =>
|
||||
{
|
||||
loggingBuilder.AddFilter("System", LogLevel.Warning);
|
||||
loggingBuilder.AddFilter("Microsoft", LogLevel.Warning);
|
||||
loggingBuilder.AddLog4Net();
|
||||
})
|
||||
.ConfigureWebHostDefaults(webBuilder =>
|
||||
{
|
||||
// webBuilder.UseUrls("http://*:8082");
|
||||
webBuilder.UseStartup<Startup>();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:54928",
|
||||
"sslPort": 0
|
||||
}
|
||||
},
|
||||
"$schema": "http://json.schemastore.org/launchsettings.json",
|
||||
"profiles": {
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "weatherforecast",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"nativeDebugging": true
|
||||
},
|
||||
"Appointment.Api": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "weatherforecast",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
//"applicationUrl": "http://localhost:54928"
|
||||
"applicationUrl": "http://127.0.0.1:8062"
|
||||
}
|
||||
}
|
||||
}
|
||||
85
api_v1/Appointment.Api/Appointment.Api/Startup.cs
Normal file
85
api_v1/Appointment.Api/Appointment.Api/Startup.cs
Normal file
@@ -0,0 +1,85 @@
|
||||
using Appointment.Api.Utility;
|
||||
using Appointment.IRepository;
|
||||
using Appointment.Repository;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Server.Kestrel.Core;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Appointment.Api
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
public Startup(IConfiguration configuration)
|
||||
{
|
||||
Configuration = configuration;
|
||||
}
|
||||
|
||||
public IConfiguration Configuration { get; }
|
||||
|
||||
// This method gets called by the runtime. Use this method to add services to the container.
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddSwaggerSetup();
|
||||
|
||||
services.AddControllers(options =>
|
||||
{
|
||||
options.Filters.Add(typeof(CustomExceptionFilterAttribute));
|
||||
});
|
||||
|
||||
//
|
||||
services.AddTransient<IManagerGroup, ManagerGroup>();
|
||||
services.AddTransient<IApptTypeRepo, ApptTypeRepo>();
|
||||
services.AddTransient<IApptAuditorRepo, ApptAuditorRepo>();
|
||||
services.AddTransient<IApptRepo, ApptRepo>();
|
||||
services.AddTransient<IUserRepo, UserRepo>();
|
||||
services.AddTransient<IApptRepo, ApptRepo>();
|
||||
services.AddTransient<IApptLogRepo, ApptLogRepo>();
|
||||
services.AddTransient<IApptRepoJNC, ApptRepoJNC>();
|
||||
|
||||
}
|
||||
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
// <20><><EFBFBD>û<EFBFBD><C3BB><EFBFBD>Http<74><70>ʾ<EFBFBD><CABE>Body<64><79><EFBFBD><EFBFBD>
|
||||
app.Use(next => new RequestDelegate(
|
||||
async context =>
|
||||
{
|
||||
context.Request.EnableBuffering();
|
||||
await next(context);
|
||||
}
|
||||
));
|
||||
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
|
||||
app.UseSwagger();
|
||||
app.UseSwaggerUI(c =>
|
||||
{
|
||||
c.SwaggerEndpoint($"/swagger/V1/swagger.json", "Appointment.Api V1");
|
||||
c.RoutePrefix = "sw";
|
||||
});
|
||||
|
||||
app.UseRouting();
|
||||
|
||||
app.UseAuthorization();
|
||||
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapControllers();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.Filters;
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.IO;
|
||||
using Appointment.Entity;
|
||||
|
||||
namespace Appointment.Api.Utility
|
||||
{
|
||||
public class CustomExceptionFilterAttribute : ExceptionFilterAttribute
|
||||
{
|
||||
private readonly log4net.ILog _logger = log4net.LogManager.GetLogger(typeof(CustomExceptionFilterAttribute));
|
||||
public override void OnException(ExceptionContext context)
|
||||
{
|
||||
// 异常未被处理
|
||||
if (!context.ExceptionHandled)
|
||||
{
|
||||
// 文本日志
|
||||
StringBuilder msg = new StringBuilder();
|
||||
msg.Append("出现异常:");
|
||||
msg.AppendFormat("请求地址:{0} ", context.HttpContext.Request.Path);
|
||||
string reqMethod = context.HttpContext.Request.Method;
|
||||
msg.AppendFormat("请求类型:{0}", reqMethod);
|
||||
|
||||
Dictionary<string, string> dict = new Dictionary<string, string>();
|
||||
if (reqMethod == "GET" && context.HttpContext.Request.Query.Count > 0)
|
||||
{
|
||||
msg.AppendFormat("请求参数:{0} ", context.HttpContext.Request.QueryString.ToString());
|
||||
}
|
||||
else if (reqMethod == "POST"
|
||||
&& context.HttpContext.Request.ContentType != null
|
||||
&& context.HttpContext.Request.ContentType.Contains("form-data")
|
||||
&& context.HttpContext.Request.ContentLength.Value > 0)
|
||||
{
|
||||
List<string> keys = context.HttpContext.Request.Form.Keys.ToList();
|
||||
if (keys.Count > 0)
|
||||
{
|
||||
msg.Append("请求参数:");
|
||||
foreach (var item in keys)
|
||||
{
|
||||
msg.AppendFormat("{0}={1},", item, context.HttpContext.Request.Form[item].ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (reqMethod == "POST"
|
||||
&& context.HttpContext.Request.ContentType != null
|
||||
&& context.HttpContext.Request.ContentType == "application/json"
|
||||
&& context.HttpContext.Request.ContentLength > 0)
|
||||
{
|
||||
context.HttpContext.Request.Body.Position = 0;
|
||||
StreamReader sr = new StreamReader(context.HttpContext.Request.Body);
|
||||
string body = sr.ReadToEndAsync().Result;
|
||||
msg.AppendFormat("请求参数:Body:{0} ", body);
|
||||
context.HttpContext.Request.Body.Position = 0;
|
||||
}
|
||||
_logger.Error(msg.ToString() + context.Exception);
|
||||
|
||||
// 返回前端
|
||||
DateTime now = DateTime.Now;
|
||||
context.Result = new JsonResult(ApiResult.Failed(context.Exception.Message, null));
|
||||
context.ExceptionHandled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.OpenApi.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Appointment.Api
|
||||
{
|
||||
public static class SwaggerSetUp
|
||||
{
|
||||
/// <summary>
|
||||
/// 注册Swagger服务
|
||||
/// </summary>
|
||||
/// <param name="services"></param>
|
||||
public static void AddSwaggerSetup(this IServiceCollection services)
|
||||
{
|
||||
if (services == null) throw new ArgumentNullException(nameof(services));
|
||||
|
||||
var apiName = "Appointment.Api";
|
||||
|
||||
services.AddSwaggerGen(c =>
|
||||
{
|
||||
//
|
||||
c.SwaggerDoc("V1", new OpenApiInfo
|
||||
{
|
||||
// {ApiName} 定义成全局变量,方便修改
|
||||
Version = "V1",
|
||||
Title = $"{apiName} 接口文档",
|
||||
Description = $"{apiName} API V1",
|
||||
});
|
||||
//c.OrderActionsBy(o => o.RelativePath);
|
||||
|
||||
|
||||
var api = Path.Combine(AppContext.BaseDirectory, "Appointment.Api.xml");
|
||||
c.IncludeXmlComments(api, true);
|
||||
|
||||
var entity = Path.Combine(AppContext.BaseDirectory, "Appointment.Entity.xml");
|
||||
c.IncludeXmlComments(entity, true);
|
||||
|
||||
// 获取ReadMe项目实体的xml注释文件的目录
|
||||
var Irepository = Path.Combine(AppContext.BaseDirectory, "Appointment.IRepository.xml");
|
||||
c.IncludeXmlComments(Irepository);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
10
api_v1/Appointment.Api/Appointment.Api/Utility/htmlpage.html
Normal file
10
api_v1/Appointment.Api/Appointment.Api/Utility/htmlpage.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
}
|
||||
}
|
||||
28
api_v1/Appointment.Api/Appointment.Api/appsettings.json
Normal file
28
api_v1/Appointment.Api/Appointment.Api/appsettings.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"ConnectionString": "server=.;uid=sa;pwd=dlhis123;database=hotel;",
|
||||
"NoPrefix": "JNCYXB", // 预定编号前缀
|
||||
"ApptType": "2", // 审核类型:1-默认模式,2-江南春模式
|
||||
"WeChat": { // 小程序
|
||||
"AppId": "wx7e511954cc1c23f7",
|
||||
"AppSecret": "9bef838143040d1972903089ab5429f3"
|
||||
},
|
||||
"AccessTokenMode": "2", // 获取AccessToken模式:1-爱住网获取,其他-本地获取
|
||||
"WeChatService": { // 服务号
|
||||
// 江南春
|
||||
//"AppId": "wx3f193488e04b2ed8",
|
||||
//"AppName": "江南春",
|
||||
//"AppSecret": "aaa88fba85e536c12ebc2e90915bdf46"
|
||||
"AppId": "wx2b6e92e9e0c6025f",
|
||||
"AppName": "香堤湾",
|
||||
"AppSecret": "1bbc7d71ea3154b803f438698d87c458"
|
||||
},
|
||||
"Hotelid": "oatest",
|
||||
"AllowedHosts": "*"
|
||||
}
|
||||
10
api_v1/Appointment.Api/Appointment.Api/htmlpage.html
Normal file
10
api_v1/Appointment.Api/Appointment.Api/htmlpage.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>启动</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
44
api_v1/Appointment.Api/Appointment.Api/log4net.Config
Normal file
44
api_v1/Appointment.Api/Appointment.Api/log4net.Config
Normal file
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<log4net>
|
||||
<!-- Define some output appenders -->
|
||||
<appender name="rollingAppender" type="log4net.Appender.RollingFileAppender">
|
||||
<file value="log\log.txt" />
|
||||
<!--追加日志内容-->
|
||||
<appendToFile value="true" />
|
||||
|
||||
<!--防止多线程时不能写Log,官方说线程非安全-->
|
||||
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
|
||||
|
||||
<!--可以为:Once|Size|Date|Composite-->
|
||||
<!--Composite为Size和Date的组合-->
|
||||
<rollingStyle value="Composite" />
|
||||
|
||||
<!--当备份文件时,为文件名加的后缀-->
|
||||
<datePattern value="yyyyMMdd.TXT" />
|
||||
|
||||
<!--日志最大个数,都是最新的-->
|
||||
<!--rollingStyle节点为Size时,只能有value个日志-->
|
||||
<!--rollingStyle节点为Composite时,每天有value个日志-->
|
||||
<maxSizeRollBackups value="20" />
|
||||
|
||||
<!--可用的单位:KB|MB|GB-->
|
||||
<maximumFileSize value="3MB" />
|
||||
|
||||
<!--置为true,当前最新日志文件名永远为file节中的名字-->
|
||||
<staticLogFileName value="true" />
|
||||
|
||||
<!--输出级别在INFO和ERROR之间的日志-->
|
||||
<filter type="log4net.Filter.LevelRangeFilter">
|
||||
<param name="LevelMin" value="ALL" />
|
||||
<param name="LevelMax" value="FATAL" />
|
||||
</filter>
|
||||
<layout type="log4net.Layout.PatternLayout">
|
||||
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline"/>
|
||||
</layout>
|
||||
</appender>
|
||||
<root>
|
||||
<priority value="ALL"/>
|
||||
<level value="ALL"/>
|
||||
<appender-ref ref="rollingAppender" />
|
||||
</root>
|
||||
</log4net>
|
||||
Reference in New Issue
Block a user