This commit is contained in:
2020-06-08 23:42:40 +00:00
parent 4e13b3c9bb
commit 937e9c5907
18 changed files with 119 additions and 83 deletions

2
.vscode/launch.json vendored
View File

@@ -10,7 +10,7 @@
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceRoot}/bin/Debug/netcoreapp2.1/rockfishCore.dll",
"program": "${workspaceRoot}/bin/Debug/netcoreapp3.1/rockfishCore.dll",
"args": [],
"cwd": "${workspaceRoot}",
"stopAtEntry": false,

View File

@@ -50,6 +50,32 @@ namespace rockfishCore.Controllers
}
// //Get api/customer/list
// [HttpGet("list")]
// public ActionResult GetList()
// {
// var res = from c in _context.Customer.OrderBy(c => c.Name)
// select new dtoCustomerListItem
// {
// lapsed = false,
// active = c.Active,
// id = c.Id,
// name = c.Name
// };
// //Need to be made into a list before updating or else the changes would be lost
// //The tolist is what triggers the actual query to run
// var LapsedRes = res.ToList();
// foreach (dtoCustomerListItem i in LapsedRes)
// {
// i.lapsed = CustomerHasLapsed(i.id);
// }
// return Ok(LapsedRes);
// }
/// <summary>
/// Check if a customer has any active subs
/// return true if no active subs

View File

@@ -138,8 +138,8 @@ namespace rockfishCore.Controllers
public class dtoReplyMessageItem
{
public string composition;
public bool trackDelivery;
public string composition { get; set; }
public bool trackDelivery { get; set; }
}

View File

@@ -102,8 +102,8 @@ namespace rockfishCore.Controllers
public class dtoOpsStatus
{
public bool Status;
public string ServiceCheckError;
public bool Status { get; set; }
public string ServiceCheckError { get; set; }
public dtoOpsStatus()
{

View File

@@ -54,12 +54,12 @@ namespace rockfishCore.Controllers
//dto classes for route
public class expiresResultItem
{
public long id;
public string name;
public string Customer;
public long customerId;
public long? expireDate;
public long site_id;
public long id { get; set; }
public string name { get; set; }
public string Customer { get; set; }
public long customerId { get; set; }
public long? expireDate { get; set; }
public long site_id { get; set; }
}
@@ -188,9 +188,9 @@ namespace rockfishCore.Controllers
//dto classes for route
public class requestEmailsForProductCodes
{
public string[] products;
public bool ckIncidental;
public bool ckNoContact;
public string[] products { get; set; }
public bool ckIncidental { get; set; }
public bool ckNoContact { get; set; }
}
/////////////////////////////////////////////////////////////////////////////////////

View File

@@ -102,11 +102,11 @@ namespace rockfishCore.Controllers
//dto classes for route
public class subnotifyResultItem
{
public long id;
public string Customer;
public string purchasenames;
public List<long> purchaseidlist;
public long customerId;
public long id { get; set; }
public string Customer { get; set; }
public string purchasenames { get; set; }
public List<long> purchaseidlist { get; set; }
public long customerId { get; set; }
}

View File

@@ -161,8 +161,8 @@ namespace rockfishCore.Controllers
public class dtoChangePassword
{
public string oldpassword;
public string newpassword;
public string oldpassword { get; set; }
public string newpassword { get; set; }
}

View File

@@ -3,9 +3,9 @@ namespace rockfishCore.Models
//Used to populate list routes for return
public class dtoCustomerListItem
{
public bool active;
public bool lapsed;
public long id;
public string name;
public bool active { get; set; }
public bool lapsed { get; set; }
public long id { get; set; }
public string name { get; set; }
}
}

View File

@@ -3,11 +3,11 @@ namespace rockfishCore.Models
//Used to populate list routes for return
public class dtoLicenseListItem
{
public long id;
public long created;
public string regto;
public bool fetched;
public bool trial;
public long id { get; set; }
public long created { get; set; }
public string regto { get; set; }
public bool fetched { get; set; }
public bool trial { get; set; }
}
}

View File

@@ -3,8 +3,8 @@ namespace rockfishCore.Models
//Used to populate list routes for return
public class dtoNameIdActiveItem
{
public bool active;
public long id;
public string name;
public bool active { get; set; }
public long id { get; set; }
public string name { get; set; }
}
}

View File

@@ -9,9 +9,9 @@ namespace rockfishCore.Models
{
children = new List<dtoNameIdItem>();
}
public long id;
public string name;
public List<dtoNameIdItem> children;
public long id { get; set; }
public string name { get; set; }
public List<dtoNameIdItem> children { get; set; }
}

View File

@@ -3,7 +3,7 @@ namespace rockfishCore.Models
//Used to populate list routes for return
public class dtoNameIdItem
{
public long id;
public string name;
public long id { get; set; }
public string name { get; set; }
}
}

View File

@@ -78,6 +78,8 @@ namespace rockfishCore
});
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
@@ -113,6 +115,7 @@ namespace rockfishCore
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
}
}

View File

@@ -9,12 +9,12 @@
<ItemGroup>
<PackageReference Include="AWSSDK.S3" Version="3.3.111.9" />
<!-- <PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.0" /> -->
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.1.4" />
<PackageReference Include="jose-jwt" Version="2.5.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.4" />
<PackageReference Include="mailkit" Version="2.7.0" />
<!-- <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.4" /> -->
</ItemGroup>
</Project>

View File

@@ -259,21 +259,21 @@ namespace rockfishCore.Util
{
attachments = new List<fbAttachment>();
}
public bool noRecord;
public string id;
public string title;
public string project;
public int priority;
public string notes;
public long? created;
public long? closed;
public List<fbAttachment> attachments;
public bool noRecord { get; set; }
public string id { get; set; }
public string title { get; set; }
public string project { get; set; }
public int priority { get; set; }
public string notes { get; set; }
public long? created { get; set; }
public long? closed { get; set; }
public List<fbAttachment> attachments { get; set; }
}
public class fbAttachment
{
public string fileName;
public byte[] blob;
public string fileName { get; set; }
public byte[] blob { get; set; }
}
//eoc

View File

@@ -21,13 +21,18 @@ namespace rockfishCore.Util
private const string S3_HOST_ENDPOINT = "https://nyc3.digitaloceanspaces.com";
private const string S3_BUCKET_NAME = "gztw1";
private static HttpClient Client = new HttpClient();
private static readonly HttpClient _httpClient;
static OpsDiagnostics()
{
_httpClient = new HttpClient();
}
public static bool CheckWebsite(string url, string mustContain)
{
bool Result = false;
var Response = Client.GetAsync(url).Result;
var Response = _httpClient.GetAsync(url).Result;
if (Response.IsSuccessStatusCode)
{
var PageText = Response.Content.ReadAsStringAsync().Result;
@@ -73,9 +78,11 @@ namespace rockfishCore.Util
}
};
var httpClient = new HttpClient(httpClientHandler);
using (var httpClient = new HttpClient(httpClientHandler))
{
await httpClient.SendAsync(new HttpRequestMessage(HttpMethod.Head, url));
//httpClient.Dispose();
}
return ret;
}

View File

@@ -43,8 +43,8 @@ namespace rockfishCore.Util
public class rfMailMessage
{
public MimeMessage message;
public uint uid;
public MimeMessage message { get; set; }
public uint uid { get; set; }
}
@@ -119,8 +119,8 @@ namespace rockfishCore.Util
bool trackDeliveryStatus = false, string CustomHeader = "", string CustomHeaderValue = "")
{
var message = new MimeMessage();
message.From.Add(new MailboxAddress("",MessageFrom));
message.To.Add(new MailboxAddress("",MessageTo));
message.From.Add(new MailboxAddress("", MessageFrom));
message.To.Add(new MailboxAddress("", MessageTo));
message.Subject = MessageSubject;
message.Body = new TextPart("plain")
@@ -273,12 +273,12 @@ namespace rockfishCore.Util
case rfMailAccount.sales:
from_account = MAIL_ACCOUNT_SALES;
from_account_password = MAIL_ACCOUNT_PASSWORD_SALES;
from = new MailboxAddress("",from_account);
from = new MailboxAddress("", from_account);
break;
default:
from_account = MAIL_ACCOUNT_SUPPORT;
from_account_password = MAIL_ACCOUNT_PASSWORD_SUPPORT;
from = new MailboxAddress("",from_account);
from = new MailboxAddress("", from_account);
break;
}
reply.From.Add(from);
@@ -342,7 +342,7 @@ namespace rockfishCore.Util
theBody = StripHTML(ht, true);
theBody += "> ";
theBody = theBody.Replace("\r\n", "\r\n> ").Trim().TrimEnd('>');
theBody ="\r\n"+theBody;//descend the first line under the On you wrote bit
theBody = "\r\n" + theBody;//descend the first line under the On you wrote bit
}
else
@@ -520,7 +520,7 @@ namespace rockfishCore.Util
string CustomHeader = "", string CustomHeaderValue = "")
{
var message = new MimeMessage();
message.From.Add(new MailboxAddress("",MessageFrom));
message.From.Add(new MailboxAddress("", MessageFrom));
//case 3512 handle more than one email in the address
@@ -530,13 +530,13 @@ namespace rockfishCore.Util
var addrs = MessageTo.Split(',');
foreach (string addr in addrs)
{
mbAll.Add(new MailboxAddress("",addr.Trim()));
mbAll.Add(new MailboxAddress("", addr.Trim()));
}
message.To.AddRange(mbAll);
}
else
{
message.To.Add(new MailboxAddress("",MessageTo));
message.To.Add(new MailboxAddress("", MessageTo));
}
@@ -656,12 +656,12 @@ namespace rockfishCore.Util
public class rfMessageSummary
{
public string account;
public uint id;
public string from;
public string subject;
public long? sent;
public string flags;
public string account { get; set; }
public uint id { get; set; }
public string from { get; set; }
public string subject { get; set; }
public long? sent { get; set; }
public string flags { get; set; }
}
//Fetch a single string preview of message by Account / folder / UID
@@ -737,9 +737,9 @@ namespace rockfishCore.Util
public class rfMessagePreview
{
public bool isKeyRequest;
public string preview;
public uint id;
public bool isKeyRequest { get; set; }
public string preview { get; set; }
public uint id { get; set; }
}

View File

@@ -2,7 +2,7 @@ namespace rockfishCore.Util
{
public static class RfVersion
{
public const string NumberOnly="6.8";
public const string NumberOnly="6.9";
public const string Full = "Rockfish server " + NumberOnly;
}
}