240930
This commit is contained in:
7
.gitignore
vendored
Normal file
7
.gitignore
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
/target/
|
||||||
|
/.idea/.gitignore
|
||||||
|
/.idea/compiler.xml
|
||||||
|
/.idea/encodings.xml
|
||||||
|
/.idea/jarRepositories.xml
|
||||||
|
/.idea/misc.xml
|
||||||
|
/.idea/vcs.xml
|
||||||
91
Payment.java
Normal file
91
Payment.java
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
package com.gxwebsoft.common.system.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付方式
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-05-11 12:39:11
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "Payment对象", description = "支付方式")
|
||||||
|
@TableName("sys_payment")
|
||||||
|
public class Payment implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "支付方式")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "类型")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "标识")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "支付图标")
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "微信商户号类型 1普通商户2子商户")
|
||||||
|
private Integer wechatType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "应用ID")
|
||||||
|
private String appId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户号")
|
||||||
|
private String mchId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "设置APIv3密钥")
|
||||||
|
private String apiKey;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "证书文件 (CERT)")
|
||||||
|
private String apiclientCert;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "证书文件 (KEY)")
|
||||||
|
private String apiclientKey;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户证书序列号")
|
||||||
|
private String merchantSerialNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "支付结果通知")
|
||||||
|
private String notifyUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文章排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0未启用, 1启用")
|
||||||
|
private Boolean status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "注册时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改时间")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
}
|
||||||
310
mvnw
vendored
Normal file
310
mvnw
vendored
Normal file
@@ -0,0 +1,310 @@
|
|||||||
|
#!/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.
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# Maven 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)`"
|
||||||
|
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
|
||||||
|
if [ -n "$MVNW_REPOURL" ]; then
|
||||||
|
jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
|
||||||
|
else
|
||||||
|
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
|
||||||
|
fi
|
||||||
|
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 $cygwin; then
|
||||||
|
wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
|
||||||
|
fi
|
||||||
|
|
||||||
|
if command -v wget > /dev/null; then
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Found wget ... using wget"
|
||||||
|
fi
|
||||||
|
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||||
|
wget "$jarUrl" -O "$wrapperJarPath"
|
||||||
|
else
|
||||||
|
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
|
||||||
|
fi
|
||||||
|
elif command -v curl > /dev/null; then
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Found curl ... using curl"
|
||||||
|
fi
|
||||||
|
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||||
|
curl -o "$wrapperJarPath" "$jarUrl" -f
|
||||||
|
else
|
||||||
|
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
|
||||||
|
fi
|
||||||
|
|
||||||
|
else
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Falling back to using Java to download"
|
||||||
|
fi
|
||||||
|
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
|
||||||
|
# For Cygwin, switch paths to Windows format before running javac
|
||||||
|
if $cygwin; then
|
||||||
|
javaClass=`cygpath --path --windows "$javaClass"`
|
||||||
|
fi
|
||||||
|
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
|
||||||
|
|
||||||
|
# Provide a "standardized" way to retrieve the CLI args that will
|
||||||
|
# work with both Windows and non-Windows executions.
|
||||||
|
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
|
||||||
|
export MAVEN_CMD_LINE_ARGS
|
||||||
|
|
||||||
|
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 "$@"
|
||||||
182
mvnw.cmd
vendored
Normal file
182
mvnw.cmd
vendored
Normal file
@@ -0,0 +1,182 @@
|
|||||||
|
@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 Maven 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 keystroke 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 by 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.5.6/maven-wrapper-0.5.6.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% (
|
||||||
|
if "%MVNW_VERBOSE%" == "true" (
|
||||||
|
echo Found %WRAPPER_JAR%
|
||||||
|
)
|
||||||
|
) else (
|
||||||
|
if not "%MVNW_REPOURL%" == "" (
|
||||||
|
SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
|
||||||
|
)
|
||||||
|
if "%MVNW_VERBOSE%" == "true" (
|
||||||
|
echo Couldn't find %WRAPPER_JAR%, downloading it ...
|
||||||
|
echo Downloading from: %DOWNLOAD_URL%
|
||||||
|
)
|
||||||
|
|
||||||
|
powershell -Command "&{"^
|
||||||
|
"$webclient = new-object System.Net.WebClient;"^
|
||||||
|
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
|
||||||
|
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
|
||||||
|
"}"^
|
||||||
|
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
|
||||||
|
"}"
|
||||||
|
if "%MVNW_VERBOSE%" == "true" (
|
||||||
|
echo Finished downloading %WRAPPER_JAR%
|
||||||
|
)
|
||||||
|
)
|
||||||
|
@REM End of extension
|
||||||
|
|
||||||
|
@REM Provide a "standardized" way to retrieve the CLI args that will
|
||||||
|
@REM work with both Windows and non-Windows executions.
|
||||||
|
set MAVEN_CMD_LINE_ARGS=%*
|
||||||
|
|
||||||
|
%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%
|
||||||
346
pom.xml
Normal file
346
pom.xml
Normal file
@@ -0,0 +1,346 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<groupId>com.gxwebsoft</groupId>
|
||||||
|
<artifactId>com-gxwebsoft-modules</artifactId>
|
||||||
|
<version>1.5.0</version>
|
||||||
|
|
||||||
|
<name>com-gxwebsoft-api</name>
|
||||||
|
<description>WebSoftApi project for Spring Boot</description>
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
|
<version>2.5.4</version>
|
||||||
|
<relativePath/> <!-- lookup parent from repository -->
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<java.version>1.8</java.version>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<!-- spring-boot-devtools -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-devtools</artifactId>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- spring-boot-test -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- spring-boot-web -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- spring-boot-aop -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-aop</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- spring-boot-configuration-processor -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- lombok -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- mysql -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- druid -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba</groupId>
|
||||||
|
<artifactId>druid-spring-boot-starter</artifactId>
|
||||||
|
<version>1.2.6</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- mybatis-plus -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.baomidou</groupId>
|
||||||
|
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||||
|
<version>3.4.3.3</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- mybatis-plus 连表插件-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.yulichang</groupId>
|
||||||
|
<artifactId>mybatis-plus-join-boot-starter</artifactId>
|
||||||
|
<version>1.4.5</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- mybatis-plus-generator -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.baomidou</groupId>
|
||||||
|
<artifactId>mybatis-plus-generator</artifactId>
|
||||||
|
<version>3.4.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- hutool -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.hutool</groupId>
|
||||||
|
<artifactId>hutool-core</artifactId>
|
||||||
|
<version>5.8.11</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.hutool</groupId>
|
||||||
|
<artifactId>hutool-extra</artifactId>
|
||||||
|
<version>5.8.11</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.hutool</groupId>
|
||||||
|
<artifactId>hutool-http</artifactId>
|
||||||
|
<version>5.8.11</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.hutool</groupId>
|
||||||
|
<artifactId>hutool-crypto</artifactId>
|
||||||
|
<version>5.8.11</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- easy poi -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.afterturn</groupId>
|
||||||
|
<artifactId>easypoi-base</artifactId>
|
||||||
|
<version>4.4.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- tika, 用于FileServer获取content-type -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.tika</groupId>
|
||||||
|
<artifactId>tika-core</artifactId>
|
||||||
|
<version>2.1.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- open office, 用于文档转pdf实现在线预览 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.livesense</groupId>
|
||||||
|
<artifactId>jodconverter-core</artifactId>
|
||||||
|
<version>1.0.5</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- spring-boot-mail -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-mail</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 模板引擎, 用于邮件、代码生成等 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ibeetl</groupId>
|
||||||
|
<artifactId>beetl</artifactId>
|
||||||
|
<version>3.6.1.RELEASE</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- swagger -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.springfox</groupId>
|
||||||
|
<artifactId>springfox-boot-starter</artifactId>
|
||||||
|
<version>3.0.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- spring security -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-security</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- jjwt -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
|
<artifactId>jjwt-impl</artifactId>
|
||||||
|
<version>0.11.2</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
|
<artifactId>jjwt-jackson</artifactId>
|
||||||
|
<version>0.11.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 图形验证码 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.whvcse</groupId>
|
||||||
|
<artifactId>easy-captcha</artifactId>
|
||||||
|
<version>1.6.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--Redis-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 阿里SDK -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.aliyun</groupId>
|
||||||
|
<artifactId>aliyun-java-sdk-core</artifactId>
|
||||||
|
<version>4.4.3</version>
|
||||||
|
</dependency>
|
||||||
|
<!--阿里支付 老版本 SDK-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alipay.sdk</groupId>
|
||||||
|
<artifactId>alipay-sdk-java</artifactId>
|
||||||
|
<version>4.35.0.ALL</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.bouncycastle</groupId>
|
||||||
|
<artifactId>bcprov-jdk15on</artifactId>
|
||||||
|
<version>1.70</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- https://mvnrepository.com/artifact/commons-logging/commons-logging -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-logging</groupId>
|
||||||
|
<artifactId>commons-logging</artifactId>
|
||||||
|
<version>1.2</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba</groupId>
|
||||||
|
<artifactId>fastjson</artifactId>
|
||||||
|
<version>2.0.20</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--二维码-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.zxing</groupId>
|
||||||
|
<artifactId>core</artifactId>
|
||||||
|
<version>3.3.3</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.code.gson</groupId>
|
||||||
|
<artifactId>gson</artifactId>
|
||||||
|
<version>2.8.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.vaadin.external.google</groupId>
|
||||||
|
<artifactId>android-json</artifactId>
|
||||||
|
<version>0.0.20131108.vaadin1</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- socketio -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.corundumstudio.socketio</groupId>
|
||||||
|
<artifactId>netty-socketio</artifactId>
|
||||||
|
<version>2.0.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 微信支付 APIv3 Java SDK-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.wechatpay-apiv3</groupId>
|
||||||
|
<artifactId>wechatpay-java</artifactId>
|
||||||
|
<version>0.2.9</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.binarywang</groupId>
|
||||||
|
<artifactId>weixin-java-miniapp</artifactId>
|
||||||
|
<version>4.5.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 阿里云 OSS -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.aliyun.oss</groupId>
|
||||||
|
<artifactId>aliyun-sdk-oss</artifactId>
|
||||||
|
<version>3.17.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--诺诺开票接口-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.nuonuo</groupId>
|
||||||
|
<artifactId>open-sdk</artifactId>
|
||||||
|
<version>1.0.5.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- knife4j -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.xiaoymin</groupId>
|
||||||
|
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||||||
|
<version>3.0.3</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.belerweb</groupId>
|
||||||
|
<artifactId>pinyin4j</artifactId>
|
||||||
|
<version>2.5.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/java</directory>
|
||||||
|
<includes>
|
||||||
|
<include>**/*Mapper.xml</include>
|
||||||
|
</includes>
|
||||||
|
</resource>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
<includes>
|
||||||
|
<include>**</include>
|
||||||
|
</includes>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<version>2.5.4</version>
|
||||||
|
<configuration>
|
||||||
|
<excludes>
|
||||||
|
<exclude>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
</exclude>
|
||||||
|
</excludes>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<source>16</source>
|
||||||
|
<target>16</target>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>aliYunMaven</id>
|
||||||
|
<url>https://maven.aliyun.com/repository/public</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
|
||||||
|
</project>
|
||||||
28
src/main/java/com/gxwebsoft/WebSoftApplication.java
Normal file
28
src/main/java/com/gxwebsoft/WebSoftApplication.java
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
package com.gxwebsoft;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.config.ConfigProperties;
|
||||||
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
|
import org.springframework.scheduling.annotation.EnableAsync;
|
||||||
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启动类
|
||||||
|
* Created by WebSoft on 2018-02-22 11:29:03
|
||||||
|
*/
|
||||||
|
@EnableAsync
|
||||||
|
@EnableTransactionManagement
|
||||||
|
@MapperScan("com.gxwebsoft.**.mapper")
|
||||||
|
@EnableConfigurationProperties(ConfigProperties.class)
|
||||||
|
@SpringBootApplication
|
||||||
|
@EnableScheduling
|
||||||
|
public class WebSoftApplication {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(WebSoftApplication.class, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
142
src/main/java/com/gxwebsoft/cms/controller/AdController.java
Normal file
142
src/main/java/com/gxwebsoft/cms/controller/AdController.java
Normal file
@@ -0,0 +1,142 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.gxwebsoft.cms.entity.Ad;
|
||||||
|
import com.gxwebsoft.cms.param.AdParam;
|
||||||
|
import com.gxwebsoft.cms.service.AdService;
|
||||||
|
import com.gxwebsoft.cms.vo.SideVo;
|
||||||
|
import com.gxwebsoft.common.core.utils.JSONUtil;
|
||||||
|
import com.gxwebsoft.common.core.web.*;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 广告位管理表控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-04 21:14:15
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Api(tags = "广告")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/ad")
|
||||||
|
public class AdController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private AdService adService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询广告位管理表")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<Ad>> page(AdParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(adService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部广告位管理表")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<Ad>> list(AdParam param) {
|
||||||
|
PageParam<Ad, AdParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("create_time desc");
|
||||||
|
return success(adService.list(page.getOrderWrapper()));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(adService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询广告位管理表")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<Ad> get(@PathVariable("id") Integer id) {
|
||||||
|
return success(adService.getById(id));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(adService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:ad:save')")
|
||||||
|
@ApiOperation("添加广告位管理表")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody Ad ad) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
ad.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (adService.save(ad)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:ad:update')")
|
||||||
|
@ApiOperation("修改广告位管理表")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody Ad ad) {
|
||||||
|
if (adService.updateById(ad)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:ad:remove')")
|
||||||
|
@ApiOperation("删除广告位管理表")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (adService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:ad:save')")
|
||||||
|
@ApiOperation("批量添加广告位管理表")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<Ad> list) {
|
||||||
|
if (adService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:ad:update')")
|
||||||
|
@ApiOperation("批量修改广告位管理表")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<Ad> batchParam) {
|
||||||
|
if (batchParam.update(adService, "ad_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:ad:remove')")
|
||||||
|
@ApiOperation("批量删除广告位管理表")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (adService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("首页幻灯片")
|
||||||
|
@GetMapping("/side")
|
||||||
|
public ApiResult<?> getSide() {
|
||||||
|
final Ad ad = adService.getOne(new LambdaQueryWrapper<Ad>().eq(Ad::getPageName, "首页").eq(Ad::getAdType, "幻灯片").last("limit 1"));
|
||||||
|
System.out.println("adService = " + ad);
|
||||||
|
if (ObjectUtil.isNotEmpty(ad)) {
|
||||||
|
ad.setData(JSONUtil.parseObject(ad.getImages(), Object.class));
|
||||||
|
return success(ad);
|
||||||
|
}
|
||||||
|
return fail("幻灯片未设置");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.cms.entity.AdRecord;
|
||||||
|
import com.gxwebsoft.cms.param.AdRecordParam;
|
||||||
|
import com.gxwebsoft.cms.service.AdRecordService;
|
||||||
|
import com.gxwebsoft.common.core.web.*;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 广告图片记录表控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-04 21:14:15
|
||||||
|
*/
|
||||||
|
@Api(tags = "广告图片")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/ad-record")
|
||||||
|
public class AdRecordController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private AdRecordService adRecordService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询广告图片记录表")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<AdRecord>> page(AdRecordParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(adRecordService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部广告图片记录表")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<AdRecord>> list(AdRecordParam param) {
|
||||||
|
PageParam<AdRecord, AdRecordParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("create_time desc");
|
||||||
|
return success(adRecordService.list(page.getOrderWrapper()));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(adRecordService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询广告图片记录表")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<AdRecord> get(@PathVariable("id") Integer id) {
|
||||||
|
return success(adRecordService.getById(id));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(adRecordService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:adRecord:list')")
|
||||||
|
@ApiOperation("添加广告图片记录表")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody AdRecord adRecord) {
|
||||||
|
if (adRecordService.save(adRecord)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:adRecord:update')")
|
||||||
|
@ApiOperation("修改广告图片记录表")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody AdRecord adRecord) {
|
||||||
|
if (adRecordService.updateById(adRecord)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:adRecord:remove')")
|
||||||
|
@ApiOperation("删除广告图片记录表")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (adRecordService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:adRecord:save')")
|
||||||
|
@ApiOperation("批量添加广告图片记录表")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<AdRecord> list) {
|
||||||
|
if (adRecordService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:adRecord:update')")
|
||||||
|
@ApiOperation("批量修改广告图片记录表")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<AdRecord> batchParam) {
|
||||||
|
if (batchParam.update(adRecordService, "ad_record_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:adRecord:remove')")
|
||||||
|
@ApiOperation("批量删除广告图片记录表")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (adRecordService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,179 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.gxwebsoft.cms.entity.Article;
|
||||||
|
import com.gxwebsoft.cms.entity.ArticleCategory;
|
||||||
|
import com.gxwebsoft.cms.entity.Navigation;
|
||||||
|
import com.gxwebsoft.cms.param.ArticleCategoryParam;
|
||||||
|
import com.gxwebsoft.cms.param.ArticleParam;
|
||||||
|
import com.gxwebsoft.cms.param.NavigationParam;
|
||||||
|
import com.gxwebsoft.cms.service.ArticleCategoryService;
|
||||||
|
import com.gxwebsoft.cms.service.ArticleService;
|
||||||
|
import com.gxwebsoft.common.core.utils.CommonUtil;
|
||||||
|
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||||
|
import com.gxwebsoft.common.core.web.*;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文章分类表控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2023-10-22 15:47:09
|
||||||
|
*/
|
||||||
|
@Api(tags = "文章分类")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/article-category")
|
||||||
|
public class ArticleCategoryController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private ArticleCategoryService articleCategoryService;
|
||||||
|
@Resource
|
||||||
|
private ArticleService articleService;
|
||||||
|
@Resource
|
||||||
|
private RedisUtil redisUtil;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询文章分类表")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<ArticleCategory>> page(ArticleCategoryParam param) {
|
||||||
|
PageParam<ArticleCategory, ArticleCategoryParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("sort_number asc,create_time asc");
|
||||||
|
return success(articleCategoryService.page(page, page.getWrapper()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部文章分类表")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<ArticleCategory>> list(ArticleCategoryParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
List<ArticleCategory> categoryList = articleCategoryService.listRel(param);
|
||||||
|
// 是否读取新闻列表
|
||||||
|
if (param.getSceneType() != null && param.getSceneType().equals("showArticle")) {
|
||||||
|
categoryList.forEach(d->{
|
||||||
|
final ArticleParam articleParam = new ArticleParam();
|
||||||
|
articleParam.setCategoryId(d.getCategoryId());
|
||||||
|
articleParam.setDeleted(0);
|
||||||
|
if(param.getLimit() != null){
|
||||||
|
articleParam.setLimit(param.getLimit());
|
||||||
|
}
|
||||||
|
final PageResult<Article> articlePageResult = articleService.pageRel(articleParam);
|
||||||
|
d.setArticleList(articlePageResult.getList());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return success(categoryList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询文章分类表")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<ArticleCategory> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
ArticleCategory category = articleCategoryService.getByIdRel(id);
|
||||||
|
if(category != null){
|
||||||
|
if (!category.getParentId().equals(0)) {
|
||||||
|
final ArticleCategory parentCategory = articleCategoryService.getById(category.getParentId());
|
||||||
|
category.setParentName(parentCategory.getTitle());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return success(category);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:articleCategory:save')")
|
||||||
|
@ApiOperation("添加文章分类表")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody ArticleCategory articleCategory) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
articleCategory.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (articleCategoryService.save(articleCategory)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:articleCategory:update')")
|
||||||
|
@ApiOperation("修改文章分类表")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody ArticleCategory articleCategory) {
|
||||||
|
if (articleCategoryService.updateById(articleCategory)) {
|
||||||
|
// 同步分类状态
|
||||||
|
final List<ArticleCategory> list = articleCategoryService.list(new LambdaQueryWrapper<ArticleCategory>().eq(ArticleCategory::getParentId, articleCategory.getCategoryId()));
|
||||||
|
list.forEach(d -> {
|
||||||
|
d.setStatus(articleCategory.getStatus());
|
||||||
|
});
|
||||||
|
articleCategoryService.updateBatchById(list);
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:articleCategory:remove')")
|
||||||
|
@ApiOperation("删除文章分类表")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (articleService.count(new LambdaQueryWrapper<Article>().eq(Article::getCategoryId,id)) > 0) {
|
||||||
|
return fail("请先删除栏目下的文章");
|
||||||
|
}
|
||||||
|
if (articleCategoryService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:articleCategory:save')")
|
||||||
|
@ApiOperation("批量添加文章分类表")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<ArticleCategory> list) {
|
||||||
|
if (articleCategoryService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:articleCategory:update')")
|
||||||
|
@ApiOperation("批量修改文章分类表")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<ArticleCategory> batchParam) {
|
||||||
|
if (batchParam.update(articleCategoryService, "category_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:articleCategory:remove')")
|
||||||
|
@ApiOperation("批量删除文章分类表")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
final int count = articleService.count(new LambdaQueryWrapper<Article>().in(Article::getCategoryId, ids));
|
||||||
|
System.out.println("count = " + count);
|
||||||
|
if (articleService.count(new LambdaQueryWrapper<Article>().in(Article::getCategoryId,ids)) > 0) {
|
||||||
|
return fail("请先删除栏目下的文章");
|
||||||
|
}
|
||||||
|
if (articleCategoryService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("检查分类是否存在")
|
||||||
|
@GetMapping("/existence")
|
||||||
|
public ApiResult<?> existence(ExistenceParam<ArticleCategory> param) {
|
||||||
|
if (param.isExistence(articleCategoryService, ArticleCategory::getUserId)) {
|
||||||
|
return success(param.getValue() + "已存在");
|
||||||
|
}
|
||||||
|
return fail(param.getValue() + "不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("获取树形结构数据")
|
||||||
|
@GetMapping("/tree")
|
||||||
|
public ApiResult<List<ArticleCategory>> tree(ArticleCategoryParam param) {
|
||||||
|
param.setHide(0);
|
||||||
|
final List<ArticleCategory> categoryList = articleCategoryService.listRel(param);
|
||||||
|
return success(CommonUtil.toTreeData(categoryList, 0, ArticleCategory::getParentId, ArticleCategory::getCategoryId, ArticleCategory::setChildren));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,130 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.ArticleCommentService;
|
||||||
|
import com.gxwebsoft.cms.entity.ArticleComment;
|
||||||
|
import com.gxwebsoft.cms.param.ArticleCommentParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文章评论表控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2023-10-22 15:47:09
|
||||||
|
*/
|
||||||
|
@Api(tags = "文章评论")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/article-comment")
|
||||||
|
public class ArticleCommentController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private ArticleCommentService articleCommentService;
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:articleComment:list')")
|
||||||
|
@ApiOperation("分页查询文章评论表")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<ArticleComment>> page(ArticleCommentParam param) {
|
||||||
|
PageParam<ArticleComment, ArticleCommentParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("create_time desc");
|
||||||
|
return success(articleCommentService.page(page, page.getWrapper()));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(articleCommentService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:articleComment:list')")
|
||||||
|
@ApiOperation("查询全部文章评论表")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<ArticleComment>> list(ArticleCommentParam param) {
|
||||||
|
PageParam<ArticleComment, ArticleCommentParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("create_time desc");
|
||||||
|
return success(articleCommentService.list(page.getOrderWrapper()));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(articleCommentService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:articleComment:list')")
|
||||||
|
@ApiOperation("根据id查询文章评论表")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<ArticleComment> get(@PathVariable("id") Integer id) {
|
||||||
|
return success(articleCommentService.getById(id));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(articleCommentService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:articleComment:save')")
|
||||||
|
@ApiOperation("添加文章评论表")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody ArticleComment articleComment) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
articleComment.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (articleCommentService.save(articleComment)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:articleComment:update')")
|
||||||
|
@ApiOperation("修改文章评论表")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody ArticleComment articleComment) {
|
||||||
|
if (articleCommentService.updateById(articleComment)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:articleComment:remove')")
|
||||||
|
@ApiOperation("删除文章评论表")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (articleCommentService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:articleComment:save')")
|
||||||
|
@ApiOperation("批量添加文章评论表")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<ArticleComment> list) {
|
||||||
|
if (articleCommentService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:articleComment:update')")
|
||||||
|
@ApiOperation("批量修改文章评论表")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<ArticleComment> batchParam) {
|
||||||
|
if (batchParam.update(articleCommentService, "comment_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:articleComment:remove')")
|
||||||
|
@ApiOperation("批量删除文章评论表")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (articleCommentService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,111 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.cms.entity.ArticleContent;
|
||||||
|
import com.gxwebsoft.cms.param.ArticleContentParam;
|
||||||
|
import com.gxwebsoft.cms.service.ArticleContentService;
|
||||||
|
import com.gxwebsoft.common.core.web.*;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文章控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-13 20:28:29
|
||||||
|
*/
|
||||||
|
@Api(tags = "文章内容")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/article-content")
|
||||||
|
public class ArticleContentController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private ArticleContentService articleContentService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询文章")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<ArticleContent>> page(ArticleContentParam param) {
|
||||||
|
PageParam<ArticleContent, ArticleContentParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("create_time desc");
|
||||||
|
return success(articleContentService.page(page, page.getWrapper()));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(articleContentService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部文章")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<ArticleContent>> list(ArticleContentParam param) {
|
||||||
|
PageParam<ArticleContent, ArticleContentParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("create_time desc");
|
||||||
|
return success(articleContentService.list(page.getOrderWrapper()));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(articleContentService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询文章")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<ArticleContent> get(@PathVariable("id") Integer id) {
|
||||||
|
return success(articleContentService.getById(id));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(articleContentService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:article:save')")
|
||||||
|
@ApiOperation("添加文章")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody ArticleContent articleContent) {
|
||||||
|
if (articleContentService.save(articleContent)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改文章")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody ArticleContent articleContent) {
|
||||||
|
if (articleContentService.updateById(articleContent)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除文章")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (articleContentService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加文章")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<ArticleContent> list) {
|
||||||
|
if (articleContentService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改文章")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<ArticleContent> batchParam) {
|
||||||
|
if (batchParam.update(articleContentService, "")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除文章")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (articleContentService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,222 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.gxwebsoft.cms.entity.Article;
|
||||||
|
import com.gxwebsoft.cms.entity.ArticleCategory;
|
||||||
|
import com.gxwebsoft.cms.entity.ArticleContent;
|
||||||
|
import com.gxwebsoft.cms.param.ArticleParam;
|
||||||
|
import com.gxwebsoft.cms.service.ArticleCategoryService;
|
||||||
|
import com.gxwebsoft.cms.service.ArticleContentService;
|
||||||
|
import com.gxwebsoft.cms.service.ArticleService;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import com.gxwebsoft.shop.entity.Goods;
|
||||||
|
import com.gxwebsoft.shop.param.GoodsParam;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文章控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2023-10-22 15:47:09
|
||||||
|
*/
|
||||||
|
@Api(tags = "文章")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/article")
|
||||||
|
public class ArticleController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private ArticleService articleService;
|
||||||
|
@Resource
|
||||||
|
private ArticleCategoryService articleCategoryService;
|
||||||
|
@Resource
|
||||||
|
private ArticleContentService articleContentService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询文章")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<Article>> page(ArticleParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(articleService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部文章")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<Article>> list(ArticleParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(articleService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询文章")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<Article> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
Article article = articleService.getByIdRel(id);
|
||||||
|
// 更新阅读数量
|
||||||
|
article.setActualViews(article.getActualViews() + 1);
|
||||||
|
articleService.updateById(article);
|
||||||
|
// 附加文字内容
|
||||||
|
ArticleContent content = articleContentService.getOne(new LambdaQueryWrapper<ArticleContent>().eq(ArticleContent::getArticleId,article.getArticleId()).last("limit 1"));
|
||||||
|
if(content != null){
|
||||||
|
article.setContent(content.getContent());
|
||||||
|
}
|
||||||
|
return success(article);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("读取上一篇")
|
||||||
|
@GetMapping("/getPrevious/{id}")
|
||||||
|
public ApiResult<Article> getPrevious(@PathVariable("id") Integer id) {
|
||||||
|
LambdaQueryWrapper<Article> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.lt(Article::getArticleId,id);
|
||||||
|
wrapper.eq(Article::getStatus,0);
|
||||||
|
wrapper.eq(Article::getType,0);
|
||||||
|
wrapper.orderByDesc(Article::getArticleId);
|
||||||
|
wrapper.last("limit 1");
|
||||||
|
final Article article = articleService.getOne(wrapper);
|
||||||
|
return success(article);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("读取下一篇")
|
||||||
|
@GetMapping("/getNext/{id}")
|
||||||
|
public ApiResult<Article> getNext(@PathVariable("id") Integer id) {
|
||||||
|
LambdaQueryWrapper<Article> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.gt(Article::getArticleId,id);
|
||||||
|
wrapper.eq(Article::getStatus,0);
|
||||||
|
wrapper.eq(Article::getType,0);
|
||||||
|
wrapper.orderByAsc(Article::getArticleId);
|
||||||
|
wrapper.last("limit 1");
|
||||||
|
final Article article = articleService.getOne(wrapper);
|
||||||
|
return success(article);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:article:save')")
|
||||||
|
@ApiOperation("添加文章")
|
||||||
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody Article article) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
article.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
// 同步类型
|
||||||
|
// final ArticleCategory category = articleCategoryService.getById(article.getCategoryId());
|
||||||
|
// article.setType(category.getType());
|
||||||
|
if (articleService.save(article)) {
|
||||||
|
// 保存文章内容
|
||||||
|
final ArticleContent content = new ArticleContent();
|
||||||
|
content.setArticleId(article.getArticleId());
|
||||||
|
content.setContent(article.getContent());
|
||||||
|
articleContentService.save(content);
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:article:update')")
|
||||||
|
@ApiOperation("修改文章")
|
||||||
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody Article article) {
|
||||||
|
if (articleService.updateById(article)) {
|
||||||
|
// 更新文章内容
|
||||||
|
ArticleContent content = new ArticleContent();
|
||||||
|
content.setArticleId(article.getArticleId());
|
||||||
|
content.setContent(article.getContent());
|
||||||
|
ArticleContent one = articleContentService.getOne(new LambdaQueryWrapper<ArticleContent>().eq(ArticleContent::getArticleId, article.getArticleId()).last("limit 1"));
|
||||||
|
if(one != null){
|
||||||
|
one.setContent(article.getContent());
|
||||||
|
articleContentService.updateById(one);
|
||||||
|
}else {
|
||||||
|
articleContentService.save(content);
|
||||||
|
}
|
||||||
|
// 更新时间
|
||||||
|
article.setUpdateTime(new Date());
|
||||||
|
articleService.updateById(article);
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:article:remove')")
|
||||||
|
@ApiOperation("删除文章")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (articleService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:article:save')")
|
||||||
|
@ApiOperation("批量添加文章")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<Article> list) {
|
||||||
|
if (articleService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:article:update')")
|
||||||
|
@ApiOperation("批量修改文章")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<Article> batchParam) {
|
||||||
|
if (batchParam.update(articleService, "article_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:article:remove')")
|
||||||
|
@ApiOperation("批量删除文章")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (articleService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("统计信息")
|
||||||
|
@GetMapping("/data")
|
||||||
|
public ApiResult<Map<String, Integer>> data(ArticleParam param) {
|
||||||
|
Map<String, Integer> data = new HashMap<>();
|
||||||
|
final LambdaQueryWrapper<Article> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
if(param.getMerchantId() != null){
|
||||||
|
wrapper.eq(Article::getMerchantId,param.getMerchantId());
|
||||||
|
}
|
||||||
|
|
||||||
|
Integer totalNum = articleService.count(
|
||||||
|
wrapper.eq(Article::getDeleted,0).eq(Article::getStatus,0)
|
||||||
|
);
|
||||||
|
data.put("totalNum", totalNum);
|
||||||
|
|
||||||
|
Integer totalNum2 = articleService.count(
|
||||||
|
wrapper.eq(Article::getStatus,1)
|
||||||
|
);
|
||||||
|
data.put("totalNum2", totalNum2);
|
||||||
|
|
||||||
|
Integer totalNum3 = articleService.count(
|
||||||
|
wrapper.gt(Article::getStatus,1)
|
||||||
|
);
|
||||||
|
data.put("totalNum3", totalNum3);
|
||||||
|
|
||||||
|
return success(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.ArticleLikeService;
|
||||||
|
import com.gxwebsoft.cms.entity.ArticleLike;
|
||||||
|
import com.gxwebsoft.cms.param.ArticleLikeParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点赞文章控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2023-10-22 15:47:09
|
||||||
|
*/
|
||||||
|
@Api(tags = "文章点赞")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/article-like")
|
||||||
|
public class ArticleLikeController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private ArticleLikeService articleLikeService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询点赞文章")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<ArticleLike>> page(ArticleLikeParam param) {
|
||||||
|
PageParam<ArticleLike, ArticleLikeParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("create_time desc");
|
||||||
|
return success(articleLikeService.page(page, page.getWrapper()));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(articleLikeService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部点赞文章")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<ArticleLike>> list(ArticleLikeParam param) {
|
||||||
|
PageParam<ArticleLike, ArticleLikeParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("create_time desc");
|
||||||
|
return success(articleLikeService.list(page.getOrderWrapper()));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(articleLikeService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询点赞文章")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<ArticleLike> get(@PathVariable("id") Integer id) {
|
||||||
|
return success(articleLikeService.getById(id));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(articleLikeService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:articleLike:save')")
|
||||||
|
@ApiOperation("添加点赞文章")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody ArticleLike articleLike) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
articleLike.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (articleLikeService.save(articleLike)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:articleLike:update')")
|
||||||
|
@ApiOperation("修改点赞文章")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody ArticleLike articleLike) {
|
||||||
|
if (articleLikeService.updateById(articleLike)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:articleLike:remove')")
|
||||||
|
@ApiOperation("删除点赞文章")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (articleLikeService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:articleLike:save')")
|
||||||
|
@ApiOperation("批量添加点赞文章")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<ArticleLike> list) {
|
||||||
|
if (articleLikeService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:articleLike:update')")
|
||||||
|
@ApiOperation("批量修改点赞文章")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<ArticleLike> batchParam) {
|
||||||
|
if (batchParam.update(articleLikeService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:articleLike:remove')")
|
||||||
|
@ApiOperation("批量删除点赞文章")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (articleLikeService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,118 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.ComponentsService;
|
||||||
|
import com.gxwebsoft.cms.entity.Components;
|
||||||
|
import com.gxwebsoft.cms.param.ComponentsParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-08-25 19:00:41
|
||||||
|
*/
|
||||||
|
@Api(tags = "组件管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/components")
|
||||||
|
public class ComponentsController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private ComponentsService componentsService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询组件")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<Components>> page(ComponentsParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(componentsService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部组件")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<Components>> list(ComponentsParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(componentsService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询组件")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<Components> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(componentsService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:components:save')")
|
||||||
|
@ApiOperation("添加组件")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody Components components) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
components.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (componentsService.save(components)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:components:update')")
|
||||||
|
@ApiOperation("修改组件")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody Components components) {
|
||||||
|
if (componentsService.updateById(components)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:components:remove')")
|
||||||
|
@ApiOperation("删除组件")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (componentsService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:components:save')")
|
||||||
|
@ApiOperation("批量添加组件")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<Components> list) {
|
||||||
|
if (componentsService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:components:update')")
|
||||||
|
@ApiOperation("批量修改组件")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<Components> batchParam) {
|
||||||
|
if (batchParam.update(componentsService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:components:remove')")
|
||||||
|
@ApiOperation("批量删除组件")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (componentsService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
131
src/main/java/com/gxwebsoft/cms/controller/DesignController.java
Normal file
131
src/main/java/com/gxwebsoft/cms/controller/DesignController.java
Normal file
@@ -0,0 +1,131 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.gxwebsoft.cms.entity.Design;
|
||||||
|
import com.gxwebsoft.cms.entity.Navigation;
|
||||||
|
import com.gxwebsoft.cms.param.DesignParam;
|
||||||
|
import com.gxwebsoft.cms.service.DesignService;
|
||||||
|
import com.gxwebsoft.cms.service.NavigationService;
|
||||||
|
import com.gxwebsoft.common.core.web.*;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面管理记录表控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-04 21:20:40
|
||||||
|
*/
|
||||||
|
@Api(tags = "网站页面")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/design")
|
||||||
|
public class DesignController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private DesignService designService;
|
||||||
|
@Resource
|
||||||
|
private NavigationService navigationService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询页面管理记录表")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<Design>> page(DesignParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(designService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部页面管理记录表")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<Design>> list(DesignParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(designService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询页面管理记录表")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<Design> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(designService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:design:save')")
|
||||||
|
@ApiOperation("添加页面管理记录表")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody Design design) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
design.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
// if (designService.count(new LambdaQueryWrapper<Design>().eq(Design::getPath,design.getPath())) > 0) {
|
||||||
|
// return fail("路由地址已存在");
|
||||||
|
// }
|
||||||
|
if (designService.save(design)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:design:update')")
|
||||||
|
@ApiOperation("修改页面管理记录表")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody Design design) {
|
||||||
|
if (designService.updateById(design)) {
|
||||||
|
// 更新导航路径
|
||||||
|
// if (design.getNavigationId() > 0) {
|
||||||
|
// navigationService.update(new LambdaUpdateWrapper<Navigation>()
|
||||||
|
// .eq(Navigation::getPageId,design.getPageId())
|
||||||
|
// .set(Navigation::getPath,design.getPath())
|
||||||
|
// .set(Navigation::getComponent,design.getComponent()));
|
||||||
|
// }
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:design:remove')")
|
||||||
|
@ApiOperation("删除页面管理记录表")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (designService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:design:save')")
|
||||||
|
@ApiOperation("批量添加页面管理记录表")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<Design> list) {
|
||||||
|
if (designService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:design:update')")
|
||||||
|
@ApiOperation("批量修改页面管理记录表")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<Design> batchParam) {
|
||||||
|
if (batchParam.update(designService, "page_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:design:remove')")
|
||||||
|
@ApiOperation("批量删除页面管理记录表")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (designService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.DesignRecordService;
|
||||||
|
import com.gxwebsoft.cms.entity.DesignRecord;
|
||||||
|
import com.gxwebsoft.cms.param.DesignRecordParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面组件表控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-08-25 20:34:14
|
||||||
|
*/
|
||||||
|
@Api(tags = "页面组件表管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/design-record")
|
||||||
|
public class DesignRecordController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private DesignRecordService designRecordService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询页面组件表")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<DesignRecord>> page(DesignRecordParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(designRecordService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部页面组件表")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<DesignRecord>> list(DesignRecordParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(designRecordService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:designRecord:list')")
|
||||||
|
@ApiOperation("根据id查询页面组件表")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<DesignRecord> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(designRecordService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加页面组件表")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody DesignRecord designRecord) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
designRecord.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (designRecordService.save(designRecord)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改页面组件表")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody DesignRecord designRecord) {
|
||||||
|
if (designRecordService.updateById(designRecord)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除页面组件表")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (designRecordService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加页面组件表")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<DesignRecord> list) {
|
||||||
|
if (designRecordService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改页面组件表")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<DesignRecord> batchParam) {
|
||||||
|
if (batchParam.update(designRecordService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除页面组件表")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (designRecordService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,142 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.gxwebsoft.cms.entity.Docs;
|
||||||
|
import com.gxwebsoft.cms.entity.DocsBook;
|
||||||
|
import com.gxwebsoft.cms.entity.DocsContent;
|
||||||
|
import com.gxwebsoft.cms.param.DocsBookParam;
|
||||||
|
import com.gxwebsoft.cms.service.DocsBookService;
|
||||||
|
import com.gxwebsoft.cms.service.DocsContentService;
|
||||||
|
import com.gxwebsoft.cms.service.DocsService;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 书籍记录表控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-23 19:40:02
|
||||||
|
*/
|
||||||
|
@Api(tags = "文档(书籍)")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/docs-book")
|
||||||
|
public class DocsBookController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private DocsBookService docsBookService;
|
||||||
|
@Resource
|
||||||
|
private DocsService docsService;
|
||||||
|
@Resource
|
||||||
|
private DocsContentService contentService;
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:docsBook:list')")
|
||||||
|
@ApiOperation("分页查询书籍记录表")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<DocsBook>> page(DocsBookParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(docsBookService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:docsBook:list')")
|
||||||
|
@ApiOperation("查询全部书籍记录表")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<DocsBook>> list(DocsBookParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(docsBookService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:docsBook:list')")
|
||||||
|
@ApiOperation("根据id查询书籍记录表")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<DocsBook> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(docsBookService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:docsBook:save')")
|
||||||
|
@ApiOperation("添加书籍记录表")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody DocsBook docsBook) {
|
||||||
|
if (docsBookService.count(new LambdaQueryWrapper<DocsBook>().eq(DocsBook::getCode,docsBook.getCode())) > 0) {
|
||||||
|
return fail("该标识已存在");
|
||||||
|
}
|
||||||
|
if (docsBookService.save(docsBook)) {
|
||||||
|
// 添加默认章节
|
||||||
|
final Docs docs = new Docs();
|
||||||
|
final DocsContent content = new DocsContent();
|
||||||
|
docs.setTitle("序言");
|
||||||
|
docs.setBookId(docsBook.getBookId());
|
||||||
|
docsService.save(docs);
|
||||||
|
content.setDocsId(docs.getDocsId());
|
||||||
|
content.setContent("撰写中...");
|
||||||
|
contentService.save(content);
|
||||||
|
docs.setTitle("系统简介");
|
||||||
|
docs.setBookId(docsBook.getBookId());
|
||||||
|
docsService.save(docs);
|
||||||
|
content.setDocsId(docs.getDocsId());
|
||||||
|
content.setContent("撰写中...");
|
||||||
|
contentService.save(content);
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:docsBook:update')")
|
||||||
|
@ApiOperation("修改书籍记录表")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody DocsBook docsBook) {
|
||||||
|
if (docsBookService.updateById(docsBook)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:docsBook:remove')")
|
||||||
|
@ApiOperation("删除书籍记录表")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (docsBookService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:docsBook:save')")
|
||||||
|
@ApiOperation("批量添加书籍记录表")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<DocsBook> list) {
|
||||||
|
if (docsBookService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:docsBook:update')")
|
||||||
|
@ApiOperation("批量修改书籍记录表")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<DocsBook> batchParam) {
|
||||||
|
if (batchParam.update(docsBookService, "book_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:docsBook:remove')")
|
||||||
|
@ApiOperation("批量删除书籍记录表")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (docsBookService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,112 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.cms.entity.DocsContent;
|
||||||
|
import com.gxwebsoft.cms.param.DocsContentParam;
|
||||||
|
import com.gxwebsoft.cms.service.DocsContentService;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文档内容记录表控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-23 19:51:37
|
||||||
|
*/
|
||||||
|
@Api(tags = "文档内容")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/docs-content")
|
||||||
|
public class DocsContentController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private DocsContentService docsContentService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询文档内容记录表")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<DocsContent>> page(DocsContentParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(docsContentService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部文档内容记录表")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<DocsContent>> list(DocsContentParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(docsContentService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询文档内容记录表")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<DocsContent> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(docsContentService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:docs:save')")
|
||||||
|
@ApiOperation("添加文档内容记录表")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody DocsContent docsContent) {
|
||||||
|
if (docsContentService.save(docsContent)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:docs:update')")
|
||||||
|
@ApiOperation("修改文档内容记录表")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody DocsContent docsContent) {
|
||||||
|
if (docsContentService.updateById(docsContent)) {
|
||||||
|
return success("保存成功");
|
||||||
|
}
|
||||||
|
return fail("保存失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:docs:remove')")
|
||||||
|
@ApiOperation("删除文档内容记录表")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (docsContentService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:docs:update')")
|
||||||
|
@ApiOperation("批量添加文档内容记录表")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<DocsContent> list) {
|
||||||
|
if (docsContentService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:docs:update')")
|
||||||
|
@ApiOperation("批量修改文档内容记录表")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<DocsContent> batchParam) {
|
||||||
|
if (batchParam.update(docsContentService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:docs:remove')")
|
||||||
|
@ApiOperation("批量删除文档内容记录表")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (docsContentService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
179
src/main/java/com/gxwebsoft/cms/controller/DocsController.java
Normal file
179
src/main/java/com/gxwebsoft/cms/controller/DocsController.java
Normal file
@@ -0,0 +1,179 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.gxwebsoft.cms.entity.Docs;
|
||||||
|
import com.gxwebsoft.cms.entity.DocsBook;
|
||||||
|
import com.gxwebsoft.cms.entity.DocsContent;
|
||||||
|
import com.gxwebsoft.cms.param.DocsBookParam;
|
||||||
|
import com.gxwebsoft.cms.param.DocsContentParam;
|
||||||
|
import com.gxwebsoft.cms.param.DocsParam;
|
||||||
|
import com.gxwebsoft.cms.service.DocsBookService;
|
||||||
|
import com.gxwebsoft.cms.service.DocsContentService;
|
||||||
|
import com.gxwebsoft.cms.service.DocsService;
|
||||||
|
import com.gxwebsoft.common.core.utils.CommonUtil;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文档管理记录表控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2023-10-22 15:47:09
|
||||||
|
*/
|
||||||
|
@Api(tags = "文档")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/docs")
|
||||||
|
public class DocsController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private DocsService docsService;
|
||||||
|
@Resource
|
||||||
|
private DocsContentService contentService;
|
||||||
|
@Resource
|
||||||
|
private DocsBookService bookService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询文档管理记录表")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<Docs>> page(DocsParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(docsService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部文档管理记录表")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<Docs>> list(DocsParam param) {
|
||||||
|
// 通过书籍标识查询所有的目录章节
|
||||||
|
if(param.getCode() != null){
|
||||||
|
final DocsBookParam bookParam = new DocsBookParam();
|
||||||
|
bookParam.setCode(param.getCode());
|
||||||
|
final List<DocsBook> books = bookService.listRel(bookParam);
|
||||||
|
final DocsBook book = CommonUtil.listGetOne(books);
|
||||||
|
param.setBookId(book.getBookId());
|
||||||
|
return success(docsService.listRel(param));
|
||||||
|
}
|
||||||
|
// 使用关联查询
|
||||||
|
return success(docsService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询文档管理记录表")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<Docs> get(@PathVariable("id") Integer id) {
|
||||||
|
final Docs docs = docsService.getByIdRel(id);
|
||||||
|
final DocsContentParam param = new DocsContentParam();
|
||||||
|
param.setDocsId(id);
|
||||||
|
final List<DocsContent> list = contentService.listRel(param);
|
||||||
|
DocsContent content = CommonUtil.listGetOne(list);
|
||||||
|
docs.setContent(content.getContent());
|
||||||
|
docs.setContentId(content.getId());
|
||||||
|
// 更新阅读数量
|
||||||
|
docs.setActualViews(docs.getActualViews() + 1);
|
||||||
|
docsService.updateById(docs);
|
||||||
|
return success(docs);
|
||||||
|
}
|
||||||
|
@ApiOperation("读取上一篇")
|
||||||
|
@GetMapping("/getPrevious/{id}")
|
||||||
|
public ApiResult<Docs> getPrevious(@PathVariable("id") Integer id) {
|
||||||
|
LambdaQueryWrapper<Docs> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.lt(Docs::getDocsId,id);
|
||||||
|
wrapper.eq(Docs::getStatus,0);
|
||||||
|
wrapper.orderByDesc(Docs::getDocsId);
|
||||||
|
wrapper.last("limit 1");
|
||||||
|
final Docs article = docsService.getOne(wrapper);
|
||||||
|
return success(article);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("读取下一篇")
|
||||||
|
@GetMapping("/getNext/{id}")
|
||||||
|
public ApiResult<Docs> getNext(@PathVariable("id") Integer id) {
|
||||||
|
LambdaQueryWrapper<Docs> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.gt(Docs::getDocsId,id);
|
||||||
|
wrapper.eq(Docs::getStatus,0);
|
||||||
|
wrapper.orderByAsc(Docs::getDocsId);
|
||||||
|
wrapper.last("limit 1");
|
||||||
|
final Docs article = docsService.getOne(wrapper);
|
||||||
|
return success(article);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:docs:save')")
|
||||||
|
@ApiOperation("添加文档管理记录表")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody Docs docs) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
docs.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (docsService.save(docs)) {
|
||||||
|
final DocsContent content = new DocsContent();
|
||||||
|
content.setDocsId(docs.getDocsId());
|
||||||
|
contentService.save(content);
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:docs:update')")
|
||||||
|
@ApiOperation("修改文档管理记录表")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody Docs docs) {
|
||||||
|
if (docsService.updateById(docs)) {
|
||||||
|
final DocsContent content = contentService.getOne(new LambdaQueryWrapper<DocsContent>().eq(DocsContent::getDocsId, docs.getDocsId()).last("limit 1"));
|
||||||
|
if(docs.getContent() != null){
|
||||||
|
content.setContent(docs.getContent());
|
||||||
|
}
|
||||||
|
contentService.saveOrUpdate(content);
|
||||||
|
return success("保存成功");
|
||||||
|
}
|
||||||
|
return fail("保存失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:docs:remove')")
|
||||||
|
@ApiOperation("删除文档管理记录表")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (docsService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:docs:update')")
|
||||||
|
@ApiOperation("批量添加文档管理记录表")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<Docs> list) {
|
||||||
|
if (docsService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:docs:update')")
|
||||||
|
@ApiOperation("批量修改文档管理记录表")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<Docs> batchParam) {
|
||||||
|
if (batchParam.update(docsService, "docs_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:docs:remove')")
|
||||||
|
@ApiOperation("批量删除文档管理记录表")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (docsService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
198
src/main/java/com/gxwebsoft/cms/controller/DomainController.java
Normal file
198
src/main/java/com/gxwebsoft/cms/controller/DomainController.java
Normal file
@@ -0,0 +1,198 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.gxwebsoft.cms.entity.Domain;
|
||||||
|
import com.gxwebsoft.cms.entity.Website;
|
||||||
|
import com.gxwebsoft.cms.mapper.DomainMapper;
|
||||||
|
import com.gxwebsoft.cms.param.DomainParam;
|
||||||
|
import com.gxwebsoft.cms.service.DomainService;
|
||||||
|
import com.gxwebsoft.cms.service.WebsiteService;
|
||||||
|
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||||
|
import com.gxwebsoft.common.core.web.*;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import static com.gxwebsoft.common.core.utils.DomainUtils.DNSLookup;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站域名记录表控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-26 21:27:29
|
||||||
|
*/
|
||||||
|
@Api(tags = "网站域名")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/domain")
|
||||||
|
public class DomainController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private DomainService domainService;
|
||||||
|
@Resource
|
||||||
|
private DomainMapper domainMapper;
|
||||||
|
@Resource
|
||||||
|
private RedisUtil redisUtil;
|
||||||
|
@Resource
|
||||||
|
private WebsiteService websiteService;
|
||||||
|
|
||||||
|
@ApiOperation("根据域名查询授权")
|
||||||
|
@GetMapping("/getByDomain")
|
||||||
|
public ApiResult<Domain> get(DomainParam param) {
|
||||||
|
System.out.println("param = " + param);
|
||||||
|
final Domain one = domainService.getOne(new LambdaQueryWrapper<Domain>().eq(Domain::getDomain, param.getDomain()).eq(Domain::getDeleted, 0).last("limit 1"));
|
||||||
|
if (ObjectUtil.isEmpty(one)) {
|
||||||
|
return fail("域名未授权.",null);
|
||||||
|
}
|
||||||
|
if (one.getStatus().equals(0)) {
|
||||||
|
return fail("域名审核中.",null);
|
||||||
|
}
|
||||||
|
return success(one);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("分页查询网站域名记录表")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<Domain>> page(DomainParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(domainService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部网站域名记录表")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<Domain>> list(DomainParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(domainService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询网站域名记录表")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<Domain> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(domainService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:domain:save')")
|
||||||
|
@ApiOperation("添加网站域名记录表")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody Domain domain) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
domain.setUserId(loginUser.getUserId());
|
||||||
|
domain.setTenantId(loginUser.getTenantId());
|
||||||
|
domain.setHostValue(UUID.randomUUID() + ".wsdns.cn");
|
||||||
|
}
|
||||||
|
// 检查缓存是否已存在
|
||||||
|
String key = "Domain:" + domain.getDomain();
|
||||||
|
final String string = redisUtil.get(key);
|
||||||
|
if(string != null){
|
||||||
|
return fail("您绑定的域名已存在");
|
||||||
|
}
|
||||||
|
// 是否有重复
|
||||||
|
if(domainService.count(new LambdaQueryWrapper<Domain>().eq(Domain::getDomain, domain.getDomain())) > 0){
|
||||||
|
return fail("您绑定的域名已存在");
|
||||||
|
}
|
||||||
|
// 是否超过最大绑定数量
|
||||||
|
if(domainService.count() > 20){
|
||||||
|
return fail("超过最大绑定限制");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (domainService.save(domain)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:domain:update')")
|
||||||
|
@ApiOperation("修改网站域名记录表")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody Domain domain) {
|
||||||
|
if (domainService.updateById(domain)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:domain:remove')")
|
||||||
|
@ApiOperation("删除网站域名记录表")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
final Domain domain = domainService.getById(id);
|
||||||
|
if (domainService.removeById(id)) {
|
||||||
|
// 删除缓存
|
||||||
|
String key = "Domain:" + domain.getDomain();
|
||||||
|
redisUtil.delete(key);
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:domain:update')")
|
||||||
|
@ApiOperation("批量添加网站域名记录表")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<Domain> list) {
|
||||||
|
if (domainService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:domain:update')")
|
||||||
|
@ApiOperation("批量修改网站域名记录表")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<Domain> batchParam) {
|
||||||
|
if (batchParam.update(domainService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:domain:remove')")
|
||||||
|
@ApiOperation("批量删除网站域名记录表")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (domainService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("检查域名是否存在")
|
||||||
|
@GetMapping("/existence")
|
||||||
|
public ApiResult<?> existence(ExistenceParam<Domain> param) {
|
||||||
|
if (param.isExistence(domainService, Domain::getDomain)) {
|
||||||
|
return success(param.getValue() + "已存在");
|
||||||
|
}
|
||||||
|
return fail(param.getValue() + "不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("验证DNS解析信息是否填写正确")
|
||||||
|
@GetMapping("/resolvable/{id}")
|
||||||
|
public ApiResult<?> resolvable(@PathVariable("id") Integer id){
|
||||||
|
Domain domain = domainService.getByIdRel(id);
|
||||||
|
if(DNSLookup(domain)){
|
||||||
|
// 改变状态
|
||||||
|
domain.setStatus(1);
|
||||||
|
domainService.updateById(domain);
|
||||||
|
// 重写缓存
|
||||||
|
String key = "Domain:" + domain.getDomain();
|
||||||
|
redisUtil.set(key,domain.getTenantId());
|
||||||
|
return success("验证通过");
|
||||||
|
};
|
||||||
|
return fail("未检测到解析值");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询网站域名记录表")
|
||||||
|
@GetMapping("/getByDomain/{domain}")
|
||||||
|
public ApiResult<Domain> getByDomain(@PathVariable("domain") String domain) {
|
||||||
|
final Domain one = domainMapper.getDomain(domain);
|
||||||
|
return success(one);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
142
src/main/java/com/gxwebsoft/cms/controller/FormController.java
Normal file
142
src/main/java/com/gxwebsoft/cms/controller/FormController.java
Normal file
@@ -0,0 +1,142 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.gxwebsoft.cms.entity.Form;
|
||||||
|
import com.gxwebsoft.cms.param.FormParam;
|
||||||
|
import com.gxwebsoft.cms.service.FormService;
|
||||||
|
import com.gxwebsoft.common.core.security.JwtUtil;
|
||||||
|
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||||
|
import com.gxwebsoft.common.core.utils.RequestUtil;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import com.gxwebsoft.shop.service.MerchantService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单设计表控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-14 08:59:33
|
||||||
|
*/
|
||||||
|
@Api(tags = "表单设计")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/form")
|
||||||
|
public class FormController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private FormService formService;
|
||||||
|
@Resource
|
||||||
|
private MerchantService merchantService;
|
||||||
|
@Resource
|
||||||
|
private RedisUtil redisUtil;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询表单设计表")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<Form>> page(FormParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(formService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部表单设计表")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<Form>> list(FormParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(formService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询表单设计表")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<Form> get(@PathVariable("id") Integer id,HttpServletRequest request) {
|
||||||
|
String key = "FormId:" + id;
|
||||||
|
final String formInfo = redisUtil.get(key);
|
||||||
|
// 从缓存读取信息
|
||||||
|
if(StrUtil.isNotBlank(formInfo)){
|
||||||
|
return success(JSONObject.parseObject(formInfo, Form.class));
|
||||||
|
}
|
||||||
|
// 使用关联查询shop_merchant
|
||||||
|
final Form form = formService.getByIdRel(id);
|
||||||
|
// 获取商户信息
|
||||||
|
form.setMerchant(merchantService.getById(form.getMerchantId()));
|
||||||
|
return success(form);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:form:save')")
|
||||||
|
@ApiOperation("添加表单设计表")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody Form form) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
form.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (formService.save(form)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:form:update')")
|
||||||
|
@ApiOperation("修改表单设计表")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody Form form) {
|
||||||
|
if (formService.updateById(form)) {
|
||||||
|
if (form.getClearCache() != null) {
|
||||||
|
String key = "FormId:" + form.getFormId();
|
||||||
|
redisUtil.set(key,form);
|
||||||
|
}
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:form:remove')")
|
||||||
|
@ApiOperation("删除表单设计表")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (formService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:form:save')")
|
||||||
|
@ApiOperation("批量添加表单设计表")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<Form> list) {
|
||||||
|
if (formService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:form:update')")
|
||||||
|
@ApiOperation("批量修改表单设计表")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<Form> batchParam) {
|
||||||
|
if (batchParam.update(formService, "form_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:form:remove')")
|
||||||
|
@ApiOperation("批量删除表单设计表")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (formService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,123 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.gxwebsoft.cms.entity.Form;
|
||||||
|
import com.gxwebsoft.cms.entity.FormRecord;
|
||||||
|
import com.gxwebsoft.cms.param.FormRecordParam;
|
||||||
|
import com.gxwebsoft.cms.service.FormRecordService;
|
||||||
|
import com.gxwebsoft.cms.service.FormService;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单数据记录表控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-14 08:59:33
|
||||||
|
*/
|
||||||
|
@Api(tags = "表单数据")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/form-record")
|
||||||
|
public class FormRecordController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private FormRecordService formRecordService;
|
||||||
|
@Resource
|
||||||
|
private FormService formService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询表单数据记录表")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<FormRecord>> page(FormRecordParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(formRecordService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部表单数据记录表")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<FormRecord>> list(FormRecordParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(formRecordService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询表单数据记录表")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<FormRecord> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(formRecordService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:form:save')")
|
||||||
|
@ApiOperation("添加表单数据记录表")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody FormRecord formRecord) {
|
||||||
|
final Form form = formService.getById(formRecord.getFormId());
|
||||||
|
if (form.getSubmitNumber().equals(1)) {
|
||||||
|
if (formRecordService.count(new LambdaQueryWrapper<FormRecord>().eq(FormRecord::getStatus,0).eq(FormRecord::getPhone,formRecord.getPhone())) > 0) {
|
||||||
|
return fail("请勿重复提交");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (formRecordService.save(formRecord)) {
|
||||||
|
return success("提交成功");
|
||||||
|
}
|
||||||
|
return fail("提交失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:form:update')")
|
||||||
|
@ApiOperation("修改表单数据记录表")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody FormRecord formRecord) {
|
||||||
|
if (formRecordService.updateById(formRecord)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:form:remove')")
|
||||||
|
@ApiOperation("删除表单数据记录表")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (formRecordService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:form:save')")
|
||||||
|
@ApiOperation("批量添加表单数据记录表")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<FormRecord> list) {
|
||||||
|
if (formRecordService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:form:update')")
|
||||||
|
@ApiOperation("批量修改表单数据记录表")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<FormRecord> batchParam) {
|
||||||
|
if (batchParam.update(formRecordService, "form_record_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:form:remove')")
|
||||||
|
@ApiOperation("批量删除表单数据记录表")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (formRecordService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
115
src/main/java/com/gxwebsoft/cms/controller/MpAdController.java
Normal file
115
src/main/java/com/gxwebsoft/cms/controller/MpAdController.java
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.MpAdService;
|
||||||
|
import com.gxwebsoft.cms.entity.MpAd;
|
||||||
|
import com.gxwebsoft.cms.param.MpAdParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序广告位控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-07-23 01:53:01
|
||||||
|
*/
|
||||||
|
@Api(tags = "小程序广告")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/mp-ad")
|
||||||
|
public class MpAdController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private MpAdService mpAdService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询小程序广告位")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<MpAd>> page(MpAdParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(mpAdService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部小程序广告位")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<MpAd>> list(MpAdParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(mpAdService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:mpAd:list')")
|
||||||
|
@ApiOperation("根据id查询小程序广告位")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<MpAd> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(mpAdService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加小程序广告位")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody MpAd mpAd) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
mpAd.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (mpAdService.save(mpAd)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改小程序广告位")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody MpAd mpAd) {
|
||||||
|
if (mpAdService.updateById(mpAd)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除小程序广告位")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (mpAdService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加小程序广告位")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<MpAd> list) {
|
||||||
|
if (mpAdService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改小程序广告位")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<MpAd> batchParam) {
|
||||||
|
if (batchParam.update(mpAdService, "ad_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除小程序广告位")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (mpAdService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
319
src/main/java/com/gxwebsoft/cms/controller/MpController.java
Normal file
319
src/main/java/com/gxwebsoft/cms/controller/MpController.java
Normal file
@@ -0,0 +1,319 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateField;
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.gxwebsoft.cms.entity.*;
|
||||||
|
import com.gxwebsoft.cms.param.MpParam;
|
||||||
|
import com.gxwebsoft.cms.service.*;
|
||||||
|
import com.gxwebsoft.common.core.utils.JSONUtil;
|
||||||
|
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.system.entity.KVEntity;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import com.gxwebsoft.shop.entity.Goods;
|
||||||
|
import com.gxwebsoft.shop.param.GoodsParam;
|
||||||
|
import com.gxwebsoft.shop.service.GoodsService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-07-21 23:03:05
|
||||||
|
*/
|
||||||
|
@Api(tags = "小程序")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/mp")
|
||||||
|
public class MpController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private MpService mpService;
|
||||||
|
@Resource
|
||||||
|
private MpPagesService mpPagesService;
|
||||||
|
@Resource
|
||||||
|
private AdService adService;
|
||||||
|
@Resource
|
||||||
|
private MpMenuService mpMenuService;
|
||||||
|
@Resource
|
||||||
|
private MpFieldService mpFieldService;
|
||||||
|
@Resource
|
||||||
|
private GoodsService goodsService;
|
||||||
|
@Resource
|
||||||
|
private RedisUtil redisUtil;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询小程序")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<Mp>> page(MpParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(mpService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部小程序")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<Mp>> list(MpParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(mpService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:mp:list')")
|
||||||
|
@ApiOperation("根据id查询小程序")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<Mp> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(mpService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:mp:save')")
|
||||||
|
@ApiOperation("添加小程序")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody Mp mp) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
mp.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (mpService.save(mp)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:mp:update')")
|
||||||
|
@ApiOperation("修改小程序")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody Mp mp) {
|
||||||
|
// 只允许一个主账号
|
||||||
|
if (mp.getType().equals(1)) {
|
||||||
|
mpService.update(new LambdaUpdateWrapper<Mp>().eq(Mp::getType, 1).set(Mp::getType, 0));
|
||||||
|
}
|
||||||
|
if (mpService.updateById(mp)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:mp:remove')")
|
||||||
|
@ApiOperation("删除小程序")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (mpService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:mp:save')")
|
||||||
|
@ApiOperation("批量添加小程序")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<Mp> list) {
|
||||||
|
if (mpService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:mp:update')")
|
||||||
|
@ApiOperation("批量修改小程序")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<Mp> batchParam) {
|
||||||
|
if (batchParam.update(mpService, "mp_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:mp:remove')")
|
||||||
|
@ApiOperation("批量删除小程序")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (mpService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation("小程序基本信息")
|
||||||
|
@GetMapping("/getMpInfo")
|
||||||
|
public ApiResult<?> getMpInfo() {
|
||||||
|
final Integer tenantId = getTenantId();
|
||||||
|
String key = "MpInfo:" + tenantId;
|
||||||
|
System.out.println("key = " + key);
|
||||||
|
final String mpInfo = redisUtil.get(key);
|
||||||
|
|
||||||
|
if (tenantId.equals(0)) {
|
||||||
|
return fail("租户ID不存在", null);
|
||||||
|
}
|
||||||
|
System.out.println("mpInfo = " + mpInfo);
|
||||||
|
// 从缓存读取信息
|
||||||
|
if (StrUtil.isNotBlank(mpInfo)) {
|
||||||
|
final Object object = JSONUtil.parseObject(mpInfo, Object.class);
|
||||||
|
System.out.println("object = " + object);
|
||||||
|
return success(object);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取小程序
|
||||||
|
if (mpService.count(new LambdaUpdateWrapper<Mp>().eq(Mp::getDeleted, 0)) == 0) {
|
||||||
|
// 创建小程序
|
||||||
|
createMp();
|
||||||
|
}
|
||||||
|
|
||||||
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
|
|
||||||
|
// 获取小程序
|
||||||
|
final Mp mp = mpService.getOne(new LambdaQueryWrapper<Mp>().eq(Mp::getTenantId, tenantId).last("limit 1"));
|
||||||
|
mp.setAppSecret(null);
|
||||||
|
map.put("mp", mp);
|
||||||
|
|
||||||
|
// 原生导航条
|
||||||
|
final List<MpPages> tabBar = mpPagesService.list(new LambdaQueryWrapper<MpPages>().eq(MpPages::getSubpackage, "MainPackage").last("limit 5"));
|
||||||
|
map.put("tabBar", tabBar);
|
||||||
|
|
||||||
|
// 配置信息
|
||||||
|
HashMap<String, Object> config = new HashMap<>();
|
||||||
|
config.put("LICENSE_CODE", "");
|
||||||
|
config.put("MAP_KEY", "");
|
||||||
|
final List<MpField> fields = mpFieldService.list();
|
||||||
|
fields.forEach(d -> {
|
||||||
|
config.put(d.getName(), d.getValue());
|
||||||
|
});
|
||||||
|
map.put("config", config);
|
||||||
|
|
||||||
|
// 服务器时间
|
||||||
|
HashMap<String, Object> serverTime = new HashMap<>();
|
||||||
|
// 今天日期
|
||||||
|
DateTime date = DateUtil.date();
|
||||||
|
String today = DateUtil.today();
|
||||||
|
// 明天日期
|
||||||
|
final DateTime dateTime = DateUtil.tomorrow();
|
||||||
|
String tomorrow = DateUtil.format(dateTime, "yyyy-MM-dd");
|
||||||
|
// 后天日期
|
||||||
|
final DateTime dateTime2 = DateUtil.offsetDay(date, 2);
|
||||||
|
final String afterDay = DateUtil.format(dateTime2, "yyyy-MM-dd");
|
||||||
|
// 今天星期几
|
||||||
|
final int week = DateUtil.thisDayOfWeek();
|
||||||
|
final DateTime nextWeek = DateUtil.nextWeek();
|
||||||
|
serverTime.put("now", DateUtil.now()); // 2024-07-18 22:06:36
|
||||||
|
serverTime.put("today", today); // 2024-07-18
|
||||||
|
serverTime.put("tomorrow", tomorrow); // 2024-07-19
|
||||||
|
serverTime.put("afterDay", afterDay); // 2024-07-20
|
||||||
|
serverTime.put("nextWeek", nextWeek); // 2024-07-25 22:06:36
|
||||||
|
serverTime.put("week", week); // 5
|
||||||
|
map.put("serverTime", serverTime);
|
||||||
|
redisUtil.set(key, map, 1L, TimeUnit.DAYS);
|
||||||
|
return success(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createMp() {
|
||||||
|
System.out.println("创建小程序 = ");
|
||||||
|
final User loginUser = getLoginUser();
|
||||||
|
final Integer tenantId = getTenantId();
|
||||||
|
// 创建网站记录
|
||||||
|
final Mp mp = new Mp();
|
||||||
|
mp.setTenantId(tenantId);
|
||||||
|
mp.setAppId("小程序ID");
|
||||||
|
mp.setMpName("小程序名称");
|
||||||
|
mp.setMainPath("/pages/index");
|
||||||
|
if (loginUser != null) {
|
||||||
|
mp.setUserId(getLoginUserId());
|
||||||
|
}
|
||||||
|
mp.setExpirationTime(DateUtil.offset(DateUtil.date(), DateField.YEAR, 1));
|
||||||
|
mpService.save(mp);
|
||||||
|
|
||||||
|
// 创建底部导航栏
|
||||||
|
final MpPages mpPages = new MpPages();
|
||||||
|
mpPages.setHome(1);
|
||||||
|
mpPages.setTitle("首页");
|
||||||
|
mpPages.setPath("/pages/index");
|
||||||
|
mpPages.setSubpackage("MainPackage");
|
||||||
|
mpPages.setIcon("HomeOutlined");
|
||||||
|
mpPages.setSortNumber(0);
|
||||||
|
mpPages.setTenantId(tenantId);
|
||||||
|
mpPagesService.save(mpPages);
|
||||||
|
mpPages.setHome(0);
|
||||||
|
mpPages.setTitle("分类");
|
||||||
|
mpPages.setPath("/pages/category");
|
||||||
|
mpPages.setSubpackage("MainPackage");
|
||||||
|
mpPages.setIcon("AppstoreOutlined");
|
||||||
|
mpPages.setSortNumber(0);
|
||||||
|
mpPagesService.save(mpPages);
|
||||||
|
mpPages.setTitle("购物车");
|
||||||
|
mpPages.setPath("/pages/category");
|
||||||
|
mpPages.setSubpackage("MainPackage");
|
||||||
|
mpPages.setIcon("ShoppingCartOutlined");
|
||||||
|
mpPages.setSortNumber(0);
|
||||||
|
mpPagesService.save(mpPages);
|
||||||
|
mpPages.setTitle("我的");
|
||||||
|
mpPages.setPath("/pages/user");
|
||||||
|
mpPages.setSubpackage("MainPackage");
|
||||||
|
mpPages.setIcon("UserOutlined");
|
||||||
|
mpPages.setSortNumber(0);
|
||||||
|
mpPagesService.save(mpPages);
|
||||||
|
|
||||||
|
// 创建导航图标
|
||||||
|
final MpMenu mpMenu = new MpMenu();
|
||||||
|
mpMenu.setTenantId(tenantId);
|
||||||
|
mpMenu.setTitle("分类1");
|
||||||
|
mpMenu.setIcon("PictureOutlined");
|
||||||
|
mpMenu.setPath("/package/order");
|
||||||
|
mpMenu.setTarget("uni.navigateTo");
|
||||||
|
mpMenuService.save(mpMenu);
|
||||||
|
mpMenu.setTitle("分类2");
|
||||||
|
mpMenu.setIcon("PictureOutlined");
|
||||||
|
mpMenu.setPath("/package/order");
|
||||||
|
mpMenuService.save(mpMenu);
|
||||||
|
mpMenu.setTitle("分类3");
|
||||||
|
mpMenu.setIcon("PictureOutlined");
|
||||||
|
mpMenu.setPath("/package/order");
|
||||||
|
mpMenuService.save(mpMenu);
|
||||||
|
mpMenu.setTitle("分类4");
|
||||||
|
mpMenu.setIcon("PictureOutlined");
|
||||||
|
mpMenu.setPath("/package/order");
|
||||||
|
mpMenuService.save(mpMenu);
|
||||||
|
|
||||||
|
// 小程序配置信息
|
||||||
|
MpField field = new MpField();
|
||||||
|
field.setName("mpLogo");
|
||||||
|
mpFieldService.save(field);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("首页数据")
|
||||||
|
@GetMapping("/index")
|
||||||
|
public ApiResult<?> index(GoodsParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
final HashMap<String, Object> layout = new HashMap<>();
|
||||||
|
// 瀑布流商品数据 (type:0 商城商品,1 外卖商品)
|
||||||
|
// final List<Goods> goods = goodsService.list(new LambdaQueryWrapper<Goods>().ne(Goods::getType, 0).last("limit 10"));
|
||||||
|
// final List<Goods> foods = goodsService.list(new LambdaQueryWrapper<Goods>().eq(Goods::getType, 1).last("limit 10"));
|
||||||
|
|
||||||
|
layout.put("goods",goodsService.getGoodsSpecType0());
|
||||||
|
layout.put("foods", goodsService.getGoodsSpecType1());
|
||||||
|
|
||||||
|
return success(layout);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:mp:remove')")
|
||||||
|
@ApiOperation("清除缓存")
|
||||||
|
@DeleteMapping("/clearMpInfo/{key}")
|
||||||
|
public ApiResult<?> clearSiteInfo(@PathVariable("key") String key) {
|
||||||
|
redisUtil.delete("MpInfo:" + getTenantId());
|
||||||
|
return success("清除成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,110 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.MpFieldService;
|
||||||
|
import com.gxwebsoft.cms.entity.MpField;
|
||||||
|
import com.gxwebsoft.cms.param.MpFieldParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序配置控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-07-22 12:54:13
|
||||||
|
*/
|
||||||
|
@Api(tags = "小程序参数")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/mp-field")
|
||||||
|
public class MpFieldController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private MpFieldService mpFieldService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询小程序配置")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<MpField>> page(MpFieldParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(mpFieldService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部小程序配置")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<MpField>> list(MpFieldParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(mpFieldService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:mpField:list')")
|
||||||
|
@ApiOperation("根据id查询小程序配置")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<MpField> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(mpFieldService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加小程序配置")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody MpField mpField) {
|
||||||
|
if (mpFieldService.save(mpField)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改小程序配置")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody MpField mpField) {
|
||||||
|
if (mpFieldService.updateById(mpField)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除小程序配置")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (mpFieldService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加小程序配置")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<MpField> list) {
|
||||||
|
if (mpFieldService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改小程序配置")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<MpField> batchParam) {
|
||||||
|
if (batchParam.update(mpFieldService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除小程序配置")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (mpFieldService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
132
src/main/java/com/gxwebsoft/cms/controller/MpMenuController.java
Normal file
132
src/main/java/com/gxwebsoft/cms/controller/MpMenuController.java
Normal file
@@ -0,0 +1,132 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.MpMenuService;
|
||||||
|
import com.gxwebsoft.cms.entity.MpMenu;
|
||||||
|
import com.gxwebsoft.cms.param.MpMenuParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序端菜单控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-05-02 12:22:25
|
||||||
|
*/
|
||||||
|
@Api(tags = "小程序导航图标")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/mp-menu")
|
||||||
|
public class MpMenuController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private MpMenuService mpMenuService;
|
||||||
|
@Resource
|
||||||
|
private RedisUtil redisUtil;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询小程序端菜单")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<MpMenu>> page(MpMenuParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(mpMenuService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部小程序端菜单")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<MpMenu>> list(MpMenuParam param) {
|
||||||
|
return success(mpMenuService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询小程序端菜单")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<MpMenu> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(mpMenuService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:mpMenu:save')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("添加小程序端菜单")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody MpMenu mpMenu) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
// User loginUser = getLoginUser();
|
||||||
|
// if (loginUser != null) {
|
||||||
|
// mpMenu.setUserId(loginUser.getUserId());
|
||||||
|
// }
|
||||||
|
if (mpMenuService.save(mpMenu)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:mpMenu:update')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("修改小程序端菜单")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody MpMenu mpMenu) {
|
||||||
|
if (mpMenuService.updateById(mpMenu)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:mpMenu:remove')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("删除小程序端菜单")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (mpMenuService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:mpMenu:save')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("批量添加小程序端菜单")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<MpMenu> list) {
|
||||||
|
if (mpMenuService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:mpMenu:update')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("批量修改小程序端菜单")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<MpMenu> batchParam) {
|
||||||
|
if (batchParam.update(mpMenuService, "menu_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:mpMenu:remove')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("批量删除小程序端菜单")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (mpMenuService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,203 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import cn.hutool.http.HttpUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.gxwebsoft.cms.service.MpMenuService;
|
||||||
|
import com.gxwebsoft.cms.service.NavigationService;
|
||||||
|
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.MpOfficialMenuService;
|
||||||
|
import com.gxwebsoft.cms.entity.MpOfficialMenu;
|
||||||
|
import com.gxwebsoft.cms.param.MpOfficialMenuParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.apache.http.HttpEntity;
|
||||||
|
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||||
|
import org.apache.http.client.methods.HttpPost;
|
||||||
|
import org.apache.http.entity.StringEntity;
|
||||||
|
import org.apache.http.impl.client.CloseableHttpClient;
|
||||||
|
import org.apache.http.impl.client.HttpClients;
|
||||||
|
import org.apache.http.util.EntityUtils;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import static com.gxwebsoft.common.core.constants.PlatformConstants.MP_OFFICIAL;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信公众号菜单控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-15 13:12:38
|
||||||
|
*/
|
||||||
|
@Api(tags = "微信公众号")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/mp-official-menu")
|
||||||
|
public class MpOfficialMenuController extends BaseController {
|
||||||
|
// 创建公众号菜单
|
||||||
|
private static final String MENU_CREATE_URL = "https://api.weixin.qq.com/cgi-bin/menu/create?access_token=";
|
||||||
|
// 公众号AppID
|
||||||
|
private static final String appid = "wxa67c676fc445590e";
|
||||||
|
// 秘钥
|
||||||
|
private static final String secret = "a450297b5ca8e081080148799d4e6b25";
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private RedisUtil redisUtil;
|
||||||
|
@Resource
|
||||||
|
private MpOfficialMenuService mpOfficialMenuService;
|
||||||
|
@Resource
|
||||||
|
private MpMenuService mpMenuService;
|
||||||
|
@Resource
|
||||||
|
private NavigationService navigationService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询微信公众号菜单")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<MpOfficialMenu>> page(MpOfficialMenuParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(mpOfficialMenuService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部微信公众号菜单")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<MpOfficialMenu>> list(MpOfficialMenuParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(mpOfficialMenuService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:mpOfficialMenu:list')")
|
||||||
|
@ApiOperation("根据id查询微信公众号菜单")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<MpOfficialMenu> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(mpOfficialMenuService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加微信公众号菜单")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody MpOfficialMenu mpOfficialMenu) {
|
||||||
|
if (mpOfficialMenuService.save(mpOfficialMenu)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改微信公众号菜单")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody MpOfficialMenu mpOfficialMenu) {
|
||||||
|
if (mpOfficialMenuService.updateById(mpOfficialMenu)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除微信公众号菜单")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (mpOfficialMenuService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加微信公众号菜单")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<MpOfficialMenu> list) {
|
||||||
|
if (mpOfficialMenuService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改微信公众号菜单")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<MpOfficialMenu> batchParam) {
|
||||||
|
if (batchParam.update(mpOfficialMenuService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除微信公众号菜单")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (mpOfficialMenuService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 调用接口凭证
|
||||||
|
private String getAccessToken() {
|
||||||
|
String key = MP_OFFICIAL.concat(":access_token:").concat(getTenantId().toString());
|
||||||
|
// 从缓存获取access_token
|
||||||
|
String value = redisUtil.get(key);
|
||||||
|
if (value != null) {
|
||||||
|
// 解析access_token
|
||||||
|
JSONObject response = JSON.parseObject(value);
|
||||||
|
return response.getString("access_token");
|
||||||
|
}
|
||||||
|
// 微信获取凭证接口https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET
|
||||||
|
String apiUrl = "https://api.weixin.qq.com/cgi-bin/token";
|
||||||
|
// 组装url参数
|
||||||
|
String url = apiUrl.concat("?grant_type=client_credential").concat("&appid=").concat(appid).concat("&secret=").concat(secret);
|
||||||
|
// 执行get请求
|
||||||
|
String result = HttpUtil.get(url);
|
||||||
|
// 解析access_token
|
||||||
|
JSONObject response = JSON.parseObject(result);
|
||||||
|
if (response.getString("access_token") != null) {
|
||||||
|
// 存入缓存
|
||||||
|
redisUtil.set(key, result,7000L, TimeUnit.SECONDS);
|
||||||
|
return response.getString("access_token");
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("创建公众号菜单接口")
|
||||||
|
@GetMapping("/createMenu")
|
||||||
|
public ApiResult<?> createMenu() {
|
||||||
|
System.out.println("AccessToken = " + getAccessToken());
|
||||||
|
String url = MENU_CREATE_URL.concat(Objects.requireNonNull(getAccessToken()));
|
||||||
|
CloseableHttpClient httpClient = HttpClients.createDefault();
|
||||||
|
HttpPost httpPost = new HttpPost(url);
|
||||||
|
final HashMap<String, Object> menu = new HashMap<>();
|
||||||
|
final MpOfficialMenu officialMenu = new MpOfficialMenu();
|
||||||
|
officialMenu.setName("官方服务");
|
||||||
|
officialMenu.setType("view");
|
||||||
|
officialMenu.setUrl("https://websoft.top");
|
||||||
|
menu.put("button",officialMenu);
|
||||||
|
officialMenu.setName("产品演示");
|
||||||
|
officialMenu.setType("view");
|
||||||
|
officialMenu.setUrl("https://websoft.top/product/website");
|
||||||
|
menu.put("button",officialMenu);
|
||||||
|
officialMenu.setName("我的");
|
||||||
|
officialMenu.setType("view");
|
||||||
|
officialMenu.setUrl("https://websoft.top/user");
|
||||||
|
menu.put("button",officialMenu);
|
||||||
|
httpPost.setEntity(new StringEntity(JSON.toJSONString(menu), "UTF-8"));
|
||||||
|
httpPost.setHeader("Content-type", "application/json");
|
||||||
|
|
||||||
|
try (CloseableHttpResponse response = httpClient.execute(httpPost)) {
|
||||||
|
HttpEntity entity = response.getEntity();
|
||||||
|
if (entity != null) {
|
||||||
|
String result = EntityUtils.toString(entity, "UTF-8");
|
||||||
|
System.out.println("result = " + result);
|
||||||
|
return success("返回结果",entity);
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
return fail("创建失败",url);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.MpPagesService;
|
||||||
|
import com.gxwebsoft.cms.entity.MpPages;
|
||||||
|
import com.gxwebsoft.cms.param.MpPagesParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序页面控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-07-20 19:49:55
|
||||||
|
*/
|
||||||
|
@Api(tags = "小程序页面")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/mp-pages")
|
||||||
|
public class MpPagesController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private MpPagesService mpPagesService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询小程序页面")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<MpPages>> page(MpPagesParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(mpPagesService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部小程序页面")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<MpPages>> list(MpPagesParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(mpPagesService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:mpPages:list')")
|
||||||
|
@ApiOperation("根据id查询小程序页面")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<MpPages> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(mpPagesService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加小程序页面")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody MpPages mpPages) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
mpPages.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (mpPagesService.save(mpPages)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改小程序页面")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody MpPages mpPages) {
|
||||||
|
if (mpPagesService.updateById(mpPages)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除小程序页面")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (mpPagesService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加小程序页面")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<MpPages> list) {
|
||||||
|
if (mpPagesService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改小程序页面")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<MpPages> batchParam) {
|
||||||
|
if (batchParam.update(mpPagesService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除小程序页面")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (mpPagesService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,198 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.gxwebsoft.cms.entity.Design;
|
||||||
|
import com.gxwebsoft.cms.entity.Navigation;
|
||||||
|
import com.gxwebsoft.cms.mapper.NavigationMapper;
|
||||||
|
import com.gxwebsoft.cms.param.NavigationParam;
|
||||||
|
import com.gxwebsoft.cms.service.DesignService;
|
||||||
|
import com.gxwebsoft.cms.service.NavigationService;
|
||||||
|
import com.gxwebsoft.common.core.utils.CommonUtil;
|
||||||
|
import com.gxwebsoft.common.core.web.*;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导航控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-04 21:27:55
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Api(tags = "网站栏目导航")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/navigation")
|
||||||
|
public class NavigationController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private NavigationService navigationService;
|
||||||
|
@Resource
|
||||||
|
private NavigationMapper navigationMapper;
|
||||||
|
@Resource
|
||||||
|
private DesignService designService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询导航")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<Navigation>> page(NavigationParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(navigationService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部导航")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<Navigation>> list(NavigationParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(navigationService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询导航")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<Navigation> get(@PathVariable("id") Integer id) {
|
||||||
|
final Navigation navigation = navigationService.getById(id);
|
||||||
|
// 页面布局
|
||||||
|
final Design one = designService.getOne(new LambdaUpdateWrapper<Design>().eq(Design::getCategoryId, id).last("limit 1"));
|
||||||
|
if (ObjectUtil.isNotEmpty(one)) {
|
||||||
|
navigation.setLayout(one.getLayout());
|
||||||
|
navigation.setDesign(one);
|
||||||
|
}
|
||||||
|
return success(navigation);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
|
@PreAuthorize("hasAuthority('cms:navigation:save')")
|
||||||
|
@ApiOperation("添加导航")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody Navigation navigation) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
navigation.setUserId(loginUser.getUserId());
|
||||||
|
navigation.setTenantId(loginUser.getTenantId());
|
||||||
|
}
|
||||||
|
if (navigationService.save(navigation)) {
|
||||||
|
// 添加成功事务处理
|
||||||
|
navigationService.saveAsync(navigation);
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
|
@PreAuthorize("hasAuthority('cms:navigation:update')")
|
||||||
|
@ApiOperation("修改导航")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody Navigation navigation) {
|
||||||
|
if (navigationService.updateById(navigation)) {
|
||||||
|
// 修改成功事务处理
|
||||||
|
navigationService.saveAsync(navigation);
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:navigation:remove')")
|
||||||
|
@ApiOperation("删除导航")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (navigationService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:navigation:save')")
|
||||||
|
@ApiOperation("批量添加导航")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<Navigation> list) {
|
||||||
|
if (navigationService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:navigation:update')")
|
||||||
|
@ApiOperation("批量修改导航")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<Navigation> batchParam) {
|
||||||
|
if (batchParam.update(navigationService, "navigation_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:navigation:remove')")
|
||||||
|
@ApiOperation("批量删除导航")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (navigationService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("检查分类是否存在")
|
||||||
|
@GetMapping("/existence")
|
||||||
|
public ApiResult<?> existence(ExistenceParam<Navigation> param) {
|
||||||
|
if (ObjectUtil.isEmpty(param.getId())) {
|
||||||
|
return fail(param.getValue() + "不存在");
|
||||||
|
}
|
||||||
|
if (navigationService.count(new LambdaQueryWrapper<Navigation>()
|
||||||
|
.eq(Navigation::getPath, param.getValue())
|
||||||
|
.ne(Navigation::getNavigationId,param.getId())
|
||||||
|
.ne(Navigation::getType,9)
|
||||||
|
)> 0) {
|
||||||
|
return success(param.getValue() + "已存在");
|
||||||
|
}
|
||||||
|
return fail(param.getValue() + "不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("获取树形结构的网站导航数据")
|
||||||
|
@GetMapping("/tree")
|
||||||
|
public ApiResult<List<Navigation>> tree(NavigationParam param) {
|
||||||
|
Integer parentId = 0;
|
||||||
|
if (ObjectUtil.isEmpty(param.getHide())) {
|
||||||
|
param.setHide(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
final List<Navigation> navigations = navigationService.listRel(param);
|
||||||
|
return success(CommonUtil.toTreeData(navigations, parentId, Navigation::getParentId, Navigation::getNavigationId, Navigation::setChildren));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据path获取导航")
|
||||||
|
@GetMapping("/getNavigationByPath")
|
||||||
|
public ApiResult<Navigation> getNavigationByPath(NavigationParam param) {
|
||||||
|
if(StrUtil.isBlank(param.getPath())){
|
||||||
|
return fail("path不能为空",null);
|
||||||
|
}
|
||||||
|
final Navigation one = navigationService.getOne(new LambdaUpdateWrapper<Navigation>().eq(Navigation::getPath, param.getPath()).last("limit 1"));
|
||||||
|
|
||||||
|
final Navigation navigation = navigationMapper.getByPathRel(param);
|
||||||
|
// 页面元素
|
||||||
|
final Design design = designService.getOne(new LambdaUpdateWrapper<Design>().eq(Design::getCategoryId,one.getNavigationId()).last("limit 1"));
|
||||||
|
|
||||||
|
// 上级导航
|
||||||
|
if (!navigation.getParentId().equals(0)) {
|
||||||
|
final Navigation parent = navigationService.getById(navigation.getParentId());
|
||||||
|
navigation.setParentPath(parent.getPath());
|
||||||
|
navigation.setParentName(parent.getTitle());
|
||||||
|
}
|
||||||
|
// 页面信息
|
||||||
|
navigation.setDesign(design);
|
||||||
|
// 页面布局
|
||||||
|
if (ObjectUtil.isNotEmpty(design)) {
|
||||||
|
navigation.setLayout(design.getLayout());
|
||||||
|
}
|
||||||
|
return success(navigation);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,499 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.hutool.http.HttpRequest;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.gxwebsoft.cms.entity.*;
|
||||||
|
import com.gxwebsoft.cms.param.*;
|
||||||
|
import com.gxwebsoft.cms.service.*;
|
||||||
|
import com.gxwebsoft.common.core.exception.BusinessException;
|
||||||
|
import com.gxwebsoft.common.core.security.JwtUtil;
|
||||||
|
import com.gxwebsoft.common.core.utils.CommonUtil;
|
||||||
|
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||||
|
import com.gxwebsoft.common.core.web.*;
|
||||||
|
import com.gxwebsoft.common.system.entity.Dict;
|
||||||
|
import com.gxwebsoft.common.system.entity.DictData;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import com.gxwebsoft.common.system.service.DictDataService;
|
||||||
|
import com.gxwebsoft.common.system.service.DictService;
|
||||||
|
import com.gxwebsoft.oa.entity.Company;
|
||||||
|
import com.gxwebsoft.shop.entity.Order;
|
||||||
|
import com.gxwebsoft.shop.service.OrderService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.apache.commons.lang3.time.DateUtils;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import static com.gxwebsoft.common.core.constants.WebsiteConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站信息记录表控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-04 21:14:15
|
||||||
|
*/
|
||||||
|
@Api(tags = "网站")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/website")
|
||||||
|
public class WebsiteController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private WebsiteService websiteService;
|
||||||
|
@Resource
|
||||||
|
private WebsiteFieldService websiteFieldService;
|
||||||
|
@Resource
|
||||||
|
private DesignService designService;
|
||||||
|
@Resource
|
||||||
|
private NavigationService navigationService;
|
||||||
|
@Resource
|
||||||
|
private RedisUtil redisUtil;
|
||||||
|
@Resource
|
||||||
|
private OrderService orderService;
|
||||||
|
@Resource
|
||||||
|
private DictService dictService;
|
||||||
|
@Resource
|
||||||
|
private DictDataService dictDataService;
|
||||||
|
@Resource
|
||||||
|
private DomainService domainService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询网站信息记录表")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<Website>> page(WebsiteParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(websiteService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部网站信息记录表")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<Website>> list(WebsiteParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(websiteService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询网站信息记录表")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<Website> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
final Website website = websiteService.getByIdRel(id);
|
||||||
|
// 附加状态说明
|
||||||
|
website.setStatusName(WEBSITE_STATUS_NAME[website.getStatus()]);
|
||||||
|
website.setStatusIcon(WEBSITE_STATUS_ICON[website.getStatus()]);
|
||||||
|
website.setStatusUrl(WEBSITE_STATUS_URL[website.getStatus()]);
|
||||||
|
website.setStatusBtnText(WEBSITE_STATUS_BTN_TEXT[website.getStatus()]);
|
||||||
|
if (!website.getStatus().equals(2)) {
|
||||||
|
website.setStatusText(WEBSITE_STATUS_TEXT[website.getStatus()]);
|
||||||
|
}
|
||||||
|
return success(website);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:website:save')")
|
||||||
|
@ApiOperation("添加网站信息记录表")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody Website website) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
website.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (websiteService.save(website)) {
|
||||||
|
// 绑定免费二级域名
|
||||||
|
domainService.saveAsync(website);
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:website:update')")
|
||||||
|
@ApiOperation("修改网站信息记录表")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody Website website) {
|
||||||
|
if (websiteService.updateById(website)) {
|
||||||
|
// 绑定免费二级域名
|
||||||
|
website.setTenantId(getLoginUser().getTenantId());
|
||||||
|
domainService.saveAsync(website);
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:website:remove')")
|
||||||
|
@ApiOperation("删除网站信息记录表")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (websiteService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:website:save')")
|
||||||
|
@ApiOperation("批量添加网站信息记录表")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<Website> list) {
|
||||||
|
if (websiteService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:website:update')")
|
||||||
|
@ApiOperation("批量修改网站信息记录表")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<Website> batchParam) {
|
||||||
|
if (batchParam.update(websiteService, "website_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:website:remove')")
|
||||||
|
@ApiOperation("批量删除网站信息记录表")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (websiteService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("检查域名是否存在")
|
||||||
|
@GetMapping("/existence")
|
||||||
|
public ApiResult<?> existence(ExistenceParam<Website> param) {
|
||||||
|
if (param.isExistence(websiteService, Website::getWebsiteCode)) {
|
||||||
|
return success(param.getValue() + "已存在");
|
||||||
|
}
|
||||||
|
return fail(param.getValue() + "不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("网站基本信息")
|
||||||
|
@GetMapping("/getSiteInfo")
|
||||||
|
public ApiResult<Website> getSiteInfo(HttpServletRequest request) {
|
||||||
|
String key = "SiteInfo:".concat(getTenantId().toString());
|
||||||
|
final String siteInfo = redisUtil.get(key);
|
||||||
|
String access_token = JwtUtil.getAccessToken(request);
|
||||||
|
// 从缓存读取信息
|
||||||
|
if(StrUtil.isNotBlank(siteInfo)){
|
||||||
|
return success(JSONObject.parseObject(siteInfo,Website.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 判断是否存在
|
||||||
|
if (websiteService.count() == 0) {
|
||||||
|
return fail("站点不存在",null);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取站点信息
|
||||||
|
final Website website = websiteService.getOne(new LambdaQueryWrapper<Website>().eq(Website::getDeleted, 0).last("limit 1"));
|
||||||
|
System.out.println("website = " + website);
|
||||||
|
|
||||||
|
// 站点配置参数
|
||||||
|
HashMap<String, Object> config = new HashMap<>();
|
||||||
|
final List<WebsiteField> fields = websiteFieldService.list();
|
||||||
|
fields.forEach(d -> {
|
||||||
|
config.put(d.getName(), d.getValue());
|
||||||
|
});
|
||||||
|
config.put("Domain", website.getDomain());
|
||||||
|
config.put("SubDomain", website.getWebsiteCode().concat(".wsdns.cn"));
|
||||||
|
website.setConfig(config);
|
||||||
|
|
||||||
|
// 网站导航
|
||||||
|
final NavigationParam navigationParam = new NavigationParam();
|
||||||
|
navigationParam.setHide(0);
|
||||||
|
navigationParam.setTop(0);
|
||||||
|
navigationParam.setBottom(null);
|
||||||
|
final List<Navigation> topNavs = navigationService.listRel(navigationParam);
|
||||||
|
// 顶部菜单
|
||||||
|
website.setTopNavs(CommonUtil.toTreeData(topNavs, 0, Navigation::getParentId, Navigation::getNavigationId, Navigation::setChildren));
|
||||||
|
navigationParam.setTop(null);
|
||||||
|
navigationParam.setBottom(0);
|
||||||
|
final List<Navigation> bottomNavs = navigationService.listRel(navigationParam);
|
||||||
|
// 底部菜单
|
||||||
|
website.setBottomNavs(CommonUtil.toTreeData(bottomNavs, 0, Navigation::getParentId, Navigation::getNavigationId, Navigation::setChildren));
|
||||||
|
|
||||||
|
// 当前登录用户
|
||||||
|
if(access_token != null){
|
||||||
|
final User loginUser = getLoginUser();
|
||||||
|
website.setLoginUser(loginUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 服务器时间
|
||||||
|
HashMap<String, Object> serverTime = new HashMap<>();
|
||||||
|
// 今天日期
|
||||||
|
DateTime date = DateUtil.date();
|
||||||
|
String today= DateUtil.today();
|
||||||
|
// 明天日期
|
||||||
|
final DateTime dateTime = DateUtil.tomorrow();
|
||||||
|
String tomorrow = DateUtil.format(dateTime, "yyyy-MM-dd");
|
||||||
|
// 后天日期
|
||||||
|
final DateTime dateTime2 = DateUtil.offsetDay(date, 2);
|
||||||
|
final String afterDay = DateUtil.format(dateTime2, "yyyy-MM-dd");
|
||||||
|
// 今天星期几
|
||||||
|
final int week = DateUtil.thisDayOfWeek();
|
||||||
|
final DateTime nextWeek = DateUtil.nextWeek();
|
||||||
|
serverTime.put("now",DateUtil.now());
|
||||||
|
serverTime.put("today",today);
|
||||||
|
serverTime.put("tomorrow",tomorrow);
|
||||||
|
serverTime.put("afterDay",afterDay);
|
||||||
|
serverTime.put("week",week);
|
||||||
|
serverTime.put("nextWeek",nextWeek);
|
||||||
|
website.setServerTime(serverTime);
|
||||||
|
redisUtil.set(key,website,1L, TimeUnit.DAYS);
|
||||||
|
|
||||||
|
return success(website);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createWebsite(String access_token) {
|
||||||
|
final Integer tenantId = getTenantId();
|
||||||
|
// 请求主服务器获取租户信息
|
||||||
|
String result = HttpRequest.get("https://server.gxwebsoft.com/api/auth/tenant")
|
||||||
|
.header("Authorization", access_token)
|
||||||
|
.header("Tenantid", tenantId.toString())
|
||||||
|
.timeout(20000)//超时,毫秒
|
||||||
|
.execute().body();
|
||||||
|
|
||||||
|
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||||
|
final String data = jsonObject.getString("data");
|
||||||
|
final Company company = JSONObject.parseObject(data, Company.class);
|
||||||
|
if(company == null){
|
||||||
|
throw new BusinessException("站点不存在");
|
||||||
|
}
|
||||||
|
// 创建网站记录
|
||||||
|
final Website website = new Website();
|
||||||
|
website.setTenantId(company.getTenantId());
|
||||||
|
website.setWebsiteName(company.getShortName());
|
||||||
|
website.setWebsiteLogo(company.getCompanyLogo());
|
||||||
|
website.setWebsiteIcon("/favicon.ico");
|
||||||
|
website.setWebsiteType("企业官网");
|
||||||
|
website.setDomain(company.getDomain());
|
||||||
|
website.setExpirationTime(company.getExpirationTime());
|
||||||
|
website.setIndustryParent(company.getIndustryParent());
|
||||||
|
website.setIndustryChild(company.getIndustryChild());
|
||||||
|
website.setCompanyId(company.getCompanyId());
|
||||||
|
website.setAddress(company.getAddress());
|
||||||
|
website.setComments(company.getComments());
|
||||||
|
website.setKeywords(company.getCompanyName());
|
||||||
|
website.setUserId(company.getUserId());
|
||||||
|
websiteService.save(website);
|
||||||
|
|
||||||
|
// 创建默认页面及导航
|
||||||
|
final Navigation navigation = new Navigation();
|
||||||
|
final Design design = new Design();
|
||||||
|
// 1.首页
|
||||||
|
design.setName("首页");
|
||||||
|
design.setHome(1);
|
||||||
|
design.setPath("/");
|
||||||
|
design.setComponent("/pages/index");
|
||||||
|
design.setSortNumber(0);
|
||||||
|
designService.save(design);
|
||||||
|
navigation.setTitle(design.getName());
|
||||||
|
navigation.setPath(design.getPath());
|
||||||
|
navigation.setComponent(design.getComponent());
|
||||||
|
navigation.setHome(design.getHome());
|
||||||
|
navigation.setPageId(design.getPageId());
|
||||||
|
navigation.setSortNumber(0);
|
||||||
|
navigation.setType(1);
|
||||||
|
navigation.setPosition(1);
|
||||||
|
navigationService.save(navigation);
|
||||||
|
// // 2.关于我们
|
||||||
|
// design.setName("关于我们");
|
||||||
|
// design.setPath("/about");
|
||||||
|
// design.setComponent("/about/index");
|
||||||
|
// design.setSortNumber(1);
|
||||||
|
// designService.save(design);
|
||||||
|
// navigation.setTitle(design.getName());
|
||||||
|
// navigation.setPath(design.getPath());
|
||||||
|
// navigation.setComponent(design.getComponent());
|
||||||
|
// navigation.setPageId(design.getPageId());
|
||||||
|
// navigation.setSortNumber(1);
|
||||||
|
// navigation.setType(1);
|
||||||
|
// navigationService.save(navigation);
|
||||||
|
// // 3.产品展示
|
||||||
|
// final ArticleCategory articleCategory = new ArticleCategory();
|
||||||
|
// articleCategory.setTitle("产品展示");
|
||||||
|
// articleCategory.setPath("/product/" + articleCategory.getCategoryId());
|
||||||
|
// articleCategory.setComponent("/article/photo");
|
||||||
|
// articleCategory.setSortNumber(2);
|
||||||
|
// articleCategoryService.save(articleCategory);
|
||||||
|
// navigation.setTitle(articleCategory.getTitle());
|
||||||
|
// navigation.setPath(articleCategory.getPath());
|
||||||
|
// navigation.setComponent(articleCategory.getComponent());
|
||||||
|
// navigation.setArticleCategoryId(articleCategory.getCategoryId());
|
||||||
|
// navigation.setSortNumber(2);
|
||||||
|
// navigation.setType(2);
|
||||||
|
// navigationService.save(navigation);
|
||||||
|
// // 4.新闻资讯
|
||||||
|
// articleCategory.setTitle("新闻资讯");
|
||||||
|
// articleCategoryService.save(articleCategory);
|
||||||
|
// navigation.setTitle(articleCategory.getTitle());
|
||||||
|
// navigation.setPath("/article/" + articleCategory.getCategoryId());
|
||||||
|
// navigation.setComponent("/article/index");
|
||||||
|
// navigation.setArticleCategoryId(articleCategory.getCategoryId());
|
||||||
|
// navigation.setSortNumber(3);
|
||||||
|
// navigation.setType(2);
|
||||||
|
// navigation.setPosition(1);
|
||||||
|
// navigationService.save(navigation);
|
||||||
|
// // 5.表单页面
|
||||||
|
// final Form form = new Form();
|
||||||
|
// form.setName("业务咨询");
|
||||||
|
// form.setLayout("[{\"id\":\"vhEB\",\"type\":\"text\",\"name\":\"姓名\",\"checked\":true},{\"id\":\"Hg7v\",\"type\":\"phone\",\"name\":\"手机号码\",\"checked\":true},{\"id\":\"byBy\",\"type\":\"textarea\",\"name\":\"需求描述\",\"checked\":false}]");
|
||||||
|
// form.setComments("简单描述您的需求,我们会尽快联系您");
|
||||||
|
// formService.save(form);
|
||||||
|
// navigation.setTitle(form.getName());
|
||||||
|
// navigation.setPath("/form/" + form.getFormId());
|
||||||
|
// navigation.setComponent("/form/index");
|
||||||
|
// navigation.setFormId(form.getFormId());
|
||||||
|
// navigation.setSortNumber(4);
|
||||||
|
// navigation.setType(4);
|
||||||
|
// navigation.setPosition(1);
|
||||||
|
// navigationService.save(navigation);
|
||||||
|
// // 6.联系我们
|
||||||
|
// design.setName("联系我们");
|
||||||
|
// design.setPath("/contact");
|
||||||
|
// design.setComponent("/about/index");
|
||||||
|
// design.setSortNumber(5);
|
||||||
|
// designService.save(design);
|
||||||
|
// navigation.setTitle(design.getName());
|
||||||
|
// navigation.setPath(design.getPath());
|
||||||
|
// navigation.setComponent(design.getComponent());
|
||||||
|
// navigation.setPageId(design.getPageId());
|
||||||
|
// navigation.setSortNumber(5);
|
||||||
|
// navigation.setType(1);
|
||||||
|
// navigation.setPosition(1);
|
||||||
|
// navigationService.save(navigation);
|
||||||
|
// 添加字典
|
||||||
|
final Dict dict = new Dict();
|
||||||
|
dict.setDictName("路由方式");
|
||||||
|
dict.setDictCode("navType");
|
||||||
|
dict.setSortNumber(100);
|
||||||
|
final boolean save = dictService.save(dict);
|
||||||
|
final Integer dictId = dict.getDictId();
|
||||||
|
final DictData dictData = new DictData();
|
||||||
|
dictData.setDictDataName("uni.navigateTo");
|
||||||
|
dictData.setDictDataCode("uni.navigateTo");
|
||||||
|
dictData.setComments("保留当前页面,跳转到应用内的某个页面,使用uni.navigateBack可以返回到原页面");
|
||||||
|
dictDataService.save(dictData);
|
||||||
|
dictData.setDictDataName("uni.redirectTo");
|
||||||
|
dictData.setDictDataCode("uni.redirectTo");
|
||||||
|
dictData.setComments("关闭当前页面,跳转到应用内的某个页面");
|
||||||
|
dictDataService.save(dictData);
|
||||||
|
dictData.setDictDataName("uni.reLaunch");
|
||||||
|
dictData.setDictDataCode("uni.reLaunch");
|
||||||
|
dictData.setComments("关闭所有页面,打开到应用内的某个页面");
|
||||||
|
dictDataService.save(dictData);
|
||||||
|
dictData.setDictDataName("uni.switchTab");
|
||||||
|
dictData.setDictDataCode("uni.switchTab");
|
||||||
|
dictData.setComments("跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面");
|
||||||
|
dictDataService.save(dictData);
|
||||||
|
// 网站配置参数
|
||||||
|
List<WebsiteField> fields = new ArrayList<>();
|
||||||
|
WebsiteField field = new WebsiteField();
|
||||||
|
field.setType(0);
|
||||||
|
field.setName("siteLogo");
|
||||||
|
field.setValue(company.getCompanyLogo());
|
||||||
|
field.setComments("网站LOGO");
|
||||||
|
websiteFieldService.save(field);
|
||||||
|
field.setName("siteName");
|
||||||
|
field.setValue(company.getShortName());
|
||||||
|
field.setComments("网站名称");
|
||||||
|
websiteFieldService.save(field);
|
||||||
|
field.setName("icpNo");
|
||||||
|
field.setValue("-");
|
||||||
|
field.setComments("备案号");
|
||||||
|
websiteFieldService.save(field);
|
||||||
|
field.setName("qrcode");
|
||||||
|
field.setValue("");
|
||||||
|
field.setComments("公众号二维码");
|
||||||
|
websiteFieldService.save(field);
|
||||||
|
field.setName("bottomBg");
|
||||||
|
field.setValue("https://oss.wsdns.cn/20240717/13165035c35e4f25a6c9fbd3636c6292.png");
|
||||||
|
field.setComments("网站底部背景图");
|
||||||
|
websiteFieldService.save(field);
|
||||||
|
field.setName("address");
|
||||||
|
field.setValue(company.getAddress());
|
||||||
|
field.setComments("办公地址");
|
||||||
|
websiteFieldService.save(field);
|
||||||
|
field.setName("tel");
|
||||||
|
field.setValue(company.getTel());
|
||||||
|
field.setComments("公司电话");
|
||||||
|
websiteFieldService.save(field);
|
||||||
|
field.setName("domain");
|
||||||
|
field.setValue(company.getDomain());
|
||||||
|
field.setComments("网站域名");
|
||||||
|
websiteFieldService.save(field);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("获取服务器时间")
|
||||||
|
@GetMapping("/getServerTime")
|
||||||
|
public ApiResult<?> getServerTime(){
|
||||||
|
// 服务器时间
|
||||||
|
final ServerTimeVO vo = new ServerTimeVO();
|
||||||
|
final int hour = DateUtil.hour(DateUtil.date(), true);
|
||||||
|
final int minute = DateUtil.minute(DateUtil.date());
|
||||||
|
vo.setDate(DateUtil.date());
|
||||||
|
vo.setToday(DateUtil.today());
|
||||||
|
vo.setHour(hour);
|
||||||
|
vo.setMinute(minute);
|
||||||
|
vo.setHourMinute(String.format("%02d", hour).concat(String.format("%02d", minute)));
|
||||||
|
final int compare = Integer.compare(Integer.valueOf(vo.getHourMinute()), 900);
|
||||||
|
vo.setIsAfter(compare);
|
||||||
|
|
||||||
|
final User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
if (orderService.count(new LambdaQueryWrapper<Order>().eq(Order::getPayStatus,0)) > 0) {
|
||||||
|
vo.setHasNoPayOrder(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return success(vo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("获取未来一周的日期")
|
||||||
|
@GetMapping("/getNext7day")
|
||||||
|
public ApiResult<?> getNext7day(){
|
||||||
|
List<Next7dayVO> dateList = new ArrayList<>();
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
SimpleDateFormat sdf2 = new SimpleDateFormat("MM-dd");
|
||||||
|
for (int i = 0; i < 7; i++) {
|
||||||
|
Date date = DateUtils.addDays(new Date(), +i);
|
||||||
|
String formatDate = sdf.format(date);
|
||||||
|
String dateTime = sdf2.format(date);
|
||||||
|
final Next7dayVO vo = new Next7dayVO();
|
||||||
|
vo.setDate(dateTime);
|
||||||
|
vo.setDateTime(formatDate);
|
||||||
|
final DateTime parse = DateUtil.parse(formatDate);
|
||||||
|
int dayOfWeek = DateUtil.dayOfWeek(parse);
|
||||||
|
vo.setWeek(dayOfWeek - 1);
|
||||||
|
dateList.add(vo);
|
||||||
|
}
|
||||||
|
|
||||||
|
return success(dateList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:website:remove')")
|
||||||
|
@ApiOperation("清除缓存")
|
||||||
|
@DeleteMapping("/clearSiteInfo/{key}")
|
||||||
|
public ApiResult<?> clearSiteInfo(@PathVariable("key") String key) {
|
||||||
|
final String siteInfo = redisUtil.get(key);
|
||||||
|
if(StrUtil.isNotBlank(siteInfo)){
|
||||||
|
// 清除指定key
|
||||||
|
redisUtil.delete(key);
|
||||||
|
// 清除小程序缓存
|
||||||
|
redisUtil.delete("MpInfo:".concat(getTenantId().toString()));
|
||||||
|
// 清除网站缓存
|
||||||
|
redisUtil.delete("SiteInfo:".concat(getTenantId().toString()));
|
||||||
|
// 选择支付方式
|
||||||
|
redisUtil.delete("SelectPayment:".concat(getTenantId().toString()));
|
||||||
|
return success("清除成功");
|
||||||
|
}
|
||||||
|
return success("清除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,141 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.gxwebsoft.cms.entity.WebsiteField;
|
||||||
|
import com.gxwebsoft.cms.mapper.WebsiteFieldMapper;
|
||||||
|
import com.gxwebsoft.cms.param.WebsiteFieldParam;
|
||||||
|
import com.gxwebsoft.cms.service.WebsiteFieldService;
|
||||||
|
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||||
|
import com.gxwebsoft.common.core.web.*;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应用参数控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-05 15:53:44
|
||||||
|
*/
|
||||||
|
@Api(tags = "网站参数")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/website-field")
|
||||||
|
public class WebsiteFieldController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private WebsiteFieldService websiteFieldService;
|
||||||
|
@Resource
|
||||||
|
private WebsiteFieldMapper websiteFieldMapper;
|
||||||
|
@Resource
|
||||||
|
private RedisUtil redisUtil;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询应用参数")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<WebsiteField>> page(WebsiteFieldParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(websiteFieldService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部应用参数")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<WebsiteField>> list(WebsiteFieldParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(websiteFieldService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询应用参数")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<WebsiteField> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(websiteFieldService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:websiteField:save')")
|
||||||
|
@ApiOperation("添加应用参数")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody WebsiteField websiteField) {
|
||||||
|
if (websiteFieldService.save(websiteField)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:websiteField:update')")
|
||||||
|
@ApiOperation("修改应用参数")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody WebsiteField websiteField) {
|
||||||
|
if (websiteFieldService.updateById(websiteField)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:websiteField:remvoe')")
|
||||||
|
@ApiOperation("删除应用参数")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (websiteFieldService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:websiteField:save')")
|
||||||
|
@ApiOperation("批量添加应用参数")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<WebsiteField> list) {
|
||||||
|
if (websiteFieldService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:websiteField:update')")
|
||||||
|
@ApiOperation("批量修改应用参数")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<WebsiteField> batchParam) {
|
||||||
|
if (batchParam.update(websiteFieldService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:websiteField:remvoe')")
|
||||||
|
@ApiOperation("批量删除应用参数")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (websiteFieldService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:websiteField:update')")
|
||||||
|
@ApiOperation("从回收站放回原处")
|
||||||
|
@DeleteMapping("/undelete/{id}")
|
||||||
|
public ApiResult<?> undelete(@PathVariable("id") Integer id) {
|
||||||
|
if (websiteFieldMapper.undelete(id) > 0) {
|
||||||
|
return success("恢复成功");
|
||||||
|
}
|
||||||
|
return fail("恢复失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("获取网站配置参数-对象形式")
|
||||||
|
@GetMapping("/config")
|
||||||
|
public ApiResult<?> getConfig(WebsiteFieldParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
final List<WebsiteField> fields = websiteFieldService.listRel(param);
|
||||||
|
|
||||||
|
HashMap<String, Object> config = new HashMap<>();
|
||||||
|
fields.forEach(d -> {
|
||||||
|
config.put(d.getName(), d.getValue());
|
||||||
|
});
|
||||||
|
System.out.println("config = " + config);
|
||||||
|
return success(config);
|
||||||
|
}
|
||||||
|
}
|
||||||
87
src/main/java/com/gxwebsoft/cms/entity/Ad.java
Normal file
87
src/main/java/com/gxwebsoft/cms/entity/Ad.java
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.gxwebsoft.cms.vo.SideVo;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 广告位管理表
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-04 21:14:15
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "Ad对象", description = "广告位管理表")
|
||||||
|
@TableName("cms_ad")
|
||||||
|
public class Ad implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@TableId(value = "ad_id", type = IdType.AUTO)
|
||||||
|
private Integer adId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "广告位名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "广告类型")
|
||||||
|
private String adType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "宽")
|
||||||
|
private String width;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "高")
|
||||||
|
private String height;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "路由/链接地址")
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "广告图片")
|
||||||
|
private String images;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户ID")
|
||||||
|
private Integer merchantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面ID")
|
||||||
|
private Integer pageId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面名称")
|
||||||
|
private String pageName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "注册时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "幻灯片广告图片")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Object side;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "广告图列表")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Object data;
|
||||||
|
|
||||||
|
}
|
||||||
58
src/main/java/com/gxwebsoft/cms/entity/AdRecord.java
Normal file
58
src/main/java/com/gxwebsoft/cms/entity/AdRecord.java
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 广告图片记录表
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-04 21:14:15
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "AdRecord对象", description = "广告图片记录表")
|
||||||
|
@TableName("cms_ad_record")
|
||||||
|
public class AdRecord implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@TableId(value = "ad_record_id", type = IdType.AUTO)
|
||||||
|
private Integer adRecordId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "广告标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "图片地址")
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "链接地址")
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "广告位ID")
|
||||||
|
private Integer adId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "注册时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
||||||
156
src/main/java/com/gxwebsoft/cms/entity/Article.java
Normal file
156
src/main/java/com/gxwebsoft/cms/entity/Article.java
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import static com.gxwebsoft.common.core.constants.ArticleConstants.ARTICLE_STATUS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文章
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2023-10-22 15:47:09
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "Article对象", description = "文章")
|
||||||
|
@TableName("cms_article")
|
||||||
|
public class Article implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文章ID")
|
||||||
|
@TableId(value = "article_id", type = IdType.AUTO)
|
||||||
|
private Integer articleId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文章标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "类型 0列表 1页面 2外链")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "列表显示方式(10小图展示 20大图展示)")
|
||||||
|
private Integer showType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "话题")
|
||||||
|
private String topic;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文章分类ID")
|
||||||
|
private Integer categoryId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "封面图")
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "来源")
|
||||||
|
private String source;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文章内容")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "虚拟阅读量(仅用作展示)")
|
||||||
|
private Integer virtualViews;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "实际阅读量")
|
||||||
|
private Integer actualViews;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "发布来源客户端 (APP、H5、小程序等)")
|
||||||
|
private String platform;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文章附件")
|
||||||
|
private String files;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "视频地址")
|
||||||
|
private String video;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "接受的文件类型")
|
||||||
|
private String accept;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "经度")
|
||||||
|
private String longitude;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "纬度")
|
||||||
|
private String latitude;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "所在省份")
|
||||||
|
private String province;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "所在城市")
|
||||||
|
private String city;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "所在辖区")
|
||||||
|
private String region;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "街道地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "点赞数")
|
||||||
|
private Integer likes;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "评论数")
|
||||||
|
private Integer commentNumbers;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "提醒谁看")
|
||||||
|
private String toUsers;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户ID")
|
||||||
|
private Integer merchantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String merchantName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户头像")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String merchantAvatar;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态文本")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String statusText;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "注册时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改时间")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "栏目名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String categoryName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "父级栏目ID")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer parentId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "父级栏目名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String parentName;
|
||||||
|
|
||||||
|
public String getStatusText() {
|
||||||
|
return ARTICLE_STATUS[this.status];
|
||||||
|
}
|
||||||
|
}
|
||||||
110
src/main/java/com/gxwebsoft/cms/entity/ArticleCategory.java
Normal file
110
src/main/java/com/gxwebsoft/cms/entity/ArticleCategory.java
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文章分类表
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2023-10-22 15:47:09
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "ArticleCategory对象", description = "文章分类表")
|
||||||
|
@TableName("cms_article_category")
|
||||||
|
public class ArticleCategory implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文章分类ID")
|
||||||
|
@TableId(value = "category_id", type = IdType.AUTO)
|
||||||
|
private Integer categoryId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分类标识")
|
||||||
|
private String categoryCode;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "类型 0列表 1页面 2外链")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分类名称")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分类图片")
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "上级分类ID")
|
||||||
|
private Integer parentId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "路由/链接地址")
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
@ApiModelProperty("导航组件地址")
|
||||||
|
private String component;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "绑定的页面ID")
|
||||||
|
private Integer pageId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String pageName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户ID")
|
||||||
|
private Integer merchantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文章数量")
|
||||||
|
private Integer count;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)")
|
||||||
|
private Integer hide;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否推荐")
|
||||||
|
private Integer recommend;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否显示在首页")
|
||||||
|
private Integer showIndex;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1禁用")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "注册时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改时间")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "子分类")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<ArticleCategory> children;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "父级栏目名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String parentName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文章列表")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<Article> articleList;
|
||||||
|
|
||||||
|
}
|
||||||
79
src/main/java/com/gxwebsoft/cms/entity/ArticleComment.java
Normal file
79
src/main/java/com/gxwebsoft/cms/entity/ArticleComment.java
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文章评论表
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2023-10-22 15:47:09
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "ArticleComment对象", description = "文章评论表")
|
||||||
|
@TableName("cms_article_comment")
|
||||||
|
public class ArticleComment implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "评价ID")
|
||||||
|
@TableId(value = "comment_id", type = IdType.AUTO)
|
||||||
|
private Integer commentId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文章ID")
|
||||||
|
private Integer articleId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "评分 (10好评 20中评 30差评)")
|
||||||
|
private Integer score;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "评价内容")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否为图片评价")
|
||||||
|
private Integer isPicture;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "评论者ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "被评价者ID")
|
||||||
|
private Integer toUserId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "回复的评论ID")
|
||||||
|
private Integer replyCommentId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "回复者ID")
|
||||||
|
private Integer replyUserId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0未读, 1已读")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "注册时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改时间")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
}
|
||||||
43
src/main/java/com/gxwebsoft/cms/entity/ArticleContent.java
Normal file
43
src/main/java/com/gxwebsoft/cms/entity/ArticleContent.java
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文章
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-13 20:28:29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "ArticleContent对象", description = "文章")
|
||||||
|
@TableName("cms_article_content")
|
||||||
|
public class ArticleContent implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文章ID")
|
||||||
|
private Integer articleId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文章内容")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "注册时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
||||||
44
src/main/java/com/gxwebsoft/cms/entity/ArticleLike.java
Normal file
44
src/main/java/com/gxwebsoft/cms/entity/ArticleLike.java
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点赞文章
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2023-10-22 15:47:09
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "ArticleLike对象", description = "点赞文章")
|
||||||
|
@TableName("cms_article_like")
|
||||||
|
public class ArticleLike implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文章ID")
|
||||||
|
private Integer articleId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "注册时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
||||||
71
src/main/java/com/gxwebsoft/cms/entity/Components.java
Normal file
71
src/main/java/com/gxwebsoft/cms/entity/Components.java
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-08-25 19:00:41
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "Components对象", description = "组件")
|
||||||
|
@TableName("cms_components")
|
||||||
|
public class Components implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "组件标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "关联导航ID")
|
||||||
|
private Integer navigationId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "组件类型")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面关键词")
|
||||||
|
private String keywords;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面描述")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "组件路径")
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "组件图标")
|
||||||
|
private String icon;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
||||||
98
src/main/java/com/gxwebsoft/cms/entity/Design.java
Normal file
98
src/main/java/com/gxwebsoft/cms/entity/Design.java
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面管理记录表
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-04 21:20:40
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "Design对象", description = "页面管理记录表")
|
||||||
|
@TableName("cms_design")
|
||||||
|
public class Design implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@TableId(value = "page_id", type = IdType.AUTO)
|
||||||
|
private Integer pageId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "上级id, 0是顶级")
|
||||||
|
private Integer parentId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面标题")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面关键词")
|
||||||
|
private String keywords;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面描述")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "路由地址")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "组件路径")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String component;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "缩列图")
|
||||||
|
private String photo;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "购买链接")
|
||||||
|
private String buyUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面样式")
|
||||||
|
private String style;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面内容")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否开启布局")
|
||||||
|
private Boolean showLayout;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面布局")
|
||||||
|
private String layout;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户ID")
|
||||||
|
private Integer merchantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "栏目ID")
|
||||||
|
private Integer categoryId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "设为首页")
|
||||||
|
private Integer home;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "注册时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
||||||
72
src/main/java/com/gxwebsoft/cms/entity/DesignRecord.java
Normal file
72
src/main/java/com/gxwebsoft/cms/entity/DesignRecord.java
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面组件表
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-08-25 20:34:14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "DesignRecord对象", description = "页面组件表")
|
||||||
|
@TableName("cms_design_record")
|
||||||
|
public class DesignRecord implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "关联导航ID")
|
||||||
|
private Integer navigationId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "组件")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "组件标识")
|
||||||
|
private String dictCode;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "组件样式")
|
||||||
|
private String styles;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面关键词")
|
||||||
|
private String keywords;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面描述")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面路由地址")
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "缩列图")
|
||||||
|
private String photo;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
84
src/main/java/com/gxwebsoft/cms/entity/Docs.java
Normal file
84
src/main/java/com/gxwebsoft/cms/entity/Docs.java
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文档管理记录表
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2023-10-22 15:47:09
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "Docs对象", description = "文档管理记录表")
|
||||||
|
@TableName("cms_docs")
|
||||||
|
public class Docs implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文档ID")
|
||||||
|
@TableId(value = "docs_id", type = IdType.AUTO)
|
||||||
|
private Integer docsId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "书籍ID")
|
||||||
|
private Integer bookId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文档标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "上级目录")
|
||||||
|
private Integer parentId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "可见性(public,private,protected)")
|
||||||
|
private String visibility;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "虚拟阅读量(仅用作展示)")
|
||||||
|
private Integer virtualViews;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "实际阅读量")
|
||||||
|
private Integer actualViews;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文章内容ID")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer contentId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文章内容")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "注册时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改时间")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "书籍标识")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
}
|
||||||
63
src/main/java/com/gxwebsoft/cms/entity/DocsBook.java
Normal file
63
src/main/java/com/gxwebsoft/cms/entity/DocsBook.java
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 书籍记录表
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-23 19:40:02
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "DocsBook对象", description = "书籍记录表")
|
||||||
|
@TableName("cms_docs_book")
|
||||||
|
public class DocsBook implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@TableId(value = "book_id", type = IdType.AUTO)
|
||||||
|
private Integer bookId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "书籍名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "书籍标识")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "封面图")
|
||||||
|
private String photo;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "书籍介绍")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "注册时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
||||||
43
src/main/java/com/gxwebsoft/cms/entity/DocsContent.java
Normal file
43
src/main/java/com/gxwebsoft/cms/entity/DocsContent.java
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文档内容记录表
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-23 19:51:37
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "DocsContent对象", description = "文档内容记录表")
|
||||||
|
@TableName("cms_docs_content")
|
||||||
|
public class DocsContent implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文档ID")
|
||||||
|
private Integer docsId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文档内容")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "注册时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
||||||
69
src/main/java/com/gxwebsoft/cms/entity/Domain.java
Normal file
69
src/main/java/com/gxwebsoft/cms/entity/Domain.java
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站域名记录表
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-26 21:27:29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "Domain对象", description = "网站域名记录表")
|
||||||
|
@TableName("cms_domain")
|
||||||
|
public class Domain implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "类型 0赠送域名 1绑定域名 ")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "域名")
|
||||||
|
private String domain;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主机记录")
|
||||||
|
private String hostName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "记录值")
|
||||||
|
private String hostValue;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序号")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "网站ID")
|
||||||
|
private Integer websiteId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户ID")
|
||||||
|
private Integer appId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改时间")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
}
|
||||||
94
src/main/java/com/gxwebsoft/cms/entity/Form.java
Normal file
94
src/main/java/com/gxwebsoft/cms/entity/Form.java
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.gxwebsoft.shop.entity.Merchant;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单设计表
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-14 08:59:33
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "Form对象", description = "表单设计表")
|
||||||
|
@TableName("cms_form")
|
||||||
|
public class Form implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@TableId(value = "form_id", type = IdType.AUTO)
|
||||||
|
private Integer formId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "表单标题")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "顶部图片")
|
||||||
|
private String photo;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "背景图片")
|
||||||
|
private String background;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "视频文件")
|
||||||
|
private String video;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "提交次数")
|
||||||
|
private Integer submitNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面布局")
|
||||||
|
private String layout;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户ID")
|
||||||
|
private Integer merchantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否隐藏顶部图片")
|
||||||
|
private Integer hidePhoto;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否隐藏背景图片")
|
||||||
|
private Integer hideBackground;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否隐藏视频")
|
||||||
|
private Integer hideVideo;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "背景图片透明度")
|
||||||
|
private BigDecimal opacity;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否更新缓存")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer clearCache;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户信息")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Merchant merchant;
|
||||||
|
|
||||||
|
}
|
||||||
67
src/main/java/com/gxwebsoft/cms/entity/FormRecord.java
Normal file
67
src/main/java/com/gxwebsoft/cms/entity/FormRecord.java
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单数据记录表
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-14 08:59:33
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "FormRecord对象", description = "表单数据记录表")
|
||||||
|
@TableName("cms_form_record")
|
||||||
|
public class FormRecord implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@TableId(value = "form_record_id", type = IdType.AUTO)
|
||||||
|
private Integer formRecordId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "表单ID")
|
||||||
|
private Integer formId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "表单数据")
|
||||||
|
private String formData;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "手机号码")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "表单名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String formName;
|
||||||
|
|
||||||
|
}
|
||||||
100
src/main/java/com/gxwebsoft/cms/entity/Mp.java
Normal file
100
src/main/java/com/gxwebsoft/cms/entity/Mp.java
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序信息
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-07-21 23:03:05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "Mp对象", description = "小程序信息")
|
||||||
|
@TableName("cms_mp")
|
||||||
|
public class Mp implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@TableId(value = "mp_id", type = IdType.AUTO)
|
||||||
|
private Integer mpId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否主账号")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "小程序ID")
|
||||||
|
private String appId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "小程序密钥")
|
||||||
|
private String appSecret;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "小程序名称")
|
||||||
|
private String mpName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "小程序简称")
|
||||||
|
private String shortName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "头像")
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "小程序码")
|
||||||
|
private String mpQrcode;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "微信认证")
|
||||||
|
private Integer authentication;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主体信息")
|
||||||
|
private String companyName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "小程序备案")
|
||||||
|
private String icpNo;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "登录邮箱")
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "登录密码")
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "原始ID")
|
||||||
|
private String ghId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "入口页面")
|
||||||
|
private String mainPath;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "过期时间")
|
||||||
|
private Date expirationTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "介绍")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "注册时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
||||||
82
src/main/java/com/gxwebsoft/cms/entity/MpAd.java
Normal file
82
src/main/java/com/gxwebsoft/cms/entity/MpAd.java
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序广告位
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-07-23 01:53:01
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "MpAd对象", description = "小程序广告位")
|
||||||
|
@TableName("cms_mp_ad")
|
||||||
|
public class MpAd implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@TableId(value = "ad_id", type = IdType.AUTO)
|
||||||
|
private Integer adId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面ID")
|
||||||
|
private Integer pageId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面名称")
|
||||||
|
private String pageName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "广告类型")
|
||||||
|
private String adType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "广告位名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "宽")
|
||||||
|
private String width;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "高")
|
||||||
|
private String height;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "广告图片")
|
||||||
|
private String images;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "图标背景色")
|
||||||
|
private String colors;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "路由/链接地址")
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
||||||
63
src/main/java/com/gxwebsoft/cms/entity/MpField.java
Normal file
63
src/main/java/com/gxwebsoft/cms/entity/MpField.java
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序配置
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-07-22 12:54:13
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "MpField对象", description = "小程序配置")
|
||||||
|
@TableName("cms_mp_field")
|
||||||
|
public class MpField implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "自增ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "类型,0文本 1图片 2其他")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "名称")
|
||||||
|
private String value;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面ID")
|
||||||
|
private Integer pageId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String pageName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
||||||
132
src/main/java/com/gxwebsoft/cms/entity/MpMenu.java
Normal file
132
src/main/java/com/gxwebsoft/cms/entity/MpMenu.java
Normal file
@@ -0,0 +1,132 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序端菜单
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-05-02 12:22:25
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "MpMenu对象", description = "小程序端菜单")
|
||||||
|
@TableName("cms_mp_menu")
|
||||||
|
public class MpMenu implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@TableId(value = "menu_id", type = IdType.AUTO)
|
||||||
|
private Integer menuId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "上级id, 0是顶级")
|
||||||
|
private Integer parentId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "菜单名称")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "类型 0自定义 1单页内容2外部链接")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "所在行 0第一行 1第二行")
|
||||||
|
private Integer rows;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否微信小程序菜单")
|
||||||
|
private Boolean isMpWeixin;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "菜单路由地址")
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "菜单组件地址, 目录可为空")
|
||||||
|
private String component;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "打开位置")
|
||||||
|
private String target;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "菜单图标")
|
||||||
|
private String icon;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "图标颜色")
|
||||||
|
private String color;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "上传图标")
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)")
|
||||||
|
private Integer hide;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "位置 0不限 1顶部 2底部")
|
||||||
|
private Integer position;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "菜单侧栏选中的path")
|
||||||
|
private String active;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "其它路由元信息")
|
||||||
|
private String meta;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "绑定的页面")
|
||||||
|
private Integer pageId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "绑定的文章分类ID")
|
||||||
|
private Integer articleCategoryId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "绑定的文章ID")
|
||||||
|
private Integer articleId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "绑定的表单ID")
|
||||||
|
private Integer formId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "绑定的书籍标识")
|
||||||
|
private String bookCode;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "绑定的商品分类ID")
|
||||||
|
private Integer goodsCategoryId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "绑定的商品ID")
|
||||||
|
private Integer goodsId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否管理人员可见")
|
||||||
|
private Integer adminShow;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "设为首页")
|
||||||
|
private Integer home;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "注册时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分组名称")
|
||||||
|
private String groupName;
|
||||||
|
|
||||||
|
@ApiModelProperty("子菜单")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<MpMenu> children;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
65
src/main/java/com/gxwebsoft/cms/entity/MpOfficialMenu.java
Normal file
65
src/main/java/com/gxwebsoft/cms/entity/MpOfficialMenu.java
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信公众号菜单
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-15 13:12:38
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "MpOfficialMenu对象", description = "微信公众号菜单")
|
||||||
|
@TableName("cms_mp_official_menu")
|
||||||
|
public class MpOfficialMenu implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "上级id, 0是顶级")
|
||||||
|
private Integer parentId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "菜单名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "类型")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "菜单值")
|
||||||
|
private String key;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "网址")
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "子菜单")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<MpOfficialMenu> sub_button;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
||||||
92
src/main/java/com/gxwebsoft/cms/entity/MpPages.java
Normal file
92
src/main/java/com/gxwebsoft/cms/entity/MpPages.java
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序页面
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-07-20 19:49:55
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "MpPages对象", description = "小程序页面")
|
||||||
|
@TableName("cms_mp_pages")
|
||||||
|
public class MpPages implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "上级id, 0是顶级")
|
||||||
|
private Integer parentId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面名称")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面路径")
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "设为首页")
|
||||||
|
private Integer home;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分包")
|
||||||
|
private String subpackage;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "图标")
|
||||||
|
private String icon;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "未选中")
|
||||||
|
private String iconPath;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "已选中")
|
||||||
|
private String selectedIconPath;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "注册时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面下的导航图标列表")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Map<Integer, List<MpMenu>> mpMenus;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面下的广告图片")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<MpAd> ads;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面参数")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private HashMap<String, Object> config;
|
||||||
|
|
||||||
|
}
|
||||||
162
src/main/java/com/gxwebsoft/cms/entity/Navigation.java
Normal file
162
src/main/java/com/gxwebsoft/cms/entity/Navigation.java
Normal file
@@ -0,0 +1,162 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导航
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-04 21:27:55
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "Navigation对象", description = "导航")
|
||||||
|
@TableName("cms_navigation")
|
||||||
|
public class Navigation implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@TableId(value = "navigation_id", type = IdType.AUTO)
|
||||||
|
private Integer navigationId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "类型 0菜单 1单页内容 2外部链接")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "模型")
|
||||||
|
private String model;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "模型名称")
|
||||||
|
private String modelName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "别名")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "上级id, 0是顶级")
|
||||||
|
private Integer parentId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "菜单名称")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "菜单路由地址")
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "菜单组件地址, 目录可为空")
|
||||||
|
private String component;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "菜单组件地址, 目录可为空")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String componentPath;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "打开位置")
|
||||||
|
private String target;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "菜单图标")
|
||||||
|
private String icon;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "图标颜色")
|
||||||
|
private String color;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)")
|
||||||
|
private Integer hide;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "访问权限 0所有人 登录可见 密码可见")
|
||||||
|
private Integer permission;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用于访问")
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "位置 0不限 1顶部 2底部")
|
||||||
|
private Integer position;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "顶部 0隐藏 1显示")
|
||||||
|
private Integer top;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "底部 0隐藏 1显示")
|
||||||
|
private Integer bottom;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "菜单侧栏选中的path")
|
||||||
|
private String active;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "其它路由元信息")
|
||||||
|
private String meta;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "css样式")
|
||||||
|
private String style;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面ID")
|
||||||
|
private Integer pageId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "设为首页")
|
||||||
|
private Integer home;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否微信小程序菜单")
|
||||||
|
private Boolean isMpWeixin;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "注册时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String pageName;
|
||||||
|
|
||||||
|
@ApiModelProperty("子菜单")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<Navigation> children;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面布局")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String layout;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "关联的页面")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Design design;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "父级栏目链接")
|
||||||
|
private String parentPath;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "父级栏目名称")
|
||||||
|
private String parentName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "当前栏目名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String categoryName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "当前栏目链接")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String categoryPath;
|
||||||
|
|
||||||
|
public String getCategoryName() {
|
||||||
|
return this.title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCategoryPath() {
|
||||||
|
return this.path;
|
||||||
|
}
|
||||||
|
}
|
||||||
37
src/main/java/com/gxwebsoft/cms/entity/Next7dayVO.java
Normal file
37
src/main/java/com/gxwebsoft/cms/entity/Next7dayVO.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 未来7天
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-05-02 12:22:25
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "未来7天", description = "未来7天")
|
||||||
|
public class Next7dayVO implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "星期")
|
||||||
|
private Integer week;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "日期(月日)")
|
||||||
|
private String date;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "日期(年月日)")
|
||||||
|
private String dateTime;
|
||||||
|
|
||||||
|
}
|
||||||
45
src/main/java/com/gxwebsoft/cms/entity/ServerTimeVO.java
Normal file
45
src/main/java/com/gxwebsoft/cms/entity/ServerTimeVO.java
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import io.swagger.models.auth.In;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务器时间
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-05-02 12:22:25
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "服务器时间", description = "服务器当前时间及日期")
|
||||||
|
public class ServerTimeVO implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "今天日期")
|
||||||
|
private String today;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "今天是周几")
|
||||||
|
private DateTime date;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "当前时间(时)")
|
||||||
|
private Integer hour;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "当前时间(分)")
|
||||||
|
private Integer minute;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "当期时间(时分)")
|
||||||
|
private String hourMinute;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否已过时间")
|
||||||
|
private Integer isAfter;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否含有未支付订单")
|
||||||
|
private Boolean hasNoPayOrder;
|
||||||
|
|
||||||
|
}
|
||||||
239
src/main/java/com/gxwebsoft/cms/entity/Website.java
Normal file
239
src/main/java/com/gxwebsoft/cms/entity/Website.java
Normal file
@@ -0,0 +1,239 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import com.gxwebsoft.oa.entity.Link;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站信息记录表
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-04 21:14:15
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "Website对象", description = "网站信息记录表")
|
||||||
|
@TableName("cms_website")
|
||||||
|
public class Website implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "站点ID")
|
||||||
|
@TableId(value = "website_id", type = IdType.AUTO)
|
||||||
|
private Integer websiteId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "网站名称")
|
||||||
|
private String websiteName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "网站标识")
|
||||||
|
private String websiteCode;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "网站Icon")
|
||||||
|
private String websiteIcon;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "网站Logo")
|
||||||
|
private String websiteLogo;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "网站Logo(深色模式)")
|
||||||
|
private String websiteDarkLogo;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "网站类型")
|
||||||
|
private String websiteType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "全局样式")
|
||||||
|
private String styles;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "域名前缀")
|
||||||
|
private String prefix;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "绑定域名")
|
||||||
|
private String domain;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "全局样式")
|
||||||
|
private String style;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "后台管理地址")
|
||||||
|
private String adminUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "网站关键词")
|
||||||
|
private String keywords;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "当前版本")
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "服务到期时间")
|
||||||
|
private Date expirationTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "模版ID")
|
||||||
|
private Integer templateId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "行业类型(父级)")
|
||||||
|
private String industryParent;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "行业类型(子级)")
|
||||||
|
private String industryChild;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "企业ID")
|
||||||
|
private Integer companyId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "所在国家")
|
||||||
|
private String country;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "所在省份")
|
||||||
|
private String province;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "所在城市")
|
||||||
|
private String city;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "所在辖区")
|
||||||
|
private String region;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "办公地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "办公电话")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "办公电话")
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "经度")
|
||||||
|
private String longitude;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "纬度")
|
||||||
|
private String latitude;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ICP备案")
|
||||||
|
private String icpNo;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "公安备案")
|
||||||
|
private String policeNo;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否推荐")
|
||||||
|
private Integer recommend;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String statusName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态说明")
|
||||||
|
private String statusText;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "关闭原因")
|
||||||
|
private String statusClose;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "跳转地址")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String statusUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "跳转按钮文字")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String statusBtnText;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态图标")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String statusIcon;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序号")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户ID")
|
||||||
|
private Integer merchantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改时间")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "预设字段")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<WebsiteField> fields;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "小程序导航图标")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Map<String, List<MpMenu>> mpMenus;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "网站导航栏")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<Navigation> navigations;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "顶部菜单")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<Navigation> topNavs;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "底部菜单")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<Navigation> bottomNavs;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "幻灯片广告")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Ad slide;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "站点广告")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<Ad> ads;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "首页布局")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String layout;
|
||||||
|
|
||||||
|
// @ApiModelProperty(value = "文章分类")
|
||||||
|
// @TableField(exist = false)
|
||||||
|
// private List<ArticleCategory> categoryList;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "友情链接")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<Link> links;
|
||||||
|
|
||||||
|
// @ApiModelProperty(value = "用户信息")
|
||||||
|
// @TableField(exist = false)
|
||||||
|
// private User userInfo;
|
||||||
|
|
||||||
|
// @ApiModelProperty(value = "商户信息")
|
||||||
|
// @TableField(exist = false)
|
||||||
|
// private Merchant merchant;
|
||||||
|
//
|
||||||
|
// @ApiModelProperty(value = "商户账号")
|
||||||
|
// @TableField(exist = false)
|
||||||
|
// private MerchantAccount merchantAccount;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "配置信息")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Object config;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "当前登录用户")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private User loginUser;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "服务器时间")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private HashMap<String, Object> serverTime;
|
||||||
|
|
||||||
|
}
|
||||||
66
src/main/java/com/gxwebsoft/cms/entity/WebsiteField.java
Normal file
66
src/main/java/com/gxwebsoft/cms/entity/WebsiteField.java
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应用参数
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-05 15:53:43
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "WebsiteField对象", description = "应用参数")
|
||||||
|
@TableName("cms_website_field")
|
||||||
|
public class WebsiteField implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "自增ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "类型,0文本 1图片 2其他")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "参数名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "参数值")
|
||||||
|
private String value;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "css样式")
|
||||||
|
private String style;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "可修改范围")
|
||||||
|
private String modifyRange;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "参数值")
|
||||||
|
private String defaultValue;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "注册时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
||||||
37
src/main/java/com/gxwebsoft/cms/mapper/AdMapper.java
Normal file
37
src/main/java/com/gxwebsoft/cms/mapper/AdMapper.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.Ad;
|
||||||
|
import com.gxwebsoft.cms.param.AdParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 广告位管理表Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-04 21:14:15
|
||||||
|
*/
|
||||||
|
public interface AdMapper extends BaseMapper<Ad> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<Ad>
|
||||||
|
*/
|
||||||
|
List<Ad> selectPageRel(@Param("page") IPage<Ad> page,
|
||||||
|
@Param("param") AdParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<Ad> selectListRel(@Param("param") AdParam param);
|
||||||
|
|
||||||
|
}
|
||||||
37
src/main/java/com/gxwebsoft/cms/mapper/AdRecordMapper.java
Normal file
37
src/main/java/com/gxwebsoft/cms/mapper/AdRecordMapper.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.AdRecord;
|
||||||
|
import com.gxwebsoft.cms.param.AdRecordParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 广告图片记录表Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-04 21:14:15
|
||||||
|
*/
|
||||||
|
public interface AdRecordMapper extends BaseMapper<AdRecord> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<AdRecord>
|
||||||
|
*/
|
||||||
|
List<AdRecord> selectPageRel(@Param("page") IPage<AdRecord> page,
|
||||||
|
@Param("param") AdRecordParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<AdRecord> selectListRel(@Param("param") AdRecordParam param);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.ArticleCategory;
|
||||||
|
import com.gxwebsoft.cms.param.ArticleCategoryParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文章分类表Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2023-10-22 15:47:09
|
||||||
|
*/
|
||||||
|
public interface ArticleCategoryMapper extends BaseMapper<ArticleCategory> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<ArticleCategory>
|
||||||
|
*/
|
||||||
|
List<ArticleCategory> selectPageRel(@Param("page") IPage<ArticleCategory> page,
|
||||||
|
@Param("param") ArticleCategoryParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<ArticleCategory> selectListRel(@Param("param") ArticleCategoryParam param);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.ArticleComment;
|
||||||
|
import com.gxwebsoft.cms.param.ArticleCommentParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文章评论表Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2023-10-22 15:47:09
|
||||||
|
*/
|
||||||
|
public interface ArticleCommentMapper extends BaseMapper<ArticleComment> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<ArticleComment>
|
||||||
|
*/
|
||||||
|
List<ArticleComment> selectPageRel(@Param("page") IPage<ArticleComment> page,
|
||||||
|
@Param("param") ArticleCommentParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<ArticleComment> selectListRel(@Param("param") ArticleCommentParam param);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.ArticleContent;
|
||||||
|
import com.gxwebsoft.cms.param.ArticleContentParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文章Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-13 20:28:29
|
||||||
|
*/
|
||||||
|
public interface ArticleContentMapper extends BaseMapper<ArticleContent> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<ArticleContent>
|
||||||
|
*/
|
||||||
|
List<ArticleContent> selectPageRel(@Param("page") IPage<ArticleContent> page,
|
||||||
|
@Param("param") ArticleContentParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<ArticleContent> selectListRel(@Param("param") ArticleContentParam param);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.ArticleLike;
|
||||||
|
import com.gxwebsoft.cms.param.ArticleLikeParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点赞文章Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2023-10-22 15:47:09
|
||||||
|
*/
|
||||||
|
public interface ArticleLikeMapper extends BaseMapper<ArticleLike> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<ArticleLike>
|
||||||
|
*/
|
||||||
|
List<ArticleLike> selectPageRel(@Param("page") IPage<ArticleLike> page,
|
||||||
|
@Param("param") ArticleLikeParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<ArticleLike> selectListRel(@Param("param") ArticleLikeParam param);
|
||||||
|
|
||||||
|
}
|
||||||
37
src/main/java/com/gxwebsoft/cms/mapper/ArticleMapper.java
Normal file
37
src/main/java/com/gxwebsoft/cms/mapper/ArticleMapper.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.Article;
|
||||||
|
import com.gxwebsoft.cms.param.ArticleParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文章Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2023-10-22 15:47:09
|
||||||
|
*/
|
||||||
|
public interface ArticleMapper extends BaseMapper<Article> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<Article>
|
||||||
|
*/
|
||||||
|
List<Article> selectPageRel(@Param("page") IPage<Article> page,
|
||||||
|
@Param("param") ArticleParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<Article> selectListRel(@Param("param") ArticleParam param);
|
||||||
|
|
||||||
|
}
|
||||||
37
src/main/java/com/gxwebsoft/cms/mapper/ComponentsMapper.java
Normal file
37
src/main/java/com/gxwebsoft/cms/mapper/ComponentsMapper.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.Components;
|
||||||
|
import com.gxwebsoft.cms.param.ComponentsParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-08-25 19:00:41
|
||||||
|
*/
|
||||||
|
public interface ComponentsMapper extends BaseMapper<Components> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<Components>
|
||||||
|
*/
|
||||||
|
List<Components> selectPageRel(@Param("page") IPage<Components> page,
|
||||||
|
@Param("param") ComponentsParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<Components> selectListRel(@Param("param") ComponentsParam param);
|
||||||
|
|
||||||
|
}
|
||||||
37
src/main/java/com/gxwebsoft/cms/mapper/DesignMapper.java
Normal file
37
src/main/java/com/gxwebsoft/cms/mapper/DesignMapper.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.Design;
|
||||||
|
import com.gxwebsoft.cms.param.DesignParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面管理记录表Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-04 21:20:40
|
||||||
|
*/
|
||||||
|
public interface DesignMapper extends BaseMapper<Design> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<Design>
|
||||||
|
*/
|
||||||
|
List<Design> selectPageRel(@Param("page") IPage<Design> page,
|
||||||
|
@Param("param") DesignParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<Design> selectListRel(@Param("param") DesignParam param);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.DesignRecord;
|
||||||
|
import com.gxwebsoft.cms.param.DesignRecordParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面组件表Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-08-25 20:34:14
|
||||||
|
*/
|
||||||
|
public interface DesignRecordMapper extends BaseMapper<DesignRecord> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<DesignRecord>
|
||||||
|
*/
|
||||||
|
List<DesignRecord> selectPageRel(@Param("page") IPage<DesignRecord> page,
|
||||||
|
@Param("param") DesignRecordParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<DesignRecord> selectListRel(@Param("param") DesignRecordParam param);
|
||||||
|
|
||||||
|
}
|
||||||
37
src/main/java/com/gxwebsoft/cms/mapper/DocsBookMapper.java
Normal file
37
src/main/java/com/gxwebsoft/cms/mapper/DocsBookMapper.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.DocsBook;
|
||||||
|
import com.gxwebsoft.cms.param.DocsBookParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 书籍记录表Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-23 19:40:02
|
||||||
|
*/
|
||||||
|
public interface DocsBookMapper extends BaseMapper<DocsBook> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<DocsBook>
|
||||||
|
*/
|
||||||
|
List<DocsBook> selectPageRel(@Param("page") IPage<DocsBook> page,
|
||||||
|
@Param("param") DocsBookParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<DocsBook> selectListRel(@Param("param") DocsBookParam param);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.DocsContent;
|
||||||
|
import com.gxwebsoft.cms.param.DocsContentParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文档内容记录表Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-23 19:51:37
|
||||||
|
*/
|
||||||
|
public interface DocsContentMapper extends BaseMapper<DocsContent> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<DocsContent>
|
||||||
|
*/
|
||||||
|
List<DocsContent> selectPageRel(@Param("page") IPage<DocsContent> page,
|
||||||
|
@Param("param") DocsContentParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<DocsContent> selectListRel(@Param("param") DocsContentParam param);
|
||||||
|
|
||||||
|
}
|
||||||
37
src/main/java/com/gxwebsoft/cms/mapper/DocsMapper.java
Normal file
37
src/main/java/com/gxwebsoft/cms/mapper/DocsMapper.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.Docs;
|
||||||
|
import com.gxwebsoft.cms.param.DocsParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文档管理记录表Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2023-10-22 15:47:09
|
||||||
|
*/
|
||||||
|
public interface DocsMapper extends BaseMapper<Docs> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<Docs>
|
||||||
|
*/
|
||||||
|
List<Docs> selectPageRel(@Param("page") IPage<Docs> page,
|
||||||
|
@Param("param") DocsParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<Docs> selectListRel(@Param("param") DocsParam param);
|
||||||
|
|
||||||
|
}
|
||||||
41
src/main/java/com/gxwebsoft/cms/mapper/DomainMapper.java
Normal file
41
src/main/java/com/gxwebsoft/cms/mapper/DomainMapper.java
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.Domain;
|
||||||
|
import com.gxwebsoft.cms.param.DomainParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站域名记录表Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-26 21:27:29
|
||||||
|
*/
|
||||||
|
public interface DomainMapper extends BaseMapper<Domain> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<Domain>
|
||||||
|
*/
|
||||||
|
List<Domain> selectPageRel(@Param("page") IPage<Domain> page,
|
||||||
|
@Param("param") DomainParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<Domain> selectListRel(@Param("param") DomainParam param);
|
||||||
|
|
||||||
|
@InterceptorIgnore(tenantLine = "true")
|
||||||
|
Domain getDomain(@Param("domain") String domain);
|
||||||
|
}
|
||||||
37
src/main/java/com/gxwebsoft/cms/mapper/FormMapper.java
Normal file
37
src/main/java/com/gxwebsoft/cms/mapper/FormMapper.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.Form;
|
||||||
|
import com.gxwebsoft.cms.param.FormParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单设计表Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-14 08:59:33
|
||||||
|
*/
|
||||||
|
public interface FormMapper extends BaseMapper<Form> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<Form>
|
||||||
|
*/
|
||||||
|
List<Form> selectPageRel(@Param("page") IPage<Form> page,
|
||||||
|
@Param("param") FormParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<Form> selectListRel(@Param("param") FormParam param);
|
||||||
|
|
||||||
|
}
|
||||||
37
src/main/java/com/gxwebsoft/cms/mapper/FormRecordMapper.java
Normal file
37
src/main/java/com/gxwebsoft/cms/mapper/FormRecordMapper.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.FormRecord;
|
||||||
|
import com.gxwebsoft.cms.param.FormRecordParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单数据记录表Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-14 08:59:33
|
||||||
|
*/
|
||||||
|
public interface FormRecordMapper extends BaseMapper<FormRecord> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<FormRecord>
|
||||||
|
*/
|
||||||
|
List<FormRecord> selectPageRel(@Param("page") IPage<FormRecord> page,
|
||||||
|
@Param("param") FormRecordParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<FormRecord> selectListRel(@Param("param") FormRecordParam param);
|
||||||
|
|
||||||
|
}
|
||||||
37
src/main/java/com/gxwebsoft/cms/mapper/MpAdMapper.java
Normal file
37
src/main/java/com/gxwebsoft/cms/mapper/MpAdMapper.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.MpAd;
|
||||||
|
import com.gxwebsoft.cms.param.MpAdParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序广告位Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-07-23 01:53:01
|
||||||
|
*/
|
||||||
|
public interface MpAdMapper extends BaseMapper<MpAd> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<MpAd>
|
||||||
|
*/
|
||||||
|
List<MpAd> selectPageRel(@Param("page") IPage<MpAd> page,
|
||||||
|
@Param("param") MpAdParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<MpAd> selectListRel(@Param("param") MpAdParam param);
|
||||||
|
|
||||||
|
}
|
||||||
37
src/main/java/com/gxwebsoft/cms/mapper/MpFieldMapper.java
Normal file
37
src/main/java/com/gxwebsoft/cms/mapper/MpFieldMapper.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.MpField;
|
||||||
|
import com.gxwebsoft.cms.param.MpFieldParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序配置Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-07-22 12:54:13
|
||||||
|
*/
|
||||||
|
public interface MpFieldMapper extends BaseMapper<MpField> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<MpField>
|
||||||
|
*/
|
||||||
|
List<MpField> selectPageRel(@Param("page") IPage<MpField> page,
|
||||||
|
@Param("param") MpFieldParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<MpField> selectListRel(@Param("param") MpFieldParam param);
|
||||||
|
|
||||||
|
}
|
||||||
37
src/main/java/com/gxwebsoft/cms/mapper/MpMapper.java
Normal file
37
src/main/java/com/gxwebsoft/cms/mapper/MpMapper.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.Mp;
|
||||||
|
import com.gxwebsoft.cms.param.MpParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序信息Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-07-23 00:09:11
|
||||||
|
*/
|
||||||
|
public interface MpMapper extends BaseMapper<Mp> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<Mp>
|
||||||
|
*/
|
||||||
|
List<Mp> selectPageRel(@Param("page") IPage<Mp> page,
|
||||||
|
@Param("param") MpParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<Mp> selectListRel(@Param("param") MpParam param);
|
||||||
|
|
||||||
|
}
|
||||||
37
src/main/java/com/gxwebsoft/cms/mapper/MpMenuMapper.java
Normal file
37
src/main/java/com/gxwebsoft/cms/mapper/MpMenuMapper.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.MpMenu;
|
||||||
|
import com.gxwebsoft.cms.param.MpMenuParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序端菜单Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-05-02 12:22:25
|
||||||
|
*/
|
||||||
|
public interface MpMenuMapper extends BaseMapper<MpMenu> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<MpMenu>
|
||||||
|
*/
|
||||||
|
List<MpMenu> selectPageRel(@Param("page") IPage<MpMenu> page,
|
||||||
|
@Param("param") MpMenuParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<MpMenu> selectListRel(@Param("param") MpMenuParam param);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.MpOfficialMenu;
|
||||||
|
import com.gxwebsoft.cms.param.MpOfficialMenuParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序端菜单Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-15 13:12:38
|
||||||
|
*/
|
||||||
|
public interface MpOfficialMenuMapper extends BaseMapper<MpOfficialMenu> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<MpOfficialMenu>
|
||||||
|
*/
|
||||||
|
List<MpOfficialMenu> selectPageRel(@Param("page") IPage<MpOfficialMenu> page,
|
||||||
|
@Param("param") MpOfficialMenuParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<MpOfficialMenu> selectListRel(@Param("param") MpOfficialMenuParam param);
|
||||||
|
|
||||||
|
}
|
||||||
37
src/main/java/com/gxwebsoft/cms/mapper/MpPagesMapper.java
Normal file
37
src/main/java/com/gxwebsoft/cms/mapper/MpPagesMapper.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.MpPages;
|
||||||
|
import com.gxwebsoft.cms.param.MpPagesParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序页面Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-07-20 19:49:55
|
||||||
|
*/
|
||||||
|
public interface MpPagesMapper extends BaseMapper<MpPages> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<MpPages>
|
||||||
|
*/
|
||||||
|
List<MpPages> selectPageRel(@Param("page") IPage<MpPages> page,
|
||||||
|
@Param("param") MpPagesParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<MpPages> selectListRel(@Param("param") MpPagesParam param);
|
||||||
|
|
||||||
|
}
|
||||||
41
src/main/java/com/gxwebsoft/cms/mapper/NavigationMapper.java
Normal file
41
src/main/java/com/gxwebsoft/cms/mapper/NavigationMapper.java
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.Domain;
|
||||||
|
import com.gxwebsoft.cms.entity.Navigation;
|
||||||
|
import com.gxwebsoft.cms.param.NavigationParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导航Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-04 21:27:55
|
||||||
|
*/
|
||||||
|
public interface NavigationMapper extends BaseMapper<Navigation> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<Navigation>
|
||||||
|
*/
|
||||||
|
List<Navigation> selectPageRel(@Param("page") IPage<Navigation> page,
|
||||||
|
@Param("param") NavigationParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<Navigation> selectListRel(@Param("param") NavigationParam param);
|
||||||
|
|
||||||
|
@InterceptorIgnore(tenantLine = "true")
|
||||||
|
Navigation getByPathRel(@Param("param") NavigationParam param);
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.WebsiteField;
|
||||||
|
import com.gxwebsoft.cms.param.WebsiteFieldParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应用参数Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-05 15:53:44
|
||||||
|
*/
|
||||||
|
public interface WebsiteFieldMapper extends BaseMapper<WebsiteField> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<WebsiteField>
|
||||||
|
*/
|
||||||
|
List<WebsiteField> selectPageRel(@Param("page") IPage<WebsiteField> page,
|
||||||
|
@Param("param") WebsiteFieldParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<WebsiteField> selectListRel(@Param("param") WebsiteFieldParam param);
|
||||||
|
|
||||||
|
int undelete(Integer id);
|
||||||
|
}
|
||||||
37
src/main/java/com/gxwebsoft/cms/mapper/WebsiteMapper.java
Normal file
37
src/main/java/com/gxwebsoft/cms/mapper/WebsiteMapper.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.Website;
|
||||||
|
import com.gxwebsoft.cms.param.WebsiteParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站信息记录表Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-03-04 21:14:15
|
||||||
|
*/
|
||||||
|
public interface WebsiteMapper extends BaseMapper<Website> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<Website>
|
||||||
|
*/
|
||||||
|
List<Website> selectPageRel(@Param("page") IPage<Website> page,
|
||||||
|
@Param("param") WebsiteParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<Website> selectListRel(@Param("param") WebsiteParam param);
|
||||||
|
|
||||||
|
}
|
||||||
65
src/main/java/com/gxwebsoft/cms/mapper/xml/AdMapper.xml
Normal file
65
src/main/java/com/gxwebsoft/cms/mapper/xml/AdMapper.xml
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gxwebsoft.cms.mapper.AdMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM cms_ad a
|
||||||
|
<where>
|
||||||
|
<if test="param.adId != null">
|
||||||
|
AND a.ad_id = #{param.adId}
|
||||||
|
</if>
|
||||||
|
<if test="param.adType != null">
|
||||||
|
AND a.ad_type LIKE CONCAT('%', #{param.adType}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.width != null">
|
||||||
|
AND a.width LIKE CONCAT('%', #{param.width}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.height != null">
|
||||||
|
AND a.height LIKE CONCAT('%', #{param.height}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.images != null">
|
||||||
|
AND a.images LIKE CONCAT('%', #{param.images}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.userId != null">
|
||||||
|
AND a.user_id = #{param.userId}
|
||||||
|
</if>
|
||||||
|
<if test="param.merchantId != null">
|
||||||
|
AND a.merchant_id = #{param.merchantId}
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
OR a.ad_id = #{param.keywords}
|
||||||
|
OR a.path LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.Ad">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.cms.entity.Ad">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gxwebsoft.cms.mapper.AdRecordMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM cms_ad_record a
|
||||||
|
<where>
|
||||||
|
<if test="param.adRecordId != null">
|
||||||
|
AND a.ad_record_id = #{param.adRecordId}
|
||||||
|
</if>
|
||||||
|
<if test="param.title != null">
|
||||||
|
AND a.title LIKE CONCAT('%', #{param.title}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.path != null">
|
||||||
|
AND a.path LIKE CONCAT('%', #{param.path}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.url != null">
|
||||||
|
AND a.url LIKE CONCAT('%', #{param.url}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.adId != null">
|
||||||
|
AND a.ad_id = #{param.adId}
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.AdRecord">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.cms.entity.AdRecord">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gxwebsoft.cms.mapper.ArticleCategoryMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*,b.name as pageName
|
||||||
|
FROM cms_article_category a
|
||||||
|
LEFT JOIN cms_design b ON a.page_id = b.page_id
|
||||||
|
<where>
|
||||||
|
<if test="param.categoryId != null">
|
||||||
|
AND a.category_id = #{param.categoryId}
|
||||||
|
</if>
|
||||||
|
<if test="param.type != null">
|
||||||
|
AND a.type = #{param.type}
|
||||||
|
</if>
|
||||||
|
<if test="param.title != null">
|
||||||
|
AND a.title LIKE CONCAT('%', #{param.title}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.image != null">
|
||||||
|
AND a.image LIKE CONCAT('%', #{param.image}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.parentId != null">
|
||||||
|
AND a.parent_id = #{param.parentId}
|
||||||
|
</if>
|
||||||
|
<if test="param.pageId != null">
|
||||||
|
AND a.page_id = #{param.pageId}
|
||||||
|
</if>
|
||||||
|
<if test="param.userId != null">
|
||||||
|
AND a.user_id = #{param.userId}
|
||||||
|
</if>
|
||||||
|
<if test="param.merchantId != null">
|
||||||
|
AND a.merchant_id = #{param.merchantId}
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.hide != null">
|
||||||
|
AND a.hide = #{param.hide}
|
||||||
|
</if>
|
||||||
|
<if test="param.showIndex != null">
|
||||||
|
AND a.show_index = #{param.showIndex}
|
||||||
|
</if>
|
||||||
|
<if test="param.recommend != null">
|
||||||
|
AND a.recommend = #{param.recommend}
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted != null">
|
||||||
|
AND a.deleted = #{param.deleted}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted == null">
|
||||||
|
AND a.deleted = 0
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.ArticleCategory">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.cms.entity.ArticleCategory">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gxwebsoft.cms.mapper.ArticleCommentMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM cms_article_comment a
|
||||||
|
<where>
|
||||||
|
<if test="param.commentId != null">
|
||||||
|
AND a.comment_id = #{param.commentId}
|
||||||
|
</if>
|
||||||
|
<if test="param.articleId != null">
|
||||||
|
AND a.article_id = #{param.articleId}
|
||||||
|
</if>
|
||||||
|
<if test="param.score != null">
|
||||||
|
AND a.score = #{param.score}
|
||||||
|
</if>
|
||||||
|
<if test="param.content != null">
|
||||||
|
AND a.content LIKE CONCAT('%', #{param.content}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.isPicture != null">
|
||||||
|
AND a.is_picture = #{param.isPicture}
|
||||||
|
</if>
|
||||||
|
<if test="param.userId != null">
|
||||||
|
AND a.user_id = #{param.userId}
|
||||||
|
</if>
|
||||||
|
<if test="param.toUserId != null">
|
||||||
|
AND a.to_user_id = #{param.toUserId}
|
||||||
|
</if>
|
||||||
|
<if test="param.replyCommentId != null">
|
||||||
|
AND a.reply_comment_id = #{param.replyCommentId}
|
||||||
|
</if>
|
||||||
|
<if test="param.replyUserId != null">
|
||||||
|
AND a.reply_user_id = #{param.replyUserId}
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted != null">
|
||||||
|
AND a.deleted = #{param.deleted}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted == null">
|
||||||
|
AND a.deleted = 0
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.ArticleComment">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.cms.entity.ArticleComment">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gxwebsoft.cms.mapper.ArticleContentMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM cms_article_content a
|
||||||
|
<where>
|
||||||
|
<if test="param.id != null">
|
||||||
|
AND a.id = #{param.idd}
|
||||||
|
</if>
|
||||||
|
<if test="param.articleId != null">
|
||||||
|
AND a.article_id = #{param.articleId}
|
||||||
|
</if>
|
||||||
|
<if test="param.content != null">
|
||||||
|
AND a.content LIKE CONCAT('%', #{param.content}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.ArticleContent">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.cms.entity.ArticleContent">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gxwebsoft.cms.mapper.ArticleLikeMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM cms_article_like a
|
||||||
|
<where>
|
||||||
|
<if test="param.id != null">
|
||||||
|
AND a.id = #{param.id}
|
||||||
|
</if>
|
||||||
|
<if test="param.articleId != null">
|
||||||
|
AND a.article_id = #{param.articleId}
|
||||||
|
</if>
|
||||||
|
<if test="param.userId != null">
|
||||||
|
AND a.user_id = #{param.userId}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.ArticleLike">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.cms.entity.ArticleLike">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
131
src/main/java/com/gxwebsoft/cms/mapper/xml/ArticleMapper.xml
Normal file
131
src/main/java/com/gxwebsoft/cms/mapper/xml/ArticleMapper.xml
Normal file
@@ -0,0 +1,131 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gxwebsoft.cms.mapper.ArticleMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*,b.title as categoryName, c.merchant_name as merchantName, c.image as merchantAvatar
|
||||||
|
FROM cms_article a
|
||||||
|
LEFT JOIN cms_navigation b ON a.category_id = b.navigation_id
|
||||||
|
LEFT JOIN shop_merchant c ON a.merchant_id = c.merchant_id
|
||||||
|
<where>
|
||||||
|
<if test="param.articleId != null">
|
||||||
|
AND a.article_id = #{param.articleId}
|
||||||
|
</if>
|
||||||
|
<if test="param.title != null">
|
||||||
|
AND a.title LIKE CONCAT('%', #{param.title}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.showType != null">
|
||||||
|
AND a.show_type = #{param.showType}
|
||||||
|
</if>
|
||||||
|
<if test="param.topic != null">
|
||||||
|
AND a.topic LIKE CONCAT('%', #{param.topic}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.categoryId != null">
|
||||||
|
AND a.category_id = #{param.categoryId}
|
||||||
|
</if>
|
||||||
|
<if test="param.navigationId != null">
|
||||||
|
AND a.category_id = #{param.navigationId}
|
||||||
|
</if>
|
||||||
|
<if test="param.image != null">
|
||||||
|
AND a.image LIKE CONCAT('%', #{param.image}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.source != null">
|
||||||
|
AND a.source LIKE CONCAT('%', #{param.source}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.content != null">
|
||||||
|
AND a.content LIKE CONCAT('%', #{param.content}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.virtualViews != null">
|
||||||
|
AND a.virtual_views = #{param.virtualViews}
|
||||||
|
</if>
|
||||||
|
<if test="param.actualViews != null">
|
||||||
|
AND a.actual_views = #{param.actualViews}
|
||||||
|
</if>
|
||||||
|
<if test="param.platform != null">
|
||||||
|
AND a.platform LIKE CONCAT('%', #{param.platform}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.files != null">
|
||||||
|
AND a.files LIKE CONCAT('%', #{param.files}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.video != null">
|
||||||
|
AND a.video LIKE CONCAT('%', #{param.video}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.accept != null">
|
||||||
|
AND a.accept LIKE CONCAT('%', #{param.accept}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.longitude != null">
|
||||||
|
AND a.longitude LIKE CONCAT('%', #{param.longitude}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.latitude != null">
|
||||||
|
AND a.latitude LIKE CONCAT('%', #{param.latitude}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.province != null">
|
||||||
|
AND a.province LIKE CONCAT('%', #{param.province}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.city != null">
|
||||||
|
AND a.city LIKE CONCAT('%', #{param.city}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.region != null">
|
||||||
|
AND a.region LIKE CONCAT('%', #{param.region}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.address != null">
|
||||||
|
AND a.address LIKE CONCAT('%', #{param.address}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.likes != null">
|
||||||
|
AND a.likes = #{param.likes}
|
||||||
|
</if>
|
||||||
|
<if test="param.commentNumbers != null">
|
||||||
|
AND a.comment_numbers = #{param.commentNumbers}
|
||||||
|
</if>
|
||||||
|
<if test="param.toUsers != null">
|
||||||
|
AND a.to_users LIKE CONCAT('%', #{param.toUsers}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.userId != null">
|
||||||
|
AND a.user_id = #{param.userId}
|
||||||
|
</if>
|
||||||
|
<if test="param.merchantId != null">
|
||||||
|
AND a.merchant_id = #{param.merchantId}
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted != null">
|
||||||
|
AND a.deleted = #{param.deleted}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted == null">
|
||||||
|
AND a.deleted = 0
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND (a.title LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
OR a.phone LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
OR a.region LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
OR a.user_id = #{param.keywords}
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.Article">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.cms.entity.Article">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gxwebsoft.cms.mapper.ComponentsMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM cms_components a
|
||||||
|
<where>
|
||||||
|
<if test="param.id != null">
|
||||||
|
AND a.id = #{param.id}
|
||||||
|
</if>
|
||||||
|
<if test="param.title != null">
|
||||||
|
AND a.title LIKE CONCAT('%', #{param.title}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.navigationId != null">
|
||||||
|
AND a.navigation_id = #{param.navigationId}
|
||||||
|
</if>
|
||||||
|
<if test="param.type != null">
|
||||||
|
AND a.type LIKE CONCAT('%', #{param.type}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND a.keywords LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.description != null">
|
||||||
|
AND a.description LIKE CONCAT('%', #{param.description}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.path != null">
|
||||||
|
AND a.path LIKE CONCAT('%', #{param.path}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.icon != null">
|
||||||
|
AND a.icon LIKE CONCAT('%', #{param.icon}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.userId != null">
|
||||||
|
AND a.user_id = #{param.userId}
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.Components">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.cms.entity.Components">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
78
src/main/java/com/gxwebsoft/cms/mapper/xml/DesignMapper.xml
Normal file
78
src/main/java/com/gxwebsoft/cms/mapper/xml/DesignMapper.xml
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gxwebsoft.cms.mapper.DesignMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*, b.path,b.component
|
||||||
|
FROM cms_design a
|
||||||
|
LEFT JOIN cms_navigation b ON a.category_id = b.navigation_id
|
||||||
|
<where>
|
||||||
|
<if test="param.pageId != null">
|
||||||
|
AND a.page_id = #{param.pageId}
|
||||||
|
</if>
|
||||||
|
<if test="param.parentId != null">
|
||||||
|
AND a.parent_id = #{param.parentId}
|
||||||
|
</if>
|
||||||
|
<if test="param.home != null">
|
||||||
|
AND a.home = #{param.home}
|
||||||
|
</if>
|
||||||
|
<if test="param.name != null">
|
||||||
|
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND a.keywords LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.description != null">
|
||||||
|
AND a.description LIKE CONCAT('%', #{param.description}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.path != null">
|
||||||
|
AND a.path LIKE CONCAT('%', #{param.path}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.photo != null">
|
||||||
|
AND a.photo LIKE CONCAT('%', #{param.photo}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.userId != null">
|
||||||
|
AND a.user_id = #{param.userId}
|
||||||
|
</if>
|
||||||
|
<if test="param.merchantId != null">
|
||||||
|
AND a.merchant_id = #{param.merchantId}
|
||||||
|
</if>
|
||||||
|
<if test="param.categoryId != null">
|
||||||
|
AND a.category_id = #{param.categoryId}
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted != null">
|
||||||
|
AND a.deleted = #{param.deleted}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted == null">
|
||||||
|
AND a.deleted = 0
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.Design">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.cms.entity.Design">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gxwebsoft.cms.mapper.DesignRecordMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM cms_design_record a
|
||||||
|
<where>
|
||||||
|
<if test="param.id != null">
|
||||||
|
AND a.id = #{param.id}
|
||||||
|
</if>
|
||||||
|
<if test="param.navigationId != null">
|
||||||
|
AND a.navigation_id = #{param.navigationId}
|
||||||
|
</if>
|
||||||
|
<if test="param.title != null">
|
||||||
|
AND a.title LIKE CONCAT('%', #{param.title}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.dictCode != null">
|
||||||
|
AND a.dict_code LIKE CONCAT('%', #{param.dictCode}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.styles != null">
|
||||||
|
AND a.styles LIKE CONCAT('%', #{param.styles}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND a.keywords LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.description != null">
|
||||||
|
AND a.description LIKE CONCAT('%', #{param.description}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.path != null">
|
||||||
|
AND a.path LIKE CONCAT('%', #{param.path}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.photo != null">
|
||||||
|
AND a.photo LIKE CONCAT('%', #{param.photo}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.userId != null">
|
||||||
|
AND a.user_id = #{param.userId}
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.DesignRecord">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.cms.entity.DesignRecord">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gxwebsoft.cms.mapper.DocsBookMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM cms_docs_book a
|
||||||
|
<where>
|
||||||
|
<if test="param.bookId != null">
|
||||||
|
AND a.book_id = #{param.bookId}
|
||||||
|
</if>
|
||||||
|
<if test="param.name != null">
|
||||||
|
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.code != null">
|
||||||
|
AND a.code = #{param.code}
|
||||||
|
</if>
|
||||||
|
<if test="param.photo != null">
|
||||||
|
AND a.photo LIKE CONCAT('%', #{param.photo}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.content != null">
|
||||||
|
AND a.content LIKE CONCAT('%', #{param.content}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted != null">
|
||||||
|
AND a.deleted = #{param.deleted}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted == null">
|
||||||
|
AND a.deleted = 0
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.DocsBook">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.cms.entity.DocsBook">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gxwebsoft.cms.mapper.DocsContentMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM cms_docs_content a
|
||||||
|
<where>
|
||||||
|
<if test="param.id != null">
|
||||||
|
AND a.id = #{param.id}
|
||||||
|
</if>
|
||||||
|
<if test="param.docsId != null">
|
||||||
|
AND a.docs_id = #{param.docsId}
|
||||||
|
</if>
|
||||||
|
<if test="param.content != null">
|
||||||
|
AND a.content LIKE CONCAT('%', #{param.content}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.DocsContent">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.cms.entity.DocsContent">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
69
src/main/java/com/gxwebsoft/cms/mapper/xml/DocsMapper.xml
Normal file
69
src/main/java/com/gxwebsoft/cms/mapper/xml/DocsMapper.xml
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gxwebsoft.cms.mapper.DocsMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*, b.code
|
||||||
|
FROM cms_docs a
|
||||||
|
LEFT JOIN cms_docs_book b ON a.book_id = b.book_id
|
||||||
|
<where>
|
||||||
|
<if test="param.docsId != null">
|
||||||
|
AND a.docs_id = #{param.docsId}
|
||||||
|
</if>
|
||||||
|
<if test="param.bookId != null">
|
||||||
|
AND a.book_id = #{param.bookId}
|
||||||
|
</if>
|
||||||
|
<if test="param.title != null">
|
||||||
|
AND a.title LIKE CONCAT('%', #{param.title}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.parentId != null">
|
||||||
|
AND a.parent_id = #{param.parentId}
|
||||||
|
</if>
|
||||||
|
<if test="param.userId != null">
|
||||||
|
AND a.user_id = #{param.userId}
|
||||||
|
</if>
|
||||||
|
<if test="param.organizationId != null">
|
||||||
|
AND a.organization_id = #{param.organizationId}
|
||||||
|
</if>
|
||||||
|
<if test="param.visibility != null">
|
||||||
|
AND a.visibility LIKE CONCAT('%', #{param.visibility}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.content != null">
|
||||||
|
AND a.content LIKE CONCAT('%', #{param.content}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted != null">
|
||||||
|
AND a.deleted = #{param.deleted}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted == null">
|
||||||
|
AND a.deleted = 0
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.Docs">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.cms.entity.Docs">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
61
src/main/java/com/gxwebsoft/cms/mapper/xml/DomainMapper.xml
Normal file
61
src/main/java/com/gxwebsoft/cms/mapper/xml/DomainMapper.xml
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gxwebsoft.cms.mapper.DomainMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM cms_domain a
|
||||||
|
<where>
|
||||||
|
<if test="param.id != null">
|
||||||
|
AND a.id = #{param.id}
|
||||||
|
</if>
|
||||||
|
<if test="param.type != null">
|
||||||
|
AND a.type = #{param.type}
|
||||||
|
</if>
|
||||||
|
<if test="param.domain != null">
|
||||||
|
AND a.domain = #{param.domain}
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.userId != null">
|
||||||
|
AND a.user_id = #{param.userId}
|
||||||
|
</if>
|
||||||
|
<if test="param.websiteId != null">
|
||||||
|
AND a.website_id = #{param.websiteId}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted != null">
|
||||||
|
AND a.deleted = #{param.deleted}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted == null">
|
||||||
|
AND a.deleted = 0
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.Domain">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.cms.entity.Domain">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 更新用户信息 -->
|
||||||
|
<select id="getDomain" resultType="com.gxwebsoft.cms.entity.Domain">
|
||||||
|
SELECT * FROM cms_domain WHERE domain = #{domain} and deleted = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
71
src/main/java/com/gxwebsoft/cms/mapper/xml/FormMapper.xml
Normal file
71
src/main/java/com/gxwebsoft/cms/mapper/xml/FormMapper.xml
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gxwebsoft.cms.mapper.FormMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM cms_form a
|
||||||
|
<where>
|
||||||
|
<if test="param.formId != null">
|
||||||
|
AND a.form_id = #{param.formId}
|
||||||
|
</if>
|
||||||
|
<if test="param.name != null">
|
||||||
|
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.photo != null">
|
||||||
|
AND a.photo LIKE CONCAT('%', #{param.photo}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.background != null">
|
||||||
|
AND a.background LIKE CONCAT('%', #{param.background}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.submitNumber != null">
|
||||||
|
AND a.submit_number = #{param.submitNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.layout != null">
|
||||||
|
AND a.layout LIKE CONCAT('%', #{param.layout}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.userId != null">
|
||||||
|
AND a.user_id = #{param.userId}
|
||||||
|
</if>
|
||||||
|
<if test="param.merchantId != null">
|
||||||
|
AND a.merchant_id = #{param.merchantId}
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted != null">
|
||||||
|
AND a.deleted = #{param.deleted}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted == null">
|
||||||
|
AND a.deleted = 0
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
<if test="param.merchantId != null">
|
||||||
|
AND a.merchant_id = #{param.merchantId}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.Form">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.cms.entity.Form">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gxwebsoft.cms.mapper.FormRecordMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*,b.name as formName
|
||||||
|
FROM cms_form_record a
|
||||||
|
LEFT JOIN cms_form b ON a.form_id = b.form_id
|
||||||
|
<where>
|
||||||
|
<if test="param.formRecordId != null">
|
||||||
|
AND a.form_record_id = #{param.formRecordId}
|
||||||
|
</if>
|
||||||
|
<if test="param.formId != null">
|
||||||
|
AND a.form_id = #{param.formId}
|
||||||
|
</if>
|
||||||
|
<if test="param.formData != null">
|
||||||
|
AND a.form_data LIKE CONCAT('%', #{param.formData}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.userId != null">
|
||||||
|
AND a.user_id = #{param.userId}
|
||||||
|
</if>
|
||||||
|
<if test="param.phone != null">
|
||||||
|
AND a.phone = #{param.phone}
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted != null">
|
||||||
|
AND a.deleted = #{param.deleted}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted == null">
|
||||||
|
AND a.deleted = 0
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND (a.phone LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.FormRecord">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.cms.entity.FormRecord">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user