|
|
@@ -16,10 +16,10 @@ namespace Winsoft.GOV.XF.WebApi.WXCore.Services
|
|
|
public class XFApiService : BaseService
|
|
|
{
|
|
|
public delegate void OnFails(string message);
|
|
|
- XFDbContext _context;
|
|
|
- public XFApiService(XFDbContext context, ILoggerFactory loggerFactory):base(context, loggerFactory)
|
|
|
+ BundlesService _bundlesService;
|
|
|
+ public XFApiService(BundlesService bundlesService, ILoggerFactory loggerFactory):base(context, loggerFactory)
|
|
|
{
|
|
|
- _context = context;
|
|
|
+ _bundlesService = bundlesService;
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 提交信件
|
|
|
@@ -29,6 +29,10 @@ namespace Winsoft.GOV.XF.WebApi.WXCore.Services
|
|
|
/// <returns></returns>
|
|
|
public async Task<bool> PostLetter(Bundle b, OnFails onFails)
|
|
|
{
|
|
|
+ string s = "advice={0};type={1};name={2};phone={3};is_public={4};content={5};title={6};county_id={7};unit_id={8};sswz=8;ly=2; user_id={9}";
|
|
|
+ s = String.Format(s, b.Advice, b.Type.ToString(), b.Name, b.Mobile, b.IsPublic.ToString(), b.Describe, b.Title, b.County_id, b.Unit_id, b.OpenID);
|
|
|
+ return s;
|
|
|
+
|
|
|
XFApiResult rObj = await HttpPostAsync<XFApiResult>("http://118.178.118.50/test1/letter/submitLetter;", b.ToString(), onFails);
|
|
|
|
|
|
if (rObj == null)
|
|
|
@@ -40,7 +44,7 @@ namespace Winsoft.GOV.XF.WebApi.WXCore.Services
|
|
|
return false;
|
|
|
}
|
|
|
b.SearchCode = rObj.Data.Data;
|
|
|
- _context.Bundles.Update(b);
|
|
|
+ _bundlesService.Update(b);
|
|
|
return true;
|
|
|
//if (rObj != null)
|
|
|
//{
|