当前位置:网站首页>A little assistant for teenagers' physiological health knowledge based on wechat applet (free source code + project introduction + operation introduction + operation screenshot + Thesis)
A little assistant for teenagers' physiological health knowledge based on wechat applet (free source code + project introduction + operation introduction + operation screenshot + Thesis)
2022-07-01 05:34:00 【Code garden of Azhou】
Technology Architecture
Back end :JDK1.8+SingBoot+SpringMVC
front end :WXML+WXSS +css +js
database :MySQL
Function module
The front desk user :
The user login
Personal center
Psychological assessment
Customer service
Encyclopedia of adolescent physical health
Backstage Administrator :
Registration Management
Psychological evaluation management
User management
Knowledge management of adolescent health encyclopedia
Code display :
wx.getUserProfile({
desc: ' It is used to improve the membership information ',
success: (res) => {
var sessionKey = app.globalData.sessionKey;
console.log("userInfo", res.userInfo)
app.globalData.userInfo = res.userInfo
this.setData({
'userInfo': res.userInfo,
'hiddenName': true
})
wx.request({
url: 'http://localhost:8080/wx/getUserInfo',
header: {
"accept": "*/*",
'Content-Type': 'application/x-www-form-urlencoded',
},
data: {
'encryptedData': res.encryptedData,
'iv': res.iv,
'sessionKey': sessionKey,
},
method: 'POST',
success(res) {
console.log("userInfo:", res)
}
})
}
package com.azhou.code.aop;
import com.azhou.code.annotations.Limit;
import com.azhou.code.common.exception.MyException;
import com.google.common.collect.Maps;
import com.google.common.util.concurrent.RateLimiter;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.stereotype.Component;
import java.lang.reflect.Method;
import java.util.Map;
/**
* @description: Current limiting aop
* @author: azhou
* @Create: 2022-05-29 12:40
*/
@Slf4j
@Aspect
@Component
public class LimitAop {
private final Map<String, RateLimiter> limiterMap = Maps.newConcurrentMap();
@Around("@annotation(com.azhou.code.annotations.Limit)")
public Object around(ProceedingJoinPoint joinPoint) throws Throwable {
MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature();
Method method = methodSignature.getMethod();
// take limit Annotations
Limit limit = method.getAnnotation(Limit.class);
if (limit != null) {
// key effect : Different interfaces , Different flow control
String key = limit.key();
RateLimiter rateLimiter = null;
// Verify whether the cache hits key
if (!limiterMap.containsKey(key)) {
// Create token bucket
rateLimiter = RateLimiter.create(limit.permitsPerSecond());
limiterMap.put(key, rateLimiter);
log.debug(" New token bucket ={}, Capacity ={}", key, limit.permitsPerSecond());
}
rateLimiter = limiterMap.get(key);
// Take the token
boolean acquire = rateLimiter.tryAcquire(limit.timeout(), limit.timeunit());
// Can't get orders , Directly return the exception prompt
if (!acquire) {
log.warn(" Token bucket ={}, Failed to get token ", key);
throw new MyException(limit.msg());
}
}
return joinPoint.proceed();
}
}






边栏推荐
- JS random verification code
- HDU - 1024 Max Sum Plus Plus(DP)
- Unit testing with mongodb
- Is it safe for a novice to open a securities account?
- Web Security (IX) what is JWT?
- Vérification simple de la lecture et de l'écriture de qdatastream
- Global and Chinese markets of gps/gnss receiver modules 2022-2028: Research Report on technology, participants, trends, market size and share
- Software intelligence: the "world" and "boundary" of AI sentient beings in AAAs system
- 导电滑环使用的注意事项
- LRU cache for leveldb source code analysis
猜你喜欢
![[excel] column operation, which performs specific column for data in a cell, such as text division by comma, colon, space, etc](/img/c8/e3e31ad9ef214d97228cb501dd752f.jpg)
[excel] column operation, which performs specific column for data in a cell, such as text division by comma, colon, space, etc

液压滑环的特点讲解

Set set detailed explanation

工业导电滑环的应用

ssm+mysql二手交易网站(论文+源码获取链接)

数字金额加逗号;js给数字加三位一逗号间隔的两种方法;js数据格式化

JDBC常见面试题

Daily code 300 lines learning notes day 11

0xc000007b应用程序无法正常启动解决方案(亲测有效)

Unity drags and modifies scene camera parameters under the editor
随机推荐
LevelDB源码分析之LRU Cache
Numeric amount plus comma; JS two methods of adding three digits and a comma to numbers; JS data formatting
导电滑环使用的注意事项
QT waiting box production
QT等待框制作
Unity drags and modifies scene camera parameters under the editor
Things generated by busybox
Qt编译时,出现 first defined here,原因及解决方法
数字金额加逗号;js给数字加三位一逗号间隔的两种方法;js数据格式化
Txncoordsender of cockroachdb distributed transaction source code analysis
如何选择导电滑环材料
0xc000007b应用程序无法正常启动解决方案(亲测有效)
Summary of spanner's paper
Actual combat: basic use of Redux
SSM的教务管理系统(免费源码获取)
Unity 使用Sqlite
Global and Chinese markets for soft ferrite cores 2022-2028: Research Report on technology, participants, trends, market size and share
Thread process foundation of JUC
Series of improving enterprise product delivery efficiency (1) -- one click installation and upgrade of enterprise applications
QDataStream的簡單讀寫驗證