2025-04-24 18:31:27 +08:00

124 lines
4.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/************************************************************************************
* Copyright (c) 2017 All Rights Reserved.
* CLR版本4.0.30319.42000
* 机器名称JIAN
* 命名空间Wolf.Project.WebApi.Controllers
* 文件名CommonController
* 版本号v1.0.0.0
* 唯一标识323d1bf7-e520-4040-8fa3-ca029aa3521d
* 当前的用户域JIAN
* 创建人:简玄冰
* 电子邮箱jianxuanhuo1@126.com
* 创建时间2017/6/20 10:06:56
* 描述:
*
* =====================================================================
* 修改标记:
* 修改时间2017/6/20 10:06:56
* 修改人:简玄冰
* 版本号v1.0.0.0
* 描述:
*
/************************************************************************************/
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Http;
using Wolf.Project.Domain.Message;
using Wolf.Project.Domain.Message.Act;
using Wolf.Project.Domain.Message.Common;
using Wolf.Project.Domain.Message.Request;
using Wolf.Project.Domain.Message.Response;
using Wolf.Project.Domain.ViewModel;
using Wolf.Project.Domain.ViewModel.Common;
using Wolf.Project.Infrastructure;
using Wolf.Project.Infrastructure.Common;
using Wolf.Project.Infrastructure.Enumeration;
using Wolf.Project.Infrastructure.Exceptions;
using Wolf.Project.Services;
using Wolf.Project.WebApi.App_Filter;
using Wolf.Project.WebApi.SwaggerExtensions;
using ImportResult = Wolf.Project.Infrastructure.Imports.ImportResult;
namespace Wolf.Project.WebApi.Controllers
{
/// <summary>
/// 区域管理 相关API
/// </summary>
public class DistrictManagerController : BaseAPIController
{
private readonly IDistrictManagerService _districtManagerService;
public DistrictManagerController(IDistrictManagerService districtManagerService)
{
_districtManagerService = districtManagerService;
}
/// <summary>
/// 保存区域管理人
/// </summary>
/// <param name="act"></param>
[HttpPost]
public void SaveDistrictManager(DistrictManagerAct act)
{
if (act.Id == null)
{
_districtManagerService.AddDistrictManager(act, CurrentUser.MerchantID, UserName);
}
else {
_districtManagerService.UpdateDistrictManager(act, CurrentUser.MerchantID, UserName);
}
}
/// <summary>
/// 启用、禁用管理人
/// </summary>
/// <param name="request"></param>
/// <param name="username"></param>
[HttpPost]
public void ChangeDistrictManagerStatus(ChangeStatusRequest request)
{
_districtManagerService.ChangeDistrictManagerStatus(request, UserName);
}
/// <summary>
/// 得到区域管理人列表
/// </summary>
/// <param name="request">请求参数</param>
/// <returns></returns>
[HttpPost]
public PageResult<DistrictManagerListResp> GetDistrictManagerPageList(PagedSearch<DistrictManagerSearchRequest> request)
{
return _districtManagerService.GetDistrictManagerPageList(request, CurrentUser.MerchantID);
}
/// <summary>
/// 得到区域内代理适用于后台因可以得到DistrictManagerId
/// </summary>
/// <param name="request">请求参数</param>
/// <returns></returns>
[HttpPost]
public PageResult<DistrictManagerInResp> GetDistrictManagerInPageList(PagedSearch<DistrictManagerInDependOnIdSearchRequest> request)
{
return _districtManagerService.GetDistrictManagerInPageList(request);
}
/// <summary>
/// 得到区域内代理适用于H5微信端
/// </summary>
/// <param name="request">团队ID</param>
[HttpPost]
public PageResult<DistrictManagerInResp> GetCustomersInDistrictManagerPageList(PagedSearch<Guid> request)
{
return _districtManagerService.GetDistrictManagerInPageList(request,CurrentUser.CustomerID.Value);
}
}
}