规范代码

This commit is contained in:
xuwenbo
2020-11-26 10:08:28 +08:00
parent a679bbe0f3
commit 9754fc53fe
5 changed files with 13 additions and 9 deletions

View File

@ -82,7 +82,7 @@ public class AuthService {
* @param loginParam loginParam
* @return long
*/
@Transactional
@Transactional(rollbackFor = Exception.class)
public YxUser wxappLogin(LoginParam loginParam) {
String code = loginParam.getCode();
String encryptedData = loginParam.getEncryptedData();
@ -171,7 +171,7 @@ public class AuthService {
* @param spread 上级用户
* @return uid
*/
@Transactional
@Transactional(rollbackFor = Exception.class)
public YxUser wechatLogin(String code,String spread){
try {
WxMpService wxService = WxMpConfiguration.getWxMpService();
@ -257,7 +257,7 @@ public class AuthService {
* 注册
* @param param RegDTO
*/
@Transactional
@Transactional(rollbackFor = Exception.class)
public void register(RegParam param){
String account = param.getAccount();

View File

@ -34,7 +34,7 @@ public class PrintStoreOrderVO implements Serializable {
@ApiModelProperty(value = "门店列表")
private Integer storeId;
@ApiModelProperty(hidden = true)
long startSecond;
Long startSecond;
@ApiModelProperty(hidden = true)
long endSecond;
Long endSecond;
}

View File

@ -13,6 +13,7 @@ import java.io.Serializable;
* @modified By
* @version:
*/
@SuppressWarnings("ALL")
@Data
@ApiModel(value="腾讯地图返回对象")
public class GetTencentLocationVO implements Serializable {
@ -27,7 +28,7 @@ public class GetTencentLocationVO implements Serializable {
@ApiModelProperty(value = "状态说明")
private String message;
@ApiModelProperty(value = "状态码0为正常")
private int status;
private Integer status;
@Data
@ApiModel(value="地址解析结果")

View File

@ -73,7 +73,7 @@ public class YxStoreProductAttrServiceImpl extends BaseServiceImpl<StoreProductA
* @param productId 商品id
*/
@Override
@Transactional
@Transactional(rollbackFor = Exception.class)
public void insertYxStoreProductAttr(List<FromatDetailDto> items, List<ProductFormatDto> attrs,
Long productId)
{

View File

@ -18,6 +18,7 @@ import co.yixiang.tools.domain.vo.EmailVo;
import co.yixiang.tools.service.VerificationCodeService;
import co.yixiang.tools.service.mapper.VerificationCodeMapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.apache.commons.lang3.concurrent.BasicThreadFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
@ -26,6 +27,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.Collections;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
/**
@ -83,7 +85,8 @@ public class VerificationCodeServiceImpl extends BaseServiceImpl<VerificationCod
*/
private void timedDestruction(VerificationCode verifyCode) {
//以下示例为程序调用结束继续运行
ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor();
ScheduledExecutorService executorService = new ScheduledThreadPoolExecutor(1,
new BasicThreadFactory.Builder().namingPattern("verifyCode-schedule-pool-%d").daemon(true).build());
try {
executorService.schedule(() -> {
verifyCode.setStatus(false);