Asp.net+Vue2 to build Simple Accounting WebApp II (use ABP to quickly build. Net background)

Keywords: JSON Database Attribute ASP.NET

Introduction to ABP

ABP is short for "ASP. NET Boilerplate Project" (ASP. NET template project).  
ASP.NET Boilerplate is a new starting point for developing modern WEB applications with best practices and popular technologies. It aims to be a general WEB application framework and project template. Details can be accessed on the official website: http://www.aspnetboilerplate.com/

II. Download template

Visit: https://aspnetboilerplate.com/Templates Download your own project template.  

Unzip and open the project
 
In fact, a lot of the content of this framework has been encapsulated in dll, which is probably the project structure.

  1. There are some basic things in core.
  2. Entity Framework contains data access objects and warehouses.
  3. Application s usually write services to web and web API calls
  4. Web, web API is the place where the export of a project is finally presented to a third party or user

3. Try it quickly.

1. Select Solution - Restore NuGet Package

2. Modify the data connection (where you need your own database service)
Modify the connection under web.config.

  <connectionStrings>
    <add name="Default" connectionString="Server=.; Database=MyBill; Trusted_Connection=True;" providerName="System.Data.SqlClient" />
  </connectionStrings>
  • 1
  • 2
  • 3

3. Data migration
Set the web project to start the project and then select Entity Framework for the default project in the Program Management Console. The input cannot return update-database.  
 
Start and see the username admin, password 123qwe

The interface style is still beautiful.  

Fourth, add our own things

1. Adding Entities
Add the following two classes to core:

using Abp.Domain.Entities;

namespace MyBill.Bills
{
    /// <summary>
    /// Bookkeeping type
    /// </summary>
    public class BillType : Entity
    {
        /// <summary>
        /// Name
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// font Icon style name
        /// </summary>
        public string FontStyle { get; set; }
        /// <summary>
        /// Picture address
        /// </summary>
        public string ImgUrl { get; set; }
        /// <summary>
        /// Is it income?
        /// </summary>
        public bool IsCountIn { get; set; }
    }

}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using System;
using System.ComponentModel.DataAnnotations.Schema;
namespace MyBill.Bills
{
    /// <summary>
    /// billing data
    /// </summary>
    public class Bill : Entity, IHasCreationTime
    {
        /// <summary>
        /// creator
        /// </summary>
        public string CreatorUser { get; set; }
        /// <summary>
        /// Creation time
        /// </summary>
        public DateTime CreationTime { get; set; }
        /// <summary>
        /// Bookkeeping type
        /// </summary>
        public int BillTypeId { get; set; }
        [ForeignKey("BillTypeId")]
        public BillType BillType { get; set; }
        /// <summary>
        /// Amount of account
        /// </summary>
        public decimal Money { get; set; }
        /// <summary>
        /// describe
        /// </summary>
        public string Des { get; set; }
    }
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36

2. Adding data sets
Add the dataset at the end of the following file:

        public MyBillDbContext(DbConnection existingConnection, bool contextOwnsConnection)
         : base(existingConnection, contextOwnsConnection)
        {

        }
        public IDbSet<Bill> Bills { get; set; } // Bill Data Set
        public IDbSet<BillType> BillTypes { get; set; } // Accounting Type Data Set
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

What if I want to give BillType some initial data for data migration?  
Add the following files here (refer to other files in the same directory)

using System.Linq;
using MyBill.EntityFramework;
using System.Collections.Generic;
using MyBill.Bills;

namespace MyBill.Migrations.SeedData
{
    /// <summary>
    /// Initialize database billType data
    /// </summary>
    public class DefaultBillTypeCreator
    {
        private readonly MyBillDbContext _context;
        public DefaultBillTypeCreator(MyBillDbContext context)
        {
            _context = context;
        }

        public void Create()
        {
            CreateBillTypes();
        }

        private void CreateBillTypes()
        {
            List<BillType> list = new List<BillType> {
                new BillType { IsCountIn= false, Name = "food",FontStyle="fa-cutlery"},
                new BillType { IsCountIn= false, Name = "Clothing",FontStyle="fa-columns"},
                new BillType { IsCountIn= false, Name = "Daily life",FontStyle="fa-umbrella"},
                new BillType { IsCountIn= false, Name = "Traffic trip",FontStyle="fa-car"},
                new BillType { IsCountIn= false, Name = "Travel?",FontStyle="fa-fighter-jet"},
                new BillType { IsCountIn= false, Name = "Holiday gift",FontStyle="fa-gift"},
                new BillType { IsCountIn= false, Name = "Party dinner",FontStyle="fa-users"},
                new BillType { IsCountIn= false, Name = "Medical health",FontStyle="fa-plus-square"},
                new BillType { IsCountIn= false, Name = "Pets",FontStyle="fa-github-alt"},
                new BillType { IsCountIn= false, Name = "Book materials",FontStyle="fa-file-excel-o"},
                new BillType { IsCountIn= false, Name = "tool",FontStyle="fa-wrench"},
                new BillType { IsCountIn= false, Name = "motion",FontStyle="fa-frown-o"},
                new BillType { IsCountIn= false, Name = "Training learning",FontStyle="fa-pied-piper-alt"},
                new BillType { IsCountIn= false, Name = "Children",FontStyle="fa-child"},
                new BillType { IsCountIn= false, Name = "Housing at home",FontStyle="fa-home"},
                new BillType { IsCountIn= false, Name = "Movie performance",FontStyle="fa-film"},
                new BillType { IsCountIn= false, Name = "Recreation & Entertainment",FontStyle="fa-coffee"},
                new BillType { IsCountIn= false, Name = "Red envelopes",FontStyle="fa-bomb"},
                new BillType { IsCountIn= false, Name = "Loan",FontStyle="fa-skype"},
                new BillType { IsCountIn= false, Name = "Other",FontStyle="fa-globe"},
            };
            foreach (var billType in list)
            {
                AddBillTypesIfNotExists(billType);
            }


        }
        private void AddBillTypesIfNotExists(BillType billType)
        {
            if (_context.BillTypes.Any(l => l.Name == billType.Name))
            {
                return;
            }

            _context.BillTypes.Add(billType);

            _context.SaveChanges();
        }
    }
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68

Modifying seed () method in Configuration

        protected override void Seed(MyBill.EntityFramework.MyBillDbContext context)
        {
            context.DisableAllFilters();

            if (Tenant == null)
            {
                //Host seed
                new InitialHostDbBuilder(context).Create();

                //Default tenant seed (in host database).
                new DefaultTenantCreator(context).Create();
                new TenantRoleAndUserBuilder(context, 1).Create();
            }
            else
            {
                //You can add seed for tenant databases and use Tenant property...
            }
            new DefaultBillTypeCreator(context).Create();// Add your own initial data execution
            context.SaveChanges();
        }
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21

Execute Add-Migration Add_Bills add migration

Execute update-database to migrate data
Open the database to see
 
 
3. Writing Service
The service is written in Application and the following files are created.

using System;

namespace MyBill.Bills.Dto
{
    public class BillDto
    {
        public int Id { get; set; }
        /// <summary>
        /// Creation time
        /// </summary>
        public DateTime CreationTime { get; set; }
        /// <summary>
        /// Amount of account
        /// </summary>
        public decimal Money { get; set; }
        /// <summary>
        /// Name
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// font Icon style name
        /// </summary>
        public string FontStyle { get; set; }
    }
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
namespace MyBill.Bills.Dto
{
    public class ChartNumDto
    {
        public string Name { get; set; }
        public decimal Value { get; set; }

    }
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
using Abp.AutoMapper;
using System;
using System.ComponentModel.DataAnnotations;


namespace MyBill.Bills.Dto
{
    [AutoMapTo(typeof(Bill))]
    public class CreateBillDto
    {
        /// <summary>
        /// creator
        /// </summary>
        public string CreatorUser { get; set; }
        /// <summary>
        /// Creation time
        /// </summary>
        public DateTime CreationTime { get; set; }
        /// <summary>
        /// Bookkeeping type
        /// </summary>
        [Required]
        public int BillTypeId { get; set; }
        /// <summary>
        /// Amount of account
        /// </summary>
        [Required]
        public decimal Money { get; set; }
        /// <summary>
        /// describe
        /// </summary>
        public string Des { get; set; }

        public CreateBillDto()
        {
            this.CreationTime = DateTime.Now;
        }
    }
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
using Abp.Application.Services.Dto;
using System;
using System.ComponentModel.DataAnnotations;

namespace MyBill.Bills.Dto
{
    public class GetBillDto : IPagedResultRequest, ISortedResultRequest
    {
        [Range(0, 1000)]
        public int MaxResultCount { get; set; }

        public int SkipCount { get; set; }

        public string Sorting { get; set; }

        public DateTime? Date { get; set; }
        public string User { get; set; }
        /// <summary>
        /// Data type, 0 by year, 1 by month,
        /// </summary>
        public int Type { get; set; }
        /// <summary>
        /// Grouping based on 0, consumption type, January
        /// </summary>
        public int GroupBy { get; set; }

    }
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
using Abp.Application.Services;
using Abp.Application.Services.Dto;
using MyBill.Bills.Dto;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace MyBill.Bills
{
    public interface IBillAppServer : IApplicationService
    {
        /// <summary>
        /// Add a record
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task CreatBill(CreateBillDto input);
        /// <summary>
        /// Delete a record
        /// </summary>
        /// <param name="key"></param>
        Task DeleteBill(int key);
        /// <summary>
        /// Obtaining Consumption Types
        /// </summary>
        /// <returns></returns>
        IList<BillType> GetBillType();
        /// <summary>
        /// Access to statistical information
        /// </summary>
        /// <param name="date">time</param>
        /// <param name="type">Type, 0 by year, 1 by month</param>
        /// <returns></returns>
        IList<ChartNumDto> GetCount(GetBillDto input);
        /// <summary>
        /// Get list
        /// </summary>
        /// <param name="getBillDto"></param>
        /// <returns></returns>
        PagedResultDto<BillDto> GetBills(GetBillDto input);
        /// <summary>
        /// Obtain total bookkeeping
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        decimal GetTotallCount(GetBillDto input);
    }
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
using Abp;
using Abp.Application.Services.Dto;
using Abp.Domain.Repositories;
using MyBill.Bills.Dto;
using System;
using System.Collections.Generic;
using System.Linq;
using Abp.Linq.Extensions;
using System.Threading.Tasks;
using System.Data.Entity;

namespace MyBill.Bills
{
    public class BillAppServer : AbpServiceBase, IBillAppServer
    {
        private readonly IRepository<Bill> _billRepository;
        private readonly IRepository<BillType> _billTypeRepository;
        public BillAppServer(IRepository<Bill> billRepository,
            IRepository<BillType> billTypeRepository
            )
        {
            _billRepository = billRepository;
            _billTypeRepository = billTypeRepository;
        }

        public async Task DeleteBill(int key)
        {
            await _billRepository.DeleteAsync(key);
        }

        public async Task CreatBill(CreateBillDto input)
        {
            var bill = ObjectMapper.Map<Bill>(input);
            await _billRepository.InsertAsync(bill);
        }

        public IList<BillType> GetBillType()
        {
            return _billTypeRepository.GetAllList();
        }

        public IList<ChartNumDto> GetCount(GetBillDto input)
        {
            if (!input.Date.HasValue) return null;
            string date = "";
            DateTime startDate, endDate;
            if (input.Type == 1)
            {
                date = input.Date.Value.ToString("yyyy-MM");
                startDate = DateTime.Parse(date);
                endDate = startDate.AddMonths(1);
            }
            else
            {
                date = input.Date.Value.Year + "-01-01";
                startDate = DateTime.Parse(date);
                endDate = startDate.AddYears(1);
            }

            if (input.GroupBy == 1)
            {
                var bills = _billRepository.GetAll().Where(m => m.CreationTime >= startDate && m.CreationTime < endDate && m.CreatorUser == input.User);
                return bills.GroupBy(m => m.CreationTime.Month).Select(m => new ChartNumDto
                {
                    Name = m.Key + "month",
                    Value = m.Sum(n => n.Money)
                }).ToList();
            }
            else
            {
                var bills = _billRepository.GetAll().Where(m => m.CreationTime >= startDate && m.CreationTime < endDate && m.CreatorUser == input.User).Include(m => m.BillType);
                return bills.GroupBy(m => m.BillType.Name).Select(m => new ChartNumDto
                {
                    Name = m.Key,
                    Value = m.Sum(n => n.Money)
                }).ToList();
            }


        }

        public PagedResultDto<BillDto> GetBills(GetBillDto input)
        {
            if (!input.Date.HasValue) return null;
            var date = input.Date.Value.ToString("yyyy-MM");
            var startDate = DateTime.Parse(date);
            var endDate = startDate.AddMonths(1);
            var bills = _billRepository.GetAll().Where(m => m.CreationTime >= startDate && m.CreationTime < endDate && m.CreatorUser == input.User);
            var count = bills.Count();
            var billsPage = bills
                                        .Include(q => q.BillType)
                                        .OrderBy(q => q.CreationTime)
                                        .PageBy(input)
                                        .Select(m => new BillDto
                                        {
                                            Name = m.BillType.Name,
                                            FontStyle = m.BillType.FontStyle,
                                            Money = m.Money,
                                            Id = m.Id,
                                            CreationTime = m.CreationTime
                                        })
                                        .ToList();
            return new PagedResultDto<BillDto>
            {
                TotalCount = count,
                Items = billsPage
            };
        }
        public decimal GetTotallCount(GetBillDto input)
        {
            var bills = _billRepository.GetAll().Where(m => m.CreatorUser == input.User);
            return bills.Sum(m => m.Money);
        }
    }
}

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117

abp encapsulates a common warehouse IRepository, so it is generally not necessary to write the warehouse separately.

4. Write controller
Add

using Abp.Web.Security.AntiForgery;
using MyBill.Bills;
using MyBill.Bills.Dto;
using System;
using System.Threading.Tasks;
using System.Web.Mvc;

namespace MyBill.Web.Controllers
{
    public class BillController : MyBillControllerBase
    {
        private readonly IBillAppServer _billAppService;

        public BillController(IBillAppServer billAppService)
        {
            _billAppService = billAppService;
        }
        [DisableAbpAntiForgeryTokenValidation]
        public ActionResult GetBillType()
        {
            try
            {
                var result = _billAppService.GetBillType();
                return Json(new { result = true, data = result }, JsonRequestBehavior.AllowGet);
            }
            catch (Exception e)
            {
                return Json(new { result = false, data = e.Message }, JsonRequestBehavior.AllowGet);
            }

        }
        [DisableAbpAntiForgeryTokenValidation]
        public ActionResult GetBills(GetBillDto input)
        {
            input.MaxResultCount = 10;
            try
            {
                var result = _billAppService.GetBills(input);
                return Json(new { result = true, data = result }, JsonRequestBehavior.AllowGet);
            }
            catch (Exception e)
            {
                return Json(new { result = false, data = e.Message }, JsonRequestBehavior.AllowGet);
            }
        }
        [DisableAbpAntiForgeryTokenValidation]
        public ActionResult GetCount(GetBillDto input)
        {
            try
            {
                var result = _billAppService.GetCount(input);
                return Json(new { result = true, data = result }, JsonRequestBehavior.AllowGet);
            }
            catch (Exception e)
            {
                return Json(new { result = false, data = e.Message }, JsonRequestBehavior.AllowGet);
            }
        }
        [DisableAbpAntiForgeryTokenValidation]
        public async Task<JsonResult> AddBills(CreateBillDto bill)
        {
            try
            {
                if (string.IsNullOrEmpty(bill.CreatorUser)) bill.CreatorUser = "1";
                await _billAppService.CreatBill(bill);
                return Json(new { result = true, data = "success" }, JsonRequestBehavior.AllowGet);
            }
            catch (Exception e)
            {
                return Json(new { result = false, data = e.Message }, JsonRequestBehavior.AllowGet);
            }
        }
        [DisableAbpAntiForgeryTokenValidation]
        public ActionResult GetTotallCount(GetBillDto input)
        {
            try
            {
                var result = _billAppService.GetTotallCount(input);
                return Json(new { result = true, data = result }, JsonRequestBehavior.AllowGet);
            }
            catch (Exception e)
            {
                return Json(new { result = false, data = e.Message }, JsonRequestBehavior.AllowGet);
            }
        }
        [DisableAbpAntiForgeryTokenValidation]
        public async Task<ActionResult> DeleteBill(int key)
        {
            try
            {
                await _billAppService.DeleteBill(key);
                return Json(new { result = true, data = "" }, JsonRequestBehavior.AllowGet);
            }
            catch (Exception e)
            {
                return Json(new { result = false, data = e.Message }, JsonRequestBehavior.AllowGet);
            }
        }
    }
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100

Attention should be paid to adding the [Disable abp AntiForgery Token Validation] tag because the abp framework has anti-counterfeiting validation for post requests. Adding this tag can avoid anti-counterfeiting validation or modify the protocol header when post requests are needed, or use ajax requests encapsulated by abp itself.

5. Try Controller
Enter the corresponding address in the address bar;

5. Backstage completion

Write the interface api and throw it to the front desk.
1. Obtain the type of accounting:
Path: / bill/GetBillType
METHODS: get
Parameter: None
Return: Correct {"result": true, "data": []} Error {"result": false, "data": []}
Where [] represents an array. Array Element Reference: {"name":"food", "font Style": null,""imgUrl": null," "isCountIn": false,""id": 1}
2. Add billing data:
Path: / bill/AddBills
METHODS: post
Parameter: {CreatorUser: User's name or ID ID id, BillTypeId: ID of the data returned in Method 1, Money: Accounting amount, Des: Description, no}
Return: Success {result = true, data = success} Failure: {result = false, data = error content}
3. Obtain billing data:
Path: / bill/GetBills
METHODS: get
Parameters: {User: User: User's name or id identifier, Date: Time of data, Type:'Data type 0 represents data for one year, data basis for one month', SkipCount: How much data is used for paging before skipping}
Return: Correct {"result": true, "data": {Total Count: Total number of data, items:[]} Error {"result": false, "data": error content}
Where [] represents an array. Array Element Reference: {"id": 1, "Creation Time": "2017-09-12T13:13:32.03", "money": 123.00, "name", "daily use", "font Style": null}
4. Delete billing data:
Path: / bill/DeleteBill
METHODS: post
Parameter: {key: id of the data returned in method 3}
Return: Success {result = true, data = success} Failure: {result = false, data = error content}
5. Get the total number of accounts.
Path: / bill/GetTotallCount
METHODS: get
Parameter: {CreatorUser: User's name or id identifier}
Return: Success {result = true, data = value} Failure: {result = false, data = error content}
6. Access to statistical data
Path: / bill/GetCount
METHODS: get
Parameters: {User: User: User's name or id identifier, Date: Time of data, Type:'Data type 0 represents data for one year, data basis for one month', GroupBy: GroupBy: Groupby 0, consumption type, January}
Return: Success {result = true, data = []} Failure: {result = false, data = error content}
Where [] denotes that the array is the data required for the graph. Array Element Reference: {"name":"daily life", "value": 123.00} or {"name":"September", "value": 123.00}]

Posted by demon_athens on Wed, 19 Dec 2018 20:00:07 -0800