liaoxujun@qq.com
2024-04-01 68bcb554b91c0da1b7765142cc95ba0b5ade1a5a
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
/***********************************************************************
 *            Project: baifenBinfa
 *        ProjectName: 百分兵法管理系统                               
 *                Web: http://chuanyin.com                     
 *             Author:                                        
 *              Email:                               
 *         CreateTime: 202403/02   
 *        Description: 暂无
 ***********************************************************************/
 
 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CoreCms.Net.Configuration;
using CoreCms.Net.IServices;
using CoreCms.Net.Model.FromBody;
using CoreCms.Net.Model.ViewModels.UI;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
 
namespace CoreCms.Net.Web.WebApi.Controllers
{
    /// <summary>
    /// 表单接口
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class FormController : ControllerBase
    {
        private readonly ICoreCmsFormServices _formServices;
 
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="formServices"></param>
        public FormController(ICoreCmsFormServices formServices)
        {
            _formServices = formServices;
        }
 
 
        #region 获取表单列表
        /// <summary>
        /// 获取表单列表
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public async Task<WebApiCallBack> GetList([FromBody] FMPageByIntId entity)
        {
            var jm = new WebApiCallBack();
 
            var list = await _formServices.QueryPageAsync(p => p.endDateTime >= DateTime.Now, p => p.sort, OrderByType.Desc, entity.page, entity.limit);
            jm.status = true;
            jm.data = list;
 
            return jm;
        }
 
        #endregion
 
 
        #region 万能表单/获取活动商品详情=============================================================================
        /// <summary>
        /// 万能表单/获取活动商品详情
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<WebApiCallBack> GetFormDetial([FromBody] FmGetForm entity)
        {
            var jm = await _formServices.GetFormInfo(entity.id, entity.token);
            return jm;
        }
        #endregion
 
        #region 万能表单/提交表单=============================================================================
        /// <summary>
        /// 万能表单/提交表单
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<WebApiCallBack> AddSubmit([FromBody] FmAddSubmit entity)
        {
            var jm = await _formServices.AddSubmit(entity);
 
            jm.otherData = entity;
 
            return jm;
        }
        #endregion
 
 
    }
}