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,@RequestParam(required = false) String conditionColumn,@RequestParam(required = false) String conditionValue,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);
}
if(StringUtils.isNotBlank(conditionColumn)) {
params.put("conditionColumn", conditionColumn);
}
if(StringUtils.isNotBlank(conditionValue)) {
params.put("conditionValue", conditionValue);
}
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 = confi
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
基于Vue的健身俱乐部网站.js+SpringBoot+MySQL开发,高分成品毕业设计, (705个子文件)
update-password.vue.bak 3KB
main.js.bak 2KB
IndexMain.vue.bak 2KB
IndexAsideStatic.vue.bak 2KB
BreadCrumbs.vue.bak 2KB
IndexHeader.vue.bak 1KB
3-build.bat 15B
2-run.bat 14B
build.bat 14B
run.bat 14B
1-install.bat 12B
install.bat 12B
mvnw.cmd 6KB
app.84c23d33.css 376KB
chunk-vendors.717566f5.css 242KB
app.87b523ab.css 188KB
chunk-vendors.a72b0961.css 37KB
swiper.min.css 13KB
swiper.min.css 13KB
iconfont.css 599B
canvas-bg-1.css 379B
canvas-bg-1.css 379B
canvas-bg-2.css 79B
canvas-bg-2.css 79B
canvas-bg-4.css 57B
canvas-bg-5.css 57B
canvas-bg-3.css 57B
canvas-bg-3.css 57B
springbootrix1z数据库文档.doc 1.6MB
springboot健身俱乐部网站.docx 12.06MB
.gitignore 333B
index.html 1KB
index.html 971B
index.html 795B
index.html 605B
favicon.ico 4KB
favicon.ico 4KB
favicon.ico 4KB
favicon.ico 4KB
maven-wrapper.jar 50KB
CommonController.java 10KB
JiaolianController.java 9KB
JianshenkechengController.java 9KB
YonghuController.java 8KB
BaiduUtil.java 7KB
XunlianjihuaController.java 7KB
KechengyuyueController.java 7KB
DiscussjianshenkechengController.java 7KB
DiscussjianshenqicaiController.java 7KB
QicaijieyongController.java 7KB
BankaxinxiController.java 7KB
JianshenqicaiController.java 7KB
HuiyuankaxinxiController.java 7KB
StoreupController.java 7KB
JiaoshixinxiController.java 6KB
SystemintroController.java 6KB
MessagesController.java 6KB
AboutusController.java 6KB
NewsController.java 6KB
UsersController.java 5KB
MPUtil.java 5KB
KechengyuyueEntity.java 5KB
MavenWrapperDownloader.java 5KB
BankaxinxiEntity.java 5KB
JianshenkechengEntity.java 5KB
XunlianjihuaEntity.java 4KB
QicaijieyongEntity.java 4KB
FileController.java 4KB
KechengyuyueModel.java 4KB
KechengyuyueVO.java 4KB
StoreupEntity.java 4KB
HuiyuankaxinxiEntity.java 4KB
JianshenqicaiEntity.java 4KB
BankaxinxiModel.java 3KB
JianshenkechengModel.java 3KB
JiaolianEntity.java 3KB
BankaxinxiVO.java 3KB
MessagesEntity.java 3KB
JianshenkechengVO.java 3KB
AuthorizationInterceptor.java 3KB
YonghuEntity.java 3KB
XunlianjihuaModel.java 3KB
DiscussjianshenkechengEntity.java 3KB
DiscussjianshenqicaiEntity.java 3KB
ConfigController.java 3KB
XunlianjihuaVO.java 3KB
SystemintroEntity.java 3KB
AboutusEntity.java 3KB
QicaijieyongModel.java 3KB
QicaijieyongVO.java 3KB
JiaoshixinxiEntity.java 3KB
NewsEntity.java 3KB
Query.java 3KB
StoreupModel.java 2KB
StoreupVO.java 2KB
TokenServiceImpl.java 2KB
JianshenqicaiModel.java 2KB
HuiyuankaxinxiModel.java 2KB
JianshenqicaiVO.java 2KB
MessagesModel.java 2KB
共 705 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
资源评论
普通网友
- 粉丝: 1127
- 资源: 5292
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功