Commit 61b1ac18 by XiaHou

first

parents
HELP.md
/target/
!.mvn/wrapper/maven-wrapper.jar
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
/build/
### VS Code ###
.vscode/
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Maven2 Start Up Batch script
#
# Required ENV vars:
# ------------------
# JAVA_HOME - location of a JDK home dir
#
# Optional ENV vars
# -----------------
# M2_HOME - location of maven2's installed home dir
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
# e.g. to debug Maven itself, use
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
# ----------------------------------------------------------------------------
if [ -z "$MAVEN_SKIP_RC" ] ; then
if [ -f /etc/mavenrc ] ; then
. /etc/mavenrc
fi
if [ -f "$HOME/.mavenrc" ] ; then
. "$HOME/.mavenrc"
fi
fi
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
mingw=false
case "`uname`" in
CYGWIN*) cygwin=true ;;
MINGW*) mingw=true;;
Darwin*) darwin=true
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
if [ -z "$JAVA_HOME" ]; then
if [ -x "/usr/libexec/java_home" ]; then
export JAVA_HOME="`/usr/libexec/java_home`"
else
export JAVA_HOME="/Library/Java/Home"
fi
fi
;;
esac
if [ -z "$JAVA_HOME" ] ; then
if [ -r /etc/gentoo-release ] ; then
JAVA_HOME=`java-config --jre-home`
fi
fi
if [ -z "$M2_HOME" ] ; then
## resolve links - $0 may be a link to maven's home
PRG="$0"
# need this for relative symlinks
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG="`dirname "$PRG"`/$link"
fi
done
saveddir=`pwd`
M2_HOME=`dirname "$PRG"`/..
# make it fully qualified
M2_HOME=`cd "$M2_HOME" && pwd`
cd "$saveddir"
# echo Using m2 at $M2_HOME
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --unix "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi
# For Mingw, ensure paths are in UNIX format before anything is touched
if $mingw ; then
[ -n "$M2_HOME" ] &&
M2_HOME="`(cd "$M2_HOME"; pwd)`"
[ -n "$JAVA_HOME" ] &&
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
# TODO classpath?
fi
if [ -z "$JAVA_HOME" ]; then
javaExecutable="`which javac`"
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
# readlink(1) is not available as standard on Solaris 10.
readLink=`which readlink`
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
if $darwin ; then
javaHome="`dirname \"$javaExecutable\"`"
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
else
javaExecutable="`readlink -f \"$javaExecutable\"`"
fi
javaHome="`dirname \"$javaExecutable\"`"
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
JAVA_HOME="$javaHome"
export JAVA_HOME
fi
fi
fi
if [ -z "$JAVACMD" ] ; then
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
else
JAVACMD="`which java`"
fi
fi
if [ ! -x "$JAVACMD" ] ; then
echo "Error: JAVA_HOME is not defined correctly." >&2
echo " We cannot execute $JAVACMD" >&2
exit 1
fi
if [ -z "$JAVA_HOME" ] ; then
echo "Warning: JAVA_HOME environment variable is not set."
fi
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
# traverses directory structure from process work directory to filesystem root
# first directory with .mvn subdirectory is considered project base directory
find_maven_basedir() {
if [ -z "$1" ]
then
echo "Path not specified to find_maven_basedir"
return 1
fi
basedir="$1"
wdir="$1"
while [ "$wdir" != '/' ] ; do
if [ -d "$wdir"/.mvn ] ; then
basedir=$wdir
break
fi
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
if [ -d "${wdir}" ]; then
wdir=`cd "$wdir/.."; pwd`
fi
# end of workaround
done
echo "${basedir}"
}
# concatenates all lines of a file
concat_lines() {
if [ -f "$1" ]; then
echo "$(tr -s '\n' ' ' < "$1")"
fi
}
BASE_DIR=`find_maven_basedir "$(pwd)"`
if [ -z "$BASE_DIR" ]; then
exit 1;
fi
##########################################################################################
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
# This allows using the maven wrapper in projects that prohibit checking in binary data.
##########################################################################################
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found .mvn/wrapper/maven-wrapper.jar"
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
fi
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"
while IFS="=" read key value; do
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
esac
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
if [ "$MVNW_VERBOSE" = true ]; then
echo "Downloading from: $jarUrl"
fi
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
if command -v wget > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found wget ... using wget"
fi
wget "$jarUrl" -O "$wrapperJarPath"
elif command -v curl > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found curl ... using curl"
fi
curl -o "$wrapperJarPath" "$jarUrl"
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Falling back to using Java to download"
fi
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
if [ -e "$javaClass" ]; then
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Compiling MavenWrapperDownloader.java ..."
fi
# Compiling the Java class
("$JAVA_HOME/bin/javac" "$javaClass")
fi
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
# Running the downloader
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Running MavenWrapperDownloader.java ..."
fi
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
fi
fi
fi
fi
##########################################################################################
# End of extension
##########################################################################################
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
if [ "$MVNW_VERBOSE" = true ]; then
echo $MAVEN_PROJECTBASEDIR
fi
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --path --windows "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
fi
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
exec "$JAVACMD" \
$MAVEN_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM https://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Maven2 Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM set title of command window
title %0
@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
:skipRcPre
@setlocal
set ERROR_CODE=0
@REM To isolate internal variables from possible post scripts, we use another setlocal
@setlocal
@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome
echo.
echo Error: JAVA_HOME not found in your environment. >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto init
echo.
echo Error: JAVA_HOME is set to an invalid directory. >&2
echo JAVA_HOME = "%JAVA_HOME%" >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
@REM ==== END VALIDATION ====
:init
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%
:findBaseDir
IF EXIST "%WDIR%"\.mvn goto baseDirFound
cd ..
IF "%WDIR%"=="%CD%" goto baseDirNotFound
set WDIR=%CD%
goto findBaseDir
:baseDirFound
set MAVEN_PROJECTBASEDIR=%WDIR%
cd "%EXEC_DIR%"
goto endDetectBaseDir
:baseDirNotFound
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
cd "%EXEC_DIR%"
:endDetectBaseDir
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
:endReadAdditionalConfig
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"
FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO (
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
)
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
if exist %WRAPPER_JAR% (
echo Found %WRAPPER_JAR%
) else (
echo Couldn't find %WRAPPER_JAR%, downloading it ...
echo Downloading from: %DOWNLOAD_URL%
powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"
echo Finished downloading %WRAPPER_JAR%
)
@REM End of extension
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end
:error
set ERROR_CODE=1
:end
@endlocal & set ERROR_CODE=%ERROR_CODE%
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
:skipRcPost
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
exit /B %ERROR_CODE%
This diff is collapsed. Click to expand it.
package com.hwstudio.antaile;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication
//redis注解 开启缓存功能
@EnableCaching
//springBoot自带的定时任务注解
@EnableScheduling
@MapperScan("com.hwstudio.antaile.mapper")
@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
public class AntaileApplication extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(AntaileApplication.class);
}
public static void main(String[] args) {
SpringApplication.run(AntaileApplication.class, args);
}
}
package com.hwstudio.antaile.common;
/**
* Constants
*
* @author whj
* @date 2018/7/29 21:26
*/
public class Constants {
/**
* 成功
*/
public static final String RESPONSE_STATUS_200 = "200";
/**
* 登录过期
*/
public static final String RESPONSE_STATUS_401 = "401";
/**
* 失败
*/
public static final String RESPONSE_STATUS_500 = "500";
/**
* excel 文件后缀
*/
public static final String XLS = "xls";
/**
* excel 文件后缀
*/
public static final String XLSX = "xlsx";
/**
* Token
*/
public static final String TOKEN_NAME = "549CCDD8711E0D5DF61169B1CA001E9D";
/**
* Session验证码
*/
public static final String SESSION_VALID_CODE = "SESSION_VALID_CODE";
/**
* 全局 true 和 false 公共变量
*/
public static final Byte GLOBAL_TRUE_BYTE = 1;
public static final Byte GLOBAL_FALSE_BYTE = 0;
public static final Short GLOBAL_TRUE_SHORT = 1;
public static final Short GLOBAL_FALSE_SHORT = 0;
public static final Integer GLOBAL_TRUE_INT = 1;
public static final Integer GLOBAL_FALSE_INT = 0;
public static final String GLOBAL_TRUE_STR = "1";
public static final String GLOBAL_FALSE_STR = "0";
public static final Boolean GLOBAL_TRUE_BOOLEAN = true;
public static final Boolean GLOBAL_FALSE_BOOLEAN = false;
/**
* 是
*/
public static final Integer YES = 1;
/**
* 否
*/
public static final Integer NO = 0;
/**
* 流水类型1:收入
*/
public static final Integer FLOW_TYPE_INCOME = 1;
/**
* 流水类型:支出
*/
public static final Integer FLOW_TYPE_OUTCOME = 2;
/**
* 变动类型1、预约单补贴
*/
public static final Integer CHANGE_TYPE_SUBSIDY = 1;
/**
* 变动类型2:提现
*/
public static final Integer CHANGE_TYPE_WITHDRAW = 2;
/**
* 变动类型4:积分活动
*/
public static final Integer CHANGE_TYPE_ACTIVITY = 4;
/**
* 收藏类型1、项目
*/
public static final Integer FAV_TYPE_PLASTIC = 1;
/**
* 收藏类型2:商品
*/
public static final Integer FAV_TYPE_GOODS = 2;
/**
* 评价类型1、项目
*/
public static final Integer COMMENT_TYPE_PLASTIC = 1;
/**
* 评价类型2:商品
*/
public static final Integer COMMENT_TYPE_GOODS = 2;
/**
* 短信类型:1:注册
*/
public static final int SMS_TYPE_REGISTER = 1;
public static final String SMS_TYPE_REGISTER_VALUE="SMS_153815089";
public static final String SMS_TYPE_REGISTER_VALUE_INTERNATIONAL = "SMS_173406364";
/**
* 短信类型:3:修改登录密码
*/
public static final int SMS_TYPE_UPDATEPASSWORD = 3;
public static final String SMS_TYPE_UPDATEPASSWORD_VALUE="SMS_153815090";
public static final String SMS_TYPE_UPDATEPASSWORD_VALUE_INTERNATIONAL="SMS_173406384";
/**
* 短信类型:4:绑定手机号
*/
public static final int SMS_TYPE_BINDINGMOBILE = 4;
public static final String SMS_TYPE_BINDINGMOBILE_VALUE="SMS_153815091";
public static final String SMS_TYPE_BINDINGMOBILE_VALUE_INTERNATIONAL="SMS_173406381";
/**
* 提现类型 1:咖啡豆
*/
public static final Integer WITHDRAW_TYPE_BEANS = 1;
/**
* 提现类型 2:奖励
*/
public static final Integer WITHDRAW_TYPE_REWARDS = 2;
/**
* 发放状态 0:待发放
*/
public static final Integer SEND_STATE_INIT = 1;
/**
* 发放状态 1:暂停发放
*/
public static final Integer SEND_STATE_PAUSE = 2;
/**
* 发放状态 2:已发放
*/
public static final Integer SEND_STATE_SENT = 2;
/**
* 服务商等级0:普通用户
*/
public static final Integer AGENT_LEVEL_NOT_AGENT = 0;
/**
* 服务商等级1:高级服务商
*/
public static final Integer AGENT_LEVEL_10 = 10;
/**
* 服务商等级2:特级服务商
*/
public static final Integer AGENT_LEVEL_20 = 20;
/**
* 服务商等级3:钻石服务商
*/
public static final Integer AGENT_LEVEL_30 = 30;
/**
* 服务商99:99服务商
*/
public static final Integer AGENT_LEVEL_99 = 5;
/**
* 订单类型 1:预约
*/
public static final Integer ORDER_TYPE_RESERVE = 1;
/**
* 订单类型 2:购买商品
*/
public static final Integer ORDER_TYPE_SHOPPING = 2;
/**
* 订单类型 3:尊享会员
*/
public static final Integer ORDER_TYPE_ENJOY = 3;
/**
* 支付方式 1:支付宝
*/
public static final Integer PAY_TYPE_ALI = 1;
/**
* 支付方式 2:微信
*/
public static final Integer PAY_TYPE_WEIXIN = 2;
/**
* 类型(1:项目;2:积分商品;3:活动页;4:敬请期待)
*/
public static final Integer BANNER_TYPE_PLASTIC = 1;
public static final Integer BANNER_TYPE_GOODS = 2;
public static final Integer BANNER_TYPE_ACTIVITY = 3;
public static final Integer BANNER_TYPE_TOAST = 4;
/**
* 触发条件1:成为服务商;2:本月推荐服务商;3:本月推荐顾客
*/
public static final int TRIGGER_TYPE_BECOME_SERVICE_PROVIDER = 1;
public static final int TRIGGER_TYPE_RECOMMEND_SERVICE_PROVIDER = 2;
public static final int TRIGGER_TYPE_RECOMMEND_CUSTOMER = 3;
/**
* 领取状态1:已领取
*/
public static final int POINT_ACTIVITY_RECEIVE_STATE_DONE = 1;
/**
* 领取状态0:未领取
*/
public static final int POINT_ACTIVITY_RECEIVE_STATE_UNCLAIMED = 0;
/**
* 领取状态2:未满足
*/
public static final int POINT_ACTIVITY_RECEIVE_STATE_FAIL = 2;
/**
* 奖励类型1:积分
*/
public static final int SENDTYPE_POINT = 1;
/**
* 奖励类型2:商品
*/
public static final int SENDTYPE_GOODS = 2;
/**
* 商品类型 1:普通商品
*/
public static final Integer GOODS_TYPE_1 = 1;
/**
* 商品类型 2:签到商品
*/
public static final Integer GOODS_TYPE_2 = 2;
/**
* 商品类型 3:99尊享会员
*/
public static final Integer GOODS_TYPE_3 = 3;
/**
* 商品类型 4:高级服务商
*/
public static final Integer GOODS_TYPE_4 = 4;
}
package com.hwstudio.antaile.common;
/**
* Constants
*
* @author whj
* @date 2018/7/29 21:26
*/
public class WxRequestCode {
/**
* 系统繁忙
*/
public static final String SYS_BUSY = "-1";
/**
* 成功
*/
public static final String SUCCESS = "0";
/**
* AppSecret错误
*/
public static final String APPSECRET_ERR = "40001";
/**
* grant_type错误
*/
public static final String GRANT_TYPE_ERR = "40002";
/**
* IP不在白名单
*/
public static final String NOT_IN_WHITE_LIST = "40164";
}
package com.hwstudio.antaile.config;
import com.hwstudio.antaile.interceptor.TokenInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
/**
* 功能描述: <br>注册拦截器
* 〈〉
* @since: 1.0.0
* @Author:Momo
* @Date: 2019/5/23 22:56
*/
@Configuration
public class InterceptorConfig extends WebMvcConfigurerAdapter {
@Bean
public TokenInterceptor tokenInterceptorInstance() {
return new TokenInterceptor();
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(tokenInterceptorInstance());
super.addInterceptors(registry);
}
}
package com.hwstudio.antaile.config;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.CachingConfigurerSupport;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.interceptor.KeyGenerator;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.cache.RedisCacheManager;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;
import java.lang.reflect.Method;
/**
* @Name: Redis缓存配置类
* @Author: Lijc
* @Date: 2019/4/8 15:29
* @Version 1.0
*/
@Configuration
@EnableCaching
public class RedisConfig extends CachingConfigurerSupport {
@Value("${spring.redis.host}")
private String host;
@Value("${spring.redis.port}")
private int port;
@Value("${spring.redis.timeout}")
private int timeout;
/**
* 生成key的策略
* @return
*/
public KeyGenerator keyGenerator(){
return new KeyGenerator() {
@Override
public Object generate(Object target, Method method, Object... params){
StringBuilder sb = new StringBuilder();
sb.append(target.getClass().getName());
sb.append(method.getName());
for (Object obj : params){
sb.append(obj.toString());
}
return sb.toString();
}
};
}
/**
* 缓存管理器
* @param connectionFactory
* @return
*/
@Bean
public CacheManager cacheManager(RedisConnectionFactory connectionFactory){
RedisCacheManager cacheManager = RedisCacheManager.create(connectionFactory);
return cacheManager;
}
/**
* RedisTemplate配置
* @param factory
* @return
*/
public RedisTemplate<String,Object> redisTemplate(RedisConnectionFactory factory){
RedisTemplate<String, Object> template = new RedisTemplate<>();
// 配置连接工厂
template.setConnectionFactory(factory);
//使用Jackson2JsonRedisSerializer来序列化和反序列化redis的value值(默认使用JDK的序列化方式)
Jackson2JsonRedisSerializer jacksonSeial = new Jackson2JsonRedisSerializer(Object.class);
ObjectMapper om = new ObjectMapper();
// 指定要序列化的域,field,get和set,以及修饰符范围,ANY是都有包括private和public
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
// 指定序列化输入的类型,类必须是非final修饰的,final修饰的类,比如String,Integer等会跑出异常
om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
jacksonSeial.setObjectMapper(om);
// 值采用json序列化
template.setValueSerializer(jacksonSeial);
//使用StringRedisSerializer来序列化和反序列化redis的key值
template.setKeySerializer(new StringRedisSerializer());
// 设置hash key 和value序列化模式
template.setHashKeySerializer(new StringRedisSerializer());
template.setHashValueSerializer(jacksonSeial);
template.afterPropertiesSet();
return template;
}
}
package com.hwstudio.antaile.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.SchedulingConfigurer;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
import java.util.concurrent.Executors;
/**
* 多线程执行定时任务
* @author 王久印
* 2018年3月1日
*/
@Configuration
//所有的定时任务都放在一个线程池中,定时任务启动时使用不同都线程。
public class ScheduleConfig implements SchedulingConfigurer {
@Override
public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
//设定一个长度10的定时任务线程池
taskRegistrar.setScheduler(Executors.newScheduledThreadPool(10));
}
}
package com.hwstudio.antaile.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.ParameterBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.schema.ModelRef;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.service.Parameter;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.util.ArrayList;
import java.util.List;
/**
* @Name: swaggerui配置类
* @Author: Lijc
* @Date: 2019/4/10 10:19
* @Version 1.0
*/
@Configuration
@EnableSwagger2
public class SwaggerConfig {
// public Docket createRestApi() {
// return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo())
// .select()
// .apis(RequestHandlerSelectors.basePackage("com.jains.controller"))
// .paths(PathSelectors.any()).build();
// }
//
// private ApiInfo apiInfo() {
// return new ApiInfoBuilder().title("janis Manger Swagger RSETful APIs")
// .description("综合管理 Swagger API 服务")
// .termsOfServiceUrl("http://swagger.io/")
// .contact(new Contact("janis", "127.0.0.1", "jains@163.com.cn"))
// .version("1.0")
// .build();
// }
@Bean
public Docket buildDocket() {
ParameterBuilder tokenPar = new ParameterBuilder();
List<Parameter> pars = new ArrayList<Parameter>();
tokenPar.name("token").description("令牌").modelRef(new ModelRef("string")).parameterType("header").required(false).build();
pars.add(tokenPar.build());
//添加head参数end
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(buildApiInf())
.select()
.apis(RequestHandlerSelectors.basePackage("com.hwstudio.antaile.controller"))
.paths(PathSelectors.any())
.build()
.globalOperationParameters(pars);
}
private ApiInfo buildApiInf() {
return new ApiInfoBuilder().title("安泰乐接口文档").termsOfServiceUrl("#").description("").version("0.1").build();
}
}
package com.hwstudio.antaile.controller;
import com.hwstudio.antaile.service.AtlAdService;
import com.hwstudio.antaile.service.ImageService;
import com.hwstudio.antaile.utils.JsonResult;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
* Created by LENOVO on 2019/5/26.
*/
@RequestMapping(value="/advertising")
@RestController
@Api(tags="广告接口")
public class AdvertisingController {
@Autowired
private AtlAdService atlAdService;
@Autowired
private ImageService imageService;
@RequestMapping(value="/showAdvertising")
@ApiOperation(value = "广告列表接口", httpMethod = "POST", notes = "广告列表接口", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "位置 1-首页上方(轮播图) 2-首页中间", required = true, dataType = "Integer", paramType = "query")
})
public JsonResult showAdvertising(Integer type){
List<Map<String, Object>> map = atlAdService.getShowAd(type);
return JsonResult.success("展示广告",map);
}
}
package com.hwstudio.antaile.controller;
import com.google.common.collect.Maps;
import com.hwstudio.antaile.entity.AtlAppVersion;
import com.hwstudio.antaile.service.AtlActivityService;
import com.hwstudio.antaile.service.AtlActivityUserReportRecordService;
import com.hwstudio.antaile.service.AtlActivityUserReportService;
import com.hwstudio.antaile.service.AtlAppVersionService;
import com.hwstudio.antaile.utils.JsonResult;
import com.hwstudio.antaile.vo.AtlActivityUserReportVo;
import com.hwstudio.antaile.vo.AtlActivityVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/7/14 23:18
* @Version 1.0
*/
@RequestMapping(value = "/atlActivity")
@RestController
@Api(tags = "活动相关接口")
public class AtlActivityController extends BaseController{
@Autowired
private AtlActivityService atlActivityService;
@Autowired
private AtlActivityUserReportService atlActivityUserReportService;
@RequestMapping(value = "/findActivityList")
@ApiOperation(value = "获取活动列表", httpMethod = "POST", notes = "获取活动列表", response = JsonResult.class)
@ApiImplicitParams({
})
public JsonResult findActivityList(AtlActivityVo atlActivityVo) {
List<Map<String, Object>> list = atlActivityService.findActivityList(atlActivityVo);
return JsonResult.success("获取活动列表成功", list);
}
@RequestMapping(value = "/report")
@ApiOperation(value = "报名", httpMethod = "POST", notes = "报名", response = JsonResult.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "actId", value = "活动Id", required = true, dataType = "Long",
paramType = "query"),
@ApiImplicitParam(name = "workId", value = "作品Id", required = true, dataType = "Long",
paramType = "query"),
@ApiImplicitParam(name = "coverUrl", value = "海报地址", required = true, dataType = "String",
paramType = "query"),
})
public JsonResult report(AtlActivityUserReportVo vo) {
Long userId = super.getUserId();
if(userId == null){
return JsonResult.notLogin();
}
vo.setUserId(userId);
atlActivityUserReportService.report(vo);
return JsonResult.success("活动报名成功");
}
}
package com.hwstudio.antaile.controller;
import com.google.common.collect.Maps;
import com.hwstudio.antaile.dto.AtlPrivateQuestionDto;
import com.hwstudio.antaile.entity.AtlAppVersion;
import com.hwstudio.antaile.service.AtlAppVersionService;
import com.hwstudio.antaile.service.AtlPrivateService;
import com.hwstudio.antaile.utils.JsonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/7/14 23:18
* @Version 1.0
*/
@CrossOrigin(value = "*", maxAge = 3600)
@RequestMapping(value = "atlAppVersion")
@RestController
@Api(tags = "版本相关接口")
public class AtlAppVersionController {
@Autowired
private AtlAppVersionService atlAppVersionService;
@RequestMapping(value = "/getAppVersion")
@ApiOperation(value = "获取app版本", httpMethod = "POST", notes = "获取app版本", response = JsonResult.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "versionNo", value = "当前版本号", required = true, dataType = "String",
paramType = "query"),
@ApiImplicitParam(name = "type", value = "类型 0-安卓 1-IOS", required = true, dataType = "String",
paramType = "query"),
})
public JsonResult getAppVserionByType(String versionNo, String type) {
Map<String, Object> result = Maps.newHashMap();
AtlAppVersion appVersion = atlAppVersionService.getAppVserionByType(type);
if (null == appVersion) {
result.put("isUpdate", "0");
result.put("url", "");
}else {
String saveVersionNo = appVersion.getVersionNo();
if (!versionNo.equals(saveVersionNo)) {
result.put("isUpdate", "1");
result.put("url", appVersion.getUrl());
} else {
result.put("isUpdate", "0");
result.put("url", "");
}
}
return JsonResult.success("获取当前app版本成功", result);
}
}
package com.hwstudio.antaile.controller;
import com.hwstudio.antaile.dto.AtlNewsListDto;
import com.hwstudio.antaile.service.AtlCommentReplyService;
import com.hwstudio.antaile.service.AtlCommentService;
import com.hwstudio.antaile.service.AtlMemorialService;
import com.hwstudio.antaile.utils.JsonResult;
import com.hwstudio.antaile.vo.AtlCommentReplyVo;
import com.hwstudio.antaile.vo.AtlCommentVo;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
* Created by LENOVO on 2019/5/26.
*/
@RequestMapping(value = "/atlComment")
@RestController
@Api(tags = "评论相关接口")
public class AtlCommentController extends BaseController {
@Autowired
private AtlCommentService atlCommentService;
@Autowired
private AtlCommentReplyService atlCommentReplyService;
@RequestMapping(value = "myCommentList")
@ApiOperation(value = "获取评论列表", httpMethod = "POST", notes = "获取新闻列表", response = JsonResult.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "limit", value = "每页条数", required = true, dataType = "Integer",
paramType = "query"),
@ApiImplicitParam(name = "page", value = "起始页", required = true, dataType = "Integer",
paramType = "query")
})
public JsonResult myCommentList(Integer page, Integer limit, AtlCommentVo atlCommentVo) {
Long userId = atlCommentVo.getUserId();
if (null == userId) {
userId = super.getUserId();
if (userId == null) {
return JsonResult.notLogin();
}
}
atlCommentVo.setUserId(userId);
return atlCommentService.myCommentList(page, limit, atlCommentVo);
}
@RequestMapping(value = "list")
@ApiOperation(value = "获取评论列表", httpMethod = "POST", notes = "获取新闻列表", response = JsonResult.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "limit", value = "每页条数", required = true, dataType = "Integer",
paramType = "query"),
@ApiImplicitParam(name = "page", value = "起始页", required = true, dataType = "Integer",
paramType = "query"),
@ApiImplicitParam(name = "type", value = "类型(0:时光记 1:(时光记)文章 2:(时光记)图片 3:(时光记)音频 4:(时光记)视频 5:自传书 6:社交消息 7:新闻)", required = true, dataType = "String",
paramType = "query"),
@ApiImplicitParam(name = "linkId", value = "编号", required = true, dataType = "Long",
paramType = "query"),
})
public JsonResult list(Integer page, Integer limit, AtlCommentVo atlCommentVo) {
return atlCommentService.list(page, limit, atlCommentVo);
}
@RequestMapping(value = "save")
@ApiOperation(value = "新增评论", httpMethod = "POST", notes = "新增评论", response = AtlNewsListDto.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "类型(0:时光记 1:(时光记)文章 2:(时光记)图片 3:(时光记)音频 4:(时光记)视频 5:自传书 6:社交消息 7:新闻)", required = true, dataType = "String",
paramType = "query"),
@ApiImplicitParam(name = "linkId", value = "编号", required = true, dataType = "Long",
paramType = "query"),
@ApiImplicitParam(name = "content", value = "评论内容", required = true, dataType = "String",
paramType = "query"),
})
public JsonResult add(AtlCommentVo atlCommentVo) {
Long userId = atlCommentVo.getUserId();
if (null == userId) {
userId = super.getUserId();
if (userId == null) {
return JsonResult.notLogin();
}
}
atlCommentVo.setCreateUserId(userId);
return atlCommentService.save(atlCommentVo);
}
@RequestMapping(value = "delete")
@ApiOperation(value = "删除评论或回复", httpMethod = "POST", notes = "删除评论或回复", response = AtlNewsListDto.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "评论编号", required = true, dataType = "Long",
paramType = "query"),
@ApiImplicitParam(name = "type", value = "类型(0:评论 1:回复)", required = true, dataType = "String",
paramType = "query"),
})
public JsonResult delete(AtlCommentVo atlCommentVo) {
Long userId = super.getUserId();
if (userId == null) {
return JsonResult.notLogin();
}
return atlCommentService.delete(atlCommentVo);
}
@RequestMapping(value = "addCollectOrlikeCount")
@ApiOperation(value = "增加点赞或收藏", httpMethod = "POST", notes = "增加点赞或收藏", response = JsonResult.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "评论编号", required = true, dataType = "Integer",
paramType = "query"),
@ApiImplicitParam(name = "type", value = "类型(0:赞 1:收藏)", required = true, dataType = "String",
paramType = "query"),
})
public JsonResult addCollectOrlikeCount(AtlCommentVo atlCommentVo) {
Long userId = super.getUserId();
if (userId == null) {
return JsonResult.notLogin();
}
return atlCommentService.addCollectOrlikeCount(atlCommentVo);
}
@RequestMapping(value = "addCommentReply")
@ApiOperation(value = "回复评论或回复回复", httpMethod = "POST", notes = "回复评论或回复回复", response = JsonResult.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "commentId", value = "评论编号", required = true, dataType = "Long",
paramType = "query"),
@ApiImplicitParam(name = "type", value = "类型(0:回复评论 1:回复回复)", required = true, dataType = "String",
paramType = "query"),
@ApiImplicitParam(name = "content", value = "评论内容", required = true, dataType = "String",
paramType = "query"),
@ApiImplicitParam(name = "parentId", value = "父级回复Id(当type=1是必传)", required = false, dataType = "Long",
paramType = "query"),
@ApiImplicitParam(name = "replyUserId", value = "被回复用户Id(当type=1是必传)", required = false, dataType = "Long",
paramType = "query"),
})
public JsonResult addCommentReply(AtlCommentReplyVo vo) {
Long userId = super.getUserId();
if (userId == null) {
return JsonResult.notLogin();
}
vo.setCreateUserId(userId);
return atlCommentReplyService.addCommentReply(vo);
}
}
package com.hwstudio.antaile.controller;
import com.hwstudio.antaile.mapper.AtlMemorialDayMapper;
import com.hwstudio.antaile.service.AtlMemorialDayService;
import com.hwstudio.antaile.utils.JsonResult;
import com.hwstudio.antaile.vo.AtlMemorialDayVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/7/14 23:18
* @Version 1.0
*/
@RequestMapping(value = "/memorialDay")
@RestController
@Api(tags = "纪念日相关接口")
public class AtlMemorialDayController extends BaseController {
@Autowired
private AtlMemorialDayService atlMemorialDayService;
@RequestMapping(value = "list")
@ApiOperation(value = "纪念日列表", httpMethod = "POST", notes = "纪念日列表", response = JsonResult.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "year", value = "年份", required = true, dataType = "String",
paramType = "query")
})
public JsonResult list(AtlMemorialDayVo vo) {
Long userId = super.getUserId();
if (userId == null) {
return JsonResult.notLogin();
}
vo.setUserId(userId);
return atlMemorialDayService.list(vo);
}
@RequestMapping(value = "delete")
@ApiOperation(value = "删除纪念日", httpMethod = "POST", notes = "删除评论或回复", response = JsonResult.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "编号", required = true, dataType = "Long",
paramType = "query")
})
public JsonResult delete(AtlMemorialDayVo vo) {
Long userId = super.getUserId();
if (userId == null) {
return JsonResult.notLogin();
}
vo.setUserId(userId);
return atlMemorialDayService.delete(vo);
}
@RequestMapping(value = "save")
@ApiOperation(value = "保存纪念日", httpMethod = "POST", notes = "保存纪念日", response = JsonResult.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "编号", required = false, dataType = "Long",
paramType = "query"),
@ApiImplicitParam(name = "dayStr", value = "日期(格式:2019年10月10日)", required = true, dataType = "String",
paramType = "query"),
@ApiImplicitParam(name = "content", value = "内容", required = true, dataType = "String",
paramType = "query"),
@ApiImplicitParam(name = "isPush", value = "是否推送(0:否(默认) 1:是)", required = true, dataType = "String",
paramType = "query"),
@ApiImplicitParam(name = "isSMS", value = "是否短信(0:否(默认) 1:是)", required = true, dataType = "String",
paramType = "query"),
})
public JsonResult save(AtlMemorialDayVo vo) {
Long userId = vo.getUserId();
if (null == userId) {
userId = super.getUserId();
if (userId == null) {
return JsonResult.notLogin();
}
}
vo.setUserId(userId);
return atlMemorialDayService.save(vo);
}
}
package com.hwstudio.antaile.controller;
import com.hwstudio.antaile.dto.AtlMyAutobiographyListDto;
import com.hwstudio.antaile.dto.AtlNewsDetailsDto;
import com.hwstudio.antaile.dto.AtlNewsListDto;
import com.hwstudio.antaile.service.AtlNewsService;
import com.hwstudio.antaile.utils.JsonResult;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/7/14 22:56
* @Version 1.0
*/
@CrossOrigin(value = "*", maxAge = 3600)
@RestController
@RequestMapping(value = "atlNews")
@Api(tags = "新闻相关接口")
public class AtlNewsController extends BaseController{
@Autowired
private AtlNewsService atlNewsService;
@RequestMapping(value = "/newsList")
@ApiOperation(value = "获取新闻列表", httpMethod = "POST", notes = "获取新闻列表", response = AtlNewsListDto.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "limit", value = "条数", required = true, dataType = "Integer",
paramType = "query"),
@ApiImplicitParam(name = "page", value = "起始页", required = true, dataType = "Integer",
paramType = "query"),
})
public JsonResult newsList(Integer page, Integer limit) {
return JsonResult.success("获取新闻列表成功", atlNewsService.newsList(page, limit));
}
@RequestMapping(value = "/newsDetails")
@ApiOperation(value = "获取新闻详情", httpMethod = "POST", notes = "获取新闻详情", response = AtlNewsDetailsDto.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "新闻id", required = true, dataType = "Long",
paramType = "query"),
})
public JsonResult newsDetails(Long id) {
return JsonResult.success("获取新闻详情成功", atlNewsService.newsDetails(id));
}
@RequestMapping(value = "/addReadCount")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "编号", required = true, dataType = "Integer",
paramType = "query")
})
@ApiOperation(value = "增加阅读量", httpMethod = "POST", notes = "新增阅读量")
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
public JsonResult addReadCount(Long id) {
return atlNewsService.addReadCount(id);
}
@RequestMapping(value="addCollectOrlikeCount")
@ApiOperation(value = "新增赞或收藏数量",httpMethod = "POST", notes = "新增赞或收藏数量")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "类型(0:赞 1:收藏)", required = true, dataType = "Integer",
paramType = "query"),
@ApiImplicitParam(name = "id", value = "新闻编号", required = true, dataType = "Long",
paramType = "query")
})
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
public JsonResult addCollectOrlikeCount(Integer type, Long id){
Long userId = super.getUserId();
if(userId == null){
return JsonResult.notLogin();
}
return atlNewsService.addCollectOrlikeCount(type, id);
}
}
package com.hwstudio.antaile.controller;
import com.hwstudio.antaile.dto.AtlPrivateQuestionDto;
import com.hwstudio.antaile.service.AtlPrivateService;
import com.hwstudio.antaile.utils.JsonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/7/14 23:18
* @Version 1.0
*/
@CrossOrigin(value = "*", maxAge = 3600)
@RequestMapping(value = "atlPrivate")
@RestController
@Api(tags = "隐私相关接口")
public class AtlPrivateController extends BaseController {
@Autowired
private AtlPrivateService atlPrivateService;
@RequestMapping(value = "/privateQuestion")
@ApiOperation(value = "获取隐私问题", httpMethod = "POST", notes = "获取隐私问题", response = AtlPrivateQuestionDto.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long",
paramType = "query"),
@ApiImplicitParam(name = "type", value = "类型 1-时光纪 2-自传书", required = true, dataType = "Integer",
paramType = "query"),
})
public JsonResult privateQuestion(Long id, Integer type) {
Long userId = super.getUserId();
return JsonResult.success("获取隐私问题成功", atlPrivateService.privateQuestion(id, type, userId));
}
}
package com.hwstudio.antaile.controller;
import com.hwstudio.antaile.dto.AtlProtocolDto;
import com.hwstudio.antaile.service.AtlProtocolService;
import com.hwstudio.antaile.utils.JsonResult;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/6/30 01:51
* @Version 1.0
*/
@CrossOrigin(value = "*",maxAge = 3600)
@RestController
@RequestMapping(value="/atlProtocol")
@Api(tags = "协议相关接口")
public class AtlProtocolController {
@Autowired
private AtlProtocolService atlProtocolService;
@GetMapping(value = "/getProtocol")
@ApiOperation(value = "获取协议", httpMethod = "GET", notes = "获取协议")
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = AtlProtocolDto.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "类型 1-协议 2-公司 3-关于APP", required = true, dataType = "Integer", paramType = "query")
})
public JsonResult getProtocol(Integer type){
return JsonResult.success("获取协议成功", atlProtocolService.getProtocol(type));
}
}
package com.hwstudio.antaile.controller;
import com.hwstudio.antaile.dto.AtlNewsListDto;
import com.hwstudio.antaile.dto.AtlTimeMessageListDto;
import com.hwstudio.antaile.service.AtlTimeMessageService;
import com.hwstudio.antaile.utils.JsonResult;
import com.hwstudio.antaile.vo.PageVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/7/19 20:20
* @Version 1.0
*/
@RestController
@RequestMapping(value = "/atlTimeMessage")
@Api(tags = "时光纪留言相关接口")
public class AtlTimeMessageController extends BaseController{
@Autowired
private AtlTimeMessageService atlTimeMessageService;
@RequestMapping(value="/addMessage")
@ApiOperation(value = "添加留言", httpMethod = "POST", notes = "添加留言", response = JsonResult.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "主键id", required = true, dataType = "Long",
paramType = "query"),
@ApiImplicitParam(name = "type", value = "类型 1-时光纪 2-时光纪文章", required = true, dataType = "Integer",
paramType = "query"),
@ApiImplicitParam(name = "content", value = "内容", required = true, dataType = "String",
paramType = "query"),
})
public JsonResult addMessage(Long id, Integer type, String content) {
Long userId = super.getUserId();
if(userId == null){
return JsonResult.notLogin();
}
atlTimeMessageService.addMessage(userId, id, type, content);
return JsonResult.success("提交成功");
}
@RequestMapping(value="/delMessage")
@ApiOperation(value = "删除留言", httpMethod = "POST", notes = "删除留言", response = JsonResult.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "留言id", required = true, dataType = "Long",
paramType = "query"),
})
public JsonResult delMessage(Long id){
Long userId = super.getUserId();
atlTimeMessageService.delMessage(userId, id);
return JsonResult.success("删除成功");
}
@RequestMapping(value="/messageList")
@ApiOperation(value = "获取留言列表", httpMethod = "POST", notes = "获取留言列表", response = AtlTimeMessageListDto.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "关联id", required = true, dataType = "Long",
paramType = "query"),
@ApiImplicitParam(name = "type", value = "类型 1-时光纪 2-时光纪文章", required = true, dataType = "Integer",
paramType = "query"),
@ApiImplicitParam(name = "page", value = "页数", required = true, dataType = "Integer",
paramType = "query"),
@ApiImplicitParam(name = "limit", value = "条数", required = true, dataType = "Integer",
paramType = "query"),
})
public JsonResult messageList(Long id, Integer type, Integer page, Integer limit) {
Long userId = super.getUserId();
if(userId == null){
return JsonResult.notLogin();
}
return JsonResult.success("获取留言列表成功", atlTimeMessageService.list(id, type, page, limit, userId));
}
@RequestMapping(value="/reviewMessage")
@ApiOperation(value = "审核留言", httpMethod = "POST", notes = "审核留言", response = JsonResult.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "留言id", required = true, dataType = "Long",
paramType = "query"),
@ApiImplicitParam(name = "state", value = "状态 1-审核通过 2-审核未通过", required = true, dataType = "Integer",
paramType = "query"),
})
public JsonResult reviewMessage(Long id, Integer state){
Long userId = super.getUserId();
if(userId == null){
return JsonResult.notLogin();
}
return atlTimeMessageService.reviewMessage(id, state);
}
@RequestMapping(value="/updateReadFlag")
@ApiOperation(value = "更新阅读状态", httpMethod = "POST", notes = "更新阅读状态", response = JsonResult.class)
public JsonResult updateReadFlag(){
Long userId = super.getUserId();
if(userId == null){
return JsonResult.notLogin();
}
return atlTimeMessageService.updateReadFlag(userId);
}
@RequestMapping(value="/isMessageUnRead")
@ApiOperation(value = "是否有新消息", httpMethod = "POST", notes = "是否有新消息", response = JsonResult.class)
public JsonResult isMessageUnRead(){
Long userId = super.getUserId();
if(userId == null){
return JsonResult.notLogin();
}
return atlTimeMessageService.isMessageUnRead(userId);
}
}
package com.hwstudio.antaile.controller;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import java.util.Objects;
/**
* 功能描述: <br>统一控制器
* 〈〉
* @since: 1.0.0
* @Author:Momo
* @Date: 2019/5/26 17:01
*/
public class BaseController {
@Autowired
private HttpServletRequest request;
/**
* 获取userId
* @return
*/
protected Long getUserId() {
Object userId = request.getAttribute("userId");
if (Objects.isNull(userId)) {
return null;
}
if (StringUtils.isBlank(userId.toString())) {
return null;
}
return Long.parseLong(userId.toString());
}
}
package com.hwstudio.antaile.controller;
import com.hwstudio.antaile.service.FeedbackService;
import com.hwstudio.antaile.utils.JsonResult;
import com.hwstudio.antaile.vo.FeedbackAddVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/7/15 00:59
* @Version 1.0
*/
@RestController
@RequestMapping(value = "feedback")
@Api(tags = "意见反馈相关接口")
public class FeedbackController extends BaseController{
@Autowired
private FeedbackService feedbackService;
@RequestMapping(value="addFeedback")
@ApiOperation(value = "添加意见反馈",httpMethod = "POST", notes = "添加意见反馈")
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
public JsonResult addFeedback (FeedbackAddVo feedbackAddVo){
Long userId = super.getUserId();
feedbackService.addFeedback(feedbackAddVo, userId);
return JsonResult.success("意见反馈添加成功");
}
}
package com.hwstudio.antaile.controller;
import com.hwstudio.antaile.entity.AtlMemorial;
import com.hwstudio.antaile.service.AtlGenealogyService;
import com.hwstudio.antaile.utils.JsonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
/**
* Created by LENOVO on 2019/5/26.
*/
@RequestMapping(value="/genealogy")
@RestController
@Api(tags="云族谱")
public class GenealogyController {
@Autowired
private AtlGenealogyService atlGenealogyService;
@RequestMapping(value="/showGenealogy")
@ApiOperation(value = "云族谱列表接口", httpMethod = "POST", notes = "云族谱列表接口", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = AtlMemorial.class))
public JsonResult showGenealogy(){
List<Map<String , Object>> maps = atlGenealogyService.getShowGenealogy();
Map<String , String> mapGenealogy = null;
List<Object> listImage = new ArrayList();
for(Map<String , Object> map : maps){
mapGenealogy = new TreeMap<String , String>();
mapGenealogy.put("genealogy_id",map.get("id").toString());
mapGenealogy.put("name",map.get("name").toString());
int i = atlGenealogyService.getGenealogyPeopleNum(Integer.parseInt(map.get("id").toString()));
mapGenealogy.put("GenealogyPeopleNum",String.valueOf(i));
listImage.add(mapGenealogy);
}
return JsonResult.success("展示云族谱",listImage);
}
}
package com.hwstudio.antaile.controller;
import com.alibaba.fastjson.JSONObject;
import com.hwstudio.antaile.dto.AtlTimeDetailsDto;
import com.hwstudio.antaile.service.AtlTimeArticleServie;
import com.hwstudio.antaile.service.AtlTimeMessageService;
import com.hwstudio.antaile.service.AtlTimeOwnerService;
import com.hwstudio.antaile.service.AtlTimeService;
import com.hwstudio.antaile.utils.JsonResult;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/6/18 23:06
* @Version 1.0
*/
@RestController
@RequestMapping(value = "/h5")
@CrossOrigin(value = "*", maxAge = 3600)
public class H5Controller {
@Autowired
private AtlTimeOwnerService atlTimeOwnerService;
@Autowired
private AtlTimeArticleServie atlTimeArticleServie;
@Autowired
private AtlTimeMessageService atlTimeMessageService;
@Autowired
private AtlTimeService atlTimeService;
@GetMapping(value = "/getAltTimeDetail")
@ApiOperation(value = "获取时光纪详情", httpMethod = "GET", notes = "获取时光纪详情", response = JsonResult.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "timeId", value = "时光纪id", required = true, dataType = "Long",
paramType = "query"),
})
public JsonResult getAltTimeDetail(Long timeId) {
Map<String, Object> map = atlTimeService.getAtlTimeDetail(timeId);
return JsonResult.success("获取时光纪详情成功", JSONObject.toJSON(map));
}
@GetMapping(value = "/getPersonalData")
@ApiOperation(value = "获取个人资料", httpMethod = "GET", notes = "获取个人资料", response = JsonResult.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "timeId", value = "时光纪id", required = true, dataType = "Long",
paramType = "query"),
})
public JsonResult getPersonalData(Long timeId) {
Map<String, Object> map = atlTimeOwnerService.getPersonalData(timeId);
return JsonResult.success("获取个人资料成功", JSONObject.toJSON(map));
}
@GetMapping(value = "/getAdditionalData")
@ApiOperation(value = "获取补充资料", httpMethod = "GET", notes = "获取补充资料", response = JsonResult.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "timeId", value = "时光纪id", required = true, dataType = "Long",
paramType = "query"),
})
public JsonResult getAdditionalData(Long timeId) {
Map<String, Object> map = atlTimeOwnerService.getAdditionalData(timeId);
return JsonResult.success("获取补充资料成功", JSONObject.toJSON(map));
}
@GetMapping(value = "/findMessageList")
@ApiOperation(value = "获取留言管理列表", httpMethod = "GET", notes = "获取留言管理列表", response = JsonResult.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "timeId", value = "时光纪id", required = true, dataType = "Long",
paramType = "query"),
})
public JsonResult findMessageList(Long timeId) {
List<Map<String, Object>> mapList = atlTimeOwnerService.findMessageList(timeId);
return JsonResult.success("获取留言管理列表成功", JSONObject.toJSON(mapList));
}
@GetMapping(value = "/findTimeMarkList")
@ApiOperation(value = "获取时光纪要列表", httpMethod = "GET", notes = "获取时光纪要列表", response = JsonResult.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "timeId", value = "时光纪id", required = true, dataType = "Long",
paramType = "query"),
@ApiImplicitParam(name = "type", value = "类型(1 大事记 2 教育经历 3 工作经历)", required = true, dataType = "Integer",
paramType = "query")
})
public JsonResult findTimeMarkList(Long timeId, Integer type) {
List<Map<String, Object>> mapList = atlTimeOwnerService.findTimeMarkList(timeId, type);
return JsonResult.success("获取时光纪要列表成功", JSONObject.toJSON(mapList));
}
@GetMapping(value = "/index")
@ApiOperation(value = "获取个人信息", httpMethod = "GET", notes = "获取个人信息", response = JsonResult.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "timeId", value = "时光纪id", required = true, dataType = "Long",
paramType = "query"),
})
public JsonResult index(Long timeId) {
Map<String, Object> map = atlTimeOwnerService.index(timeId);
return JsonResult.success("获取个人信息成功", JSONObject.toJSON(map));
}
@GetMapping(value = "/essay")
@ApiOperation(value = "获取文章列表", httpMethod = "GET", notes = "获取文章列表", response = JsonResult.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "timeId", value = "时光纪id", required = true, dataType = "Long",
paramType = "query"),
})
public JsonResult essay(Long timeId) {
List<Map<String, Object>> list = atlTimeArticleServie.getEssay(timeId);
return JsonResult.success("获取文章列表成功", JSONObject.toJSON(list));
}
@GetMapping(value = "/essayDetail")
@ApiOperation(value = "获取文章详情页", httpMethod = "GET", notes = "获取文章详情页", response = JsonResult.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "articleId", value = "文章id", required = true, dataType = "Long",
paramType = "query"),
})
public JsonResult essayDetail(Long articleId) {
net.sf.json.JSONObject result = atlTimeArticleServie.essayDetail(articleId);
return JsonResult.success("获取文章详情页成功", result);
}
@GetMapping(value = "/getFileList")
@ApiOperation(value = "获取文件列表", httpMethod = "GET", notes = "获取文件列表", response = JsonResult.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "timeId", value = "时光纪id", required = true, dataType = "Long",
paramType = "query"),
@ApiImplicitParam(name = "type", value = "类型 (2-照片 3-视频 4-音频)", required = true, dataType = "Integer",
paramType = "query"),
})
public JsonResult getFileList(Long timeId, Integer type) {
net.sf.json.JSONObject result = atlTimeArticleServie.getFileList(timeId, type);
return JsonResult.success("获取文件列表成功", result);
}
@GetMapping(value = "/getFileDetails")
@ApiOperation(value = "获取文件详情页", httpMethod = "GET", notes = "获取文件详情页", response = JsonResult.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "articleId", value = "文章id", required = true, dataType = "Long",
paramType = "query"),
})
public JsonResult getFileDetails(Long articleId) {
net.sf.json.JSONObject result = atlTimeArticleServie.getFileDetails(articleId);
return JsonResult.success("获取文件详情成功", result);
}
@GetMapping(value = "/information-p")
@ApiOperation(value = "获取个人详细信息", httpMethod = "GET", notes = "获取个人详细信息", response = JsonResult.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "timeId", value = "时光纪id", required = true, dataType = "Long",
paramType = "query"),
})
public JsonResult information(Long timeId) {
Map<String, Object> result = atlTimeOwnerService.information(timeId);
return JsonResult.success("获取个人详细信息成功", result);
}
@GetMapping(value = "/addMessage")
@ApiOperation(value = "h5添加留言", httpMethod = "GET", notes = "获取个人详细信息", response = JsonResult.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "content", value = "内容", required = true, dataType = "String",
paramType = "query"),
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long",
paramType = "query"),
@ApiImplicitParam(name = "type", value = "类型 1-时光纪 2-时光纪文章", required = true, dataType = "Integer",
paramType = "query"),
})
public JsonResult addMessage(String content, Long id, Integer type) {
atlTimeMessageService.addMessage(null, id, type, content);
return JsonResult.success("留言成功");
}
}
package com.hwstudio.antaile.controller;
import com.hwstudio.antaile.dto.AtlMyAutobiographyListDto;
import com.hwstudio.antaile.dto.AtlNewsListDto;
import com.hwstudio.antaile.dto.AtlSearchDto;
import com.hwstudio.antaile.dto.PageDto;
import com.hwstudio.antaile.service.*;
import com.hwstudio.antaile.utils.JsonResult;
import com.hwstudio.antaile.vo.AtlFineVo;
import com.hwstudio.antaile.vo.PageVo;
import io.swagger.annotations.*;
import net.bytebuddy.implementation.bind.annotation.Origin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/7/5 01:20
* @Version 1.0
*/
@RequestMapping(value = "/home")
@RestController
@Api(tags = "首页相关接口")
@CrossOrigin(origins = "*",maxAge = 3600)
public class HomeController extends BaseController {
@Autowired
private AtlTimeService atlTimeService;
@Autowired
private AtlAutobiographyService atlAutobiographyService;
@Autowired
private AtlNewsService atlNewsService;
@Autowired
private AtlTimeArticleServie atlTimeArticleServie;
@Autowired
private AtlAutobiographyArticleService atlAutobiographyArticleService;
@Autowired
private AtlTimeMessageService atlTimeMessageService;
@RequestMapping(value = "/findList")
@ApiOperation(value = "获取发现时光纪或自传书列表", httpMethod = "POST", notes = "获取发现时光纪或自传书列表")
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
public JsonResult findList(AtlFineVo atlFineVo) {
Long userId = super.getUserId();
if (atlFineVo.getType() == null) {
return JsonResult.failed("类型不能为空");
}
if (atlFineVo.getType() == 1) {
return JsonResult.success("发现时光纪列表成功", atlTimeService.findShowList(atlFineVo, userId));
} else {
return JsonResult.success("发现自传书列表成功", atlAutobiographyService.findShowList(atlFineVo, userId));
}
}
@RequestMapping(value = "/showAtlTime")
@ApiOperation(value = "时光纪列表接口", httpMethod = "POST", notes = "我的自传列表接口", response = JsonResult.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "limit", value = "条数", required = true, dataType = "Integet",
paramType = "query"),
@ApiImplicitParam(name = "page", value = "起始页", required = true, dataType = "Integer",
paramType = "query"),
@ApiImplicitParam(name = "type", value = "类型 1-首页推荐 2-频道页推荐 3-喜欢页推荐", required = true, dataType = "Integer",
paramType = "query"),
})
public JsonResult showAtlTime(Integer page, Integer limit, Integer type) {
return JsonResult.success("获取时光纪列表成功", atlTimeService.getShowAtlTime(page, limit, type));
}
@RequestMapping(value = "/showAutobiography")
@ApiOperation(value = "获取自传书列表", httpMethod = "POST", notes = "获取自传书列表", response = JsonResult.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "limit", value = "条数", required = true, dataType = "Integer",
paramType = "query"),
@ApiImplicitParam(name = "page", value = "起始页", required = true, dataType = "Integer",
paramType = "query"),
@ApiImplicitParam(name = "type", value = "类型 1-首页推荐 2-频道页推荐 3-喜欢页推荐", required = true, dataType = "Integer",
paramType = "query"),
})
public JsonResult showGenealogy(Integer page, Integer limit, Integer type) {
Long userId = super.getUserId();
return JsonResult.success("获取自传书列表成功", atlAutobiographyService.getShowAutobiography(page, limit, userId, type));
}
@RequestMapping(value = "/homeNewsList")
@ApiOperation(value = "获取首页新闻列表", httpMethod = "POST", notes = "获取首页新闻列表")
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = AtlNewsListDto.class))
public JsonResult homeNewsList() {
return JsonResult.success("获取首页新闻列表成功", atlNewsService.homeNewsList());
}
@RequestMapping(value = "/search")
@ApiOperation(value = "搜索", httpMethod = "POST", notes = "搜索")
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
public JsonResult search(AtlSearchDto atlSearchDto) {
//返回消息
String msg = "";
List<Map<String, Object>> list = new ArrayList<>();
switch (atlSearchDto.getType()) {
case 1:
list = atlTimeService.search(atlSearchDto);
msg = "搜索时光纪成功";
break;
case 3:
list = atlTimeArticleServie.search(atlSearchDto);
msg = "搜索时光纪文章成功";
break;
case 2:
list = atlAutobiographyService.search(atlSearchDto);
msg = "搜索自传书成功";
break;
case 4:
list = atlAutobiographyArticleService.search(atlSearchDto);
msg = "搜索自传书文章成功";
break;
case 5:
list = atlTimeMessageService.search(atlSearchDto);
msg = "搜索留言成功";
break;
case 6:
list = atlTimeMessageService.search(atlSearchDto);
msg = "搜索留言成功";
break;
}
return JsonResult.success(msg, PageDto.setPageVo(list));
}
@RequestMapping(value = "/addReadCount")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "编号", required = true, dataType = "Integer",
paramType = "query"),
@ApiImplicitParam(name = "type", value = "类型 1:时光记 2:自传书", required = true, dataType = "String",
paramType = "query")
})
@ApiOperation(value = "增加阅读量", httpMethod = "POST", notes = "新增阅读量")
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = AtlMyAutobiographyListDto.class))
public JsonResult addReadCount(Long id, String type) {
if ("1".equals(type)) {
return atlTimeService.addReadCount(id);
} else {
return atlAutobiographyService.addReadCount(id);
}
}
@RequestMapping(value = "/addLikeCount")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "编号", required = true, dataType = "Integer",
paramType = "query"),
@ApiImplicitParam(name = "type", value = "类型 1:时光记 2:自传书", required = true, dataType = "String",
paramType = "query")
})
@ApiOperation(value = "增加喜欢量", httpMethod = "POST", notes = "新增阅读量")
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = AtlMyAutobiographyListDto.class))
public JsonResult addLikeCount(Long id, String type) {
if ("1".equals(type)) {
return atlTimeService.addLikeCount(id);
} else {
return atlAutobiographyService.addLikeCount(id);
}
}
}
package com.hwstudio.antaile.controller;
import com.hwstudio.antaile.dto.LoginUserDto;
import com.hwstudio.antaile.service.AtlUserService;
import com.hwstudio.antaile.utils.JsonResult;
import com.hwstudio.antaile.utils.RedisUtil;
import com.hwstudio.antaile.vo.LoginUserVo;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/5/23 22:13
* @Version 1.0
*/
@RequestMapping(value="/login")
@RestController
@Api(tags="登录接口")
@CrossOrigin
public class LoginController{
@Autowired
private AtlUserService atlUserService;
@Autowired
private RedisUtil redisUtil;
@RequestMapping(value="/pwdLogin")
@ApiOperation(value = "手机号/密码登录", httpMethod = "POST", notes = "手机号+密码登录,成功后返回token,在需要登录的接口头部加入此token", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = LoginUserDto.class))
public JsonResult pwdLogin(LoginUserVo loginUserVo) throws Exception{
LoginUserDto loginUserDto = atlUserService.pwdLogin(loginUserVo);
return JsonResult.success("请求成功", loginUserDto);
}
@RequestMapping(value="/appletLogin")
@ApiOperation(value = "小程序登录", httpMethod = "POST", notes = "手机号+密码登录,成功后返回token,在需要登录的接口头部加入此token", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = LoginUserDto.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", required = false, dataType = "String",
paramType = "query"),
@ApiImplicitParam(name = "nickName", value = "昵称", required = false, dataType = "String",
paramType = "query"),
@ApiImplicitParam(name = "avatarUrl", value = "头像地址", required = false, dataType = "String",
paramType = "query"),
@ApiImplicitParam(name = "sex", value = "性别 1-男 2-女", required = false, dataType = "Integer",
paramType = "query"),
@ApiImplicitParam(name = "wxCode", value = "微信code", required = false, dataType = "String",
paramType = "query"),
@ApiImplicitParam(name = "mobile", value = "账号(手机号)", required = false, dataType = "String",
paramType = "query"),
@ApiImplicitParam(name = "pwd", value = "密码", required = false, dataType = "String",
paramType = "query"),
@ApiImplicitParam(name = "isApplet", value = "0: 账号登录 1:微信登录", required = true, dataType = "String",
paramType = "query"),
})
public JsonResult appletLogin(LoginUserVo loginUserVo) throws Exception{
return atlUserService.appletLogin(loginUserVo);
}
@RequestMapping(value="/loginOut")
@ApiOperation(value="退出登录", httpMethod = "POST", notes="退出登录")
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
public JsonResult loginOut(HttpServletRequest request){
String token = request.getHeader("token");
if(token == null){
return JsonResult.success("退出成功");
}
redisUtil.remove(token);
return JsonResult.success("退出成功");
}
}
package com.hwstudio.antaile.controller;
import com.hwstudio.antaile.entity.AtlMemorial;
import com.hwstudio.antaile.service.AtlMemorialService;
import com.hwstudio.antaile.utils.JsonResult;
import com.sun.xml.internal.xsom.impl.scd.Iterators;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
* Created by LENOVO on 2019/5/26.
*/
@RequestMapping(value="/memorial")
@RestController
@Api(tags="生命纪念馆")
public class MemorialController {
@Autowired
private AtlMemorialService atlMemorialService;
@RequestMapping(value="/showMemorial")
@ApiOperation(value = "生命纪念馆列表接口", httpMethod = "POST", notes = "生命纪念馆列表接口", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
public JsonResult showMemorial(){
List<Map<String , Object>> map = atlMemorialService.getShowMemorial();
return JsonResult.success("展示生命纪念馆",map);
}
}
package com.hwstudio.antaile.controller;
import com.hwstudio.antaile.dto.AtlTimeListDto;
import com.hwstudio.antaile.dto.AtlUserInfoDto;
import com.hwstudio.antaile.service.MsgService;
import com.hwstudio.antaile.utils.JsonResult;
import com.hwstudio.antaile.utils.PushUtils;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/8/19 15:26
* @Version 1.0
*/
@RestController
@RequestMapping("/msg")
@Api(tags = "消息相关接口")
public class MsgController extends BaseController{
@Autowired
private MsgService msgService;
@RequestMapping(value="getAllCountUnRead")
@ApiOperation(value = "获取未读消息总条数",httpMethod = "POST", notes = "获取未读消息总条数")
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
public JsonResult getAllCountUnRead(){
Long userId = super.getUserId();
if(userId == null){
return JsonResult.notLogin();
}
return JsonResult.success("获取未读消息总条数成功", msgService.getAllCountUnRead(userId));
}
@RequestMapping(value="msgHome")
@ApiOperation(value = "获取消息首页数据",httpMethod = "POST", notes = "获取消息首页数据")
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
public JsonResult msgHome(){
Long userId = super.getUserId();
if(userId == null){
return JsonResult.notLogin();
}
return JsonResult.success("获取消息首页数据成功", msgService.getMsgHome(userId));
}
@PostMapping(value="/msgList")
@ApiOperation(value="获取消息列表", httpMethod = "POST", notes = "获取消息列表", response = JsonResult.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "类型(1-系统消息 2-提醒消息 3-社交消息)", required = true, dataType = "Integer",
paramType = "query"),
@ApiImplicitParam(name = "limit", value = "条数", required = true, dataType = "Integet",
paramType = "query"),
@ApiImplicitParam(name = "page", value = "起始页", required = true, dataType = "Integer",
paramType = "query"),
})
public JsonResult msgList(Integer type, Integer page, Integer limit) {
Long userId = super.getUserId();
if(userId == null){
return JsonResult.notLogin();
}
return JsonResult.success("获取消息列表成功", msgService.msgList(userId, type, page, limit));
}
@PostMapping(value="/socialsgList")
@ApiOperation(value="获取社交消息列表", httpMethod = "POST", notes = "获取社交消息列表", response = JsonResult.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "content", value = "内容", required = true, dataType = "String",
paramType = "query")
})
public JsonResult socialsgList(String content) {
Long userId = super.getUserId();
if(userId == null){
return JsonResult.notLogin();
}
return msgService.socialsgList(userId, content);
}
@PostMapping(value="/socialsgListDelete")
@ApiOperation(value="删除社交列表消息", httpMethod = "POST", notes = "删除社交列表消息", response = JsonResult.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "userId", value = "用户id", required = true, dataType = "Long",
paramType = "query")
})
public JsonResult socialsgListDelete(Long userId) {
Long loginUserId = super.getUserId();
if(loginUserId == null){
return JsonResult.notLogin();
}
return msgService.socialsgListDelete(userId);
}
@PostMapping(value="/socialsgView")
@ApiOperation(value="获取社交消息详情", httpMethod = "POST", notes = "获取社交消息详情", response = JsonResult.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "userId", value = "用户id", required = true, dataType = "Long",
paramType = "query")
})
public JsonResult socialsgView(Long userId) {
Long loginUserId = super.getUserId();
if(loginUserId == null){
return JsonResult.notLogin();
}
return msgService.socialsgView(userId);
}
@PostMapping(value="/push")
@ApiOperation(value="消息推送", httpMethod = "POST", notes = "消息推送", response = JsonResult.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "title", value = "推送标题", required = true, dataType = "Integer",
paramType = "query"),
@ApiImplicitParam(name = "content", value = "推送内容", required = true, dataType = "Integet",
paramType = "query"),
@ApiImplicitParam(name = "clientId", value = "cid", required = true, dataType = "Integer",
paramType = "query"),
@ApiImplicitParam(name = "type", value = "类型(0:安卓 1:IOS)", required = true, dataType = "String",
paramType = "query"),
@ApiImplicitParam(name = "messageId", value = "消息id", required = true, dataType = "Long",
paramType = "query"),
@ApiImplicitParam(name = "messageType", value = "消息类型(类型 1-系统消息 2-提醒消息 3-社交消息)", required = true, dataType = "Long",
paramType = "query"),
})
public JsonResult pushTest(String title, String content, String clientId, String type, Long messageId, String messageType) {
PushUtils pushUtils = new PushUtils();
if("0".equals(type)){
return JsonResult.success("推送结果",pushUtils.pushAlone(title,content,clientId));
}else {
return JsonResult.success("推送结果",pushUtils.pushAloneTC(title,content,clientId, messageId, messageType));
}
}
}
package com.hwstudio.antaile.controller;
import com.hwstudio.antaile.service.RegisterService;
import com.hwstudio.antaile.utils.JsonResult;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 功能描述: <br>注册接口
* 〈〉
* @since: 1.0.0
* @Author:Momo
* @Date: 2019/5/23 23:33
*/
@RestController
@RequestMapping("/register")
@Api(tags = "注册接口")
@CrossOrigin
public class RegisterController {
@Autowired
private RegisterService registerService;
/**
* 注册手机号
*
* @param mobile 手机号
* @param pwd 密码
* @param verifyCode 验证码
* @return JsonResult
* @author whj
* @date 2018/10/16 10:58
*/
@PostMapping("/register-mobile")
@ApiOperation(value = "注册手机号", notes = "注册手机号")
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "mobile", value = "手机号", required = true, dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "pwd", value = "密码", required = true, dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "verifyCode", value = "验证码", required = true, dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "nickName", value = "昵称", required = true, dataType = "string", paramType = "query")
})
public JsonResult registerMobile(String mobile, String pwd, String verifyCode, String nickName) {
registerService.registerMobile(mobile, pwd, verifyCode, nickName);
return JsonResult.success("注册成功");
}
}
package com.hwstudio.antaile.controller;
import com.hwstudio.antaile.service.SmsService;
import com.hwstudio.antaile.utils.JsonResult;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/5/24 22:28
* @Version 1.0
*/
@RestController
@RequestMapping(value="/sms")
@Api(tags = "短信相关接口")
@CrossOrigin
public class SmsController {
@Autowired
private SmsService smsService;
/**
* 发送验证码
*
* @param mobile 手机号
* @param type 类型
* @return JsonResult
* @author whj
* @date 2018/10/16 10:58
*/
@PostMapping("/send-verify-code")
@ApiOperation(value = "发送验证码", notes = "发送验证码")
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "mobile", value = "手机号", required = true, dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "type", value = "类型:1:注册", required = true, dataType = "int", paramType = "query")
})
public JsonResult sendVerifyCode(String mobile, Integer type) {
smsService.sendVerifyCode(mobile, type);
return JsonResult.success("发送成功");
}
}
package com.hwstudio.antaile.controller;
import com.hwstudio.antaile.dto.CountryMobilePrefixListDto;
import com.hwstudio.antaile.dto.SysBaijiaxingDetailsDto;
import com.hwstudio.antaile.dto.SysBaijiaxingListDto;
import com.hwstudio.antaile.service.CountryMobilePrefixService;
import com.hwstudio.antaile.service.SysAreaService;
import com.hwstudio.antaile.service.SysBaijiaxingService;
import com.hwstudio.antaile.utils.JsonResult;
import com.hwstudio.antaile.vo.SysAreaVo;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/7/10 22:31
* @Version 1.0
*/
@CrossOrigin(value = "*",maxAge = 3600)
@RequestMapping(value="/sysArea")
@RestController
@Api(tags = "中国省市区相关接口")
public class SysAreaController {
@Autowired
private SysAreaService sysAreaService;
@RequestMapping(value="list")
@ApiOperation(value = "省市区列表接口", httpMethod = "POST", notes = "省市区列表接口", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "level", value = "等级", required = true, dataType = "Integer",
paramType = "query"),
@ApiImplicitParam(name = "name", value = "名称", required = false, dataType = "String",
paramType = "query")
})
public JsonResult list(SysAreaVo vo){
List list = sysAreaService.list(vo);
return JsonResult.success("请求成功",list);
}
}
package com.hwstudio.antaile.controller;
import com.hwstudio.antaile.dto.CountryMobilePrefixListDto;
import com.hwstudio.antaile.dto.SysBaijiaxingDetailsDto;
import com.hwstudio.antaile.dto.SysBaijiaxingListDto;
import com.hwstudio.antaile.service.CountryMobilePrefixService;
import com.hwstudio.antaile.service.SysBaijiaxingService;
import com.hwstudio.antaile.utils.JsonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/7/10 22:31
* @Version 1.0
*/
@CrossOrigin(value = "*",maxAge = 3600)
@RequestMapping(value="/sys")
@RestController
@Api(tags = "地区和字典相关接口")
public class SysController {
@Autowired
private CountryMobilePrefixService countryMobilePrefixService;
@Autowired
private SysBaijiaxingService sysBaijiaxingService;
@PostMapping(value="/getCountryList")
@ApiOperation(value="获取地区及区号列表", httpMethod = "POST", notes = "获取地区及区号列表", response = CountryMobilePrefixListDto.class)
public JsonResult getCountryList () {
return JsonResult.success("获取地区列表成功", countryMobilePrefixService.getCountryList());
}
@PostMapping(value="/getBaijiaxingList")
@ApiOperation(value="获取百家姓列表", httpMethod = "POST", notes = "获取百家姓列表", response = SysBaijiaxingListDto.class)
public JsonResult getBaijiaxingList () {
return JsonResult.success("获取百家姓列表成功", sysBaijiaxingService.getBaijiaxingList());
}
@PostMapping(value="/baijiaxingDetails")
@ApiOperation(value="获取百家姓详情", httpMethod = "POST", notes = "获取百家姓详情", response = SysBaijiaxingDetailsDto.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "百家姓id", required = true, dataType = "Long",
paramType = "query"),
})
public JsonResult baijiaxingDetails (Long id) {
return JsonResult.success("获取百家姓详情成功", sysBaijiaxingService.baijiaxingDetails(id));
}
}
package com.hwstudio.antaile.controller;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Maps;
import com.google.gson.JsonObject;
import com.hwstudio.antaile.common.WxRequestCode;
import com.hwstudio.antaile.dto.AtlUserInfoDto;
import com.hwstudio.antaile.service.ThirdApiService;
import com.hwstudio.antaile.utils.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import jodd.http.HttpUtil;
import jodd.util.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.cache.CacheProperties;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.*;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/5/29 14:54
* @Version 1.0
*/
@RestController
@RequestMapping(value = "/thirdApi")
@Api(tags = "第三方相关接口文档")
@CrossOrigin
public class ThirdApiController extends BaseController {
@Autowired
private ThirdApiService thirdApiService;
@Resource
private RedisUtil redisUtil;
private final static Logger logger = LoggerFactory.getLogger(ThirdApiController.class);
@RequestMapping(value = "getAliData")
@ApiOperation(value = "获取OSS信息", httpMethod = "POST", notes = "获取OSS信息")
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
public JsonResult getAliData() {
Long userId = super.getUserId();
if (Objects.isNull(userId)) {
return JsonResult.notLogin();
}
Map<String, String> map = thirdApiService.getAliData();
return JsonResult.success("获取oss成功", map);
}
@RequestMapping(value = "wx/getTicket")
@ApiOperation(value = "获取微信签名", httpMethod = "POST", notes = "获取微信签名")
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
public JsonResult getTicket(String url) {
if (StringUtil.isBlank(url)) {
return JsonResult.failed("传入参数url不可为空");
}
Map<String, Object> map = Maps.newHashMap();
String appId = thirdApiService.getValue("wxAppId");
if (StringUtil.isBlank(appId)) {
return JsonResult.failed("系统缺少微信用户唯一凭证配置");
}
map.put("appId", appId);
String secretId = thirdApiService.getValue("wxSecret");
if (StringUtil.isBlank(appId)) {
return JsonResult.failed("系统缺少微信用户唯一凭证密钥配置");
}
String redisTicketStr = (String) redisUtil.get("jsapiTicket");
if (StringUtil.isNotBlank(redisTicketStr)) {
String noncestr = UUID.randomUUID().toString().replaceAll("-", "");
map.put("noncestr", noncestr);
int timestamp = DateUtil.getSecondTimestamp(new Date());
map.put("timestamp", timestamp);
String sha1StrBef = "jsapi_ticket=" + redisTicketStr + "&noncestr=" + noncestr + "&timestamp=" + timestamp + "&url=" + url;
String sha1StrAft = StringUtils.getSha1(sha1StrBef);
map.put("jsapiTicket", sha1StrAft);
return JsonResult.success("获取微信签名成功", map);
} else {
String redisToken = (String) redisUtil.get(appId);
if (StringUtil.isNotBlank(redisToken)) {
String ticketUrl = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?type=jsapi&access_token=" + redisToken;
String ticketResult = HttpUtils.get(ticketUrl);
JSONObject ticketObject = JSONObject.parseObject(ticketResult);
String errcode = ticketObject.get("errcode").toString();
if (WxRequestCode.SUCCESS.equals(errcode)) {
String jsapiTicket = ticketObject.get("ticket").toString();
String noncestr = UUID.randomUUID().toString().replaceAll("-", "");
map.put("noncestr", noncestr);
int timestamp = DateUtil.getSecondTimestamp(new Date());
map.put("timestamp", timestamp);
String sha1StrBef = "jsapi_ticket=" + jsapiTicket + "&noncestr=" + noncestr + "&timestamp=" + timestamp + "&url=" + url;
String sha1StrAft = StringUtils.getSha1(sha1StrBef);
map.put("jsapiTicket", sha1StrAft);
return JsonResult.success("获取微信签名成功", map);
} else {
String errMsg = getWxErrMsg(errcode);
return JsonResult.failed(errMsg);
}
} else {
String accessTokenUrl = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + appId + "&secret=" + secretId;
String accessTokenResult = HttpUtils.get(accessTokenUrl);
JSONObject accessTokenObject = JSONObject.parseObject(accessTokenResult);
Set<String> keySet = accessTokenObject.keySet();
for (String str : keySet) {
if ("errcode".equals(str)) {
String errMsgKey = accessTokenObject.get(str).toString();
String errMsg = getWxErrMsg(errMsgKey);
return JsonResult.failed(errMsg);
}
}
String accessToken = accessTokenObject.get("access_token").toString();
Integer expiresIn = (Integer) accessTokenObject.get("expires_in");
redisUtil.set(appId, accessTokenObject, Integer.toUnsignedLong(expiresIn));
String ticketUrl = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?type=jsapi&access_token=" + accessToken;
String ticketResult = HttpUtils.get(ticketUrl);
JSONObject ticketObject = JSONObject.parseObject(ticketResult);
String errcode = ticketObject.get("errcode").toString();
if (WxRequestCode.SUCCESS.equals(errcode)) {
String jsapiTicket = ticketObject.get("ticket").toString();
redisUtil.set("jsapiTicket", jsapiTicket, Integer.toUnsignedLong(expiresIn));
String noncestr = UUID.randomUUID().toString().replaceAll("-", "");
map.put("noncestr", noncestr);
int timestamp = DateUtil.getSecondTimestamp(new Date());
map.put("timestamp", timestamp);
String sha1StrBef = "jsapi_ticket=" + jsapiTicket + "&noncestr=" + noncestr + "&timestamp=" + timestamp + "&url=" + url;
String sha1StrAft = StringUtils.getSha1(sha1StrBef);
map.put("jsapiTicket", sha1StrAft);
return JsonResult.success("获取微信签名成功", map);
} else {
String errMsg = getWxErrMsg(errcode);
return JsonResult.failed(errMsg);
}
}
}
}
private String getWxErrMsg(String errcode) {
String msg = "";
switch (errcode) {
case WxRequestCode.SYS_BUSY:
msg = "微信服务器系统繁忙,请稍后再试";
break;
case WxRequestCode.APPSECRET_ERR:
msg = "AppSecret错误,请检查系统配置";
break;
case WxRequestCode.GRANT_TYPE_ERR:
msg = "grant_type参数值填写错误";
break;
case WxRequestCode.NOT_IN_WHITE_LIST:
msg = "当前服务器IP不在白名单上,请添加";
break;
}
if (StringUtil.isBlank(msg)) {
msg = "未知错误,请联系开发者处理";
}
return msg;
}
}
package com.hwstudio.antaile.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
import java.util.Map;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/6/28 01:18
* @Version 1.0
*/
@Data
@ApiModel
public class AtlAutobiographyArticleDatailsDto {
@ApiModelProperty(value="主键id")
private Long id;
@ApiModelProperty(value="标题")
private String title;
@ApiModelProperty(value="作者")
private String author;
@ApiModelProperty(value="发生时间")
private String occurTime;
@ApiModelProperty(value="文章内容")
private List<Map<String, Object>> articleContent;
@ApiModelProperty(value="内容")
private String content;
@ApiModelProperty(value="创建时间")
private String createDate;
@ApiModelProperty(value="传记书id")
private Long autobiographyId;
}
package com.hwstudio.antaile.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/6/28 00:39
* @Version 1.0
*/
@Data
@ApiModel
public class AtlAutobiographyArticleListDto {
@ApiModelProperty(value="主键id")
private Long id;
@ApiModelProperty(value="标题")
private String title;
@ApiModelProperty(value="发生时间")
private String occurTime;
}
package com.hwstudio.antaile.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/6/28 00:35
* @Version 1.0
*/
@Data
@ApiModel
public class AtlAutobiographyDetailsDto {
@ApiModelProperty(value="主键id")
private Long id;
@ApiModelProperty(value="书名")
private String name;
@ApiModelProperty(value="作者")
private String author;
@ApiModelProperty(value="阅读量")
private Integer readCount;
@ApiModelProperty(value="喜欢量")
private Integer likeCount;
@ApiModelProperty(value="封面图地址")
private String coverUrl;
@ApiModelProperty(value="文章总数")
private Integer articleCount;
@ApiModelProperty(value="文章列表")
private List<AtlAutobiographyArticleListDto> atlAutobiographyListDtoArticleList;
@ApiModelProperty(value="创建时间")
private String createTime;
@ApiModelProperty(value="问题")
private String question;
@ApiModelProperty(value="答案")
private String answer;
@ApiModelProperty(value="隐私设置")
private Integer privacySetting;
@ApiModelProperty(value="模板id")
private Long templateId;
@ApiModelProperty(value="修改时间")
private String updateTime;
@ApiModelProperty(value= "是否收藏")
private Integer isCollection;
@ApiModelProperty(value = "用户id")
private Long userId;
@ApiModelProperty(value = "缩略图url")
private String thumbnailUrl;
}
package com.hwstudio.antaile.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/6/30 01:52
* @Version 1.0
*/
@Data
@ApiModel
public class AtlCommentDto {
@ApiModelProperty(value = "编号")
private Long id;
@ApiModelProperty(value = "用户id")
private Long userId;
@ApiModelProperty(value = "内容")
private String content;
@ApiModelProperty(value = "创建时间")
private String createTime;
@ApiModelProperty(value = "创建人")
private String createUserId;
@ApiModelProperty(value = "点赞数")
private Integer likeCount;
@ApiModelProperty(value = "收藏数")
private String collectCount;
}
\ No newline at end of file
package com.hwstudio.antaile.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @Name: 时光纪列表DTO
* @Author: Lijc
* @Date: 2019/5/29 22:46
* @Version 1.0
*/
@Data
@ApiModel
public class AtlMemorialDayDto {
@ApiModelProperty(value="纪念日id")
private Long id;
@ApiModelProperty(value="纪念日时间")
private Date day;
@ApiModelProperty(value="内容")
private String content;
@ApiModelProperty(value="是否推送 0:否 1:是")
private String isPush;
@ApiModelProperty(value="是否短信 0:否 1:是")
private String isSMS;
@ApiModelProperty(value="创建时间")
private Date createTime;
@ApiModelProperty(value="创建用户Id")
private Long createUserId;
@ApiModelProperty(value="修改时间")
private Date updateTime;
@ApiModelProperty(value="更新用户Id")
private Long updateUserId;
}
package com.hwstudio.antaile.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/6/24 22:59
* @Version 1.0
*/
@Data
@ApiModel
public class AtlMyAutobiographyListDto {
@ApiModelProperty(value="自传书id")
private Long id;
@ApiModelProperty(value="我喜欢的主键id")
private Long likeId;
@ApiModelProperty(value="名字")
private String name;
@ApiModelProperty(value="封面图地址")
private String coverUrl;
@ApiModelProperty(value="作者")
private String author;
@ApiModelProperty(value="修改时间")
private String updateTime;
@ApiModelProperty(value="文章数")
private String totalArticle;
@ApiModelProperty(value="是否关联")
private String isRelevance;
}
package com.hwstudio.antaile.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/7/14 23:03
* @Version 1.0
*/
@ApiModel
@Data
public class AtlNewsDetailsDto {
@ApiModelProperty(value = "id")
private Long id;
@ApiModelProperty(value = "标题")
private String title;
@ApiModelProperty(value = "首页图地址")
private String coverUrl;
@ApiModelProperty(value = "内容")
private String content;
@ApiModelProperty(value = "创建时间")
private String createTime;
@ApiModelProperty(value = "浏览量")
private String readCount;
}
package com.hwstudio.antaile.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/7/14 22:40
* @Version 1.0
*/
@Data
@ApiModel
public class AtlNewsListDto {
@ApiModelProperty(value = "id")
private Long id;
@ApiModelProperty(value = "标题")
private String title;
@ApiModelProperty(value = "首页图地址")
private String coverUrl;
@ApiModelProperty(value = "内容")
private String content;
@ApiModelProperty(value = "浏览量")
private String readCount;
}
package com.hwstudio.antaile.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/7/14 23:43
* @Version 1.0
*/
@Data
@ApiModel
public class AtlPrivateQuestionDto {
@ApiModelProperty(value = "id")
private Long id;
@ApiModelProperty(value= "隐私设置类型 1-公开 2-私密 3-需要问题")
private Integer privacySetting;
@ApiModelProperty(value = "问题, 当隐私设置为3时返回")
private String question;
@ApiModelProperty(value = "模板id")
private Long templateId;
}
package com.hwstudio.antaile.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/6/30 01:52
* @Version 1.0
*/
@Data
@ApiModel
public class AtlProtocolDto {
@ApiModelProperty(value = "主键id")
private Long id;
@ApiModelProperty(value = "类型 1-协议 2-公司 3-关于APP")
private Integer type;
@ApiModelProperty(value = "描述")
private String description;
}
package com.hwstudio.antaile.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/7/16 23:11
* @Version 1.0
*/
@Data
@ApiModel
public class AtlSearchDto extends BaseDto{
@ApiModelProperty(value = "名称")
private String name;
@ApiModelProperty(value = "类型 1-时光纪 2-自传书 3-时光纪文章 4-自传书文章 5-时光纪留言 6-文章留言")
private Integer type;
@ApiModelProperty(value = "主键id")
private Long id;
}
package com.hwstudio.antaile.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
import java.util.Map;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/6/7 16:47
* @Version 1.0
*/
@Data
@ApiModel
public class AtlTimeArticleDetailsDto {
@ApiModelProperty(value="主键id")
private Long id;
@ApiModelProperty(value="标题")
private String title;
@ApiModelProperty(value="作者")
private String author;
@ApiModelProperty(value="标签")
private List<String> label;
@ApiModelProperty(value="隐私设置")
private Integer privacySetting;
@ApiModelProperty(value="发生时间")
private String occurTime;
@ApiModelProperty(value="文章内容")
private List<Map<String, Object>> articleContent;
@ApiModelProperty(value="文件地址列表")
private List<Map<String, Object>> fileUrl;
@ApiModelProperty(value="内容")
private String content;
@ApiModelProperty(value="type")
private Integer type;
@ApiModelProperty(value="意思问题id")
private Long privateId;
@ApiModelProperty(value="问题")
private String question;
@ApiModelProperty(value="创建时间")
private String createDate;
}
package com.hwstudio.antaile.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
import java.util.Map;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/6/6 16:30
* @Version 1.0
*/
@Data
@ApiModel
public class AtlTimeArticleListDto extends BaseDto{
@ApiModelProperty(value="主键id")
private Long id;
@ApiModelProperty(value="类型 1-文章 2-图片 3-视频 4-音频")
private Integer type;
@ApiModelProperty(value="标题")
private String title;
@ApiModelProperty(value="创建时间")
private String createDate;
@ApiModelProperty(value="内容")
private String content;
@ApiModelProperty(value="文件地址列表")
private List<Map<String, Object>> urlList;
}
package com.hwstudio.antaile.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/6/6 15:15
* @Version 1.0
*/
@Data
@ApiModel
public class AtlTimeDetailsDto {
@ApiModelProperty(value="主键id")
private Long id;
@ApiModelProperty(value="时光纪名称")
private String name;
@ApiModelProperty(value="作者")
private String author;
@ApiModelProperty(value="创建时间")
private String createDate;
@ApiModelProperty(value="封面图地址")
private String coverUrl;
@ApiModelProperty(value="文章数")
private Integer articleCount;
@ApiModelProperty(value="照片数")
private Integer photoCount;
@ApiModelProperty(value="视频数")
private Integer movieCount;
@ApiModelProperty(value="音频数")
private Integer audioCount;
@ApiModelProperty(value="关于谁")
private String aboutName;
@ApiModelProperty(value="是否收藏")
private Integer isCollection;
@ApiModelProperty(value="二维码地址")
private String autobiographyId;
}
package com.hwstudio.antaile.dto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @Name: 时光纪列表DTO
* @Author: Lijc
* @Date: 2019/5/29 22:46
* @Version 1.0
*/
@Data
@ApiModel
public class AtlTimeListDto {
@ApiModelProperty(value="时光纪id")
private Long id;
@ApiModelProperty(value="名称")
private String name;
@ApiModelProperty(value="关于谁")
private String aboutName;
@ApiModelProperty(value="隐私设置")
private Integer privateSetting;
@ApiModelProperty(value="修改时间")
private Date updateDate;
@ApiModelProperty(value="修改时间")
private String updateDateStr;
@ApiModelProperty(value="是否默认")
private Integer isDefault;
@ApiModelProperty(value="是否默认(快捷发布)")
private Integer isQuickDefault;
@ApiModelProperty(value="喜欢id(只有在我喜欢的列表会出现,在需要取消关注的接口中用到)")
private Long likeId;
@ApiModelProperty(value="封面图地址")
private String coverUrl;
@ApiModelProperty(value="作者")
private String author;
@ApiModelProperty(value="二维码地址")
private String autobiographyId;
@ApiModelProperty(value="是否存在未读留言")
private String isUnRead;
@ApiModelProperty(value="剩余天数")
private Long days;
@ApiModelProperty(value="文章数")
private Integer articleCount;
@ApiModelProperty(value="封面图地址")
private String thumbnailUrl;
}
package com.hwstudio.antaile.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/6/19 23:30
* @Version 1.0
*/
@Data
@ApiModel
public class AtlTimeMessageListDto {
@ApiModelProperty(value= "留言id")
private Long id;
@ApiModelProperty(value= "内容")
private String content;
@ApiModelProperty(value= "创建时间")
private String createTime;
@ApiModelProperty(value= "用户名")
private String userName;
@ApiModelProperty(value= "头像")
private String avaterImageUrl;
@ApiModelProperty(value= "用户id")
private Long userId;
@ApiModelProperty(value= "状态 0-未审核 1-审核通过 2-审核未通过")
private Integer state;
@ApiModelProperty(value= "阅读状态 0-未读 1-已读")
private String readFlag;
}
package com.hwstudio.antaile.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/6/1 19:27
* @Version 1.0
*/
@Data
@ApiModel
public class AtlTimeOwnerDto {
private Long id;
private Long timeId;
@ApiModelProperty(value="真实姓名")
private String realName;
@ApiModelProperty(value="性别 0-男 1-女")
private Integer sex;
@ApiModelProperty(value="国籍")
private String nationality;
@ApiModelProperty(value="证件类型 1-身份证 2-护照 3-军官证")
private Integer identityType;
@ApiModelProperty(value="证件编号")
private String identity;
@ApiModelProperty(value="生辰")
private String birthdate;
@ApiModelProperty(value="生辰(农历)")
private String birthdateLunar;
@ApiModelProperty(value="出生地")
private String bornPalce;
@ApiModelProperty(value="居住地 国")
private String residenceCountry;
@ApiModelProperty(value="居住地 省")
private String residenceProvince;
@ApiModelProperty(value="居住地 市")
private String residenceCity;
@ApiModelProperty(value="居住地 区")
private String residenceArea;
@ApiModelProperty(value="居住地 详细地址")
private String residence;
@ApiModelProperty(value="家庭地位")
private String familyStatus;
@ApiModelProperty(value="婚姻 1-未婚 2-已婚 3-离异")
private Integer emotionalState;
@ApiModelProperty(value="是否过世 0 过世 1 在世")
private Integer livingState;
@ApiModelProperty(value="卒年开始")
private String deathdate;
@ApiModelProperty(value="卒年(农历)")
private String deathdateLunar;
@ApiModelProperty(value="卒年结束")
private String deathDateEnd;
@ApiModelProperty(value="子女个数")
private Integer childrenNum;
@ApiModelProperty(value="形象照地址")
private String imageUrl;
@ApiModelProperty(value="个人简介")
private String profile;
@ApiModelProperty(value="身高")
private String height;
@ApiModelProperty(value="体重")
private String weight;
@ApiModelProperty(value="血型")
private String blood;
@ApiModelProperty(value="星座")
private String constellation;
@ApiModelProperty(value="爱好")
private String hobby;
@ApiModelProperty(value="颜色")
private String color;
@ApiModelProperty(value="数字")
private Integer number;
@ApiModelProperty(value="信仰")
private String faith;
@ApiModelProperty(value="个人资料隐私设置")
private String permission;
@ApiModelProperty(value="是否删除 0-否 1-是")
private Integer delFlag;
}
package com.hwstudio.antaile.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/6/11 15:54
* @Version 1.0
*/
@Data
@ApiModel
public class AtlTimeSetDto {
@ApiModelProperty(value="主键id")
private Long id;
@ApiModelProperty(value="名称")
private String name;
@ApiModelProperty(value="关于谁")
private String aboutName;
@ApiModelProperty(value="模板id")
private Long templateId;
@ApiModelProperty(value="模板名字")
private String templateName;
@ApiModelProperty(value="封面图地址")
private String coverUrl;
@ApiModelProperty(value="隐私设置")
private Long privacySetting;
@ApiModelProperty(value="二级域名")
private String secondUrl;
@ApiModelProperty(value="问题")
private String question;
@ApiModelProperty(value="隐私id")
private Long privacySettingId;
@ApiModelProperty(value="二维码")
private String codeUrl;
@ApiModelProperty(value="答案")
private String answer;
@ApiModelProperty(value="收藏次数")
private Integer likeCount;
private Long userId;
@ApiModelProperty(value="关联自传书id")
private String autobiographyId;
}
package com.hwstudio.antaile.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/5/29 23:53
* @Version 1.0
*/
@Data
@ApiModel
public class AtlTimeTemplateListDto {
@ApiModelProperty(value="模板id")
private Long id;
@ApiModelProperty(value="封面图地址")
private String coverUrl;
@ApiModelProperty(value="名称")
private String name;
@ApiModelProperty(value="风格")
private String style;
@ApiModelProperty(value="描述")
private String describe;
}
package com.hwstudio.antaile.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/5/30 00:04
* @Version 1.0
*/
@Data
@ApiModel
public class AtlTimeTemplateTypelistDto {
@ApiModelProperty(value="模板类型id")
private Long id;
@ApiModelProperty(value="名称")
private String name;
}
package com.hwstudio.antaile.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/6/1 18:00
* @Version 1.0
*/
@Data
@ApiModel
public class AtlTimeTimemarkListDto {
@ApiModelProperty(value="主键")
private Long id;
@ApiModelProperty(value="时光纪id")
private Long timeId;
@ApiModelProperty(value="纪要类型 1 大事记 2 教育经历 3 工作经历")
private Integer type;
@ApiModelProperty(value="开始时间")
private String startTime;
@ApiModelProperty(value="结束时间")
private String endTime;
@ApiModelProperty(value="开始时间(大事记)")
private String startTimeStr;
@ApiModelProperty(value="结束时间(大事记)")
private String endTimeStr;
@ApiModelProperty(value="发生地")
private String location;
@ApiModelProperty(value="描述")
private String descript;
}
package com.hwstudio.antaile.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/5/26 17:18
* @Version 1.0
*/
@Data
@ApiModel
public class AtlUserInfoDto {
@ApiModelProperty(value="id")
private Long id;
@ApiModelProperty(value="昵称")
private String nickName;
@ApiModelProperty(value="头像地址")
private String avaterImageUrl;
@ApiModelProperty(value= "纪念日总数")
private Integer anniversaryCount;
@ApiModelProperty(value= "评论总数")
private Integer commentCount;
@ApiModelProperty(value= "地址总数")
private Integer addressCount;
@ApiModelProperty(value="生日")
private String birthday;
@ApiModelProperty(value="生日")
private String birthdayType;
@ApiModelProperty(value= "个性签名")
private String signature;
@ApiModelProperty(value="时光纪总数")
private Integer timeCount;
@ApiModelProperty(value="自传书总数")
private Integer autobiographyCount;
@ApiModelProperty(value="性别 1-男 2-女")
private Integer sex;
@ApiModelProperty(value="openId")
private String openId;
@ApiModelProperty(value="手机号")
private String phone;
@ApiModelProperty(value="是否系统消息提醒 0:否 1:是")
private String isSysPush;
@ApiModelProperty(value="是否社交消息提醒 0:否 1:是")
private String isScPush;
@ApiModelProperty(value="是否提醒消息提醒 0:否 1:是")
private String isRemPush;
}
package com.hwstudio.antaile.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/7/14 23:45
* @Version 1.0
*/
@Data
@ApiModel
public class AtlUserPhoneTypeDto {
@ApiModelProperty(value = "用户id")
private Long userId;
@ApiModelProperty(value = "类型(0:安卓 1:IOS)")
private String phoneType;
@ApiModelProperty(value = "cid")
private String clientId;
}
package com.hwstudio.antaile.dto;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
/**
* BaseVo
*
* @author whj
* @date 2018/8/15 23:45
*/
public class BaseDto {
@ApiModelProperty(value="当前页",name="page",example="1", required=true)
/**
* 当前页
*/
private Integer page;
/**
* 每页显示条数
*/
private Integer limit;
/**
* 查询sql参数
*/
private List<Object> params = new ArrayList<>();
public Integer getPage() {
return page;
}
public void setPage(Integer page) {
this.page = page;
}
public Integer getLimit() {
return limit;
}
public void setLimit(Integer limit) {
this.limit = limit;
}
public List<Object> getParams() {
return params;
}
public void setParams(List<Object> params) {
this.params = params;
}
/**
* 重置当前页
*
* @param count 总条数
*/
public void resetPage(int count) {
int totalPage = count / this.limit;
if (totalPage * this.limit < count) {
totalPage++;
}
if (totalPage > 0 && this.page > totalPage) {
this.page = totalPage;
}
}
}
package com.hwstudio.antaile.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiParam;
import lombok.Data;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/7/13 22:48
* @Version 1.0
*/
@Data
@ApiModel
public class BindingMobileDto {
@ApiModelProperty(value = "手机号")
private String mobile;
@ApiModelProperty(value = "类型 4:绑定手机")
private Integer type;
@ApiModelProperty(value = "验证码")
private String verifyCode;
@ApiModelProperty(value = "密码")
private String pwd;
@ApiModelProperty(value = "类型 0:微信 1:公众号")
private String bingType;
}
package com.hwstudio.antaile.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/7/10 22:40
* @Version 1.0
*/
@Data
@ApiModel
public class CountryMobilePrefixListDto {
@ApiModelProperty(value="id")
private Long id;
@ApiModelProperty(value="国家名称")
private String country;
@ApiModelProperty(value="区号")
private String mobilePrefix;
}
package com.hwstudio.antaile.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/6/29 22:36
* @Version 1.0
*/
@Data
@ApiModel
public class LoginUserDto {
@ApiModelProperty(value="token")
private String token;
@ApiModelProperty(value="昵称")
private String nickName;
@ApiModelProperty(value="头像地址")
private String avatarUrl;
@ApiModelProperty(value="手机号")
private String phone;
private String isBingOffice;
private String isBingApp;
private String isBingApplet;
private String isBingMobile;
private String openId;
private String officeOpendId;
private String appletOpenId;
}
package com.hwstudio.antaile.dto;
import com.github.pagehelper.PageInfo;
import java.util.List;
/**
* 功能描述: 返回分页数据
* 〈〉
* @since: 1.0.0
* @Author:Momo
* @Date: 2019/5/23 22:03
*/
public class PageDto<T> {
/**
* layui 分页状态码
*/
private Integer code;
/**
* layui 分页信息提示
*/
private String msg;
/**
* layui 分页总条数
*/
private Integer count;
/**
* layui 分页数据
*/
private List<T> data;
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public Integer getCount() {
return count;
}
public void setCount(Integer count) {
this.count = count;
}
public List<T> getData() {
return data;
}
public void setData(List<T> data) {
this.data = data;
}
/**
* 设置分页数据响应
* @param <T>
*
* @param count
* 总条数
* @param data
* 数据
* @return PageVo
*/
@SuppressWarnings("all")
public static <T> PageDto setPageVo(List<T> list) {
PageInfo pageInfo = new PageInfo(list);
PageDto pageDto = new PageDto();
int count = Long.valueOf(pageInfo.getTotal()).intValue();
List<Object> data = pageInfo.getList();
pageDto.setCount(count);
pageDto.setData(data);
pageDto.setCode(0);
pageDto.setMsg("successfully");
return pageDto;
}
}
package com.hwstudio.antaile.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/7/11 23:58
* @Version 1.0
*/
@Data
@ApiModel
public class SysBaijiaxingDetailsDto {
@ApiModelProperty(value="id")
private Long id;
@ApiModelProperty(value="标题")
private String title;
@ApiModelProperty(value="简介")
private String introduce;
@ApiModelProperty(value="内容")
private String content;
@ApiModelProperty(value="权重")
private Integer weight;
@ApiModelProperty(value="浏览人数")
private Integer numberView;
@ApiModelProperty(value="姓")
private String xin;
}
package com.hwstudio.antaile.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.ibatis.annotations.Param;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/7/11 23:22
* @Version 1.0
*/
@Data
@ApiModel
public class SysBaijiaxingDto {
@ApiModelProperty(value="id")
private Long id;
@ApiModelProperty(value="姓")
private String text;
}
package com.hwstudio.antaile.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/7/11 23:24
* @Version 1.0
*/
@Data
@ApiModel
public class SysBaijiaxingListDto implements Comparable<SysBaijiaxingListDto>{
@ApiModelProperty(value="首字母大写")
private String label;
@ApiModelProperty(value="姓氏列表")
private List<SysBaijiaxingDto> sysBaijiaxingDtos;
public SysBaijiaxingListDto(String label, List<SysBaijiaxingDto> sysBaijiaxingDtos){
this.label = label;
this.sysBaijiaxingDtos = sysBaijiaxingDtos;
}
@Override
public int compareTo(SysBaijiaxingListDto sysBaijiaxingListDto) {
return Integer.valueOf(this.label.charAt(0)) - Integer.valueOf(sysBaijiaxingListDto.getLabel().charAt(0));
}
}
package com.hwstudio.antaile.entity;
import java.util.Date;
public class AtlAd {
private Long id;
private Long type;
private String status;
private Long sort;
private String remarks;
private String isJump;
private Long imageId;
private String url;
private Date createDate;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getType() {
return type;
}
public void setType(Long type) {
this.type = type;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status == null ? null : status.trim();
}
public Long getSort() {
return sort;
}
public void setSort(Long sort) {
this.sort = sort;
}
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks == null ? null : remarks.trim();
}
public String getIsJump() {
return isJump;
}
public void setIsJump(String isJump) {
this.isJump = isJump == null ? null : isJump.trim();
}
public Long getImageId() {
return imageId;
}
public void setImageId(Long imageId) {
this.imageId = imageId;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url == null ? null : url.trim();
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}
\ No newline at end of file
package com.hwstudio.antaile.entity;
import lombok.Data;
import java.util.Date;
@Data
public class AtlAnniversary {
private Long id;
private Long uid;
private String anniversaryName;
private String anniversaryDate;
private String status;
private String delFlag;
private String remark;
private Long createBy;
private Date createDate;
private Long updateBy;
private Date updateDate;
}
\ No newline at end of file
package com.hwstudio.antaile.entity;
import lombok.Data;
import java.util.Date;
@Data
public class AtlAppVersion {
private Long id;
private String type;
private String versionNo;
private String url;
private String status;
private String desc;
private Date createDate;
private Date updateDate;
private Long createUserId;
private Long updateUserId;
private String delFlag;
}
\ No newline at end of file
package com.hwstudio.antaile.entity;
import io.swagger.models.auth.In;
import lombok.Data;
import java.util.Date;
@Data
public class AtlAutobiography {
private Long id;
private Long userId;
private String name;
private String author;
private Long style;
private Integer privacySetting;
private Integer status;
private String remark;
private Date createTime;
private Date updateTime;
private Long templateId;
private Integer readCount;
private Integer likeCount;
private String coverUrl;
}
\ No newline at end of file
package com.hwstudio.antaile.entity;
import lombok.Data;
import java.util.Date;
@Data
public class AtlAutobiographyArticle {
private Long id;
private Long autobiographyId;
private Long userId;
private String title;
private Byte delFlag;
private String remark;
private Date createTime;
private String content;
private Long timeArticleId;
private Date occurTime;
}
\ No newline at end of file
package com.hwstudio.antaile.entity;
import java.util.Date;
public class AtlAutobiographyLike {
private Long id;
private Long autobiographyId;
private Long userId;
private Byte delFlag;
private Date createDate;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getAutobiographyId() {
return autobiographyId;
}
public void setAutobiographyId(Long autobiographyId) {
this.autobiographyId = autobiographyId;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Byte getDelFlag() {
return delFlag;
}
public void setDelFlag(Byte delFlag) {
this.delFlag = delFlag;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}
\ No newline at end of file
package com.hwstudio.antaile.entity;
import java.util.Date;
public class AtlAutobiographyTemplate {
private Long id;
private String coverUrl;
private Byte delFlag;
private Date createTime;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getCoverUrl() {
return coverUrl;
}
public void setCoverUrl(String coverUrl) {
this.coverUrl = coverUrl == null ? null : coverUrl.trim();
}
public Byte getDelFlag() {
return delFlag;
}
public void setDelFlag(Byte delFlag) {
this.delFlag = delFlag;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}
\ No newline at end of file
package com.hwstudio.antaile.entity;
import java.util.Date;
public class AtlGenealogy {
private Long id;
private Long userId;
private Long styleId;
private String name;
private String lastName;
private String hallNumber;
private String countyLook;
private Byte viewPermissions;
private String remark;
private Byte state;
private Byte delFlag;
private Byte generationNumber;
private Long createBy;
private Date createTime;
private Long updateBy;
private Date updateTime;
private Byte isBirthAddress;
private Byte isNowAddress;
private Byte isChild;
private Byte isBirth;
private Byte isOyster;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Long getStyleId() {
return styleId;
}
public void setStyleId(Long styleId) {
this.styleId = styleId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName == null ? null : lastName.trim();
}
public String getHallNumber() {
return hallNumber;
}
public void setHallNumber(String hallNumber) {
this.hallNumber = hallNumber == null ? null : hallNumber.trim();
}
public String getCountyLook() {
return countyLook;
}
public void setCountyLook(String countyLook) {
this.countyLook = countyLook == null ? null : countyLook.trim();
}
public Byte getViewPermissions() {
return viewPermissions;
}
public void setViewPermissions(Byte viewPermissions) {
this.viewPermissions = viewPermissions;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
public Byte getState() {
return state;
}
public void setState(Byte state) {
this.state = state;
}
public Byte getDelFlag() {
return delFlag;
}
public void setDelFlag(Byte delFlag) {
this.delFlag = delFlag;
}
public Byte getGenerationNumber() {
return generationNumber;
}
public void setGenerationNumber(Byte generationNumber) {
this.generationNumber = generationNumber;
}
public Long getCreateBy() {
return createBy;
}
public void setCreateBy(Long createBy) {
this.createBy = createBy;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Long getUpdateBy() {
return updateBy;
}
public void setUpdateBy(Long updateBy) {
this.updateBy = updateBy;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Byte getIsBirthAddress() {
return isBirthAddress;
}
public void setIsBirthAddress(Byte isBirthAddress) {
this.isBirthAddress = isBirthAddress;
}
public Byte getIsNowAddress() {
return isNowAddress;
}
public void setIsNowAddress(Byte isNowAddress) {
this.isNowAddress = isNowAddress;
}
public Byte getIsChild() {
return isChild;
}
public void setIsChild(Byte isChild) {
this.isChild = isChild;
}
public Byte getIsBirth() {
return isBirth;
}
public void setIsBirth(Byte isBirth) {
this.isBirth = isBirth;
}
public Byte getIsOyster() {
return isOyster;
}
public void setIsOyster(Byte isOyster) {
this.isOyster = isOyster;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment