当前位置:网站首页>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();
}
}






边栏推荐
- SSGSSRCSR区别
- 提高企业产品交付效率系列(1)—— 企业应用一键安装和升级
- Unity 使用Sqlite
- HDU - 1024 Max Sum Plus Plus(DP)
- tar命令
- Practice of combining rook CEPH and rainbow, a cloud native storage solution
- Causes of short circuit of conductive slip ring and Countermeasures
- [data recovery in North Asia] a data recovery case of raid crash caused by hard disk drop during data synchronization of hot spare disk of RAID5 disk array
- Memtable for leveldb source code analysis
- Is there any good website or software for learning programming? [introduction to programming]?
猜你喜欢

How to create a progress bar that changes color according to progress

How to meet the requirements of source code confidentiality and source code security management

云原生存储解决方案Rook-Ceph与Rainbond结合的实践

了解 JVM 中几个相关问题 — JVM 内存布局、类加载机制、垃圾回收

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

Understand several related problems in JVM - JVM memory layout, class loading mechanism, garbage collection

rust猜数字游戏
![Fiber Bragg grating (FBG) notes [1]: waveguide structure and Bragg wavelength derivation](/img/83/97c0c6e23cbb7b4c2b630c217c5206.jpg)
Fiber Bragg grating (FBG) notes [1]: waveguide structure and Bragg wavelength derivation

Use and principle of AQS related implementation classes

多表操作-外键级联操作
随机推荐
JS random verification code
Flutter 实现每次进来界面都刷新数据
Unity项目心得总结
Summary of common components of applet
[Yugong series] February 2022 Net architecture class 005 ABP vNext Net core web application getting started configuration
Mongodb learning chapter: introduction after installation lesson 1
Unity drags and modifies scene camera parameters under the editor
How to create a progress bar that changes color according to progress
Vmware workstation network card settings and three common network modes
How to select conductive slip ring material
ssm+mysql二手交易网站(论文+源码获取链接)
Youqitong [vip] v3.7.2022.0106 official January 22 Edition
新手在挖财开通证券账户安全吗?
Numeric amount plus comma; JS two methods of adding three digits and a comma to numbers; JS data formatting
Unity project experience summary
0xc000007b the application cannot start the solution normally (the pro test is valid)
Global and Chinese markets of gps/gnss receiver modules 2022-2028: Research Report on technology, participants, trends, market size and share
json数据比较器
数据治理:元数据管理实施(第四篇)
LevelDB源码分析之LRU Cache