112 changed files with 2466 additions and 36 deletions
@ -0,0 +1,61 @@ |
|||
package com.yxt.demo.common.jdbc.service; |
|||
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.yxt.demo.common.core.query.PagerQuery; |
|||
import com.yxt.demo.common.core.vo.PagerVo; |
|||
import com.yxt.demo.common.core.vo.Vo; |
|||
|
|||
import java.util.ArrayList; |
|||
|
|||
/** |
|||
* Project: jbsc-commons <br/> |
|||
* File: PagerUtil.java <br/> |
|||
* Class: org.jbase.jbsc.commons.base.utils.PagerUtil <br/> |
|||
* Description: <描述类的功能>. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2020/9/22 上午9:35 <br/> |
|||
* |
|||
* @author popo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
public abstract class PagerUtil { |
|||
|
|||
public static <T> IPage<T> queryToPage(PagerQuery pq) { |
|||
IPage<T> page = new Page<>(); |
|||
page.setSize(pq.getSize()).setCurrent(pq.getCurrent()); |
|||
return page; |
|||
} |
|||
|
|||
public static <V, T> PagerVo<V> pageToVo(IPage pr, PagerVo<V> pv) { |
|||
if (pv == null) { |
|||
pv = new PagerVo<V>(); |
|||
} |
|||
pv.setCurrent(pr.getCurrent()).setSize(pr.getSize()) |
|||
.setTotal(pr.getTotal()).setPages(pr.getPages()) |
|||
.setRecords(pr.getRecords()); |
|||
return pv; |
|||
} |
|||
|
|||
/** |
|||
* 转换pagerVo |
|||
* |
|||
* @param soure |
|||
* @return |
|||
*/ |
|||
public static <S extends Vo, T extends Vo> PagerVo<T> switchPagerVo( |
|||
PagerVo<S> soure) { |
|||
if (soure == null) { |
|||
return null; |
|||
} |
|||
|
|||
PagerVo<T> target = new PagerVo<>(); |
|||
target.setCurrent(soure.getCurrent()).setPages(soure.getPages()) |
|||
.setSize(soure.getSize()).setTotal(soure.getTotal()); |
|||
target.setRecords(new ArrayList<T>()); |
|||
|
|||
return target; |
|||
} |
|||
} |
@ -0,0 +1,189 @@ |
|||
package com.yxt.demo.common.utils.allutils; |
|||
|
|||
import org.apache.commons.codec.DecoderException; |
|||
import org.apache.commons.codec.binary.Hex; |
|||
import org.apache.commons.lang3.StringEscapeUtils; |
|||
import org.apache.tomcat.util.codec.binary.Base64; |
|||
|
|||
import java.io.UnsupportedEncodingException; |
|||
import java.net.URLDecoder; |
|||
import java.net.URLEncoder; |
|||
import java.security.MessageDigest; |
|||
import java.security.NoSuchAlgorithmException; |
|||
|
|||
/** |
|||
* 封装各种格式的编码解码工具类. 1.Commons-Codec的 hex/base64 编码 2.自制的base62 编码 |
|||
* 3.Commons-Lang的xml/html escape 4.JDK提供的URLEncoder |
|||
* |
|||
* @author dimengzhe |
|||
* @date 2020/9/11 13:38 |
|||
* @description 编码解码工具类 |
|||
*/ |
|||
|
|||
public class Encodes { |
|||
|
|||
private static final String DEFAULT_URL_ENCODING = "UTF-8"; |
|||
private static final char[] BASE62 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".toCharArray(); |
|||
private static final String SALT = "jlzx@yxt?"; |
|||
|
|||
/** |
|||
* Hex编码. |
|||
*/ |
|||
public static String encodeHex(byte[] input) { |
|||
return new String(Hex.encodeHex(input)); |
|||
} |
|||
|
|||
/** |
|||
* Hex解码. |
|||
*/ |
|||
public static byte[] decodeHex(String input) { |
|||
try { |
|||
return Hex.decodeHex(input.toCharArray()); |
|||
} catch (DecoderException e) { |
|||
throw Exceptions.unchecked(e); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Base64编码. |
|||
*/ |
|||
public static String encodeBase64(byte[] input) { |
|||
return new String(Base64.encodeBase64(input)); |
|||
} |
|||
|
|||
/** |
|||
* Base64编码. |
|||
*/ |
|||
public static String encodeBase64(String input) { |
|||
try { |
|||
return new String(Base64.encodeBase64(input.getBytes(DEFAULT_URL_ENCODING))); |
|||
} catch (UnsupportedEncodingException e) { |
|||
return ""; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Base64解码. |
|||
*/ |
|||
public static byte[] decodeBase64(String input) { |
|||
return Base64.decodeBase64(input.getBytes()); |
|||
} |
|||
|
|||
/** |
|||
* Base64解码. |
|||
*/ |
|||
public static String decodeBase64String(String input) { |
|||
try { |
|||
return new String(Base64.decodeBase64(input.getBytes()), DEFAULT_URL_ENCODING); |
|||
} catch (UnsupportedEncodingException e) { |
|||
return ""; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Base62编码。 |
|||
*/ |
|||
public static String encodeBase62(byte[] input) { |
|||
char[] chars = new char[input.length]; |
|||
for (int i = 0; i < input.length; i++) { |
|||
chars[i] = BASE62[((input[i] & 0xFF) % BASE62.length)]; |
|||
} |
|||
return new String(chars); |
|||
} |
|||
|
|||
/** |
|||
* Html 转码. |
|||
*/ |
|||
public static String escapeHtml(String html) { |
|||
return StringEscapeUtils.escapeHtml4(html); |
|||
} |
|||
|
|||
/** |
|||
* Html 解码. |
|||
*/ |
|||
public static String unescapeHtml(String htmlEscaped) { |
|||
return StringEscapeUtils.unescapeHtml4(htmlEscaped); |
|||
} |
|||
|
|||
/** |
|||
* Xml 转码. |
|||
*/ |
|||
public static String escapeXml(String xml) { |
|||
return StringEscapeUtils.escapeXml10(xml); |
|||
} |
|||
|
|||
/** |
|||
* Xml 解码. |
|||
*/ |
|||
public static String unescapeXml(String xmlEscaped) { |
|||
return StringEscapeUtils.unescapeXml(xmlEscaped); |
|||
} |
|||
|
|||
/** |
|||
* URL 编码, Encode默认为UTF-8. |
|||
*/ |
|||
public static String urlEncode(String part) { |
|||
try { |
|||
return URLEncoder.encode(part, DEFAULT_URL_ENCODING); |
|||
} catch (UnsupportedEncodingException e) { |
|||
throw Exceptions.unchecked(e); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* URL 解码, Encode默认为UTF-8. |
|||
*/ |
|||
public static String urlDecode(String part) { |
|||
|
|||
try { |
|||
return URLDecoder.decode(part, DEFAULT_URL_ENCODING); |
|||
} catch (UnsupportedEncodingException e) { |
|||
throw Exceptions.unchecked(e); |
|||
} |
|||
} |
|||
|
|||
public static String md5(String str) { |
|||
return digest("MD5", str + SALT); |
|||
} |
|||
|
|||
public static String sha1(CharSequence cs) { |
|||
return digest("SHA1", cs); |
|||
} |
|||
|
|||
public static String digest(String algorithm, CharSequence cs) { |
|||
return digest(algorithm, StringUtils.getBytesUTF8(null == cs ? "" : cs), null, 1); |
|||
} |
|||
|
|||
public static String digest(String algorithm, byte[] bytes, byte[] salt, int iterations) { |
|||
try { |
|||
MessageDigest md = MessageDigest.getInstance(algorithm); |
|||
if (salt != null) { |
|||
md.update(salt); |
|||
} |
|||
byte[] hashBytes = md.digest(bytes); |
|||
for (int i = 1; i < iterations; i++) { |
|||
md.reset(); |
|||
hashBytes = md.digest(hashBytes); |
|||
} |
|||
return fixedHexString(hashBytes); |
|||
} catch (NoSuchAlgorithmException e) { |
|||
throw Exceptions.unchecked(e); |
|||
} |
|||
} |
|||
|
|||
public static String fixedHexString(byte[] hashBytes) { |
|||
StringBuffer sb = new StringBuffer(); |
|||
for (int i = 0; i < hashBytes.length; i++) { |
|||
sb.append(Integer.toString((hashBytes[i] & 0xFF) + 256, 16).substring(1)); |
|||
} |
|||
|
|||
return sb.toString(); |
|||
} |
|||
|
|||
public static String md5(String str, boolean isShort) { |
|||
if (isShort) { |
|||
return md5(str).substring(8, 24); |
|||
} |
|||
return md5(str); |
|||
} |
|||
} |
@ -0,0 +1,74 @@ |
|||
package com.yxt.demo.common.utils.allutils; |
|||
|
|||
import javax.servlet.http.HttpServletRequest; |
|||
import java.io.PrintWriter; |
|||
import java.io.StringWriter; |
|||
import java.lang.reflect.InvocationTargetException; |
|||
|
|||
/** |
|||
* 关于异常的工具类. |
|||
* |
|||
* @author dimengzhe |
|||
* @date 2020/9/11 13:44 |
|||
* @description |
|||
*/ |
|||
|
|||
public class Exceptions { |
|||
|
|||
/** |
|||
* 将CheckedException转换为UncheckedException. |
|||
*/ |
|||
public static RuntimeException unchecked(Throwable e) { |
|||
if ((e instanceof RuntimeException)) { |
|||
return (RuntimeException) e; |
|||
} |
|||
if ((e instanceof InvocationTargetException)) { |
|||
return unchecked(((InvocationTargetException) e).getTargetException()); |
|||
} |
|||
return new RuntimeException(e); |
|||
} |
|||
|
|||
/** |
|||
* 将ErrorStack转化为String. |
|||
*/ |
|||
public static String getStackTraceAsString(Throwable e) { |
|||
if (e == null) { |
|||
return ""; |
|||
} |
|||
StringWriter stringWriter = new StringWriter(); |
|||
e.printStackTrace(new PrintWriter(stringWriter)); |
|||
return stringWriter.toString(); |
|||
} |
|||
|
|||
/** |
|||
* 判断异常是否由某些底层的异常引起. |
|||
*/ |
|||
public static boolean isCausedBy(Exception ex, Class<? extends Exception>... causeExceptionClasses) { |
|||
Throwable cause = ex.getCause(); |
|||
while (cause != null) { |
|||
for (Class<? extends Exception> causeClass : causeExceptionClasses) { |
|||
if (causeClass.isInstance(cause)) { |
|||
return true; |
|||
} |
|||
} |
|||
cause = cause.getCause(); |
|||
} |
|||
return false; |
|||
} |
|||
|
|||
/** |
|||
* 在request中获取异常类 |
|||
* |
|||
* @param request |
|||
* @return |
|||
*/ |
|||
public static Throwable getThrowable(HttpServletRequest request) { |
|||
Throwable ex = null; |
|||
if (request.getAttribute("exception") != null) { |
|||
ex = (Throwable) request.getAttribute("exception"); |
|||
} else if (request.getAttribute("javax.servlet.error.exception") != null) { |
|||
ex = (Throwable) request.getAttribute("javax.servlet.error.exception"); |
|||
} |
|||
return ex; |
|||
} |
|||
} |
@ -0,0 +1,395 @@ |
|||
package com.yxt.demo.common.utils.allutils; |
|||
|
|||
import org.apache.commons.lang3.StringEscapeUtils; |
|||
|
|||
import javax.servlet.http.HttpServletRequest; |
|||
import java.io.UnsupportedEncodingException; |
|||
import java.math.BigDecimal; |
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
import java.util.regex.Matcher; |
|||
import java.util.regex.Pattern; |
|||
|
|||
/** |
|||
* @author dimengzhe |
|||
* @date 2020/9/18 9:35 |
|||
* @description |
|||
*/ |
|||
|
|||
public class StringUtils extends org.apache.commons.lang3.StringUtils { |
|||
|
|||
private static final char SEPARATOR = '_'; |
|||
private static final String CHARSET_NAME = "UTF-8"; |
|||
|
|||
public static boolean isNull(Object obj) { |
|||
return obj == null; |
|||
} |
|||
|
|||
public static boolean isNotNull(Object obj) { |
|||
return !isNull(obj); |
|||
} |
|||
|
|||
/** |
|||
* 转换为字节数组 |
|||
* |
|||
* @param str 字符串 |
|||
* @return |
|||
*/ |
|||
public static byte[] getBytes(String str) { |
|||
if (str != null) { |
|||
try { |
|||
return str.getBytes(CHARSET_NAME); |
|||
} catch (UnsupportedEncodingException e) { |
|||
return null; |
|||
} |
|||
} else { |
|||
return null; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 转换为字节数组 |
|||
* |
|||
* @param bytes |
|||
* @return |
|||
*/ |
|||
public static String toString(byte[] bytes) { |
|||
try { |
|||
return new String(bytes, CHARSET_NAME); |
|||
} catch (UnsupportedEncodingException e) { |
|||
return EMPTY; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 是否包含字符串 |
|||
* |
|||
* @param str 验证字符串 |
|||
* @param strs 字符串组 |
|||
* @return 包含返回true |
|||
*/ |
|||
public static boolean inString(String str, String... strs) { |
|||
if (str != null) { |
|||
for (String s : strs) { |
|||
if (str.equals(trim(s))) { |
|||
return true; |
|||
} |
|||
} |
|||
} |
|||
return false; |
|||
} |
|||
|
|||
/** |
|||
* 替换掉HTML标签方法 |
|||
*/ |
|||
public static String replaceHtml(String html) { |
|||
if (isBlank(html)) { |
|||
return ""; |
|||
} |
|||
String regEx = "<.+?>"; |
|||
Pattern p = Pattern.compile(regEx); |
|||
Matcher m = p.matcher(html); |
|||
String s = m.replaceAll(""); |
|||
return s; |
|||
} |
|||
|
|||
/** |
|||
* 替换为手机识别的HTML,去掉样式及属性,保留回车。 |
|||
* |
|||
* @param html |
|||
* @return |
|||
*/ |
|||
public static String replaceMobileHtml(String html) { |
|||
if (html == null) { |
|||
return ""; |
|||
} |
|||
return html.replaceAll("<([a-z]+?)\\s+?.*?>", "<$1>"); |
|||
} |
|||
|
|||
/** |
|||
* 替换为手机识别的HTML,去掉样式及属性,保留回车。 |
|||
* |
|||
* @param txt |
|||
* @return |
|||
*/ |
|||
public static String toHtml(String txt) { |
|||
if (txt == null) { |
|||
return ""; |
|||
} |
|||
return replace(replace(Encodes.escapeHtml(txt), "\n", "<br/>"), "\t", " "); |
|||
} |
|||
|
|||
/** |
|||
* 缩略字符串(不区分中英文字符) |
|||
* |
|||
* @param str 目标字符串 |
|||
* @param length 截取长度 |
|||
* @return |
|||
*/ |
|||
public static String abbr(String str, int length) { |
|||
if (str == null) { |
|||
return ""; |
|||
} |
|||
try { |
|||
StringBuilder sb = new StringBuilder(); |
|||
int currentLength = 0; |
|||
for (char c : replaceHtml(StringEscapeUtils.unescapeHtml4(str)).toCharArray()) { |
|||
currentLength += String.valueOf(c).getBytes("GBK").length; |
|||
if (currentLength <= length - 3) { |
|||
sb.append(c); |
|||
} else { |
|||
sb.append("..."); |
|||
break; |
|||
} |
|||
} |
|||
return sb.toString(); |
|||
} catch (UnsupportedEncodingException e) { |
|||
e.printStackTrace(); |
|||
} |
|||
return ""; |
|||
} |
|||
|
|||
public static String abbr2(String param, int length) { |
|||
if (param == null) { |
|||
return ""; |
|||
} |
|||
StringBuffer result = new StringBuffer(); |
|||
int n = 0; |
|||
char temp; |
|||
boolean isCode = false; // 是不是HTML代码
|
|||
boolean isHTML = false; // 是不是HTML特殊字符,如
|
|||
for (int i = 0; i < param.length(); i++) { |
|||
temp = param.charAt(i); |
|||
if (temp == '<') { |
|||
isCode = true; |
|||
} else if (temp == '&') { |
|||
isHTML = true; |
|||
} else if (temp == '>' && isCode) { |
|||
n = n - 1; |
|||
isCode = false; |
|||
} else if (temp == ';' && isHTML) { |
|||
isHTML = false; |
|||
} |
|||
try { |
|||
if (!isCode && !isHTML) { |
|||
n += String.valueOf(temp).getBytes("GBK").length; |
|||
} |
|||
} catch (UnsupportedEncodingException e) { |
|||
e.printStackTrace(); |
|||
} |
|||
|
|||
if (n <= length - 3) { |
|||
result.append(temp); |
|||
} else { |
|||
result.append("..."); |
|||
break; |
|||
} |
|||
} |
|||
// 取出截取字符串中的HTML标记
|
|||
String temp_result = result.toString().replaceAll("(>)[^<>]*(<?)", "$1$2"); |
|||
// 去掉不需要结素标记的HTML标记
|
|||
temp_result = temp_result.replaceAll( |
|||
"</?(AREA|BASE|BASEFONT|BODY|BR|COL|COLGROUP|DD|DT|FRAME|HEAD|HR|HTML|IMG|INPUT|ISINDEX|LI|LINK|META|OPTION|P|PARAM|TBODY|TD|TFOOT|TH|THEAD|TR|area|base|basefont|body|br|col|colgroup|dd|dt|frame|head|hr|html|img|input|isindex|li|link|meta|option|p|param|tbody|td|tfoot|th|thead|tr)[^<>]*/?>", |
|||
""); |
|||
// 去掉成对的HTML标记
|
|||
temp_result = temp_result.replaceAll("<([a-zA-Z]+)[^<>]*>(.*?)</\\1>", "$2"); |
|||
// 用正则表达式取出标记
|
|||
Pattern p = Pattern.compile("<([a-zA-Z]+)[^<>]*>"); |
|||
Matcher m = p.matcher(temp_result); |
|||
List<String> endHTML = new ArrayList<String>(); |
|||
while (m.find()) { |
|||
endHTML.add(m.group(1)); |
|||
} |
|||
// 补全不成对的HTML标记
|
|||
for (int i = endHTML.size() - 1; i >= 0; i--) { |
|||
result.append("</"); |
|||
result.append(endHTML.get(i)); |
|||
result.append(">"); |
|||
} |
|||
return result.toString(); |
|||
} |
|||
|
|||
/** |
|||
* 转换为Double类型 |
|||
*/ |
|||
public static Double toDouble(Object val) { |
|||
if (val == null) { |
|||
return 0D; |
|||
} |
|||
try { |
|||
return Double.valueOf(trim(val.toString())); |
|||
} catch (Exception e) { |
|||
return 0D; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 转换为Float类型 |
|||
*/ |
|||
public static Float toFloat(Object val) { |
|||
return toDouble(val).floatValue(); |
|||
} |
|||
|
|||
/** |
|||
* 转换为Long类型 |
|||
*/ |
|||
public static Long toLong(Object val) { |
|||
return toDouble(val).longValue(); |
|||
} |
|||
|
|||
/** |
|||
* 转换为Integer类型 |
|||
*/ |
|||
public static Integer toInteger(Object val) { |
|||
return toLong(val).intValue(); |
|||
} |
|||
|
|||
/** |
|||
* 转换为BigDecimal类型 |
|||
*/ |
|||
public static BigDecimal toBigDecimal(String val) { |
|||
if (StringUtils.isBlank(val)) { |
|||
return null; |
|||
} |
|||
BigDecimal bd = new BigDecimal(val); |
|||
return bd; |
|||
} |
|||
|
|||
/** |
|||
* 获得用户远程地址 |
|||
*/ |
|||
public static String getRemoteAddr(HttpServletRequest request) { |
|||
String remoteAddr = request.getHeader("X-Real-IP"); |
|||
if (isNotBlank(remoteAddr)) { |
|||
remoteAddr = request.getHeader("X-Forwarded-For"); |
|||
} else if (isNotBlank(remoteAddr)) { |
|||
remoteAddr = request.getHeader("Proxy-Client-IP"); |
|||
} else if (isNotBlank(remoteAddr)) { |
|||
remoteAddr = request.getHeader("WL-Proxy-Client-IP"); |
|||
} |
|||
return remoteAddr != null ? remoteAddr : request.getRemoteAddr(); |
|||
} |
|||
|
|||
/** |
|||
* 驼峰命名法工具 |
|||
* |
|||
* @return toCamelCase(" hello_world ") == "helloWorld" |
|||
* toCapitalizeCamelCase("hello_world") == "HelloWorld" |
|||
* toUnderScoreCase("helloWorld") = "hello_world" |
|||
*/ |
|||
public static String toCamelCase(String s) { |
|||
if (s == null) { |
|||
return null; |
|||
} |
|||
|
|||
s = s.toLowerCase(); |
|||
|
|||
StringBuilder sb = new StringBuilder(s.length()); |
|||
boolean upperCase = false; |
|||
for (int i = 0; i < s.length(); i++) { |
|||
char c = s.charAt(i); |
|||
|
|||
if (c == SEPARATOR) { |
|||
upperCase = true; |
|||
} else if (upperCase) { |
|||
sb.append(Character.toUpperCase(c)); |
|||
upperCase = false; |
|||
} else { |
|||
sb.append(c); |
|||
} |
|||
} |
|||
|
|||
return sb.toString(); |
|||
} |
|||
|
|||
/** |
|||
* 驼峰命名法工具 |
|||
* |
|||
* @return toCamelCase(" hello_world ") == "helloWorld" |
|||
* toCapitalizeCamelCase("hello_world") == "HelloWorld" |
|||
* toUnderScoreCase("helloWorld") = "hello_world" |
|||
*/ |
|||
public static String toCapitalizeCamelCase(String s) { |
|||
if (s == null) { |
|||
return null; |
|||
} |
|||
s = toCamelCase(s); |
|||
return s.substring(0, 1).toUpperCase() + s.substring(1); |
|||
} |
|||
|
|||
/** |
|||
* 驼峰命名法工具 |
|||
* |
|||
* @return toCamelCase(" hello_world ") == "helloWorld" |
|||
* toCapitalizeCamelCase("hello_world") == "HelloWorld" |
|||
* toUnderScoreCase("helloWorld") = "hello_world" |
|||
*/ |
|||
public static String toUnderScoreCase(String s) { |
|||
if (s == null) { |
|||
return null; |
|||
} |
|||
|
|||
StringBuilder sb = new StringBuilder(); |
|||
boolean upperCase = false; |
|||
for (int i = 0; i < s.length(); i++) { |
|||
char c = s.charAt(i); |
|||
|
|||
boolean nextUpperCase = true; |
|||
|
|||
if (i < (s.length() - 1)) { |
|||
nextUpperCase = Character.isUpperCase(s.charAt(i + 1)); |
|||
} |
|||
|
|||
if ((i > 0) && Character.isUpperCase(c)) { |
|||
if (!upperCase || !nextUpperCase) { |
|||
sb.append(SEPARATOR); |
|||
} |
|||
upperCase = true; |
|||
} else { |
|||
upperCase = false; |
|||
} |
|||
|
|||
sb.append(Character.toLowerCase(c)); |
|||
} |
|||
|
|||
return sb.toString(); |
|||
} |
|||
|
|||
/** |
|||
* 如果不为空,则设置值 |
|||
* |
|||
* @param target |
|||
* @param source |
|||
*/ |
|||
public static void setValueIfNotBlank(String target, String source) { |
|||
if (isNotBlank(source)) { |
|||
target = source; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 转换为JS获取对象值,生成三目运算返回结果 |
|||
* |
|||
* @param objectString 对象串 例如:row.user.id |
|||
* 返回:!row?'':!row.user?'':!row.user.id?'':row.user.id |
|||
*/ |
|||
public static String jsGetVal(String objectString) { |
|||
StringBuilder result = new StringBuilder(); |
|||
StringBuilder val = new StringBuilder(); |
|||
String[] vals = split(objectString, "."); |
|||
for (int i = 0; i < vals.length; i++) { |
|||
val.append("." + vals[i]); |
|||
result.append("!" + (val.substring(1)) + "?'':"); |
|||
} |
|||
result.append(val.substring(1)); |
|||
return result.toString(); |
|||
} |
|||
|
|||
public static byte[] getBytesUTF8(CharSequence cs) { |
|||
try { |
|||
return cs.toString().getBytes("UTF-8"); |
|||
} catch (UnsupportedEncodingException e) { |
|||
throw Exceptions.unchecked(e); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,52 @@ |
|||
package com.yxt.demo.common.utils.jwt; |
|||
|
|||
import com.auth0.jwt.JWT; |
|||
import com.auth0.jwt.algorithms.Algorithm; |
|||
import com.auth0.jwt.interfaces.DecodedJWT; |
|||
import lombok.Data; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
|
|||
import java.util.Date; |
|||
|
|||
@Data |
|||
@Slf4j |
|||
public class JWTUtil { |
|||
|
|||
private static final String TOKEN_SECRET = "yXtJLzxh2bGciO5iJIUzI1NiJ9"; |
|||
private static final String ISS = "WBK"; |
|||
private static final String USERNO = "userNo"; |
|||
private static final Long TIME = 24 * 3600 * 1000L; // 1天
|
|||
|
|||
//创建Token
|
|||
public static String create(String userNo) { |
|||
try { |
|||
return JWT |
|||
.create() |
|||
.withIssuer(ISS) |
|||
.withClaim(USERNO, userNo) |
|||
.withExpiresAt(new Date(System.currentTimeMillis() + TIME)) |
|||
.sign(Algorithm.HMAC256(TOKEN_SECRET)); |
|||
} catch (Exception e) { |
|||
log.error("JWT生成失败", e); |
|||
return e.getMessage(); |
|||
} |
|||
} |
|||
|
|||
//解析Token
|
|||
public static DecodedJWT verify(String token) throws Exception { |
|||
return JWT |
|||
.require(Algorithm.HMAC256(TOKEN_SECRET)) |
|||
.withIssuer(ISS) |
|||
.build() |
|||
.verify(token); |
|||
} |
|||
|
|||
//根据解析生成的Token返回userNo
|
|||
public static Long getUserNo(DecodedJWT decodedJWT) { |
|||
return Long.parseLong(decodedJWT.getClaim(USERNO).asString()); |
|||
} |
|||
|
|||
public static String getUserSid(DecodedJWT decodedJWT) { |
|||
return decodedJWT.getClaim(USERNO).asString(); |
|||
} |
|||
} |
@ -0,0 +1,34 @@ |
|||
package com.yxt.demo.system.api.dict_common; |
|||
|
|||
import com.yxt.demo.common.core.dto.Dto; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 15:34 |
|||
* @Description |
|||
*/ |
|||
@Data |
|||
public class DictCommonDto implements Dto { |
|||
|
|||
private String sid; |
|||
|
|||
@ApiModelProperty(value = "数据项值", required = true) |
|||
@NotBlank(message = "数据项值不能为空") |
|||
private String dictKey; |
|||
|
|||
@ApiModelProperty(value = "数据类型", required = true) |
|||
@NotBlank(message = "数据类型不能为空") |
|||
private String dictType; |
|||
|
|||
@ApiModelProperty(value = "数据项相对应的value值", required = true) |
|||
@NotBlank(message = "数据项相对应的value值不能为空") |
|||
private String dictValue; |
|||
|
|||
@ApiModelProperty(value = "数据项的父级sid", required = true) |
|||
@NotBlank(message = "数据项的父级sid不能为空") |
|||
private String parentSid; |
|||
} |
@ -0,0 +1,45 @@ |
|||
package com.yxt.demo.system.api.dict_common; |
|||
|
|||
import com.yxt.demo.common.core.query.PagerQuery; |
|||
import com.yxt.demo.common.core.result.ResultBean; |
|||
import com.yxt.demo.common.core.vo.PagerVo; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import io.swagger.annotations.ApiParam; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.validation.Valid; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:16 |
|||
* @Description |
|||
*/ |
|||
@Api(tags = "数据字典数据项") |
|||
@FeignClient( |
|||
contextId = "demo-system-DictCommon", |
|||
name = "demo-system", |
|||
path = "v1/DictCommon", |
|||
fallback = DictCommonFeignFallback.class) |
|||
public interface DictCommonFeign { |
|||
|
|||
@PostMapping(value = "/save") |
|||
@ApiOperation(value = "数据字典数据项保存") |
|||
ResultBean save(@Valid @RequestBody DictCommonDto dictCommonDto); |
|||
|
|||
@DeleteMapping("/delete/{sid}") |
|||
@ApiOperation(value = "删除") |
|||
ResultBean delete(@ApiParam(value = "数据项sid", required = true) @PathVariable("sid") String sid); |
|||
|
|||
@PostMapping("/pageList") |
|||
@ApiOperation(value = "数据字典数据项分页列表") |
|||
ResultBean<PagerVo<DictCommonVo>> pageList(@RequestBody PagerQuery<DictCommonQuery> pagerQuery); |
|||
|
|||
@GetMapping("/typeValues") |
|||
@ApiOperation("下拉框的获取") |
|||
ResultBean<List<DictCommonVo>> getTypeValues(@RequestParam("type") String type, @RequestParam(value = "psid", defaultValue = "0") String psid); |
|||
|
|||
|
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.yxt.demo.system.api.dict_common; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:46 |
|||
* @Description |
|||
*/ |
|||
public class DictCommonFeignFallback { |
|||
} |
@ -0,0 +1,24 @@ |
|||
package com.yxt.demo.system.api.dict_common; |
|||
|
|||
import com.yxt.demo.common.core.query.Query; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 16:20 |
|||
* @Description |
|||
*/ |
|||
@Data |
|||
public class DictCommonQuery implements Query { |
|||
private static final long serialVersionUID = 6235063340152975098L; |
|||
|
|||
@ApiModelProperty(value = "数据字典条目key", required = false) |
|||
private String dictKey; |
|||
|
|||
@ApiModelProperty(value = "数据字典文本", required = false) |
|||
private String dictValue; |
|||
|
|||
@ApiModelProperty(value = "dictType") |
|||
private String dictType; |
|||
} |
@ -0,0 +1,21 @@ |
|||
package com.yxt.demo.system.api.dict_common; |
|||
|
|||
import com.yxt.demo.common.core.query.Query; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author dimengzhe |
|||
* @date 2021/9/30 15:33 |
|||
* @description 下拉框条件 |
|||
*/ |
|||
@Data |
|||
public class DictCommonTypeQuery implements Query { |
|||
private static final long serialVersionUID = 139959085226402464L; |
|||
|
|||
@ApiModelProperty(value = "数据字典类型", required = true) |
|||
private String type; |
|||
|
|||
@ApiModelProperty(value = "psid", required = false, example = "0") |
|||
private String psid; |
|||
} |
@ -0,0 +1,29 @@ |
|||
package com.yxt.demo.system.api.dict_common; |
|||
|
|||
import com.yxt.demo.common.core.vo.Vo; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 16:19 |
|||
* @Description |
|||
*/ |
|||
@Data |
|||
public class DictCommonVo implements Vo { |
|||
|
|||
private static final long serialVersionUID = 5516430679944504663L; |
|||
@ApiModelProperty(value = "数据字典项key") |
|||
private String dictKey; |
|||
|
|||
@ApiModelProperty(value = "数据字典类型") |
|||
private String dictType; |
|||
|
|||
@ApiModelProperty(value = "数据字典项名称") |
|||
private String dictValue; |
|||
@ApiModelProperty(value = "父级sid:0为第一级") |
|||
private String parentSid; |
|||
|
|||
private String sid; |
|||
|
|||
} |
@ -0,0 +1,30 @@ |
|||
package com.yxt.demo.system.api.dict_type; |
|||
|
|||
import com.yxt.demo.common.core.dto.Dto; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 16:48 |
|||
* @Description |
|||
*/ |
|||
@Data |
|||
public class DictTypeDto implements Dto { |
|||
private static final long serialVersionUID = -7638091202643596231L; |
|||
|
|||
@ApiModelProperty(value = "类型代码", required = true) |
|||
@NotBlank(message = "类型代码不能为空") |
|||
private String dictTypeCode; |
|||
|
|||
@ApiModelProperty(value = "类型名称", required = true) |
|||
@NotBlank(message = "类型名称不能为空") |
|||
private String dictTypeName; |
|||
|
|||
@ApiModelProperty(value = "类型说明", required = false) |
|||
private String remarks; |
|||
|
|||
private String sid; |
|||
} |
@ -0,0 +1,40 @@ |
|||
package com.yxt.demo.system.api.dict_type; |
|||
|
|||
import com.yxt.demo.common.core.query.PagerQuery; |
|||
import com.yxt.demo.common.core.result.ResultBean; |
|||
import com.yxt.demo.common.core.vo.PagerVo; |
|||
import com.yxt.demo.system.api.dict_common.DictCommonFeignFallback; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import io.swagger.annotations.ApiParam; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.validation.Valid; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:21 |
|||
* @Description |
|||
*/ |
|||
@Api(tags = "数据字典数据项") |
|||
@FeignClient( |
|||
contextId = "demo-system-DictType", |
|||
name = "demo-system", |
|||
path = "v1/DictType", |
|||
fallback = DictTypeFeignFallback.class) |
|||
public interface DictTypeFeign { |
|||
|
|||
@PostMapping(value = "/save") |
|||
@ResponseBody |
|||
@ApiOperation(value = "数据字典类型保存") |
|||
ResultBean save(@Valid @RequestBody DictTypeDto dictTypeDto); |
|||
|
|||
@PostMapping("/pageList") |
|||
@ApiOperation(value = "数据字典类型分页列表") |
|||
ResultBean<PagerVo<DictTypeVo>> pageList(@RequestBody PagerQuery<DictTypeQuery> pagerQuery); |
|||
|
|||
@DeleteMapping("/delete/{sid}") |
|||
@ApiOperation(value = "数据字典类型删除") |
|||
ResultBean delete(@ApiParam(value = "sid", required = true) @PathVariable("sid") String sid); |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.yxt.demo.system.api.dict_type; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:47 |
|||
* @Description |
|||
*/ |
|||
public class DictTypeFeignFallback { |
|||
} |
@ -0,0 +1,23 @@ |
|||
package com.yxt.demo.system.api.dict_type; |
|||
|
|||
import com.yxt.demo.common.core.query.Query; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 17:15 |
|||
* @Description |
|||
*/ |
|||
@Data |
|||
public class DictTypeQuery implements Query { |
|||
|
|||
@ApiModelProperty(value = "数据字典code", required = false) |
|||
private String dictTypeCode; |
|||
|
|||
@ApiModelProperty(value = "数据分类名称", required = false) |
|||
private String dictTypeName; |
|||
|
|||
@ApiModelProperty(value = "说明", required = false) |
|||
private String remarks; |
|||
} |
@ -0,0 +1,27 @@ |
|||
package com.yxt.demo.system.api.dict_type; |
|||
|
|||
import com.yxt.demo.common.core.vo.Vo; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 17:16 |
|||
* @Description |
|||
*/ |
|||
@Data |
|||
public class DictTypeVo implements Vo { |
|||
private static final long serialVersionUID = -3404457483419237424L; |
|||
|
|||
@ApiModelProperty(value = "数据类型sid") |
|||
private String sid; |
|||
|
|||
@ApiModelProperty(value = "类型代码") |
|||
private String dictTypeCode; |
|||
|
|||
@ApiModelProperty(value = "类型名称") |
|||
private String dictTypeName; |
|||
|
|||
@ApiModelProperty(value = "说明") |
|||
private String remarks; |
|||
} |
@ -0,0 +1,21 @@ |
|||
package com.yxt.demo.system.api.sys_forum; |
|||
|
|||
import com.yxt.demo.system.api.dict_type.DictTypeFeignFallback; |
|||
import io.swagger.annotations.Api; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:21 |
|||
* @Description |
|||
*/ |
|||
@Api(tags = "论坛") |
|||
@FeignClient( |
|||
contextId = "demo-system-SysForum", |
|||
name = "demo-system", |
|||
path = "v1/sysforum", |
|||
fallback = SysForumFeignFallback.class) |
|||
public interface SysForumFeign { |
|||
|
|||
|
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.yxt.demo.system.api.sys_forum; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:47 |
|||
* @Description |
|||
*/ |
|||
public class SysForumFeignFallback { |
|||
} |
@ -0,0 +1,19 @@ |
|||
package com.yxt.demo.system.api.sys_forum_comment; |
|||
|
|||
import com.yxt.demo.system.api.sys_forum.SysForumFeignFallback; |
|||
import io.swagger.annotations.Api; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:22 |
|||
* @Description |
|||
*/ |
|||
@Api(tags = "论坛评论") |
|||
@FeignClient( |
|||
contextId = "demo-system-SysForumComment", |
|||
name = "demo-system", |
|||
path = "v1/SysForumComment", |
|||
fallback = SysForumCommentFeignFallback.class) |
|||
public interface SysForumCommentFeign { |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.yxt.demo.system.api.sys_forum_comment; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 15:25 |
|||
* @Description |
|||
*/ |
|||
public class SysForumCommentFeignFallback { |
|||
} |
@ -0,0 +1,19 @@ |
|||
package com.yxt.demo.system.api.sys_info; |
|||
|
|||
import com.yxt.demo.system.api.sys_user.SysUserFeignFallback; |
|||
import io.swagger.annotations.Api; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 11:50 |
|||
* @Description |
|||
*/ |
|||
@Api(tags = "基础信息") |
|||
@FeignClient( |
|||
contextId = "demo-system-SysInfo", |
|||
name = "demo-system", |
|||
path = "v1/sysinfo", |
|||
fallback = SysInfoFeignFallback.class) |
|||
public interface SysInfoFeign { |
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.yxt.demo.system.api.sys_info; |
|||
|
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 11:53 |
|||
* @Description |
|||
*/ |
|||
@Component |
|||
public class SysInfoFeignFallback { |
|||
} |
@ -0,0 +1,19 @@ |
|||
package com.yxt.demo.system.api.sys_menu; |
|||
|
|||
import com.yxt.demo.system.api.sys_info.SysInfoFeignFallback; |
|||
import io.swagger.annotations.Api; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:08 |
|||
* @Description |
|||
*/ |
|||
@Api(tags = "菜单表") |
|||
@FeignClient( |
|||
contextId = "demo-system-SysMenu", |
|||
name = "demo-system", |
|||
path = "v1/sysmenu", |
|||
fallback = SysMenuFeignFallback.class) |
|||
public interface SysMenuFeign { |
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.yxt.demo.system.api.sys_menu; |
|||
|
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:09 |
|||
* @Description |
|||
*/ |
|||
@Component |
|||
public class SysMenuFeignFallback { |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.yxt.demo.system.api.sys_notice; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:23 |
|||
* @Description |
|||
*/ |
|||
public interface SysNoticeFeign { |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.yxt.demo.system.api.sys_plan; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:24 |
|||
* @Description |
|||
*/ |
|||
public interface SysPlanFeign { |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.yxt.demo.system.api.sys_plan_schedule; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:25 |
|||
* @Description |
|||
*/ |
|||
public interface SysPlanScheduleFeign { |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.yxt.demo.system.api.sys_resources; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:26 |
|||
* @Description |
|||
*/ |
|||
public interface SysResourcesFeign { |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.yxt.demo.system.api.sys_role; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:27 |
|||
* @Description |
|||
*/ |
|||
public interface SysRoleFeign { |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.yxt.demo.system.api.sys_score; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:28 |
|||
* @Description |
|||
*/ |
|||
public interface SysScoreFeign { |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.yxt.demo.system.api.sys_student_score; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:29 |
|||
* @Description |
|||
*/ |
|||
public interface SysStudentScoreFeign { |
|||
} |
@ -0,0 +1,35 @@ |
|||
package com.yxt.demo.system.api.sys_user; |
|||
|
|||
import com.yxt.demo.common.core.dto.Dto; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 11:28 |
|||
* @Description |
|||
*/ |
|||
@Data |
|||
public class SysUserDto implements Dto { |
|||
private static final long serialVersionUID = 2068661415449582838L; |
|||
|
|||
@ApiModelProperty("学号") |
|||
@NotBlank(message = "学号不能为空") |
|||
private String userName; |
|||
@ApiModelProperty("姓名") |
|||
@NotBlank(message = "姓名不能为空") |
|||
private String name; |
|||
@ApiModelProperty("密码") |
|||
@NotBlank(message = "密码不能为空") |
|||
private String password; |
|||
@ApiModelProperty("确认密码") |
|||
@NotBlank(message = "确认密码不能为空") |
|||
private String confirmPassword; |
|||
@ApiModelProperty("手机号") |
|||
@NotBlank(message = "手机号不能为空") |
|||
private String mobile; |
|||
|
|||
|
|||
} |
@ -0,0 +1,34 @@ |
|||
package com.yxt.demo.system.api.sys_user; |
|||
|
|||
import com.yxt.demo.common.core.result.ResultBean; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.ResponseBody; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 11:26 |
|||
* @Description |
|||
*/ |
|||
@Api(tags = "用户表") |
|||
@FeignClient( |
|||
contextId = "demo-system-SysUser", |
|||
name = "demo-system", |
|||
path = "v1/sysuser", |
|||
fallback = SysUserFeignFallback.class) |
|||
public interface SysUserFeign { |
|||
|
|||
@ApiOperation(value = "学生注册") |
|||
@PostMapping("/register") |
|||
ResultBean register(@RequestBody SysUserDto dto); |
|||
|
|||
|
|||
@ApiOperation(value = "登录") |
|||
@PostMapping("/login") |
|||
ResultBean login(@RequestBody SysUserLoginQuery query); |
|||
|
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.yxt.demo.system.api.sys_user; |
|||
|
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 11:28 |
|||
* @Description |
|||
*/ |
|||
@Component |
|||
public class SysUserFeignFallback { |
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.yxt.demo.system.api.sys_user; |
|||
|
|||
import com.yxt.demo.common.core.query.Query; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 13:36 |
|||
* @Description |
|||
*/ |
|||
@Data |
|||
public class SysUserLoginQuery implements Query { |
|||
private static final long serialVersionUID = 4963834204184842445L; |
|||
|
|||
@ApiModelProperty("工号") |
|||
private String userName; |
|||
@ApiModelProperty("密码") |
|||
private String password; |
|||
} |
@ -0,0 +1,28 @@ |
|||
package com.yxt.demo.system.biz.dict_common; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.Constants; |
|||
import com.yxt.demo.system.api.dict_common.DictCommon; |
|||
import com.yxt.demo.system.api.dict_common.DictCommonVo; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:17 |
|||
* @Description |
|||
*/ |
|||
@Mapper |
|||
public interface DictCommonMapper extends BaseMapper<DictCommon> { |
|||
DictCommon selectSize(@Param("dictKey") String dictKey, @Param("dictType") String dictType, @Param("parentSid") String parentSid); |
|||
|
|||
IPage<DictCommonVo> listPageVo(IPage<DictCommon> page, @Param(Constants.WRAPPER) QueryWrapper<DictCommon> qw); |
|||
|
|||
List<DictCommonVo> getValue(@Param(Constants.WRAPPER) QueryWrapper<DictCommonVo> qw); |
|||
|
|||
List<DictCommon> selectByType(String dictTypeCode); |
|||
} |
@ -0,0 +1,33 @@ |
|||
<?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.yxt.demo.system.biz.dict_common.DictCommonMapper"> |
|||
<select id="selectSize" resultType="com.yxt.demo.system.api.dict_common.DictCommon"> |
|||
SELECT * |
|||
FROM dict_common |
|||
WHERE dictKey = #{dictKey} |
|||
AND dictType = #{dictType} |
|||
AND parentSid = #{parentSid} |
|||
</select> |
|||
|
|||
<select id="listPageVo" resultType="com.yxt.demo.system.api.dict_common.DictCommonVo"> |
|||
select * |
|||
from dict_common |
|||
<where> |
|||
${ew.sqlSegment} |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="getValue" resultType="com.yxt.demo.system.api.dict_common.DictCommonVo"> |
|||
SELECT dc.sid, dc.dictType, dc.dictKey, dc.dictValue, dc.parentSid |
|||
FROM dict_common dc |
|||
<where> |
|||
${ew.sqlSegment} |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="selectByType" resultType="com.yxt.demo.system.api.dict_common.DictCommon"> |
|||
select * |
|||
from dict_common |
|||
where dictType = #{dictTypeCode} |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,58 @@ |
|||
package com.yxt.demo.system.biz.dict_common; |
|||
|
|||
import com.yxt.demo.common.core.query.PagerQuery; |
|||
import com.yxt.demo.common.core.result.ResultBean; |
|||
import com.yxt.demo.common.core.vo.PagerVo; |
|||
import com.yxt.demo.system.api.dict_common.*; |
|||
import io.swagger.annotations.Api; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.Collections; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:16 |
|||
* @Description |
|||
*/ |
|||
@Api(tags = "数据字典数据项") |
|||
@RestController |
|||
@RequestMapping("v1/DictCommon") |
|||
public class DictCommonRest implements DictCommonFeign { |
|||
|
|||
@Autowired |
|||
private DictCommonService dictCommonService; |
|||
|
|||
@Override |
|||
public ResultBean save(DictCommonDto dictCommonDto) { |
|||
return dictCommonService.saveOrUpdates(dictCommonDto); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean delete(String sid) { |
|||
return dictCommonService.delete(sid); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean<PagerVo<DictCommonVo>> pageList(PagerQuery<DictCommonQuery> pagerQuery) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
PagerVo<DictCommonVo> pv = dictCommonService.listPageVo(pagerQuery); |
|||
return rb.success().setData(pv); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean<List<DictCommonVo>> getTypeValues(String type, String psid) { |
|||
ResultBean<List<DictCommonVo>> rb = ResultBean.fireFail(); |
|||
DictCommonTypeQuery query = new DictCommonTypeQuery(); |
|||
query.setType(type); |
|||
query.setPsid(psid); |
|||
List<DictCommonVo> dictCommonVoList = dictCommonService.getValue(query); |
|||
dictCommonVoList.removeAll(Collections.singleton(null)); |
|||
if (dictCommonVoList.isEmpty()) { |
|||
return rb.setMsg("该类型无数据项"); |
|||
} |
|||
return rb.success().setData(dictCommonVoList); |
|||
} |
|||
} |
@ -0,0 +1,114 @@ |
|||
package com.yxt.demo.system.biz.dict_common; |
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.yxt.demo.common.core.query.PagerQuery; |
|||
import com.yxt.demo.common.core.result.ResultBean; |
|||
import com.yxt.demo.common.core.vo.PagerVo; |
|||
import com.yxt.demo.common.jdbc.service.MybatisBaseService; |
|||
import com.yxt.demo.common.jdbc.service.PagerUtil; |
|||
import com.yxt.demo.common.utils.convert.StringUtil; |
|||
import com.yxt.demo.system.api.dict_common.*; |
|||
import com.yxt.demo.system.api.sys_user.SysUser; |
|||
import com.yxt.demo.system.biz.dict_type.DictTypeService; |
|||
import com.yxt.demo.system.biz.sys_user.SysUserMapper; |
|||
import org.apache.commons.lang.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.context.annotation.Bean; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:17 |
|||
* @Description |
|||
*/ |
|||
@Service |
|||
public class DictCommonService extends MybatisBaseService<DictCommonMapper, DictCommon> { |
|||
|
|||
@Autowired |
|||
private DictTypeService dictTypeService; |
|||
|
|||
public ResultBean saveOrUpdates(DictCommonDto dictCommonDto) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
//数据类型
|
|||
String dictType = dictCommonDto.getDictType(); |
|||
//数据项值
|
|||
String dictKey = dictCommonDto.getDictKey(); |
|||
//父级sid
|
|||
String parentSid = dictCommonDto.getParentSid(); |
|||
if (StringUtils.isBlank(dictCommonDto.getSid())) { |
|||
int size = dictTypeService.selectSize(dictType); |
|||
if (size > 0) { |
|||
//根据数据类型和数据项值查询是否已存在
|
|||
DictCommon dc = baseMapper.selectSize(dictKey, dictType, parentSid); |
|||
if (dc != null) { |
|||
return rb.setMsg(dictType + "此类型的数据项已存在"); |
|||
} |
|||
//新增
|
|||
DictCommon dictCommon = new DictCommon(); |
|||
BeanUtil.copyProperties(dictCommonDto, dictCommon, "sid"); |
|||
baseMapper.insert(dictCommon); |
|||
} else { |
|||
return rb.setMsg("数据字典类型不存在"); |
|||
} |
|||
} else { |
|||
int size = dictTypeService.selectSize(dictType); |
|||
if (size > 0) { |
|||
//根据数据类型和数据项值查询是否已存在
|
|||
DictCommon dictCommon = fetchBySid(dictCommonDto.getSid()); |
|||
if (dictCommon == null) { |
|||
return rb.setMsg(dictType + "此类型的数据项不存在"); |
|||
} else { |
|||
if (!dictCommonDto.getSid().equals(dictCommon.getSid())) { |
|||
return rb.setMsg(dictType + "此类型的数据项已存在"); |
|||
} |
|||
} |
|||
BeanUtil.copyProperties(dictCommonDto, dictCommon, "sid"); |
|||
baseMapper.updateById(dictCommon); |
|||
} else { |
|||
return rb.setMsg("数据字典类型不存在"); |
|||
} |
|||
} |
|||
return rb.success(); |
|||
} |
|||
|
|||
public ResultBean delete(String sid) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
DictCommon dictCommon = fetchBySid(sid); |
|||
if (dictCommon == null) { |
|||
return rb.setMsg("该数据项不存在"); |
|||
} |
|||
deleteBySid(sid); |
|||
return rb.success(); |
|||
} |
|||
|
|||
public PagerVo<DictCommonVo> listPageVo(PagerQuery<DictCommonQuery> pagerQuery) { |
|||
IPage<DictCommon> page = PagerUtil.queryToPage(pagerQuery); |
|||
DictCommonQuery params = pagerQuery.getParams(); |
|||
QueryWrapper<DictCommon> qw = new QueryWrapper<>(); |
|||
if (params != null) { |
|||
|
|||
} |
|||
IPage<DictCommonVo> pagging = baseMapper.listPageVo(page, qw); |
|||
PagerVo<DictCommonVo> p = PagerUtil.pageToVo(pagging, null); |
|||
return p; |
|||
} |
|||
|
|||
public List<DictCommonVo> getValue(DictCommonTypeQuery query) { |
|||
QueryWrapper<DictCommonVo> qw = new QueryWrapper<>(); |
|||
if (StringUtils.isNotBlank(query.getType())) {//类型
|
|||
qw.eq("dc.dictType", query.getType()); |
|||
} |
|||
if (StringUtils.isNotBlank(query.getPsid())) {//父级sid
|
|||
qw.eq("dc.parentSid", query.getPsid()); |
|||
} |
|||
return baseMapper.getValue(qw); |
|||
} |
|||
|
|||
public List<DictCommon> selectByType(String dictTypeCode) { |
|||
return baseMapper.selectByType(dictTypeCode); |
|||
} |
|||
} |
@ -0,0 +1,29 @@ |
|||
package com.yxt.demo.system.biz.dict_type; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.Constants; |
|||
import com.yxt.demo.system.api.dict_common.DictCommon; |
|||
import com.yxt.demo.system.api.dict_type.DictType; |
|||
import com.yxt.demo.system.api.dict_type.DictTypeVo; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:20 |
|||
* @Description |
|||
*/ |
|||
@Mapper |
|||
public interface DictTypeMapper extends BaseMapper<DictType> { |
|||
/** |
|||
* 查询该类型代码存在的数量 |
|||
* |
|||
* @param dictType 类型代码 |
|||
* @return |
|||
*/ |
|||
int selectSize(String dictType); |
|||
|
|||
IPage<DictTypeVo> listPageVo(IPage<DictType> page, @Param(Constants.WRAPPER)QueryWrapper<DictType> qw); |
|||
} |
@ -0,0 +1,17 @@ |
|||
<?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.yxt.demo.system.biz.dict_type.DictTypeMapper"> |
|||
<select id="selectSize" resultType="int"> |
|||
SELECT COUNT(*) |
|||
FROM dict_type |
|||
WHERE dictTypeCode = #{dictTypeCode} |
|||
</select> |
|||
|
|||
<select id="listPageVo" resultType="com.yxt.demo.system.api.dict_type.DictTypeVo"> |
|||
select * |
|||
from dict_type |
|||
<where> |
|||
${ew.sqlSegment} |
|||
</where> |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,61 @@ |
|||
package com.yxt.demo.system.biz.dict_type; |
|||
|
|||
import com.yxt.demo.common.core.query.PagerQuery; |
|||
import com.yxt.demo.common.core.result.ResultBean; |
|||
import com.yxt.demo.common.core.vo.PagerVo; |
|||
import com.yxt.demo.system.api.dict_common.DictCommon; |
|||
import com.yxt.demo.system.api.dict_common.DictCommonVo; |
|||
import com.yxt.demo.system.api.dict_type.*; |
|||
import com.yxt.demo.system.biz.dict_common.DictCommonService; |
|||
import io.swagger.annotations.Api; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:20 |
|||
* @Description |
|||
*/ |
|||
@Api(tags = "数据字典数据类型") |
|||
@RestController |
|||
@RequestMapping("v1/DictType") |
|||
public class DictTypeRest implements DictTypeFeign { |
|||
|
|||
@Autowired |
|||
private DictTypeService dictTypeService; |
|||
@Autowired |
|||
private DictCommonService dictCommonService; |
|||
|
|||
@Override |
|||
public ResultBean save(DictTypeDto dictTypeDto) { |
|||
return dictTypeService.saveOrUpdates(dictTypeDto); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean<PagerVo<DictTypeVo>> pageList(PagerQuery<DictTypeQuery> pagerQuery) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
PagerVo<DictTypeVo> pv = dictTypeService.listPageVo(pagerQuery); |
|||
return rb.success().setData(pv); |
|||
} |
|||
|
|||
@Override |
|||
public ResultBean delete(String sid) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
DictType dictType = dictTypeService.fetchBySid(sid); |
|||
if (null == dictType) { |
|||
return rb.setMsg("该数据字典类型不存在"); |
|||
} |
|||
//查询该类型下是否存在数据项
|
|||
List<DictCommon> dictCommon = dictCommonService.selectByType(dictType.getDictTypeCode()); |
|||
if (dictCommon.size() > 0) { |
|||
return rb.setMsg("该数据字典类型下存在数据项,请先删除该类下的数据项"); |
|||
} |
|||
if (0 == dictTypeService.deleteBySid(sid)) { |
|||
return rb.setMsg("删除失败"); |
|||
} |
|||
return rb.setMsg("删除成功"); |
|||
} |
|||
} |
@ -0,0 +1,76 @@ |
|||
package com.yxt.demo.system.biz.dict_type; |
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.yxt.demo.common.core.query.PagerQuery; |
|||
import com.yxt.demo.common.core.result.ResultBean; |
|||
import com.yxt.demo.common.core.vo.PagerVo; |
|||
import com.yxt.demo.common.jdbc.service.MybatisBaseService; |
|||
import com.yxt.demo.common.jdbc.service.PagerUtil; |
|||
import com.yxt.demo.system.api.dict_common.DictCommon; |
|||
import com.yxt.demo.system.api.dict_common.DictCommonQuery; |
|||
import com.yxt.demo.system.api.dict_common.DictCommonVo; |
|||
import com.yxt.demo.system.api.dict_type.DictType; |
|||
import com.yxt.demo.system.api.dict_type.DictTypeDto; |
|||
import com.yxt.demo.system.api.dict_type.DictTypeQuery; |
|||
import com.yxt.demo.system.api.dict_type.DictTypeVo; |
|||
import org.apache.commons.lang.StringUtils; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:20 |
|||
* @Description |
|||
*/ |
|||
@Service |
|||
public class DictTypeService extends MybatisBaseService<DictTypeMapper, DictType> { |
|||
/** |
|||
* 查询该类型代码存在的数量 |
|||
* |
|||
* @param dictType 类型代码 |
|||
* @return |
|||
*/ |
|||
public int selectSize(String dictType) { |
|||
return baseMapper.selectSize(dictType); |
|||
} |
|||
|
|||
public ResultBean saveOrUpdates(DictTypeDto dictTypeDto) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
if (StringUtils.isBlank(dictTypeDto.getSid())) { |
|||
//判断数据字典类型是否已存在
|
|||
String dictTypeCode = dictTypeDto.getDictTypeCode(); |
|||
int size = baseMapper.selectSize(dictTypeCode); |
|||
if (size > 0) { |
|||
return rb.setMsg("数据类型代码已存在"); |
|||
} |
|||
DictType dictType = new DictType(); |
|||
BeanUtil.copyProperties(dictTypeDto, dictType, "sid"); |
|||
baseMapper.insert(dictType); |
|||
} else { |
|||
DictType dictType = fetchBySid(dictTypeDto.getSid()); |
|||
if (dictType == null) { |
|||
return rb.setMsg("数据类型不存在"); |
|||
} |
|||
if (!dictTypeDto.getDictTypeCode().equals(dictType.getDictTypeCode())) { |
|||
return rb.setMsg("数据字典类型的code值不允许修改"); |
|||
} |
|||
BeanUtil.copyProperties(dictTypeDto, dictType, "sid"); |
|||
baseMapper.updateById(dictType); |
|||
|
|||
} |
|||
return rb.success(); |
|||
} |
|||
|
|||
public PagerVo<DictTypeVo> listPageVo(PagerQuery<DictTypeQuery> pagerQuery) { |
|||
IPage<DictType> page = PagerUtil.queryToPage(pagerQuery); |
|||
DictTypeQuery params = pagerQuery.getParams(); |
|||
QueryWrapper<DictType> qw = new QueryWrapper<>(); |
|||
if (params != null) { |
|||
|
|||
} |
|||
IPage<DictTypeVo> pagging = baseMapper.listPageVo(page, qw); |
|||
PagerVo<DictTypeVo> p = PagerUtil.pageToVo(pagging, null); |
|||
return p; |
|||
} |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.yxt.demo.system.biz.sys_forum; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:21 |
|||
* @Description |
|||
*/ |
|||
public interface SysForumMapper { |
|||
} |
@ -0,0 +1,4 @@ |
|||
<?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=""> |
|||
</mapper> |
@ -0,0 +1,9 @@ |
|||
package com.yxt.demo.system.biz.sys_forum; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:21 |
|||
* @Description |
|||
*/ |
|||
public class SysForumRest { |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.yxt.demo.system.biz.sys_forum; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:21 |
|||
* @Description |
|||
*/ |
|||
public class SysForumService { |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.yxt.demo.system.biz.sys_forum_comment; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:22 |
|||
* @Description |
|||
*/ |
|||
public interface SysForumCommentMapper { |
|||
} |
@ -0,0 +1,4 @@ |
|||
<?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.yxt.demo.system.biz.sys_forum_comment.SysForumCommentMapper"> |
|||
</mapper> |
@ -0,0 +1,9 @@ |
|||
package com.yxt.demo.system.biz.sys_forum_comment; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:22 |
|||
* @Description |
|||
*/ |
|||
public class SysForumCommentRest { |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.yxt.demo.system.biz.sys_forum_comment; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:22 |
|||
* @Description |
|||
*/ |
|||
public class SysForumCommentService { |
|||
} |
@ -0,0 +1,17 @@ |
|||
package com.yxt.demo.system.biz.sys_info; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.yxt.demo.system.api.sys_info.SysInfo; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 11:51 |
|||
* @Description |
|||
*/ |
|||
@Mapper |
|||
public interface SysInfoMapper extends BaseMapper<SysInfo> { |
|||
|
|||
SysInfo selectByNoAndName(@Param("userName") String userName, @Param("name") String name); |
|||
} |
@ -0,0 +1,10 @@ |
|||
<?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.yxt.demo.system.biz.sys_info.SysInfoMapper"> |
|||
<select id="selectByNoAndName" resultType="com.yxt.demo.system.api.sys_info.SysInfo"> |
|||
select * |
|||
from sys_info |
|||
where infoId = #{userName} |
|||
and name = #{name} |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,16 @@ |
|||
package com.yxt.demo.system.biz.sys_info; |
|||
|
|||
import io.swagger.annotations.Api; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 11:51 |
|||
* @Description |
|||
*/ |
|||
@Api(tags = "基础信息表") |
|||
@RestController |
|||
@RequestMapping("v1/sysinfo") |
|||
public class SysInfoRest { |
|||
} |
@ -0,0 +1,18 @@ |
|||
package com.yxt.demo.system.biz.sys_info; |
|||
|
|||
import com.yxt.demo.common.jdbc.service.MybatisBaseService; |
|||
import com.yxt.demo.system.api.sys_info.SysInfo; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 11:51 |
|||
* @Description |
|||
*/ |
|||
@Service |
|||
public class SysInfoService extends MybatisBaseService<SysInfoMapper, SysInfo> { |
|||
|
|||
public SysInfo selectByNoAndName(String userName, String name) { |
|||
return baseMapper.selectByNoAndName(userName, name); |
|||
} |
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.yxt.demo.system.biz.sys_info_ship; |
|||
|
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:15 |
|||
* @Description |
|||
*/ |
|||
@Mapper |
|||
public interface SysInfoShipMapper { |
|||
} |
@ -0,0 +1,4 @@ |
|||
<?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.yxt.demo.system.biz.sys_info_ship.SysInfoShipMapper"> |
|||
</mapper> |
@ -0,0 +1,12 @@ |
|||
package com.yxt.demo.system.biz.sys_info_ship; |
|||
|
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:15 |
|||
* @Description |
|||
*/ |
|||
@Service |
|||
public class SysInfoShipService { |
|||
} |
@ -0,0 +1,15 @@ |
|||
package com.yxt.demo.system.biz.sys_menu; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.yxt.demo.system.api.sys_info.SysInfo; |
|||
import com.yxt.demo.system.api.sys_menu.SysMenu; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:09 |
|||
* @Description |
|||
*/ |
|||
@Mapper |
|||
public interface SysMenuMapper extends BaseMapper<SysMenu> { |
|||
} |
@ -0,0 +1,4 @@ |
|||
<?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.yxt.demo.system.biz.sys_menu.SysMenuMapper"> |
|||
</mapper> |
@ -0,0 +1,16 @@ |
|||
package com.yxt.demo.system.biz.sys_menu; |
|||
|
|||
import io.swagger.annotations.Api; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:09 |
|||
* @Description |
|||
*/ |
|||
@Api(tags = "菜单") |
|||
@RestController |
|||
@RequestMapping("v1/sysmenu") |
|||
public class SysMenuRest { |
|||
} |
@ -0,0 +1,16 @@ |
|||
package com.yxt.demo.system.biz.sys_menu; |
|||
|
|||
import com.yxt.demo.common.jdbc.service.MybatisBaseService; |
|||
import com.yxt.demo.system.api.sys_info.SysInfo; |
|||
import com.yxt.demo.system.api.sys_menu.SysMenu; |
|||
import com.yxt.demo.system.biz.sys_info.SysInfoMapper; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:09 |
|||
* @Description |
|||
*/ |
|||
@Service |
|||
public class SysMenuService extends MybatisBaseService<SysMenuMapper, SysMenu> { |
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.yxt.demo.system.biz.sys_menu_role; |
|||
|
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:12 |
|||
* @Description |
|||
*/ |
|||
@Mapper |
|||
public interface SysMenuRoleMapper { |
|||
} |
@ -0,0 +1,4 @@ |
|||
<?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.yxt.demo.system.biz.sys_menu_role.SysMenuRoleMapper"> |
|||
</mapper> |
@ -0,0 +1,12 @@ |
|||
package com.yxt.demo.system.biz.sys_menu_role; |
|||
|
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:12 |
|||
* @Description |
|||
*/ |
|||
@Service |
|||
public class SysMenuRoleService { |
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.yxt.demo.system.biz.sys_notice; |
|||
|
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:14 |
|||
* @Description |
|||
*/ |
|||
@Mapper |
|||
public interface SysNoticeMapper { |
|||
} |
@ -0,0 +1,4 @@ |
|||
<?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.yxt.demo.system.biz.sys_notice.SysNoticeMapper"> |
|||
</mapper> |
@ -0,0 +1,9 @@ |
|||
package com.yxt.demo.system.biz.sys_notice; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:23 |
|||
* @Description |
|||
*/ |
|||
public class SysNoticeRest { |
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.yxt.demo.system.biz.sys_notice; |
|||
|
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:13 |
|||
* @Description |
|||
*/ |
|||
@Service |
|||
public class SysNoticeService { |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.yxt.demo.system.biz.sys_plan; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:24 |
|||
* @Description |
|||
*/ |
|||
public interface SysPlanMapper { |
|||
} |
@ -0,0 +1,4 @@ |
|||
<?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=""> |
|||
</mapper> |
@ -0,0 +1,9 @@ |
|||
package com.yxt.demo.system.biz.sys_plan; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:24 |
|||
* @Description |
|||
*/ |
|||
public class SysPlanRest { |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.yxt.demo.system.biz.sys_plan; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:24 |
|||
* @Description |
|||
*/ |
|||
public class SysPlanService { |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.yxt.demo.system.biz.sys_plan_schedule; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:25 |
|||
* @Description |
|||
*/ |
|||
public interface SysPlanScheduleMapper { |
|||
} |
@ -0,0 +1,4 @@ |
|||
<?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.yxt.demo.system.biz.sys_plan_schedule.SysPlanScheduleMapper"> |
|||
</mapper> |
@ -0,0 +1,9 @@ |
|||
package com.yxt.demo.system.biz.sys_plan_schedule; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:25 |
|||
* @Description |
|||
*/ |
|||
public class SysPlanScheduleRest { |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.yxt.demo.system.biz.sys_plan_schedule; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:25 |
|||
* @Description |
|||
*/ |
|||
public class SysPlanScheduleService { |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.yxt.demo.system.biz.sys_resources; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:26 |
|||
* @Description |
|||
*/ |
|||
public interface SysResourcesMapper { |
|||
} |
@ -0,0 +1,4 @@ |
|||
<?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.yxt.demo.system.biz.sys_resources.SysResourcesMapper"> |
|||
</mapper> |
@ -0,0 +1,9 @@ |
|||
package com.yxt.demo.system.biz.sys_resources; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:26 |
|||
* @Description |
|||
*/ |
|||
public class SysResourcesRest { |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.yxt.demo.system.biz.sys_resources; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:26 |
|||
* @Description |
|||
*/ |
|||
public class SysResourcesService { |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.yxt.demo.system.biz.sys_role; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:27 |
|||
* @Description |
|||
*/ |
|||
public interface SysRoleMapper { |
|||
} |
@ -0,0 +1,4 @@ |
|||
<?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.yxt.demo.system.biz.sys_role.SysRoleMapper"> |
|||
</mapper> |
@ -0,0 +1,9 @@ |
|||
package com.yxt.demo.system.biz.sys_role; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:27 |
|||
* @Description |
|||
*/ |
|||
public class SysRoleRest { |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.yxt.demo.system.biz.sys_role; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:27 |
|||
* @Description |
|||
*/ |
|||
public class SysRoleService { |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.yxt.demo.system.biz.sys_score; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:28 |
|||
* @Description |
|||
*/ |
|||
public interface SysScoreMapper { |
|||
} |
@ -0,0 +1,4 @@ |
|||
<?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.yxt.demo.system.biz.sys_score.SysScoreMapper"> |
|||
</mapper> |
@ -0,0 +1,9 @@ |
|||
package com.yxt.demo.system.biz.sys_score; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:28 |
|||
* @Description |
|||
*/ |
|||
public class SysScoreRest { |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.yxt.demo.system.biz.sys_score; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:28 |
|||
* @Description |
|||
*/ |
|||
public class SysScoreService { |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.yxt.demo.system.biz.sys_student_score; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2023/4/24 14:31 |
|||
* @Description |
|||
*/ |
|||
public interface SysStudentScoreMapper { |
|||
} |
@ -0,0 +1,4 @@ |
|||
<?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.yxt.demo.system.biz.sys_student_score.SysStudentScoreMapper"> |
|||
</mapper> |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue