Commit db5395b9a868a0ab415cce43096dc63dfaa3332a
1 parent
377b1090
更新多个.DS_Store文件,调整MqttPublisherService以支持生产环境配置,优化UavAdvertisementService以处理字符串到…
…整数的转换,修复UavAgentProfitConfigService中的返回值格式,更新UavAdvertisementCrInput以使用字符串类型的isEnabled属性。
Showing
9 changed files
with
17 additions
and
5 deletions
.DS_Store
No preview for this file type
netcore/.DS_Store
No preview for this file type
netcore/src/.DS_Store
No preview for this file type
netcore/src/Application/.DS_Store
No preview for this file type
netcore/src/Application/NCC.API/.DS_Store
No preview for this file type
netcore/src/Modularity/Extend/NCC.Extend.Entitys/uavAdvertisement/Dto/UavAdvertisementCrInput.cs
| ... | ... | @@ -23,6 +23,7 @@ namespace NCC.Extend.Entitys.Dto.UavAdvertisement |
| 23 | 23 | /// 广告排序 |
| 24 | 24 | /// </summary> |
| 25 | 25 | public string sortOrder { get; set; } |
| 26 | + | |
| 26 | 27 | /// <summary> |
| 27 | 28 | /// 代理商ID |
| 28 | 29 | /// </summary> |
| ... | ... | @@ -36,7 +37,6 @@ namespace NCC.Extend.Entitys.Dto.UavAdvertisement |
| 36 | 37 | /// <summary> |
| 37 | 38 | /// 是否启用(1=启用,0=禁用) |
| 38 | 39 | /// </summary> |
| 39 | - public int isEnabled { get; set; } | |
| 40 | - | |
| 40 | + public string isEnabled { get; set; } | |
| 41 | 41 | } |
| 42 | 42 | } | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend/MqttPublisherService.cs
| ... | ... | @@ -96,7 +96,7 @@ public class MqttPublisherService : IMqttPublisherService, ITransient, IDisposab |
| 96 | 96 | private string GetClientId() |
| 97 | 97 | { |
| 98 | 98 | // 手动设置:true为生产环境,false为开发环境 |
| 99 | - bool isProduction = false; // 这里可以手动调整 | |
| 99 | + bool isProduction = true; // 这里可以手动调整 | |
| 100 | 100 | |
| 101 | 101 | if (isProduction) |
| 102 | 102 | { | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend/UavAdvertisementService.cs
| ... | ... | @@ -149,9 +149,21 @@ namespace NCC.Extend.UavAdvertisement |
| 149 | 149 | { |
| 150 | 150 | var entity = input.Adapt<UavAdvertisementEntity>(); |
| 151 | 151 | entity.Id = YitIdHelper.NextId().ToString(); |
| 152 | - entity.ImageUrl = entity.ImageUrl.Replace("\"", ""); | |
| 152 | + entity.ImageUrl = entity.ImageUrl?.Replace("\"", ""); | |
| 153 | 153 | entity.AgentId = _userManager.UserId; |
| 154 | 154 | entity.CreateUser = _userManager.UserId; |
| 155 | + entity.CreateTime = DateTime.Now; | |
| 156 | + // 字符串到整数的强制转换 | |
| 157 | + if (!string.IsNullOrEmpty(input.isEnabled) && int.TryParse(input.isEnabled, out int isEnabledValue)) | |
| 158 | + { | |
| 159 | + entity.IsEnabled = isEnabledValue; | |
| 160 | + } | |
| 161 | + | |
| 162 | + if (!string.IsNullOrEmpty(input.sortOrder) && int.TryParse(input.sortOrder, out int sortOrderValue)) | |
| 163 | + { | |
| 164 | + entity.SortOrder = sortOrderValue; | |
| 165 | + } | |
| 166 | + | |
| 155 | 167 | var isOk = await _db.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandAsync(); |
| 156 | 168 | if (!(isOk > 0)) throw NCCException.Oh(ErrorCode.COM1000); |
| 157 | 169 | } | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend/UavAgentProfitConfigService.cs