增加设备对接接口

This commit is contained in:
Hinse 2021-07-29 19:10:19 +08:00
parent b8788f336a
commit dc1aa3b09f
31 changed files with 539 additions and 47 deletions

View File

@ -226,7 +226,7 @@ namespace Waste.Application
return new ResultInfo(ResultState.FAIL, "旧密码错误");
}
var newpassword = Md5.md5(DESEncrypt.Encrypt(Md5.md5(busienssPwd.NewPwd, 32).ToLower(), account.Secret).ToLower(), 32).ToLower();
await repository.Change<W_Account>().Context.Updateable<W_Account>().SetColumns(x => new W_Account
await dbClient.Updateable<W_Account>().SetColumns(x => new W_Account
{
Password = newpassword
}).Where(x => x.Id == account.Id).ExecuteCommandAsync();

View File

@ -77,5 +77,25 @@ namespace Waste.Application
/// <param name="estatesC2SDto"></param>
/// <returns></returns>
Task<ResultInfo> PostCollectAsync(CollectC2SDto estatesC2SDto);
/// <summary>
/// 获取时间戳
/// </summary>
/// <returns></returns>
int GetTimestamp();
/// <summary>
/// 获取随机数
/// </summary>
/// <returns></returns>
int GetNonce();
/// <summary>
/// 获取签名
/// </summary>
/// <param name="secret"></param>
/// <param name="dataparams"></param>
/// <returns></returns>
string GetUserApiSign(string secret, params string[] dataparams);
}
}

View File

@ -188,7 +188,7 @@ namespace Waste.Application
/// 获取时间戳
/// </summary>
/// <returns></returns>
private static int GetTimestamp()
public int GetTimestamp()
{
DateTime dateTimeStart = TimeZoneInfo.ConvertTimeToUtc(new DateTime(1970, 1, 1, 8, 0, 0));
int timestamp = Convert.ToInt32((DateTime.Now - dateTimeStart).TotalSeconds);
@ -198,7 +198,7 @@ namespace Waste.Application
/// 获取随机数
/// </summary>
/// <returns></returns>
private static int GetNonce()
public int GetNonce()
{
var random = new Random();
int nonce = random.Next(1, Int32.MaxValue);
@ -210,7 +210,7 @@ namespace Waste.Application
/// <param name="secret"></param>
/// <param name="dataparams"></param>
/// <returns></returns>
private static string GetUserApiSign(string secret, params string[] dataparams)
public string GetUserApiSign(string secret, params string[] dataparams)
{
StringBuilder sb = new StringBuilder();
if (dataparams != null && dataparams.Length > 0)
@ -244,6 +244,7 @@ namespace Waste.Application
{
int timestamp = GetTimestamp();
int nonce = GetNonce();
string sign = GetUserApiSign("", data);
var c2s_dto = new SuZhouApiBaseDto<object>
{
@ -254,9 +255,9 @@ namespace Waste.Application
TimeStamp = timestamp,
UserId = UserId
};
var request = new HttpRequestMessage(HttpMethod.Post, url);
var bytes = MessagePackSerializer.Serialize(c2s_dto);
request.Content = new ByteArrayContent(bytes);
var request = new HttpRequestMessage(HttpMethod.Post, url); //发起post请求
byte[] bytes = MessagePackSerializer.Serialize(c2s_dto); //序列化请求数据为byte
request.Content = new ByteArrayContent(bytes); //设置请求信息体
if (type == 2)
{
request.Headers.Add("Accept", "text/plain");

View File

@ -208,7 +208,7 @@ namespace Waste.Application
isfrist = isfrist
});
//上传垃圾数据
//if (myPackage.IsWeight && myPackage.Weight.ToDecimal() >0)
//if (myPackage.IsWeight && myPackage.Weight.ToDecimal() > 0)
//{
// var devicesecret = await repository.Change<W_SZDevice>().Context.Queryable<W_SZDevice>().FirstAsync(x => x.DeviceId == device.Id);
// if (devicesecret != null && !string.IsNullOrEmpty(devicesecret.Secret)

View File

@ -0,0 +1,54 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Waste.Application.ThirdApiInfo
{
/// <summary>
/// 获取设备信息请求数据
/// </summary>
public class GetDevInfoRequestDto
{
/// <summary>
/// 重量
/// </summary>
public decimal Weight { get; set; } = 0;
/// <summary>
/// 机器码
/// </summary>
public string ECode { get; set; }
}
/// <summary>
/// 获取设备信息响应数据
/// </summary>
public class GetDevInfoResponseDto
{
/// <summary>
/// 时间戳
/// </summary>
public int timestamp { get; set; }
/// <summary>
/// 随机数
/// </summary>
public int noncestr { get; set; }
/// <summary>
/// 用户ID
/// </summary>
public string UserId { get; set; }
/// <summary>
/// secret
/// </summary>
public string Secret { get; set; }
/// <summary>
/// secrethash
/// </summary>
public string SecretHash { get; set; }
/// <summary>
/// 设备上报时才会有
/// </summary>
public string DeviceId { get; set; } = "";
}
}

View File

@ -0,0 +1,22 @@
using Nirvana.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Waste.Application.ThirdApiInfo
{
/// <summary>
/// 设备对接接口
/// </summary>
public interface IOpenService
{
/// <summary>
/// 获取上报相关信息
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
Task<ResultInfo> GetDevInfoAsync(GetDevInfoRequestDto data);
}
}

View File

@ -0,0 +1,35 @@
using Furion.DynamicApiController;
using Microsoft.AspNetCore.Mvc;
using Nirvana.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Waste.Application.ThirdApiInfo
{
/// <summary>
/// 开放数据
/// </summary>
[ApiDescriptionSettings("DevApi")]
public class OpenAppService : IDynamicApiController
{
private readonly IOpenService _openService;
public OpenAppService(IOpenService openService)
{
_openService = openService;
}
/// <summary>
/// 获取设备上报相关信息
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
[HttpPost]
[NonUnify]
public async Task<ResultInfo> GetDevInfoAsync(GetDevInfoRequestDto data)
{
return await _openService.GetDevInfoAsync(data);
}
}
}

View File

@ -0,0 +1,64 @@
using Furion;
using Furion.DependencyInjection;
using Nirvana.Common;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Waste.Domain;
namespace Waste.Application.ThirdApiInfo
{
/// <summary>
/// 设备对接接口
/// </summary>
public class OpenService : IOpenService, ITransient
{
private static string ApiUrl = App.Configuration["SZDevPlatSetting:ApiUrl"];
private static string UserId = App.Configuration["SZDevPlatSetting:UserId"];
private static string ApiSecret = App.Configuration["SZDevPlatSetting:ApiSecret"];
private static string ApiSecretHash = App.Configuration["SZDevPlatSetting:ApiSecretHash"];
private readonly ISqlSugarRepository<W_Device> repository;
private readonly SqlSugarClient dbClient;
private readonly ISuZhouService _suZhouService;
public OpenService(ISqlSugarRepository<W_Device> sqlSugarRepository, ISuZhouService suZhouService)
{
repository = sqlSugarRepository;
dbClient = repository.Context;
_suZhouService = suZhouService;
}
/// <summary>
/// 获取设备上报相关信息
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public async Task<ResultInfo> GetDevInfoAsync(GetDevInfoRequestDto data)
{
var device = await dbClient.Queryable<W_Device>().FirstAsync(x => x.Ecode == data.ECode);
if(device == null)
{
return new ResultInfo(ResultState.FAIL, "设备未找到");
}
var devicesecret = await dbClient.Queryable<W_SZDevice>().FirstAsync(x => x.DeviceId == device.Id);
if(devicesecret == null || string.IsNullOrEmpty(devicesecret.Secret)
|| string.IsNullOrEmpty(devicesecret.SecretHash)
|| string.IsNullOrEmpty(devicesecret.DevId))
{
return new ResultInfo(ResultState.FAIL, "设备还未获取验证信息");
}
int timestamp = _suZhouService.GetTimestamp();
int noncestr = _suZhouService.GetNonce();
var returndata = new GetDevInfoResponseDto {
DeviceId = devicesecret.DevId,
noncestr = noncestr,
timestamp = timestamp,
Secret = devicesecret.Secret,
SecretHash = devicesecret.SecretHash,
UserId = UserId
};
return new ResultInfo(ResultState.SUCCESS, "success", returndata);
}
}
}

View File

@ -1106,6 +1106,26 @@
<param name="estatesC2SDto"></param>
<returns></returns>
</member>
<member name="M:Waste.Application.ISuZhouService.GetTimestamp">
<summary>
获取时间戳
</summary>
<returns></returns>
</member>
<member name="M:Waste.Application.ISuZhouService.GetNonce">
<summary>
获取随机数
</summary>
<returns></returns>
</member>
<member name="M:Waste.Application.ISuZhouService.GetUserApiSign(System.String,System.String[])">
<summary>
获取签名
</summary>
<param name="secret"></param>
<param name="dataparams"></param>
<returns></returns>
</member>
<member name="T:Waste.Application.SuZhouService">
<summary>
苏州设备对接平台
@ -1925,6 +1945,92 @@
<param name="data"></param>
<returns></returns>
</member>
<member name="T:Waste.Application.ThirdApiInfo.GetDevInfoRequestDto">
<summary>
获取设备信息请求数据
</summary>
</member>
<member name="P:Waste.Application.ThirdApiInfo.GetDevInfoRequestDto.Weight">
<summary>
重量
</summary>
</member>
<member name="P:Waste.Application.ThirdApiInfo.GetDevInfoRequestDto.ECode">
<summary>
机器码
</summary>
</member>
<member name="T:Waste.Application.ThirdApiInfo.GetDevInfoResponseDto">
<summary>
获取设备信息响应数据
</summary>
</member>
<member name="P:Waste.Application.ThirdApiInfo.GetDevInfoResponseDto.timestamp">
<summary>
时间戳
</summary>
</member>
<member name="P:Waste.Application.ThirdApiInfo.GetDevInfoResponseDto.noncestr">
<summary>
随机数
</summary>
</member>
<member name="P:Waste.Application.ThirdApiInfo.GetDevInfoResponseDto.UserId">
<summary>
用户ID
</summary>
</member>
<member name="P:Waste.Application.ThirdApiInfo.GetDevInfoResponseDto.Secret">
<summary>
secret
</summary>
</member>
<member name="P:Waste.Application.ThirdApiInfo.GetDevInfoResponseDto.SecretHash">
<summary>
secrethash
</summary>
</member>
<member name="P:Waste.Application.ThirdApiInfo.GetDevInfoResponseDto.DeviceId">
<summary>
设备上报时才会有
</summary>
</member>
<member name="T:Waste.Application.ThirdApiInfo.IOpenService">
<summary>
设备对接接口
</summary>
</member>
<member name="M:Waste.Application.ThirdApiInfo.IOpenService.GetDevInfoAsync(Waste.Application.ThirdApiInfo.GetDevInfoRequestDto)">
<summary>
获取上报相关信息
</summary>
<param name="data"></param>
<returns></returns>
</member>
<member name="T:Waste.Application.ThirdApiInfo.OpenAppService">
<summary>
开放数据
</summary>
</member>
<member name="M:Waste.Application.ThirdApiInfo.OpenAppService.GetDevInfoAsync(Waste.Application.ThirdApiInfo.GetDevInfoRequestDto)">
<summary>
获取设备上报相关信息
</summary>
<param name="data"></param>
<returns></returns>
</member>
<member name="T:Waste.Application.ThirdApiInfo.OpenService">
<summary>
设备对接接口
</summary>
</member>
<member name="M:Waste.Application.ThirdApiInfo.OpenService.GetDevInfoAsync(Waste.Application.ThirdApiInfo.GetDevInfoRequestDto)">
<summary>
获取设备上报相关信息
</summary>
<param name="data"></param>
<returns></returns>
</member>
<member name="M:Waste.Application.IWasteService.GetTypeListAsync(Nirvana.Common.QueryParams)">
<summary>
垃圾分类列表

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<?PowerDesigner AppLocale="UTF16" ID="{CE6E2FA3-BA82-4FC8-BCDD-8C9830EF68CF}" Label="" LastModificationDate="1622604918" Name="Waste" Objects="280" Symbols="16" Target="Microsoft SQL Server 2012" Type="{CDE44E21-9669-11D1-9914-006097355D9B}" signature="PDM_DATA_MODEL_XML" version="16.5.0.3982"?>
<?PowerDesigner AppLocale="UTF16" ID="{CE6E2FA3-BA82-4FC8-BCDD-8C9830EF68CF}" Label="" LastModificationDate="1622617277" Name="Waste" Objects="274" Symbols="16" Target="Microsoft SQL Server 2012" Type="{CDE44E21-9669-11D1-9914-006097355D9B}" signature="PDM_DATA_MODEL_XML" version="16.5.0.3982"?>
<!-- do not edit this file -->
<Model xmlns:a="attribute" xmlns:c="collection" xmlns:o="object">
@ -12,7 +12,7 @@
<a:Code>Waste</a:Code>
<a:CreationDate>1619681546</a:CreationDate>
<a:Creator>Administrator</a:Creator>
<a:ModificationDate>1622604918</a:ModificationDate>
<a:ModificationDate>1622606685</a:ModificationDate>
<a:Modifier>Hinse</a:Modifier>
<a:PackageOptionsText>[FolderOptions]
@ -4292,7 +4292,7 @@ Shadow=0</a:DisplayPreferences>
<a:CreationDate>1619689000</a:CreationDate>
<a:ModificationDate>1619689638</a:ModificationDate>
<a:IconMode>-1</a:IconMode>
<a:Rect>((-21190,10129), (-6566,22427))</a:Rect>
<a:Rect>((-20495,10616), (-7261,21940))</a:Rect>
<a:LineColor>12615680</a:LineColor>
<a:FillColor>16570034</a:FillColor>
<a:ShadowColor>12632256</a:ShadowColor>
@ -4344,7 +4344,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:CreationDate>1619689821</a:CreationDate>
<a:ModificationDate>1619689823</a:ModificationDate>
<a:IconMode>-1</a:IconMode>
<a:Rect>((9435,7970), (25356,21168))</a:Rect>
<a:Rect>((10199,8495), (24592,20643))</a:Rect>
<a:LineColor>12615680</a:LineColor>
<a:FillColor>16570034</a:FillColor>
<a:ShadowColor>12632256</a:ShadowColor>
@ -4369,7 +4369,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:CreationDate>1619689847</a:CreationDate>
<a:ModificationDate>1620263978</a:ModificationDate>
<a:IconMode>-1</a:IconMode>
<a:Rect>((-21764,-11100), (-5842,6598))</a:Rect>
<a:Rect>((-21000,-10388), (-6606,5886))</a:Rect>
<a:LineColor>12615680</a:LineColor>
<a:FillColor>16570034</a:FillColor>
<a:ShadowColor>12632256</a:ShadowColor>
@ -4394,7 +4394,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:CreationDate>1619690248</a:CreationDate>
<a:ModificationDate>1619690516</a:ModificationDate>
<a:IconMode>-1</a:IconMode>
<a:Rect>((-4795,-1258), (11993,8340))</a:Rect>
<a:Rect>((-3984,-883), (11182,7965))</a:Rect>
<a:LineColor>12615680</a:LineColor>
<a:FillColor>16570034</a:FillColor>
<a:ShadowColor>12632256</a:ShadowColor>
@ -4419,7 +4419,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:CreationDate>1619690618</a:CreationDate>
<a:ModificationDate>1620263981</a:ModificationDate>
<a:IconMode>-1</a:IconMode>
<a:Rect>((-4298,-11683), (11192,-2085))</a:Rect>
<a:Rect>((-3557,-11308), (10451,-2460))</a:Rect>
<a:LineColor>12615680</a:LineColor>
<a:FillColor>16570034</a:FillColor>
<a:ShadowColor>12632256</a:ShadowColor>
@ -4444,7 +4444,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:CreationDate>1620807179</a:CreationDate>
<a:ModificationDate>1620807192</a:ModificationDate>
<a:IconMode>-1</a:IconMode>
<a:Rect>((-4616,-21303), (4610,-15305))</a:Rect>
<a:Rect>((-4200,-21078), (4194,-15530))</a:Rect>
<a:LineColor>12615680</a:LineColor>
<a:FillColor>16570034</a:FillColor>
<a:ShadowColor>12632256</a:ShadowColor>
@ -4469,7 +4469,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:CreationDate>1620818971</a:CreationDate>
<a:ModificationDate>1620818987</a:ModificationDate>
<a:IconMode>-1</a:IconMode>
<a:Rect>((-7962,-32873), (7960,-23275))</a:Rect>
<a:Rect>((-7198,-32498), (7196,-23650))</a:Rect>
<a:LineColor>12615680</a:LineColor>
<a:FillColor>16570034</a:FillColor>
<a:ShadowColor>12632256</a:ShadowColor>
@ -4494,7 +4494,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:CreationDate>1621837581</a:CreationDate>
<a:ModificationDate>1622450529</a:ModificationDate>
<a:IconMode>-1</a:IconMode>
<a:Rect>((-8077,-45645), (9575,-34247))</a:Rect>
<a:Rect>((-7220,-45195), (8718,-34697))</a:Rect>
<a:LineColor>12615680</a:LineColor>
<a:FillColor>16570034</a:FillColor>
<a:ShadowColor>12632256</a:ShadowColor>
@ -4519,7 +4519,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:CreationDate>1621840684</a:CreationDate>
<a:ModificationDate>1622450529</a:ModificationDate>
<a:IconMode>-1</a:IconMode>
<a:Rect>((-8829,-56577), (8823,-46079))</a:Rect>
<a:Rect>((-7972,-56165), (7966,-46491))</a:Rect>
<a:LineColor>12615680</a:LineColor>
<a:FillColor>16570034</a:FillColor>
<a:ShadowColor>12632256</a:ShadowColor>
@ -4544,7 +4544,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:CreationDate>1621845782</a:CreationDate>
<a:ModificationDate>1622450529</a:ModificationDate>
<a:IconMode>-1</a:IconMode>
<a:Rect>((-7962,-67511), (7960,-58813))</a:Rect>
<a:Rect>((-7198,-67174), (7196,-59150))</a:Rect>
<a:LineColor>12615680</a:LineColor>
<a:FillColor>16570034</a:FillColor>
<a:ShadowColor>12632256</a:ShadowColor>
@ -4569,7 +4569,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:CreationDate>1622015994</a:CreationDate>
<a:ModificationDate>1622450529</a:ModificationDate>
<a:IconMode>-1</a:IconMode>
<a:Rect>((-7315,-78968), (7309,-69370))</a:Rect>
<a:Rect>((-6620,-78593), (6614,-69745))</a:Rect>
<a:LineColor>12615680</a:LineColor>
<a:FillColor>16570034</a:FillColor>
<a:ShadowColor>12632256</a:ShadowColor>
@ -4594,7 +4594,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:CreationDate>1622016346</a:CreationDate>
<a:ModificationDate>1622450529</a:ModificationDate>
<a:IconMode>-1</a:IconMode>
<a:Rect>((-7315,-89488), (7309,-81690))</a:Rect>
<a:Rect>((-6620,-89188), (6614,-81990))</a:Rect>
<a:LineColor>12615680</a:LineColor>
<a:FillColor>16570034</a:FillColor>
<a:ShadowColor>12632256</a:ShadowColor>
@ -4619,7 +4619,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:CreationDate>1622029336</a:CreationDate>
<a:ModificationDate>1622450529</a:ModificationDate>
<a:IconMode>-1</a:IconMode>
<a:Rect>((-7315,-98735), (7309,-93637))</a:Rect>
<a:Rect>((-6620,-98548), (6614,-93824))</a:Rect>
<a:LineColor>12615680</a:LineColor>
<a:FillColor>16570034</a:FillColor>
<a:ShadowColor>12632256</a:ShadowColor>
@ -4644,7 +4644,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:CreationDate>1622166286</a:CreationDate>
<a:ModificationDate>1622450529</a:ModificationDate>
<a:IconMode>-1</a:IconMode>
<a:Rect>((-7962,-109443), (7960,-101645))</a:Rect>
<a:Rect>((-7198,-109143), (7196,-101945))</a:Rect>
<a:LineColor>12615680</a:LineColor>
<a:FillColor>16570034</a:FillColor>
<a:ShadowColor>12632256</a:ShadowColor>
@ -4669,7 +4669,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:CreationDate>1622450488</a:CreationDate>
<a:ModificationDate>1622450529</a:ModificationDate>
<a:IconMode>-1</a:IconMode>
<a:Rect>((-7314,-120338), (7312,-112540))</a:Rect>
<a:Rect>((-6618,-120038), (6616,-112840))</a:Rect>
<a:LineColor>12615680</a:LineColor>
<a:FillColor>16570034</a:FillColor>
<a:ShadowColor>12632256</a:ShadowColor>
@ -7294,9 +7294,176 @@ LABL 0 新宋体,8,N</a:FontList>
<o:Key Ref="o217"/>
</c:ClusterObject>
</o:Table>
<o:Table Id="o218">
<a:ObjectID>80F39E8A-CE37-45FF-AA28-3B7265A7986E</a:ObjectID>
<a:Name>W_BusinessPush</a:Name>
<a:Code>W_BusinessPush</a:Code>
<a:CreationDate>1622606670</a:CreationDate>
<a:Creator>Hinse</a:Creator>
<a:ModificationDate>1622617267</a:ModificationDate>
<a:Modifier>Hinse</a:Modifier>
<a:Comment>商户消息推送</a:Comment>
<a:TotalSavingCurrency/>
<c:Columns>
<o:Column Id="o219">
<a:ObjectID>C04377F8-599E-4393-8A6C-49D6F49ED56B</a:ObjectID>
<a:Name>BusinessId</a:Name>
<a:Code>BusinessId</a:Code>
<a:CreationDate>1622606685</a:CreationDate>
<a:Creator>Hinse</a:Creator>
<a:ModificationDate>1622606695</a:ModificationDate>
<a:Modifier>Hinse</a:Modifier>
<a:DataType>uniqueidentifier</a:DataType>
<a:Column.Mandatory>1</a:Column.Mandatory>
</o:Column>
<o:Column Id="o220">
<a:ObjectID>2674C3B4-914E-4BD1-B26D-562879586DB0</a:ObjectID>
<a:Name>PushUrl</a:Name>
<a:Code>PushUrl</a:Code>
<a:CreationDate>1622606695</a:CreationDate>
<a:Creator>Hinse</a:Creator>
<a:ModificationDate>1622606722</a:ModificationDate>
<a:Modifier>Hinse</a:Modifier>
<a:Comment>推送地址</a:Comment>
<a:DataType>varchar(200)</a:DataType>
<a:Length>200</a:Length>
<a:Column.Mandatory>1</a:Column.Mandatory>
</o:Column>
<o:Column Id="o221">
<a:ObjectID>A03405EE-EC8A-46F5-8C6B-496B54832041</a:ObjectID>
<a:Name>DevCode</a:Name>
<a:Code>DevCode</a:Code>
<a:CreationDate>1622606714</a:CreationDate>
<a:Creator>Hinse</a:Creator>
<a:ModificationDate>1622606753</a:ModificationDate>
<a:Modifier>Hinse</a:Modifier>
<a:Comment>设备唯一编号</a:Comment>
<a:DataType>varchar(50)</a:DataType>
<a:Length>50</a:Length>
<a:Column.Mandatory>1</a:Column.Mandatory>
</o:Column>
<o:Column Id="o222">
<a:ObjectID>BEFE4DB5-C30A-4205-A174-2A5A36AEFFDD</a:ObjectID>
<a:Name>DevName</a:Name>
<a:Code>DevName</a:Code>
<a:CreationDate>1622606742</a:CreationDate>
<a:Creator>Hinse</a:Creator>
<a:ModificationDate>1622606772</a:ModificationDate>
<a:Modifier>Hinse</a:Modifier>
<a:Comment>设备名称</a:Comment>
<a:DataType>nvarchar(100)</a:DataType>
<a:Length>100</a:Length>
<a:Column.Mandatory>1</a:Column.Mandatory>
</o:Column>
<o:Column Id="o223">
<a:ObjectID>2D79825F-36E1-451F-8E65-8EAB8ABB0C19</a:ObjectID>
<a:Name>Address</a:Name>
<a:Code>Address</a:Code>
<a:CreationDate>1622606766</a:CreationDate>
<a:Creator>Hinse</a:Creator>
<a:ModificationDate>1622606796</a:ModificationDate>
<a:Modifier>Hinse</a:Modifier>
<a:Comment>设备地址</a:Comment>
<a:DataType>nvarchar(200)</a:DataType>
<a:Length>200</a:Length>
<a:Column.Mandatory>1</a:Column.Mandatory>
</o:Column>
<o:Column Id="o224">
<a:ObjectID>8EC4E4EE-798E-49EF-8F59-5CAA8279AC65</a:ObjectID>
<a:Name>Weight</a:Name>
<a:Code>Weight</a:Code>
<a:CreationDate>1622606791</a:CreationDate>
<a:Creator>Hinse</a:Creator>
<a:ModificationDate>1622606920</a:ModificationDate>
<a:Modifier>Hinse</a:Modifier>
<a:Comment>毛重</a:Comment>
<a:DataType>decimal(18,2)</a:DataType>
<a:Length>18</a:Length>
<a:Precision>2</a:Precision>
<a:Column.Mandatory>1</a:Column.Mandatory>
</o:Column>
<o:Column Id="o225">
<a:ObjectID>C3589E11-8F03-4B99-BFAF-E3C261E1EB51</a:ObjectID>
<a:Name>Tare</a:Name>
<a:Code>Tare</a:Code>
<a:CreationDate>1622606914</a:CreationDate>
<a:Creator>Hinse</a:Creator>
<a:ModificationDate>1622606937</a:ModificationDate>
<a:Modifier>Hinse</a:Modifier>
<a:Comment>皮重</a:Comment>
<a:DataType>decimal(18,2)</a:DataType>
<a:Length>18</a:Length>
<a:Precision>2</a:Precision>
<a:Column.Mandatory>1</a:Column.Mandatory>
</o:Column>
<o:Column Id="o226">
<a:ObjectID>A95C497F-3D9A-4EF1-8664-198A6DD4A3C1</a:ObjectID>
<a:Name>PWeight</a:Name>
<a:Code>PWeight</a:Code>
<a:CreationDate>1622606931</a:CreationDate>
<a:Creator>Hinse</a:Creator>
<a:ModificationDate>1622606958</a:ModificationDate>
<a:Modifier>Hinse</a:Modifier>
<a:Comment>净重</a:Comment>
<a:DataType>decimal(18,2)</a:DataType>
<a:Length>18</a:Length>
<a:Precision>2</a:Precision>
<a:Column.Mandatory>1</a:Column.Mandatory>
</o:Column>
<o:Column Id="o227">
<a:ObjectID>C7EF429C-884A-4C4C-9C90-87210D14B303</a:ObjectID>
<a:Name>Type</a:Name>
<a:Code>Type</a:Code>
<a:CreationDate>1622606952</a:CreationDate>
<a:Creator>Hinse</a:Creator>
<a:ModificationDate>1622606977</a:ModificationDate>
<a:Modifier>Hinse</a:Modifier>
<a:Comment>垃圾类型</a:Comment>
<a:DataType>nvarchar(50)</a:DataType>
<a:Length>50</a:Length>
<a:Column.Mandatory>1</a:Column.Mandatory>
</o:Column>
<o:Column Id="o228">
<a:ObjectID>38773DC2-20F4-4FA1-B2BA-10D5D7B2669E</a:ObjectID>
<a:Name>Time</a:Name>
<a:Code>Time</a:Code>
<a:CreationDate>1622606968</a:CreationDate>
<a:Creator>Hinse</a:Creator>
<a:ModificationDate>1622606990</a:ModificationDate>
<a:Modifier>Hinse</a:Modifier>
<a:Comment>测量时间</a:Comment>
<a:DataType>datetime</a:DataType>
<a:Column.Mandatory>1</a:Column.Mandatory>
</o:Column>
<o:Column Id="o229">
<a:ObjectID>433D5F53-D212-49BF-8014-F8216561CFE0</a:ObjectID>
<a:Name>Cnt</a:Name>
<a:Code>Cnt</a:Code>
<a:CreationDate>1622617247</a:CreationDate>
<a:Creator>Hinse</a:Creator>
<a:ModificationDate>1622617277</a:ModificationDate>
<a:Modifier>Hinse</a:Modifier>
<a:Comment>重试推送的次数</a:Comment>
<a:DataType>int</a:DataType>
<a:Column.Mandatory>1</a:Column.Mandatory>
</o:Column>
<o:Column Id="o230">
<a:ObjectID>B1C9A6D1-757A-4E30-AC4F-7704D8EFFD23</a:ObjectID>
<a:Name>CreateTime</a:Name>
<a:Code>CreateTime</a:Code>
<a:CreationDate>1622606985</a:CreationDate>
<a:Creator>Hinse</a:Creator>
<a:ModificationDate>1622607006</a:ModificationDate>
<a:Modifier>Hinse</a:Modifier>
<a:Comment>添加时间</a:Comment>
<a:DataType>datetime</a:DataType>
<a:Column.Mandatory>1</a:Column.Mandatory>
</o:Column>
</c:Columns>
</o:Table>
</c:Tables>
<c:DefaultGroups>
<o:Group Id="o218">
<o:Group Id="o231">
<a:ObjectID>5728945A-1970-4CD5-B0BB-972845F49F99</a:ObjectID>
<a:Name>PUBLIC</a:Name>
<a:Code>PUBLIC</a:Code>
@ -7307,7 +7474,7 @@ LABL 0 新宋体,8,N</a:FontList>
</o:Group>
</c:DefaultGroups>
<c:TargetModels>
<o:TargetModel Id="o219">
<o:TargetModel Id="o232">
<a:ObjectID>1FC152BA-25A4-4408-A3C4-4E73CB309440</a:ObjectID>
<a:Name>Microsoft SQL Server 2012</a:Name>
<a:Code>MSSQLSRV2012</a:Code>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<?PowerDesigner AppLocale="UTF16" ID="{CE6E2FA3-BA82-4FC8-BCDD-8C9830EF68CF}" Label="" LastModificationDate="1622617277" Name="Waste" Objects="293" Symbols="16" Target="Microsoft SQL Server 2012" Type="{CDE44E21-9669-11D1-9914-006097355D9B}" signature="PDM_DATA_MODEL_XML" version="16.5.0.3982"?>
<?PowerDesigner AppLocale="UTF16" ID="{CE6E2FA3-BA82-4FC8-BCDD-8C9830EF68CF}" Label="" LastModificationDate="1622617277" Name="Waste" Objects="274" Symbols="16" Target="Microsoft SQL Server 2012" Type="{CDE44E21-9669-11D1-9914-006097355D9B}" signature="PDM_DATA_MODEL_XML" version="16.5.0.3982"?>
<!-- do not edit this file -->
<Model xmlns:a="attribute" xmlns:c="collection" xmlns:o="object">
@ -4292,7 +4292,7 @@ Shadow=0</a:DisplayPreferences>
<a:CreationDate>1619689000</a:CreationDate>
<a:ModificationDate>1619689638</a:ModificationDate>
<a:IconMode>-1</a:IconMode>
<a:Rect>((-21190,10129), (-6566,22427))</a:Rect>
<a:Rect>((-20495,10616), (-7261,21940))</a:Rect>
<a:LineColor>12615680</a:LineColor>
<a:FillColor>16570034</a:FillColor>
<a:ShadowColor>12632256</a:ShadowColor>
@ -4344,7 +4344,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:CreationDate>1619689821</a:CreationDate>
<a:ModificationDate>1619689823</a:ModificationDate>
<a:IconMode>-1</a:IconMode>
<a:Rect>((9435,7970), (25356,21168))</a:Rect>
<a:Rect>((10199,8495), (24592,20643))</a:Rect>
<a:LineColor>12615680</a:LineColor>
<a:FillColor>16570034</a:FillColor>
<a:ShadowColor>12632256</a:ShadowColor>
@ -4369,7 +4369,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:CreationDate>1619689847</a:CreationDate>
<a:ModificationDate>1620263978</a:ModificationDate>
<a:IconMode>-1</a:IconMode>
<a:Rect>((-21764,-11100), (-5842,6598))</a:Rect>
<a:Rect>((-21000,-10388), (-6606,5886))</a:Rect>
<a:LineColor>12615680</a:LineColor>
<a:FillColor>16570034</a:FillColor>
<a:ShadowColor>12632256</a:ShadowColor>
@ -4394,7 +4394,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:CreationDate>1619690248</a:CreationDate>
<a:ModificationDate>1619690516</a:ModificationDate>
<a:IconMode>-1</a:IconMode>
<a:Rect>((-4795,-1258), (11993,8340))</a:Rect>
<a:Rect>((-3984,-883), (11182,7965))</a:Rect>
<a:LineColor>12615680</a:LineColor>
<a:FillColor>16570034</a:FillColor>
<a:ShadowColor>12632256</a:ShadowColor>
@ -4419,7 +4419,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:CreationDate>1619690618</a:CreationDate>
<a:ModificationDate>1620263981</a:ModificationDate>
<a:IconMode>-1</a:IconMode>
<a:Rect>((-4298,-11683), (11192,-2085))</a:Rect>
<a:Rect>((-3557,-11308), (10451,-2460))</a:Rect>
<a:LineColor>12615680</a:LineColor>
<a:FillColor>16570034</a:FillColor>
<a:ShadowColor>12632256</a:ShadowColor>
@ -4444,7 +4444,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:CreationDate>1620807179</a:CreationDate>
<a:ModificationDate>1620807192</a:ModificationDate>
<a:IconMode>-1</a:IconMode>
<a:Rect>((-4616,-21303), (4610,-15305))</a:Rect>
<a:Rect>((-4200,-21078), (4194,-15530))</a:Rect>
<a:LineColor>12615680</a:LineColor>
<a:FillColor>16570034</a:FillColor>
<a:ShadowColor>12632256</a:ShadowColor>
@ -4469,7 +4469,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:CreationDate>1620818971</a:CreationDate>
<a:ModificationDate>1620818987</a:ModificationDate>
<a:IconMode>-1</a:IconMode>
<a:Rect>((-7962,-32873), (7960,-23275))</a:Rect>
<a:Rect>((-7198,-32498), (7196,-23650))</a:Rect>
<a:LineColor>12615680</a:LineColor>
<a:FillColor>16570034</a:FillColor>
<a:ShadowColor>12632256</a:ShadowColor>
@ -4494,7 +4494,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:CreationDate>1621837581</a:CreationDate>
<a:ModificationDate>1622450529</a:ModificationDate>
<a:IconMode>-1</a:IconMode>
<a:Rect>((-8077,-45645), (9575,-34247))</a:Rect>
<a:Rect>((-7220,-45195), (8718,-34697))</a:Rect>
<a:LineColor>12615680</a:LineColor>
<a:FillColor>16570034</a:FillColor>
<a:ShadowColor>12632256</a:ShadowColor>
@ -4519,7 +4519,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:CreationDate>1621840684</a:CreationDate>
<a:ModificationDate>1622450529</a:ModificationDate>
<a:IconMode>-1</a:IconMode>
<a:Rect>((-8829,-56577), (8823,-46079))</a:Rect>
<a:Rect>((-7972,-56165), (7966,-46491))</a:Rect>
<a:LineColor>12615680</a:LineColor>
<a:FillColor>16570034</a:FillColor>
<a:ShadowColor>12632256</a:ShadowColor>
@ -4544,7 +4544,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:CreationDate>1621845782</a:CreationDate>
<a:ModificationDate>1622450529</a:ModificationDate>
<a:IconMode>-1</a:IconMode>
<a:Rect>((-7962,-67511), (7960,-58813))</a:Rect>
<a:Rect>((-7198,-67174), (7196,-59150))</a:Rect>
<a:LineColor>12615680</a:LineColor>
<a:FillColor>16570034</a:FillColor>
<a:ShadowColor>12632256</a:ShadowColor>
@ -4569,7 +4569,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:CreationDate>1622015994</a:CreationDate>
<a:ModificationDate>1622450529</a:ModificationDate>
<a:IconMode>-1</a:IconMode>
<a:Rect>((-7315,-78968), (7309,-69370))</a:Rect>
<a:Rect>((-6620,-78593), (6614,-69745))</a:Rect>
<a:LineColor>12615680</a:LineColor>
<a:FillColor>16570034</a:FillColor>
<a:ShadowColor>12632256</a:ShadowColor>
@ -4594,7 +4594,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:CreationDate>1622016346</a:CreationDate>
<a:ModificationDate>1622450529</a:ModificationDate>
<a:IconMode>-1</a:IconMode>
<a:Rect>((-7315,-89488), (7309,-81690))</a:Rect>
<a:Rect>((-6620,-89188), (6614,-81990))</a:Rect>
<a:LineColor>12615680</a:LineColor>
<a:FillColor>16570034</a:FillColor>
<a:ShadowColor>12632256</a:ShadowColor>
@ -4619,7 +4619,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:CreationDate>1622029336</a:CreationDate>
<a:ModificationDate>1622450529</a:ModificationDate>
<a:IconMode>-1</a:IconMode>
<a:Rect>((-7315,-98735), (7309,-93637))</a:Rect>
<a:Rect>((-6620,-98548), (6614,-93824))</a:Rect>
<a:LineColor>12615680</a:LineColor>
<a:FillColor>16570034</a:FillColor>
<a:ShadowColor>12632256</a:ShadowColor>
@ -4644,7 +4644,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:CreationDate>1622166286</a:CreationDate>
<a:ModificationDate>1622450529</a:ModificationDate>
<a:IconMode>-1</a:IconMode>
<a:Rect>((-7962,-109443), (7960,-101645))</a:Rect>
<a:Rect>((-7198,-109143), (7196,-101945))</a:Rect>
<a:LineColor>12615680</a:LineColor>
<a:FillColor>16570034</a:FillColor>
<a:ShadowColor>12632256</a:ShadowColor>
@ -4669,7 +4669,7 @@ LABL 0 新宋体,8,N</a:FontList>
<a:CreationDate>1622450488</a:CreationDate>
<a:ModificationDate>1622450529</a:ModificationDate>
<a:IconMode>-1</a:IconMode>
<a:Rect>((-7314,-120338), (7312,-112540))</a:Rect>
<a:Rect>((-6618,-120038), (6616,-112840))</a:Rect>
<a:LineColor>12615680</a:LineColor>
<a:FillColor>16570034</a:FillColor>
<a:ShadowColor>12632256</a:ShadowColor>

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

View File

@ -0,0 +1,99 @@
巨天平台软件设计方案
文件编号:jt-sky-20210401FA
编制:________刘照良________________
审核:________吴成发________________
批准:_______ 孙海清________________
巨鼎天衡
2021年04月
修订记录
日期
版本
描述
修改人
2021-04-01
V1.0.0
创建文档
刘照良
一、引言
1. 概述
传统形式的垃圾分类基本上是用手工来记录投放数据,过磅数据,出车数据。手工记录效率比较低,出错比较多,统计查询等都不方便。为了解决目前存在的问题,为此开发本软件系统。全部采用电子化来自动管理目前的各个环节。所有数据一库刊,实现了数据安全管理,出错减少,统计查询方便快捷。可以随手随地在浏览器中实时查询各个环节的具体数据,提高了管理效率
软件总体架构
软件开发环境
操作系统windows
开发语言:C#
开发平台:VSCODE
软件基本结构
该系统以设备为核心,连接上巨天云平台和政府对接平台,巨天云平台包括数据处理平台、数据展示平台、数据存储平台
数据处理平台主要对设备数据进行收发,数据协议格式解析处理,然后传输到数据存储平台进行记录
数据展示平台主要是对设备数据进行汇总展示,记录查询等
数据存数平台主要是对所有相关数据进行存储的平台
各个平台的具体关系如图所示:
三、界面设计
首页
设备列表
商户管理
物品编码
回收记录
统计报表

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

View File

@ -0,0 +1,99 @@
巨天平台软件设计方案
文件编号:jt-sky-20210401FA
编制:________刘照良________________
审核:________吴成发________________
批准:_______ 孙海清________________
巨鼎天衡
2021年04月
修订记录
日期
版本
描述
修改人
2021-04-01
V1.0.0
创建文档
刘照良
一、引言
1. 概述
传统形式的垃圾分类基本上是用手工来记录投放数据,过磅数据,出车数据。手工记录效率比较低,出错比较多,统计查询等都不方便。为了解决目前存在的问题,为此开发本软件系统。全部采用电子化来自动管理目前的各个环节。所有数据一库刊,实现了数据安全管理,出错减少,统计查询方便快捷。可以随手随地在浏览器中实时查询各个环节的具体数据,提高了管理效率
软件总体架构
软件开发环境
操作系统windows
开发语言:C#
开发平台:VSCODE
软件基本结构
该系统以设备为核心,连接上巨天云平台和政府对接平台,巨天云平台包括数据处理平台、数据展示平台、数据存储平台
数据处理平台主要对设备数据进行收发,数据协议格式解析处理,然后传输到数据存储平台进行记录
数据展示平台主要是对设备数据进行汇总展示,记录查询等
数据存数平台主要是对所有相关数据进行存储的平台
各个平台的具体关系如图所示:
三、界面设计
首页
设备列表
商户管理
物品编码
回收记录
统计报表

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

View File

@ -0,0 +1,118 @@
从测试平台迁移到正式平台的极简说明
端点
正式平台分为两个系统:设备管理系统 和 数据池(苏州)平台,其中:
设备管理平台的设备API端点为: https://api.device.suzhou.ljflytjl.cn
数据池苏州平台的设备API端点为: https://api.data.suzhou.ljflytjl.cn
现阶段设备管理平台提供的基于Web的开发者Dashboard页面地址为https://iot.ljflytjl.cn
现阶段数据池苏州平台提供的基于Web的开发者Dashboard页面为https://data.suzhou.ljflytjl.cn
基于浏览器的Dashboard是临时提供的后续会改成原生桌面客户端
HTTPS
正式平台全站强制使用HTTPS.
Swagger
正式平台不提供Swagger页面。正式平台的API前面有负载均衡网关和聚合网关Swagger的自动生成API的机制无法处理聚合网关。
API以文档形式提供。
版本概念
正式平台的API是有版本概念的。
截至本文编写时API最新主版本为1.0.
在每次API请求时服务器会在response的header中返回当前API所支持的版本
在请求API时如果不指定版本则服务器将采用默认版本号处理请求。
不同版本之间的数据格式、支持的Formatter格式等等都可以有差异
请求时可以使用query string指定版本号
或者在header中指定版本号
Json
由于对Json的支持呼声较高平台在1.x的API中增加的支持了JSON传输数据。
设备接入流程
账号
账号的用户名格式有规定,所以没开放自由注册,由平台分配。
在正式平台刚得到的账号,是只有用户名没有密码的。
所以首次登录需要走一遍找回密码的流程。
输入账号信息之后
在申领账号时邮箱中点击链接找回密码。
.
添加设备
在Web页面添加设备
总体添加设备流程与测试平台一致但正式平台的设备平台是独立于数据平台的因此不要求在设备平台绑定采集点。而是在数据平台绑定设备ID.
添加区域、采集点
在数据平台添加相关信息。
建立长连接
数据配置完成之后,就和测试平台一样,向设备平台端点建立长连接。
请确保测试平台测试没问题了之后再到正式平台建立长连接。
sayHello
建立长连接之后,和测试平台一样,正式平台依然有"sayHello"消息,没有实际意义,可以用来检测与服务端的通讯是否正常。
消息的target 是 "sayHello",接收第一个参数为字符串, 返回字符串。
接触下来发现有的开发者对rpc这个概念不是很理解什么叫"第一个参数"什么的比较困惑,类比一下,上面这个描述相当于如下伪代码
类似的之前文档上有在第一个参数里搞了个dto的约定就类似于如下伪代码
请求Token
在上述基础上请求Token的target 是 "getToken", 接收第一个参数为字符串含义为audience.
针对数据苏州平台audience的值固定为" sz_data".
该消息没有返回值即不会在同一个Invocation ID的Completion消息中返回Token. 而是与测试平台一样,采用主推消息"Token"来下发Token或主推"Error"消息来表示一个错误。
检查Token的有效期
设备平台下发的这个Token标准的称呼叫jwt bearer token标准为rfc7519标准文档为https://datatracker.ietf.org/doc/html/rfc7519
Token的有效期是不固定的请使用jwt标准规范来解析并检查Token的有效期并在Token过期前请求新的Token.
Token中除了jwt标准约定的几个字段请勿在程序中依赖其他字段信息它们可能会随意变动。
(提醒过于离谱的恶意频繁请求Token会导致账号被封禁)
推送数据到数据平台
数据平台有个api可以用于检查API通讯是否正常
GET方法返回内容是纯文本。
采用jwt bearer token的方式携带token
推送垃圾数据的API
API版本1.0
在Body中传递如下
使用MessagePack无key的数组形式传递数据。
即伪代码写法为:
注意垃圾类型的0类型是防止程序解析枚举值出错用的从内容上理解传0等同于错误数据。
数据校验
与测试平台规则类似在所有的Web API请求中应在header中传递time、sign、secret、nonce
详情参考之前的文档。

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View File

@ -0,0 +1,15 @@
巨天物联网数字平台
软件设计方案说明书
巨鼎天衡 2021

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

View File

@ -3,11 +3,14 @@ using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
using RabbitMQ.Client;
using Serilog;
using Serilog.Events;
using SuperSocket;
using SuperSocket.Channel;
using SuperSocket.Server;
using System;
using System.Net;
using System.Text;
using System.Threading.Tasks;
namespace Waste.Socket
@ -17,6 +20,22 @@ namespace Waste.Socket
public static RabbitMqService rabbitMqProxy;
static async Task Main(string[] args)
{
var filepath = "e:/errlog/wastersocket";
string date = DateTime.Now.ToString("yyyy-MM-dd");//按时间创建文件夹
string outputTemplate = "{NewLine}【{Level:u3}】{Timestamp:yyyy-MM-dd HH:mm:ss.fff}" +
"{NewLine}#Msg#{Message:lj}" +
"{NewLine}#Pro #{Properties:j}" +
"{NewLine}#Exc#{Exception}" +
new string('-', 50);//输出模板
var logger = new LoggerConfiguration()
.MinimumLevel.Information()
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.Enrich.FromLogContext()
.WriteTo.File($"{filepath}/{date}/log.log",outputTemplate:outputTemplate,rollingInterval:RollingInterval.Day,encoding:Encoding.UTF8)
.CreateLogger()
;
rabbitMqProxy = new RabbitMqService(new MqConfig
{
AutomaticRecoveryEnabled = true,
@ -95,6 +114,7 @@ namespace Waste.Socket
.ConfigureLogging((hostCtx, loggingBuilder) =>
{
loggingBuilder.AddConsole();
loggingBuilder.AddSerilog(logger);
})
.Build()
;

View File

@ -17,6 +17,9 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="RabbitMQ.Client" Version="6.2.1" />
<PackageReference Include="Serilog" Version="2.10.0" />
<PackageReference Include="Serilog.Extensions.Logging" Version="3.0.1" />
<PackageReference Include="Serilog.Settings.Configuration" Version="3.1.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="SuperSocket" Version="2.0.0-beta.8" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0-preview.1.21102.12" />
</ItemGroup>

View File

@ -7,7 +7,7 @@ using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Waste.Web.Entry.Pages.User
{
public class ChangePwdModel : PageModel
public class ChangePwdModel : BaseModel
{
public void OnGet()
{

View File

@ -5,6 +5,6 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_PublishTargetUrl>D:\webpublish\waste.ybhdmob.com</_PublishTargetUrl>
<History>True|2021-06-11T00:16:29.9542894Z;True|2021-06-04T14:46:02.2707457+08:00;True|2021-06-02T15:08:52.8245632+08:00;True|2021-06-02T15:05:50.3614099+08:00;True|2021-06-02T14:59:32.3690948+08:00;True|2021-06-02T14:10:25.1182836+08:00;True|2021-06-02T14:09:54.9215833+08:00;True|2021-06-01T10:41:54.9488501+08:00;True|2021-06-01T10:38:56.0283198+08:00;True|2021-05-28T13:59:02.2308877+08:00;True|2021-05-28T11:56:26.6796406+08:00;True|2021-05-28T11:28:00.4087907+08:00;True|2021-05-27T16:18:09.5993838+08:00;True|2021-05-27T16:07:31.3484951+08:00;True|2021-05-27T11:30:37.9119310+08:00;True|2021-05-27T11:28:35.5374674+08:00;True|2021-05-27T08:00:09.1625592+08:00;True|2021-05-26T20:42:17.0852150+08:00;True|2021-05-26T20:36:49.7527415+08:00;True|2021-05-25T17:57:31.8791293+08:00;True|2021-05-25T13:49:29.6488978+08:00;True|2021-05-25T13:48:24.6686105+08:00;True|2021-05-25T13:25:41.2512493+08:00;True|2021-05-24T17:55:33.3800078+08:00;True|2021-05-20T14:35:30.6957985+08:00;True|2021-05-20T13:17:22.6192995+08:00;True|2021-05-20T10:51:38.1268169+08:00;True|2021-05-19T19:50:03.7000224+08:00;True|2021-05-19T19:44:27.2518811+08:00;True|2021-05-19T19:43:26.5916681+08:00;True|2021-05-19T19:36:29.3197365+08:00;True|2021-05-19T19:30:00.3802430+08:00;True|2021-05-19T17:55:23.7939835+08:00;True|2021-05-19T11:05:17.9043392+08:00;True|2021-05-19T10:19:38.4839988+08:00;True|2021-05-19T10:17:19.7430612+08:00;True|2021-05-19T10:13:23.0031721+08:00;True|2021-05-19T10:06:03.9881599+08:00;True|2021-05-18T14:39:03.8876574+08:00;True|2021-05-18T14:23:46.9818836+08:00;True|2021-05-18T14:19:56.2382079+08:00;True|2021-05-18T11:29:53.5497590+08:00;True|2021-05-18T11:16:18.0123853+08:00;True|2021-05-17T18:59:52.4159105+08:00;True|2021-05-17T18:53:37.9438984+08:00;True|2021-05-17T18:48:14.9625161+08:00;True|2021-05-17T17:46:03.7723404+08:00;True|2021-05-17T17:14:20.2312990+08:00;True|2021-05-17T16:44:34.5837616+08:00;True|2021-05-17T16:25:20.1087804+08:00;True|2021-05-17T11:35:27.9388562+08:00;</History>
<History>True|2021-07-29T11:06:09.1449349Z;True|2021-06-11T08:16:29.9542894+08:00;True|2021-06-04T14:46:02.2707457+08:00;True|2021-06-02T15:08:52.8245632+08:00;True|2021-06-02T15:05:50.3614099+08:00;True|2021-06-02T14:59:32.3690948+08:00;True|2021-06-02T14:10:25.1182836+08:00;True|2021-06-02T14:09:54.9215833+08:00;True|2021-06-01T10:41:54.9488501+08:00;True|2021-06-01T10:38:56.0283198+08:00;True|2021-05-28T13:59:02.2308877+08:00;True|2021-05-28T11:56:26.6796406+08:00;True|2021-05-28T11:28:00.4087907+08:00;True|2021-05-27T16:18:09.5993838+08:00;True|2021-05-27T16:07:31.3484951+08:00;True|2021-05-27T11:30:37.9119310+08:00;True|2021-05-27T11:28:35.5374674+08:00;True|2021-05-27T08:00:09.1625592+08:00;True|2021-05-26T20:42:17.0852150+08:00;True|2021-05-26T20:36:49.7527415+08:00;True|2021-05-25T17:57:31.8791293+08:00;True|2021-05-25T13:49:29.6488978+08:00;True|2021-05-25T13:48:24.6686105+08:00;True|2021-05-25T13:25:41.2512493+08:00;True|2021-05-24T17:55:33.3800078+08:00;True|2021-05-20T14:35:30.6957985+08:00;True|2021-05-20T13:17:22.6192995+08:00;True|2021-05-20T10:51:38.1268169+08:00;True|2021-05-19T19:50:03.7000224+08:00;True|2021-05-19T19:44:27.2518811+08:00;True|2021-05-19T19:43:26.5916681+08:00;True|2021-05-19T19:36:29.3197365+08:00;True|2021-05-19T19:30:00.3802430+08:00;True|2021-05-19T17:55:23.7939835+08:00;True|2021-05-19T11:05:17.9043392+08:00;True|2021-05-19T10:19:38.4839988+08:00;True|2021-05-19T10:17:19.7430612+08:00;True|2021-05-19T10:13:23.0031721+08:00;True|2021-05-19T10:06:03.9881599+08:00;True|2021-05-18T14:39:03.8876574+08:00;True|2021-05-18T14:23:46.9818836+08:00;True|2021-05-18T14:19:56.2382079+08:00;True|2021-05-18T11:29:53.5497590+08:00;True|2021-05-18T11:16:18.0123853+08:00;True|2021-05-17T18:59:52.4159105+08:00;True|2021-05-17T18:53:37.9438984+08:00;True|2021-05-17T18:48:14.9625161+08:00;True|2021-05-17T17:46:03.7723404+08:00;True|2021-05-17T17:14:20.2312990+08:00;True|2021-05-17T16:44:34.5837616+08:00;True|2021-05-17T16:25:20.1087804+08:00;True|2021-05-17T11:35:27.9388562+08:00;</History>
</PropertyGroup>
</Project>

View File

@ -3,6 +3,6 @@
<PropertyGroup>
<RazorPage_SelectedScaffolderID>RazorPageScaffolder</RazorPage_SelectedScaffolderID>
<RazorPage_SelectedScaffolderCategoryPath>root/Common/RazorPage</RazorPage_SelectedScaffolderCategoryPath>
<NameOfLastUsedPublishProfile>E:\workspace_ybhdmob\Waste\Waste.Web.Entry\Properties\PublishProfiles\waste.ybhdmob.com.pubxml</NameOfLastUsedPublishProfile>
<NameOfLastUsedPublishProfile>H:\liuzl_ybhdmob\Waste\Waste.Web.Entry\Properties\PublishProfiles\waste.ybhdmob.com.pubxml</NameOfLastUsedPublishProfile>
</PropertyGroup>
</Project>