代码规范修改

This commit is contained in:
1539530615@qq.com 2024-01-30 14:10:58 +08:00
parent 8bf9558fc5
commit bd6e623737
17 changed files with 100 additions and 34 deletions

View File

@ -16,47 +16,57 @@ import java.util.Date;
@SuppressWarnings("serial")
public class MaLabelBind {
//机具ID
/**
* 机具ID
*/
@Excel(name = "机具ID")
@ApiModelProperty(value = "种类id")
private Long maId;
//标签编号
/**
* 标签编号
*/
@Excel(name = "标签编号")
@ApiModelProperty(value = "种类id")
private String labelCode;
//类型ID
/**
* 类型ID
*/
@Excel(name = "类型ID")
@ApiModelProperty(value = "种类id")
private Long typeId;
//绑定时间
/**
* 绑定时间
*/
@Excel(name = "绑定时间")
@ApiModelProperty(value = "种类id")
private Date bindTime;
//绑定人
/**
* 绑定人
*/
@Excel(name = "绑定人")
@ApiModelProperty(value = "种类id")
private String binder;
//是否绑定(0 , 1 )
/**
* 是否绑定(0 , 1 )
*/
@Excel(name = "是否绑定")
@ApiModelProperty(value = "种类id")
private String isBind;
//标签类型(数据字典)
/**
* 标签类型(数据字典)
*/
@Excel(name = "标签类型(数据字典)")
@ApiModelProperty(value = "种类id")
private Integer labelType;
//数据所属组织
/**
* 数据所属组织
*/
@Excel(name = "数据所属组织")
@ApiModelProperty(value = "种类id")
private String companyId;
//数据所属组织
/**
* 0已解绑 1已绑定
*/
@Excel(name = "0已解绑 1已绑定")
@ApiModelProperty(value = "0已解绑 1已绑定")
private String status;

View File

@ -6,6 +6,11 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
* @author Dingjie
* @date
*/
@ApiModel(value="com.bonus.sgzb.base.api.domain.MaMachine")
@Data
public class MaMachine extends BaseEntity {

View File

@ -5,7 +5,11 @@ import com.bonus.sgzb.common.core.web.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
* @author gmhao
* @date
*/
@Data
public class MaMachineLabel extends BaseEntity
{

View File

@ -14,6 +14,11 @@ import java.util.List;
/**
* 工机具类型管理实体类
*/
/**
*
* @author rsyao
* @date
*/
@Data
public class MaType extends BaseEntity {

View File

@ -21,10 +21,10 @@ public interface RemoteLogService
{
/**
* 保存系统日志
*
* @param sysOperLog 日志实体
* @param sysOperLog 保存系统日志
* @param source 请求来源
* @return 结果
* @throws Exception
*/
@PostMapping("/operlog")
public R<Boolean> saveLog(@RequestBody SysOperLog sysOperLog, @RequestHeader(SecurityConstants.FROM_SOURCE) String source) throws Exception;

View File

@ -41,18 +41,26 @@ public interface RemoteUserService
/**
* 发送短信
* @param phone
* @return
*/
@PostMapping("/sms/codeLogin")
public R<Boolean> sendCode(@RequestParam("phone") String phone);
/**
* 验证码校验
* @param phone
* @param code
* @return
*/
@PostMapping("/sms/checkCode")
public R<Boolean> checkCode(@RequestParam("phone") String phone, @RequestParam("code") String code);
/**
* 验证码校验
* @param phone
* @param msg
* @return
*/
@PostMapping("/sms/send")
public Boolean send(@RequestParam("phone") String phone, @RequestParam("msg") String msg);

View File

@ -41,7 +41,11 @@ public class TokenController {
@Resource
private RemoteUserService remoteUserService;
//web端登录
/**
* web端登录
* @param form
* @return
*/
@PostMapping("login")
public R<?> login(@RequestBody LoginBody form) {
// 用户登录
@ -55,8 +59,13 @@ public class TokenController {
return R.fail("验证码错误");
}
}
//App端登录
/**
* App端登录
* @param form
* @return
*/
@PostMapping("loginApp")
public R<?> loginApp(@RequestBody LoginBody form) {
// 用户登录

View File

@ -147,11 +147,12 @@ public class SysLoginService
}
public boolean checkCode(String phone, String code) {
String a = "_";
String redisCode = redisService.getCacheObject("code_" + phone);
if (StringUtils.isEmpty(redisCode)) {
throw new ServiceException("验证码失效", 403);
}
if (!StringUtils.equals(redisCode.split("_")[0], code)) {
if (!StringUtils.equals(redisCode.split(a)[0], code)) {
throw new ServiceException("验证码错误", 401);
} else {
redisService.deleteObject("code_" + phone);

View File

@ -15,7 +15,9 @@ public class KaptchaTextCreator extends DefaultTextCreator
@Override
public String getText()
{
Integer result = 0;
int i = 2;
Random random = new Random();
int x = random.nextInt(10);
int y = random.nextInt(10);
@ -45,7 +47,7 @@ public class KaptchaTextCreator extends DefaultTextCreator
suChinese.append(CNUMBERS[y]);
}
}
else if (randomoperands == 2)
else if (randomoperands == i)
{
if (x >= y)
{

View File

@ -31,7 +31,9 @@ public class AuthFilter implements GlobalFilter, Ordered
{
private static final Logger log = LoggerFactory.getLogger(AuthFilter.class);
// 排除过滤的 uri 地址nacos自行添加
/**
* 排除过滤的 uri 地址nacos自行添加
*/
@Autowired
private IgnoreWhiteProperties ignoreWhite;

View File

@ -35,7 +35,9 @@ import reactor.core.publisher.Mono;
@ConditionalOnProperty(value = "security.xss.enabled", havingValue = "true")
public class XssFilter implements GlobalFilter, Ordered
{
// 跨站脚本的 xss 配置nacos自行添加
/**
* 跨站脚本的 xss 配置nacos自行添加
*/
@Autowired
private XssProperties xss;

View File

@ -13,7 +13,11 @@ import springfox.documentation.swagger.web.SecurityConfigurationBuilder;
import springfox.documentation.swagger.web.SwaggerResourcesProvider;
import springfox.documentation.swagger.web.UiConfiguration;
import springfox.documentation.swagger.web.UiConfigurationBuilder;
/**
*
* @author bonus
* @date
*/
@RestController
@RequestMapping("/swagger-resources")
public class SwaggerHandler

View File

@ -13,11 +13,17 @@ public interface ValidateCodeService
{
/**
* 生成验证码
* @return
* @throws IOException
* @throws CaptchaException
*/
public AjaxResult createCaptcha() throws IOException, CaptchaException;
/**
* 校验验证码
* @param key
* @param value
* @throws CaptchaException
*/
public void checkCaptcha(String key, String value) throws CaptchaException;
}

View File

@ -47,6 +47,8 @@ public class ValidateCodeServiceImpl implements ValidateCodeService
@Override
public AjaxResult createCaptcha() throws IOException, CaptchaException
{
String math = "math";
String charStr = "char";
AjaxResult ajax = AjaxResult.success();
boolean captchaEnabled = captchaProperties.getEnabled();
ajax.put("captchaEnabled", captchaEnabled);
@ -64,14 +66,14 @@ public class ValidateCodeServiceImpl implements ValidateCodeService
String captchaType = captchaProperties.getType();
// 生成验证码
if ("math".equals(captchaType))
if (math.equals(captchaType))
{
String capText = captchaProducerMath.createText();
capStr = capText.substring(0, capText.lastIndexOf("@"));
code = capText.substring(capText.lastIndexOf("@") + 1);
image = captchaProducerMath.createImage(capStr);
}
else if ("char".equals(captchaType))
else if (charStr.equals(captchaType))
{
capStr = code = captchaProducer.createText();
image = captchaProducer.createImage(capStr);

View File

@ -20,6 +20,7 @@ public interface BackApplyAppMapper {
*/
List<BmAgreementInfo> getbackPro(BmAgreementInfo record);
int insertTask(TmTask task);
List<BackApplyInfo> getbackList(BackApplyInfo record);

View File

@ -16,5 +16,10 @@ public interface SysNoticeService {
*/
List<SysNotice> getList(String keyword);
/**
* 根据ID获取通知公告内容
* @param noticeId
* @return
*/
SysNotice getById(Long noticeId);
}

View File

@ -28,8 +28,8 @@ public class SysSmsServiceImpl implements ISysSmsService {
@Resource
private RedisService redisService;
// 短信url
private static final String url = "http://api.ktsms.cn/sms_token?ddtkey=bonus&secretkey=KtyBns@Admin2023!";
// 短信URL
private static final String URL = "http://api.ktsms.cn/sms_token?ddtkey=bonus&secretkey=KtyBns@Admin2023!";
@Override
public AjaxResult sendSms(String phone, String msg) {
@ -61,8 +61,8 @@ public class SysSmsServiceImpl implements ISysSmsService {
}
// 发送短信
try {
// String url = "http://106.ihuyi.common/webservice/sms.php?method=Submit";
String content = url + "&mobile=" + phone + "&content=【智慧仓储】" + msg + "";
// String URL = "http://106.ihuyi.common/webservice/sms.php?method=Submit";
String content = URL + "&mobile=" + phone + "&content=【智慧仓储】" + msg + "";
String body = HttpRequest.post(content).execute(false).body();
System.out.println("发送手机号码:" + phone + ",内容:" + msg + ",返回结果:" + body);
if (body == null || !body.contains("ok")) {
@ -92,7 +92,7 @@ public class SysSmsServiceImpl implements ISysSmsService {
}
// 发送短信
try {
String content = url + "&mobile=" + phone + "&content=【智慧仓储】您正在进行短信验证,验证码:" + code + "请在5分钟内完成验证。";
String content = URL + "&mobile=" + phone + "&content=【智慧仓储】您正在进行短信验证,验证码:" + code + "请在5分钟内完成验证。";
String body = HttpRequest.post(content).execute(false).body();
System.out.println("发送短信:" + phone + ",验证码:" + code + ",返回结果:" + body);
if (body == null || !body.contains("ok")) {