收藏关注不迷路!!
🌟文末获取源码+数据库🌟
感兴趣的可以先收藏起来,还有大家在毕设选题(免费咨询指导选题),项目以及论文编写等相关问题都可以给我留言咨询,希望帮助更多的人
前言
💗博主介绍:✨全网粉丝10W+,CSDN特邀作者、博客专家、CSDN新星计划导师,专注于Java/Python/小程序app/深度学习等计算机设计,主要对象是咱们计算机相关专业的大学生,希望您们都能前途无量!✨💗
👇🏻 精彩专栏 推荐订阅👇🏻
计算机毕业设计设计精品实战案例✅
感兴趣的可以先收藏起来,还有大家在毕设选题,项目以及论文编写等相关问题都可以给我留言咨询,希望帮助更多的人
程序资料获取
🌟文末获取资料🌟
一、项目技术
开发软件:VS 2017 (版本2017以上即可,不能低于2017)
数据库:SqlServer2008r2(数据库版本无限制,都可以导入)
开发模式:mvc
浏览器:谷歌浏览器
二、项目内容和功能介绍
🎈1.项目内容
随着科学技术的飞速发展,各行各业都在努力与现代先进技术接轨,通过科技手段提高自身的优势;对于旅游网站当然也不能排除在外,随着网络技术的不断成熟,带动了旅游网站,它彻底改变了过去传统的管理方式,不仅使服务管理难度变低了,还提升了管理的灵活性。这种个性化的平台特别注重交互协调与管理的相互配合,激发了管理人员的创造性与主动性,对旅游网站而言非常有利。
本系统采用的数据库是Mysql,使用django技术开发,运行环境使用Tomcat服务器,ECLIPSE 是本系统的开发平台。在设计过程中,充分保证了系统代码的良好可读性、实用性、易扩展性、通用性、便于后期维护、操作方便以及页面简洁等特点。
🎈2.功能介绍
使用旅游网站系统的用户分管理员和用户两个角色的权限子模块。
管理员所能使用的功能主要有:首页、个人中心、用户管理、景点分类管理、景点信息管理、门票预订管理、酒店信息管理、客房信息管理、客房预订管理、美食信息管理、用户分享、系统管理等。
用户可以实现首页、景点信息、客房信息、美食信息、用户分享、公告信息、个人中心、后台管理、帮助中心等功能。
三、核心代码
部分代码:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.StaticFiles;
using Newtonsoft.Json;
using Xiezn.Core.Business.Services;
using Xiezn.Core.Common.Helpers;
using Xiezn.Core.Models.ViewModel;
namespace Xiezn.Core.Controllers
{
/// <summary>
/// 公共接口
/// </summary>
[Route("[action]")]
public class CommonController : Controller
{
private readonly IHostingEnvironment _hostingEnvironment;
private readonly string _savePath;
private readonly CommonService _bll;
private readonly ConfigService _configBLL;
/// <summary>
/// 构造函数
/// </summary>
public CommonController(IHostingEnvironment hostingEnvironment)
{
_hostingEnvironment = hostingEnvironment;
_savePath = _hostingEnvironment.WebRootPath + Path.DirectorySeparatorChar + ConfigHelper.GetConfig("SchemaName") + Path.DirectorySeparatorChar + "upload" + Path.DirectorySeparatorChar;
_bll = new CommonService();
_configBLL = new ConfigService();
}
/// <summary>
/// 获取某表的某个字段列表接口
/// </summary>
/// <param name="tableName">表名</param>
/// <param name="columnName">列名</param>
/// <returns></returns>
[HttpGet("{tableName}/{columnName}")]
public JsonResult Option(string tableName, string columnName)
{
try
{
int level = Convert.ToInt32(HttpContext.Request.Query["level"]);
string parent = HttpContext.Request.Query["parent"];
string conditionColumn = HttpContext.Request.Query["conditionColumn"];
string conditionValue = HttpContext.Request.Query["conditionValue"];
if (!string.IsNullOrEmpty(conditionColumn) && !string.IsNullOrEmpty(conditionValue))
{
return Json(new { Code = 0, Data = _bll.Common(tableName, columnName, "", 0, "option", 0, 0, " AND " + conditionColumn + " = '" + conditionValue + "' ") });
}
if (level == 0)
{
return Json(new { Code = 0, Data = _bll.Common(tableName, columnName, parent, level) });
}
else
{
return Json(new { Code = 0, Data = _bll.Common(tableName, columnName) });
}
}
catch (Exception ex)
{
return Json(new { Code = 500, Msg = ex.Message });
}
}
/// <summary>
/// 根据option字段值获取某表的单行记录接口
/// </summary>
/// <param name="tableName">表名</param>
/// <param name="columnName">列名</param>
/// <param name="columnValue">列值</param>
/// <returns></returns>
[HttpGet("{tableName}/{columnName}")]
public JsonResult Follow(string tableName, string columnName, string columnValue)
{
try
{
return Json(new { Code = 0, Data = _bll.Common(tableName, columnName, columnValue, 0, "follow") });
}
catch (Exception ex)
{
return Json(new { Code = 500, Msg = ex.Message });
}
}
/// <summary>
/// 根据主键id修改table表的sfsh状态接口
/// </summary>
/// <param name="tableName">表名</param>
/// <param name="id">主键id</param>
/// <param name="sfsh">当前审核状态(是/否)</param>
/// <returns></returns>
[HttpPost("{tableName}")]
[Authorize(Roles = "Admin,Client")]
public JsonResult Sh(string tableName, int id, string sfsh)
{
try
{
if (_bll.Common(tableName, id.ToString(), sfsh, 0, "sh") > 0)
{
return Json(new { Code = 0, Msg = "更新成功!" });
}
return Json(new { Code = -1, Msg = "更新失败!" });
}
catch (Exception ex)
{
return Json(new { Code = 500, Msg = ex.Message });
}
}
/// <summary>
/// 获取需要提醒的记录数接口
/// </summary>
/// <param name="tableName">表名</param>
/// <param name="columnName">列名</param>
/// <param name="type">类型(1表示数字比较提醒,2表示日期比较提醒)</param>
/// <param name="remindStart">remindStart小于等于columnName满足条件提醒,当比较日期时,该值表示天数</param>
/// <param name="remindEnd">columnName小于等于remindEnd 满足条件提醒,当比较日期时,该值表示天数</param>
/// <returns></returns>
[HttpGet("{tableName}/{columnName}/{type}")]
public JsonResult Remind(string tableName, string columnName, int type, int remindStart, int remindEnd)
{
try
{
return Json(new { Code = 0, Count = _bll.Common(tableName, columnName, "", type, "remind", remindStart, remindEnd) });
}
catch (Exception ex)
{
return Json(new { Code = 500, Msg = ex.Message });
}
}
/// <summary>
/// 计算规则接口
/// </summary>
/// <param name="tableName">表名</param>
/// <param name="columnName">列名</param>
/// <returns></returns>
[HttpGet("{tableName}/{columnName}")]
public JsonResult Cal(string tableName, string columnName)
{
try
{
return Json(new { Code = 0, Data = _bll.Common(tableName, columnName, "", 0, "cal") });
}
catch (Exception ex)
{
return Json(new { Code = 500, Msg = ex.Message });
}
}
/// <summary>
/// 人脸比较
/// </summary>
/// <param name="face1">图片1名称</param>
/// <param name="face2">图片2名称</param>
/// <returns></returns>
[HttpGet]
public JsonResult MatchFace(string face1, string face2)
{
try
{
BaiduAiHelper.clientId = _configBLL.GetValueByName("APIKey");
BaiduAiHelper.clientSecret = _configBLL.GetValueByName("SecretKey");
BaiduAiHelper.GetAccessToken();
List<FaceMatchViewModel> matchInfo = new List<FaceMatchViewModel>
{
new FaceMatchViewModel { image = FuncHelper.ImageToBase64(_savePath + face1) },
new FaceMatchViewModel { image = FuncHelper.ImageToBase64(_savePath + face2) }
};
string result = BaiduAiHelper.FaceMatch(JsonConvert.SerializeObject(matchInfo));
dynamic resObj = JsonConvert.DeserializeObject(result);
if (resObj.error_code == 0)
{
return Json(new { Code = 0, Score = resObj.result.score, Msg = "匹配成功!" });
}
else
{
return Json(new { Code = -1, Score = 0, Msg = "匹配失败!" });
}
}
catch (Exception ex)
{
return Json(new { Code = 500, Msg = ex.Message });
}
}
/// <summary>
/// 定位接口(根据经纬度坐标获取到省市县(区)信息)
/// </summary>
/// <param name="lat">经度</param>
/// <param name="lng">纬度</param>
/// <returns></returns>
[HttpGet]
public JsonResult Location(double lat, double lng)
{
try
{
AddressViewModel addressViewModel = BaiduAiHelper.GetAddress(_configBLL.GetValueByName("baidu_ditu_ak"), lng, lat);
if (addressViewModel == null)
{
return Json(new { Code = -1, Msg = "位置信息获取失败!" });
}
else
{
return Json(new { Code = 0, Data = addressViewModel });
}
}
catch (Exception ex)
{
return Json(new { Code = 500, Msg = ex.Message });
}
}
/// <summary>
/// 类别统计接口
/// </summary>
/// <param name="tableName">表名</param>
/// <param name="columnName">列名</param>
/// <returns></returns>
[HttpGet("{tableName}/{columnName}")]
public JsonResult Group(string tableName, string columnName)
{
try
{
return Json(new { Code = 0, Data = _bll.Common(tableName, columnName, "", 0, "group") });
}
catch (Exception ex)
{
return Json(new { Code = 500, Msg = ex.Message });
}
}
/// <summary>
/// 按值统计接口
/// </summary>
/// <param name="tableName">表名</param>
/// <param name="xColumnName">列名</param>
/// <param name="yColumnName">列名</param>
/// <returns></returns>
[HttpGet("{tableName}/{xColumnName}/{yColumnName}")]
public JsonResult Value(string tableName, string xColumnName, string yColumnName)
{
try
{
return Json(new { Code = 0, Data = _bll.Common(tableName, xColumnName, yColumnName, 0, "value") });
}
catch (Exception ex)
{
return Json(new { Code = 500, Msg = ex.Message });
}
}
/// <summary>
/// 按时间统计类型接口
/// </summary>
/// <param name="tableName">表名</param>
/// <param name="xColumnName">列名</param>
/// <param name="yColumnName">列名</param>
/// <param name="timeStatType">类型</param>
/// <returns></returns>
[HttpGet("{tableName}/{xColumnName}/{yColumnName}/{timeStatType}")]
public JsonResult Value(string tableName, string xColumnName, string yColumnName, string timeStatType)
{
try
{
return Json(new { Code = 0, Data = _bll.StatDate(tableName, xColumnName, yColumnName, timeStatType) });
}
catch (Exception ex)
{
return Json(new { Code = 500, Msg = ex.Message });
}
}
}
}
数据库参考
-- ----------------------------
-- Table structure for config
-- ----------------------------
DROP TABLE [dbo].[config]
GO
CREATE TABLE [dbo].[config] (
[id] [bigint] primary key ,
[name] nvarchar(100) NOT NULL ,
[value] nvarchar(100) NULL
)
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description',
'SCHEMA', N'dbo',
'TABLE', N'config',
NULL, NULL)) > 0)
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'配置文件'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'config'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'配置文件'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'config'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description',
'SCHEMA', N'dbo',
'TABLE', N'config',
'COLUMN', N'id')) > 0)
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'主键'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'config'
, @level2type = 'COLUMN', @level2name = N'id'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'主键'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'config'
, @level2type = 'COLUMN', @level2name = N'id'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description',
'SCHEMA', N'dbo',
'TABLE', N'config',
'COLUMN', N'name')) > 0)
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'配置参数名称'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'config'
, @level2type = 'COLUMN', @level2name = N'name'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'配置参数名称'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'config'
, @level2type = 'COLUMN', @level2name = N'name'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description',
'SCHEMA', N'dbo',
'TABLE', N'config',
'COLUMN', N'value')) > 0)
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'配置参数值'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'config'
, @level2type = 'COLUMN', @level2name = N'value'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'配置参数值'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'config'
, @level2type = 'COLUMN', @level2name = N'value'
GO
-- ----------------------------
-- Records of config
-- ----------------------------
INSERT INTO [dbo].[config] ([id], [name], [value]) VALUES (N'1', N'picture1', N'upload/picture1.jpg')
GO
GO
INSERT INTO [dbo].[config] ([id], [name], [value]) VALUES (N'2', N'picture2', N'upload/picture2.jpg')
GO
GO
INSERT INTO [dbo].[config] ([id], [name], [value]) VALUES (N'3', N'picture3', N'upload/picture3.jpg')
GO
GO
-- ----------------------------
-- Table structure for discussjingdianxinxi
-- ----------------------------
DROP TABLE [dbo].[discussjingdianxinxi]
GO
CREATE TABLE [dbo].[discussjingdianxinxi] (
[id] [bigint] primary key ,
[addtime] datetime2(0) default getdate() ,
[refid] bigint NOT NULL ,
[userid] bigint NOT NULL ,
[nickname] nvarchar(200) NULL ,
[content] nvarchar(MAX) NOT NULL ,
[reply] nvarchar(MAX) NULL
)
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description',
'SCHEMA', N'dbo',
'TABLE', N'discussjingdianxinxi',
NULL, NULL)) > 0)
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'景点信息评论表'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'discussjingdianxinxi'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'景点信息评论表'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'discussjingdianxinxi'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description',
'SCHEMA', N'dbo',
'TABLE', N'discussjingdianxinxi',
'COLUMN', N'id')) > 0)
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'主键'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'discussjingdianxinxi'
, @level2type = 'COLUMN', @level2name = N'id'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'主键'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'discussjingdianxinxi'
, @level2type = 'COLUMN', @level2name = N'id'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description',
'SCHEMA', N'dbo',
'TABLE', N'discussjingdianxinxi',
'COLUMN', N'addtime')) > 0)
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'创建时间'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'discussjingdianxinxi'
, @level2type = 'COLUMN', @level2name = N'addtime'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'创建时间'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'discussjingdianxinxi'
, @level2type = 'COLUMN', @level2name = N'addtime'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description',
'SCHEMA', N'dbo',
'TABLE', N'discussjingdianxinxi',
'COLUMN', N'refid')) > 0)
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'关联表id'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'discussjingdianxinxi'
, @level2type = 'COLUMN', @level2name = N'refid'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'关联表id'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'discussjingdianxinxi'
, @level2type = 'COLUMN', @level2name = N'refid'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description',
'SCHEMA', N'dbo',
'TABLE', N'discussjingdianxinxi',
'COLUMN', N'userid')) > 0)
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'用户id'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'discussjingdianxinxi'
, @level2type = 'COLUMN', @level2name = N'userid'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'用户id'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'discussjingdianxinxi'
, @level2type = 'COLUMN', @level2name = N'userid'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description',
'SCHEMA', N'dbo',
'TABLE', N'discussjingdianxinxi',
'COLUMN', N'nickname')) > 0)
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'用户名'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'discussjingdianxinxi'
, @level2type = 'COLUMN', @level2name = N'nickname'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'用户名'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'discussjingdianxinxi'
, @level2type = 'COLUMN', @level2name = N'nickname'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description',
'SCHEMA', N'dbo',
'TABLE', N'discussjingdianxinxi',
'COLUMN', N'content')) > 0)
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'评论内容'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'discussjingdianxinxi'
, @level2type = 'COLUMN', @level2name = N'content'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'评论内容'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'discussjingdianxinxi'
, @level2type = 'COLUMN', @level2name = N'content'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description',
'SCHEMA', N'dbo',
'TABLE', N'discussjingdianxinxi',
'COLUMN', N'reply')) > 0)
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'回复内容'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'discussjingdianxinxi'
, @level2type = 'COLUMN', @level2name = N'reply'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'回复内容'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'discussjingdianxinxi'
, @level2type = 'COLUMN', @level2name = N'reply'
GO
四、效果图
五 、资料获取
文章下方名片联系我即可~
精彩专栏推荐订阅:在下方专栏👇🏻
毕业设计精品实战案例
收藏关注不迷路!!
🌟文末获取设计🌟