package com.controller;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ResourceUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.annotation.IgnoreAuth;
import com.baidu.aip.face.AipFace;
import com.baidu.aip.face.MatchRequest;
import com.baidu.aip.util.Base64Util;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import com.service.CommonService;
import com.service.ConfigService;
import com.utils.BaiduUtil;
import com.utils.FileUtil;
import com.utils.R;
/**
* 通用接口
*/
@RestController
public class CommonController{
@Autowired
private CommonService commonService;
private static AipFace client = null;
@Autowired
private ConfigService configService;
/**
* 获取table表中的column列表(联动接口)
* @param table
* @param column
* @return
*/
@IgnoreAuth
@RequestMapping("/option/{tableName}/{columnName}")
public R getOption(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName,String level,String parent) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName);
params.put("column", columnName);
if(StringUtils.isNotBlank(level)) {
params.put("level", level);
}
if(StringUtils.isNotBlank(parent)) {
params.put("parent", parent);
}
List<String> data = commonService.getOption(params);
return R.ok().put("data", data);
}
/**
* 根据table中的column获取单条记录
* @param table
* @param column
* @return
*/
@IgnoreAuth
@RequestMapping("/follow/{tableName}/{columnName}")
public R getFollowByOption(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName, @RequestParam String columnValue) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName);
params.put("column", columnName);
params.put("columnValue", columnValue);
Map<String, Object> result = commonService.getFollowByOption(params);
return R.ok().put("data", result);
}
/**
* 修改table表的sfsh状态
* @param table
* @param map
* @return
*/
@RequestMapping("/sh/{tableName}")
public R sh(@PathVariable("tableName") String tableName, @RequestBody Map<String, Object> map) {
map.put("table", tableName);
commonService.sh(map);
return R.ok();
}
/**
* 获取需要提醒的记录数
* @param tableName
* @param columnName
* @param type 1:数字 2:日期
* @param map
* @return
*/
@IgnoreAuth
@RequestMapping("/remind/{tableName}/{columnName}/{type}")
public R remindCount(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("table", tableName);
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
int count = commonService.remindCount(map);
return R.ok().put("count", count);
}
/**
* 单列求和
*/
@IgnoreAuth
@RequestMapping("/cal/{tableName}/{columnName}")
public R cal(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName);
params.put("column", columnName);
Map<String, Object> result = commonService.selectCal(params);
return R.ok().put("data", result);
}
/**
* 分组统计
*/
@IgnoreAuth
@RequestMapping("/group/{tableName}/{columnName}")
public R group(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName);
params.put("column", columnName);
List<Map<String, Object>> result = commonService.selectGroup(params);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
for(Map<String, Object> m : result) {
for(String k : m.keySet()) {
if(m.get(k) instanceof Date) {
m.put(k, sdf.format((Date)m.get(k)));
}
}
}
return R.ok().put("data", result);
}
/**
* (按值统计)
*/
@IgnoreAuth
@RequestMapping("/value/{tableName}/{xColumnName}/{yColumnName}")
public R value(@PathVariable("tableName") String tableName, @PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName);
params.put("xColumn", xColumnName);
params.put("yColumn", yColumnName);
List<Map<String, Object>> result = commonService.selectValue(params);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
for(Map<String, Object> m : result) {
for(String k : m.keySet()) {
if(m.get(k) instanceof Date) {
m.put(k, sdf.format((Date)m.get(k)));
}
}
}
return R.ok().put("data", result);
}
/**
* (按值统计)时间统计类型
*/
@IgnoreAuth
@RequestMapping("/value/{tableName}/{xColumnName}/{yColumnName}/{timeStatType}")
public R valueDay(@PathVariable("tableName") String tableName, @PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName, @PathVariable("timeStatType") String timeStatType) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName);
params.put("xColumn", xColumnName);
params.put("yColumn", yColumnName);
params.put("timeStatType", timeStatType);
List<Map<String, Object>> result = commonService.selectTimeStatValue(params);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
for(Map<String, Object> m : result) {
for(String k : m.keySet()) {
if(m.get(k) instanceof Date) {
m.put(k, sdf.format((Date)m.get(k)));
}
}
}
return R.ok().put("data", result);
}
/**
* 人脸比对
*
* @param face1 人脸1
* @param face2 人脸2
* @return
*/
@RequestMapping("/matchFace")
@IgnoreAuth
public R matchFace(String face1, String face2,HttpServletRequest request) {
if(client==null) {
/*String AppID = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "AppID")).getValue();*/
String APIKey = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "APIKey")).getValue();
String SecretKey = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "SecretKey")).getValue();
String token = BaiduUtil.getAuth(APIKey, SecretKey);
if(token==null) {
return R.error("请在配置�
没有合适的资源?快使用搜索试试~ 我知道了~
springboot学生成绩管理系统--LW.zip
共375个文件
svg:161个
java:75个
vue:35个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 190 浏览量
2024-12-03
20:32:25
上传
评论
收藏 13.21MB ZIP 举报
温馨提示
springboot学生成绩管理系统--LW.zip
资源推荐
资源详情
资源评论
收起资源包目录
springboot学生成绩管理系统--LW.zip (375个子文件)
update-password.vue.bak 3KB
IndexMain.vue.bak 2KB
IndexAsideStatic.vue.bak 2KB
BreadCrumbs.vue.bak 2KB
IndexHeader.vue.bak 2KB
3-build.bat 15B
2-run.bat 14B
1-install.bat 12B
.classpath 2KB
mvnw.cmd 7KB
app.543598eb.css 260KB
chunk-vendors.a72b0961.css 37KB
canvas-bg-1.css 391B
canvas-bg-2.css 83B
canvas-bg-3.css 61B
springboot开发文档.docx 13KB
.factorypath 15KB
.gitignore 364B
index.html 930B
index.html 559B
favicon.ico 4KB
favicon.ico 4KB
maven-wrapper.jar 50KB
CommonController.java 9KB
XueshengController.java 9KB
JiaoshiController.java 9KB
ZonghechengjiController.java 7KB
BanjiController.java 6KB
ZonghechengjiEntity.java 5KB
MPUtil.java 5KB
UserController.java 5KB
MavenWrapperDownloader.java 5KB
FileController.java 4KB
ZonghechengjiModel.java 4KB
ZonghechengjiVO.java 4KB
JiaoshiEntity.java 4KB
XueshengEntity.java 4KB
BaiduUtil.java 4KB
AuthorizationInterceptor.java 3KB
ConfigController.java 3KB
Query.java 3KB
XueshengModel.java 3KB
JiaoshiModel.java 3KB
XueshengVO.java 2KB
JiaoshiVO.java 2KB
TokenServiceImpl.java 2KB
TokenEntity.java 2KB
CommonUtil.java 2KB
ZonghechengjiServiceImpl.java 2KB
PageUtils.java 2KB
BanjiEntity.java 2KB
XueshengServiceImpl.java 2KB
JiaoshiServiceImpl.java 2KB
BanjiServiceImpl.java 2KB
InterceptorConfig.java 1KB
CommonServiceImpl.java 1KB
UserServiceImpl.java 1KB
UserEntity.java 1KB
SpringContextUtils.java 1KB
ValidatorUtils.java 1KB
SQLFilter.java 1KB
ZonghechengjiService.java 1KB
ZonghechengjiDao.java 1KB
HttpClientUtils.java 1013B
XueshengService.java 980B
JiaoshiService.java 966B
XueshengDao.java 963B
ZonghechengjiView.java 955B
JiaoshiDao.java 948B
BanjiService.java 938B
BanjiDao.java 918B
ConfigServiceImpl.java 918B
XueshengView.java 904B
JiaoshiView.java 895B
R.java 884B
BanjiView.java 877B
ConfigEntity.java 851B
EIException.java 845B
SpringbootSchemaApplication.java 802B
JQPageInfo.java 790B
CommonDao.java 701B
TokenService.java 684B
FileUtil.java 680B
BanjiModel.java 676B
CommonService.java 615B
UserService.java 597B
BanjiVO.java 576B
TokenDao.java 560B
UserDao.java 554B
AlipayConfig.java 534B
MybatisPlusConfig.java 523B
ConfigService.java 393B
MD5Util.java 337B
APPLoginUser.java 320B
LoginUser.java 317B
SpringbootSchemaApplicationTests.java 218B
ConfigDao.java 199B
IgnoreAuth.java 196B
bg.jpg 4.12MB
1650097200251.jpg 171KB
共 375 条
- 1
- 2
- 3
- 4
资源评论
yimeixiaolangzai
- 粉丝: 1721
- 资源: 1130
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- springboot项目福泰轴承股份有限公司进销存系统.zip
- springboot项目房屋租赁管理系统boot.zip
- 淘宝购买的廉价232-USB串口线驱动,2011年CH340
- springboot项目防疫物资管理信息系统.zip
- springboot项目高校汉服租赁网站.zip
- springboot项目甘肃旅游服务平台代码.zip
- springboot项目高校毕业与学位资格审核系统_zpl.zip
- springboot项目高校科研信息管理系统.zip
- springboot项目高校教师教研信息填报系统.zip
- springboot项目高校竞赛管理系统.zip
- springboot项目高校危化试剂仓储系统.zip
- springboot项目高校物品捐赠管理系统.zip
- springboot项目高校实习管理系统.zip
- 人工智能与机器学习课程第六组期末作业,去雾模型改善了图像的纹理细节恢复与主观视觉质量
- springboot项目高校疫情防控web系统.zip
- springboot项目工资信息管理系统.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功