/************************************************************************************
* 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
{
///
/// 区域管理 相关API
///
public class DistrictManagerController : BaseAPIController
{
private readonly IDistrictManagerService _districtManagerService;
public DistrictManagerController(IDistrictManagerService districtManagerService)
{
_districtManagerService = districtManagerService;
}
///
/// 保存区域管理人
///
///
[HttpPost]
public void SaveDistrictManager(DistrictManagerAct act)
{
if (act.Id == null)
{
_districtManagerService.AddDistrictManager(act, CurrentUser.MerchantID, UserName);
}
else {
_districtManagerService.UpdateDistrictManager(act, CurrentUser.MerchantID, UserName);
}
}
///
/// 启用、禁用管理人
///
///
///
[HttpPost]
public void ChangeDistrictManagerStatus(ChangeStatusRequest request)
{
_districtManagerService.ChangeDistrictManagerStatus(request, UserName);
}
///
/// 得到区域管理人列表
///
/// 请求参数
///
[HttpPost]
public PageResult GetDistrictManagerPageList(PagedSearch request)
{
return _districtManagerService.GetDistrictManagerPageList(request, CurrentUser.MerchantID);
}
///
/// 得到区域内代理,适用于后台,因可以得到DistrictManagerId
///
/// 请求参数
///
[HttpPost]
public PageResult GetDistrictManagerInPageList(PagedSearch request)
{
return _districtManagerService.GetDistrictManagerInPageList(request);
}
///
/// 得到区域内代理,适用于H5微信端
///
/// 团队ID
[HttpPost]
public PageResult GetCustomersInDistrictManagerPageList(PagedSearch request)
{
return _districtManagerService.GetDistrictManagerInPageList(request,CurrentUser.CustomerID.Value);
}
}
}