feat: job module support i18n message
This commit is contained in:
@@ -214,13 +214,13 @@ CREATE TABLE `sys_job` (
|
||||
`update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
|
||||
`remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '备注信息',
|
||||
PRIMARY KEY (`job_id`, `job_name`, `job_group`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '定时任务调度表' ROW_FORMAT = DYNAMIC;
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '定时任务调度表' ROW_FORMAT = DYNAMIC;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of sys_job
|
||||
-- ----------------------------
|
||||
INSERT INTO `sys_job` VALUES (4, 'Omada同步任务', 'DEFAULT', 'omadaTask.syncJob', '0/30 * * * * ?', '3', '1', '0', 'admin', '2024-05-08 21:50:55', '', NULL, '');
|
||||
INSERT INTO `sys_job` VALUES (5, 'Omada初始化任务', 'DEFAULT', 'omadaTask.initJob', '0 0 0/1 * * ? ', '3', '1', '0', 'admin', '2024-05-08 21:50:55', '', NULL, '');
|
||||
INSERT INTO `sys_job` VALUES (1, 'Omada Sync Task', 'DEFAULT', 'omadaTask.syncJob', '0/30 * * * * ?', '3', '1', '0', 'admin', '2024-05-08 21:50:55', '', NULL, '');
|
||||
INSERT INTO `sys_job` VALUES (2, 'Omada Initialization Task ', 'DEFAULT', 'omadaTask.initJob', '0 0 0/1 * * ? ', '3', '1', '0', 'admin', '2024-05-08 21:50:55', '', NULL, '');
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for sys_job_log
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
#错误消息
|
||||
not.null=* Required fill in
|
||||
user.jcaptcha.error=Captcha error
|
||||
user.jcaptcha.not.blank=Captcha cannot be blank
|
||||
user.jcaptcha.expire=Captcha invalid
|
||||
user.not.exists=Sorry, your account: {0} does not exist
|
||||
user.password.not.match=User does not exist/Password error
|
||||
user.password.retry.limit.count=Password input error {0} times
|
||||
user.password.retry.limit.exceed=Password input error {0} times, account locked for {1} minutes
|
||||
user.password.delete=Sorry, your account:{0} has been deleted
|
||||
user.blocked=Sorry, your account: {0} has been disabled. Please contact the administrator
|
||||
role.blocked=Role disabled,please contact administrators
|
||||
user.logout.success=Exit successful
|
||||
length.not.valid=The length must be between {min} and {max} characters
|
||||
user.username.not.blank=Username cannot be blank
|
||||
user.username.not.valid=* 2 to 20 chinese characters, letters, numbers or underscores, and must start with a non number
|
||||
user.username.length.valid=Account length must be between {min} and {max} characters
|
||||
user.password.not.blank=Username/Password cannot be empty
|
||||
user.password.length.valid=Password length must be between {min} and {max} characters
|
||||
user.password.not.valid=* 5-50 characters
|
||||
user.email.not.enable=The email function is not enabled in the current system
|
||||
user.email.not.valid=Mailbox format error
|
||||
user.email.not.blank=Mailbox cannot be blank
|
||||
user.phonenumber.not.blank=Phone number cannot be blank
|
||||
user.mobile.phone.number.not.valid=Phone number format error
|
||||
user.login.success=Login successful
|
||||
user.register.success=Register successful
|
||||
user.register.save.error=The registered username already exists
|
||||
user.register.phone.save.error=The registered phone already exists
|
||||
user.register.email.save.error=The registered email already exists
|
||||
user.register.error=Register failed, please contact system administrator
|
||||
user.notfound=Please login again
|
||||
user.forcelogout=The administrator is forced to exit,please login again
|
||||
user.unknown.error=Unknown error, please login again
|
||||
auth.grant.type.error=Auth grant type error
|
||||
auth.grant.type.blocked=Auth grant type disabled
|
||||
auth.grant.type.not.blank=Auth grant type cannot be blank
|
||||
auth.clientid.not.blank=Auth clientid cannot be blank
|
||||
##文件上传消息
|
||||
upload.exceed.maxSize=The uploaded file size exceeds the limit file size!<br/>the maximum allowed file size is:{0}MB!
|
||||
upload.filename.exceed.length=The maximum length of uploaded file name is {0} characters
|
||||
##权限
|
||||
no.permission=You do not have permission to the data,please contact your administrator to add permissions [{0}]
|
||||
no.create.permission=You do not have permission to create data,please contact your administrator to add permissions [{0}]
|
||||
no.update.permission=You do not have permission to modify data,please contact your administrator to add permissions [{0}]
|
||||
no.delete.permission=You do not have permission to delete data,please contact your administrator to add permissions [{0}]
|
||||
no.export.permission=You do not have permission to export data,please contact your administrator to add permissions [{0}]
|
||||
no.view.permission=You do not have permission to view data,please contact your administrator to add permissions [{0}]
|
||||
repeat.submit.message=Repeat submit is not allowed, please try again later
|
||||
rate.limiter.message=Visit too frequently, please try again later
|
||||
sms.code.not.blank=Sms code cannot be blank
|
||||
sms.code.retry.limit.count=Sms code input error {0} times
|
||||
sms.code.retry.limit.exceed=Sms code input error {0} times, account locked for {1} minutes
|
||||
email.code.not.blank=Email code cannot be blank
|
||||
email.code.retry.limit.count=Email code input error {0} times
|
||||
email.code.retry.limit.exceed=Email code input error {0} times, account locked for {1} minutes
|
||||
xcx.code.not.blank=Mini program [code] cannot be blank
|
||||
social.source.not.blank=Social login platform [source] cannot be blank
|
||||
social.code.not.blank=Social login platform [code] cannot be blank
|
||||
social.state.not.blank=Social login platform [state] cannot be blank
|
||||
##租户
|
||||
tenant.number.not.blank=Tenant number cannot be blank
|
||||
tenant.not.exists=Sorry, your tenant does not exist. Please contact the administrator
|
||||
tenant.blocked=Sorry, your tenant is disabled. Please contact the administrator
|
||||
tenant.expired=Sorry, your tenant has expired. Please contact the administrator.
|
||||
## wfc-modules-user
|
||||
user.kyc.birthdate.not.blank=Date of birth cannot be blank
|
||||
user.kyc.birthdate.not.valid=Date of birth format error
|
||||
user.client.not.redirect.params=not WANFi redirect params
|
||||
user.modify.user.phone.exist=Modify user ''{0}'' failed, phone number already exists
|
||||
user.modify.user.email.exist=Modify user ''{0}'' failed, email already exists
|
||||
user.modify.user.failed.contact.administrator=Modify personal information exception, please contact the administrator
|
||||
user.modify.password.failed.error.old.password=Failed to modify password, old password error
|
||||
user.modify.password.failed.new.password.same.old.password=The new password cannot be the same as the old password
|
||||
user.modify.password.failed.contact.administrator=Modify password exception, please contact the administrator
|
||||
user.avatar.file.format.error=Avatar fFile format is incorrect, please upload a ''{0}'' format file
|
||||
user.file.service.error.contact.administrator=File service exception, please contact the administrator
|
||||
user.avatar.upload.error.contact.administrator=Upload image exception, please contact the administrator
|
||||
user.not.register=The current system has not enabled the registration function
|
||||
user.name.or.password.error=Username or password error
|
||||
## wfc-modules-system
|
||||
system.add.dict.failed.dict.exist=Add dictionary ''{0}'' failed, dictionary type already exists
|
||||
system.modify.dict.failed.dict.exist=Modify dictionary ''{0}'' failed, dictionary type already exists
|
||||
system.add.menu.failed.menu.exist=Add menu ''{0}'' failed, menu name already exists
|
||||
system.add.menu.failed.menu.url=Add menu ''{0}'' failed, address must start with http(s)://
|
||||
system.modify.menu.failed.menu.exist=Modify menu ''{0}'' failed, menu name already exists
|
||||
system.modify.menu.failed.menu.url=Modify menu ''{0}'' failed, address must start with http(s)://
|
||||
system.modify.menu.failed.menu.parent=Modify menu ''{0}'' failed, superior menu cannot be selected by itself
|
||||
system.delete.menu.failed.menu.child=There are submenus, deletion is not allowed
|
||||
system.delete.menu.failed.menu.assign=Menu has been assigned, deletion is not allowed
|
||||
system.modify.password.failed.error.old.password=Failed to modify password, old password error
|
||||
system.modify.password.failed.new.password.same.old.password=The new password cannot be the same as the old password
|
||||
system.modify.password.failed.contact.administrator=Modify password exception, please contact the administrator
|
||||
system.upload.file.format.error=File format is incorrect, please upload a ''{0}'' format file
|
||||
system.file.service.error.contact.administrator=File service exception, please contact the administrator
|
||||
system.upload.file.error.contact.administrator=Upload file exception, please contact the administrator
|
||||
system.role.add.failed.role.exist=Add role ''{0}'' failed, role name already exists
|
||||
system.role.add.failed.role.permission.exist=Add role ''{0}'' failed, role permission already exists
|
||||
system.role.modify.failed.role.exist=Modify role ''{0}'' failed, role name already exists
|
||||
system.role.modify.failed.role.permission.exist=Modify role ''{0}'' failed, role permission already exists
|
||||
system.no.register=The current system has not enabled the registration function
|
||||
system.role.delete.failed.role.assigned=The role ''{0}'' has been assigned and cannot be deleted
|
||||
system.role.no.permission=No permission to access role data
|
||||
system.user.no.exist=User does not exist
|
||||
system.user.add.user.failed.user.exist=Add user ''{0}'' failed, login account already exists
|
||||
system.user.add.user.failed.phone.exist=Add user ''{0}'' failed, phone number already exists
|
||||
system.user.add.user.failed.email.exist=Add user ''{0}'' failed, email already exists
|
||||
system.user.modify.user.failed.user.exist=Modify user ''{0}'' failed, login account already exists
|
||||
system.user.modify.user.failed.phone.exist=Modify user ''{0}'' failed, phone number already exists
|
||||
system.user.modify.user.failed.email.exist=Modify user ''{0}'' failed, email already exists
|
||||
system.user.modify.failed.contact.administrator=Modify personal information exception, please contact the administrator
|
||||
system.user.cannot.delete=The current user cannot be deleted
|
||||
system.config.cannot.delete.builtin=The built-in parameter {0} cannot be deleted
|
||||
system.dict.delete.failed.dict.assigned=The dictionary ''{0}'' has been assigned and cannot be deleted
|
||||
system.config.add.failed.config.exist=Add parameter ''{0}'' failed, parameter key already exists
|
||||
system.config.modify.failed.config.exist=Modify parameter ''{0}'' failed, parameter key already exists
|
||||
## wfc-job
|
||||
job.name.not.blank=Task name cannot be blank
|
||||
job.name.length.valid=Task name length cannot exceed 100 characters
|
||||
job.target.not.blank=Call target cannot be blank
|
||||
job.target.length.valid=Call target length cannot exceed 255 characters
|
||||
job.cron.not.blank=Cron expression cannot be blank
|
||||
job.cron.length.valid=Cron expression length cannot exceed 255 characters
|
||||
job.execute.success=The scheduled task was executed successfully, the time taken: {0} milliseconds
|
||||
job.execute.spend.time=the time taken: {0} milliseconds
|
||||
|
||||
## wfc-common
|
||||
common.operate.success=Operation successful
|
||||
common.operate.failed=Operation failed
|
||||
|
||||
|
||||
@@ -114,6 +114,15 @@ system.config.cannot.delete.builtin=The built-in parameter {0} cannot be deleted
|
||||
system.dict.delete.failed.dict.assigned=The dictionary ''{0}'' has been assigned and cannot be deleted
|
||||
system.config.add.failed.config.exist=Add parameter ''{0}'' failed, parameter key already exists
|
||||
system.config.modify.failed.config.exist=Modify parameter ''{0}'' failed, parameter key already exists
|
||||
## wfc-job
|
||||
job.name.not.blank=Task name cannot be blank
|
||||
job.name.length.valid=Task name length cannot exceed 100 characters
|
||||
job.target.not.blank=Call target cannot be blank
|
||||
job.target.length.valid=Call target length cannot exceed 255 characters
|
||||
job.cron.not.blank=Cron expression cannot be blank
|
||||
job.cron.length.valid=Cron expression length cannot exceed 255 characters
|
||||
job.execute.success=The scheduled task was executed successfully, the time taken: {0} milliseconds
|
||||
job.execute.spend.time=the time taken: {0} milliseconds
|
||||
|
||||
## wfc-common
|
||||
common.operate.success=Operation successful
|
||||
|
||||
@@ -115,6 +115,15 @@ system.config.cannot.delete.builtin=内置参数{0}不能删除
|
||||
system.dict.delete.failed.dict.assigned=字典数据{0}已分配,不能删除
|
||||
system.config.add.failed.config.exist=新增参数''{0}''失败,参数键名已存在
|
||||
system.config.modify.failed.config.exist=修改参数''{0}''失败,参数键名已存在
|
||||
## wfc-job
|
||||
job.name.not.blank=任务名称不能为空
|
||||
job.name.length.valid=任务名称不能超过64个字符
|
||||
job.target.not.blank=调用目标字符串不能为空
|
||||
job.target.length.valid=调用目标字符串长度不能超过500个字符
|
||||
job.cron.not.blank=Cron表达式不能为空
|
||||
job.cron.length.valid=Cron执行表达式不能超过255个字符
|
||||
job.execute.success=定时任务执行成功, 耗时:{0} 毫秒
|
||||
job.execute.spend.time=总共耗时:{0} 毫秒
|
||||
|
||||
## wfc-common
|
||||
common.operate.success=操作成功
|
||||
|
||||
@@ -15,6 +15,6 @@ public class WfcFileApplication
|
||||
public static void main(String[] args)
|
||||
{
|
||||
SpringApplication.run(WfcFileApplication.class, args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ 文件服务模块启动成功 ლ(´ڡ`ლ)゙ \n");
|
||||
System.out.println("(♥◠‿◠)ノ゙ File service module startup successfully ლ(´ڡ`ლ)゙ \n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public class SysFileController {
|
||||
sysFile.setGatewayUrl(urlResult.getGatewayUrl());
|
||||
return R.ok(sysFile);
|
||||
} catch (Exception e) {
|
||||
log.error("上传文件失败", e);
|
||||
log.error("Failed to upload file", e);
|
||||
return R.fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,6 @@ public class WfcJobApplication
|
||||
public static void main(String[] args)
|
||||
{
|
||||
SpringApplication.run(WfcJobApplication.class, args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ 定时任务模块启动成功 ლ(´ڡ`ლ)゙ \n");
|
||||
System.out.println("(♥◠‿◠)ノ゙ The scheduled task module started successfully ლ(´ڡ`ლ)゙ \n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,10 +9,12 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.wfc.common.core.annotation.Excel;
|
||||
import org.wfc.common.core.annotation.Excel.ColumnType;
|
||||
import org.wfc.common.core.constant.ScheduleConstants;
|
||||
import org.wfc.common.core.utils.MessageUtils;
|
||||
import org.wfc.common.core.utils.StringUtils;
|
||||
import org.wfc.common.core.web.domain.BaseEntity;
|
||||
import org.wfc.job.util.CronUtils;
|
||||
|
||||
|
||||
/**
|
||||
* 定时任务调度表 sys_job
|
||||
*
|
||||
@@ -64,8 +66,8 @@ public class SysJob extends BaseEntity
|
||||
this.jobId = jobId;
|
||||
}
|
||||
|
||||
@NotBlank(message = "任务名称不能为空")
|
||||
@Size(min = 0, max = 64, message = "任务名称不能超过64个字符")
|
||||
@NotBlank(message = "{job.name.not.blank}")
|
||||
@Size(min = 0, max = 64, message = "{job.name.length.valid}")
|
||||
public String getJobName()
|
||||
{
|
||||
return jobName;
|
||||
@@ -86,8 +88,8 @@ public class SysJob extends BaseEntity
|
||||
this.jobGroup = jobGroup;
|
||||
}
|
||||
|
||||
@NotBlank(message = "调用目标字符串不能为空")
|
||||
@Size(min = 0, max = 500, message = "调用目标字符串长度不能超过500个字符")
|
||||
@NotBlank(message = "{job.target.not.blank}")
|
||||
@Size(min = 0, max = 500, message = "{job.target.length.valid}")
|
||||
public String getInvokeTarget()
|
||||
{
|
||||
return invokeTarget;
|
||||
@@ -98,8 +100,8 @@ public class SysJob extends BaseEntity
|
||||
this.invokeTarget = invokeTarget;
|
||||
}
|
||||
|
||||
@NotBlank(message = "Cron执行表达式不能为空")
|
||||
@Size(min = 0, max = 255, message = "Cron执行表达式不能超过255个字符")
|
||||
@NotBlank(message = "{job.cron.not.blank}")
|
||||
@Size(min = 0, max = 255, message = "{job.cron.length.valid}")
|
||||
public String getCronExpression()
|
||||
{
|
||||
return cronExpression;
|
||||
|
||||
@@ -4,6 +4,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.wfc.common.core.domain.R;
|
||||
import org.wfc.common.core.utils.MessageUtils;
|
||||
import org.wfc.system.api.RemoteUserService;
|
||||
import org.wfc.user.api.RemoteUUserService;
|
||||
|
||||
@@ -27,7 +28,7 @@ public class OmadaTask {
|
||||
remoteUserService.deviceJob();
|
||||
remoteUUserService.addCdrInfoByOmadaApi();
|
||||
long endTime = System.currentTimeMillis();
|
||||
log.info("wifi定时任务执行成功, 耗时:{} 毫秒", endTime - startTime);
|
||||
log.info(MessageUtils.message("job.execute.success", endTime - startTime));
|
||||
}
|
||||
|
||||
public R<String> testOmadaApi() {
|
||||
|
||||
@@ -8,6 +8,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.wfc.common.core.constant.ScheduleConstants;
|
||||
import org.wfc.common.core.utils.ExceptionUtil;
|
||||
import org.wfc.common.core.utils.MessageUtils;
|
||||
import org.wfc.common.core.utils.SpringUtils;
|
||||
import org.wfc.common.core.utils.StringUtils;
|
||||
import org.wfc.common.core.utils.bean.BeanUtils;
|
||||
@@ -79,7 +80,7 @@ public abstract class AbstractQuartzJob implements Job
|
||||
sysJobLog.setStartTime(startTime);
|
||||
sysJobLog.setStopTime(new Date());
|
||||
long runMs = sysJobLog.getStopTime().getTime() - sysJobLog.getStartTime().getTime();
|
||||
sysJobLog.setJobMessage(sysJobLog.getJobName() + " 总共耗时:" + runMs + "毫秒");
|
||||
sysJobLog.setJobMessage(sysJobLog.getJobName() + " " + MessageUtils.message("job.execute.spend.time", runMs));
|
||||
if (e != null)
|
||||
{
|
||||
sysJobLog.setStatus("1");
|
||||
|
||||
Reference in New Issue
Block a user