|
@@ -23,14 +23,33 @@ public class InviteCodeController : BaseController
|
|
_inviteCodeApplication = inviteCodeApplication;
|
|
_inviteCodeApplication = inviteCodeApplication;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 获取添加邀请码基础数据
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ [HttpGet("basedata")]
|
|
|
|
+ public async Task<Dictionary<string, object>> GetBasedataAsync()
|
|
|
|
+ {
|
|
|
|
+ return new Dictionary<string, object>
|
|
|
|
+ {
|
|
|
|
+ { "OrgName", await _inviteCodeApplication.GetInviteCodeItemsAsync().Where(m => m.ParentOrgId == null)
|
|
|
|
+ .Select(m => new Kv{ Key = m.Id, Value = m.OrgName}).ToListAsync() }
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 获取邀请码集合
|
|
/// 获取邀请码集合
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
[HttpGet]
|
|
- public async Task<PagedDto<InviteCode>> GetInviteCodeItemsAsync([FromQuery]GetInviteCodeItemsInDto dto)
|
|
|
|
|
|
+ public async Task<PagedDto<InviteCode>> GetInviteCodeItemsAsync([FromQuery] GetInviteCodeItemsInDto dto)
|
|
=> (await _inviteCodeApplication.GetInviteCodeItemsAsync().ToPagedListAsync(dto)).ToPaged();
|
|
=> (await _inviteCodeApplication.GetInviteCodeItemsAsync().ToPagedListAsync(dto)).ToPaged();
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 添加部门邀请码
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="dto"></param>
|
|
|
|
+ /// <returns></returns>
|
|
[HttpPost]
|
|
[HttpPost]
|
|
public async Task AddInviteCodeAsync([FromBody] AddInviteCodeInDto dto)
|
|
public async Task AddInviteCodeAsync([FromBody] AddInviteCodeInDto dto)
|
|
=> await _inviteCodeApplication.AddInviteCodeAsync(dto);
|
|
=> await _inviteCodeApplication.AddInviteCodeAsync(dto);
|